forked from h2gglobe/h2gglobe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DiPhoEfficiencySmearer.h
73 lines (52 loc) · 2.16 KB
/
DiPhoEfficiencySmearer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef __DIPHOEFFICIENCYSMEARER__
#define __DIPHOEFFICIENCYSMEARER__
#include "BaseSmearer.h"
#include "EfficiencySmearer.h"
#include <string>
#include <map>
#include "TFile.h"
#include "TGraphAsymmErrors.h"
class PhotonReducedInfo;
class TRandom3;
// ------------------------------------------------------------------------------------
class DiPhoEfficiencySmearer : public BaseDiPhotonSmearer
{
public:
struct diPhoEfficiencySmearingParameters
{
int n_categories;
std::string categoryType;
std::string parameterSetName;
typedef std::map<std::string,float> parameterMap;
typedef std::map<std::string,float>::iterator parameterMapIt;
typedef std::map<std::string,float>::const_iterator parameterMapConstIt;
// Scale offset and smearing error should be espressed as a relative value
// Example: scale_offset["EB"]=1.002 , smearing_sigma["EB"]=0.01
std::map<std::string,float> scale_offset;
std::map<std::string,float> scale_offset_error;
std::map<std::string,float> smearing_sigma;
std::map<std::string,float> smearing_sigma_error;
std::string efficiency_file;
};
DiPhoEfficiencySmearer(const diPhoEfficiencySmearingParameters& par) ;
virtual ~DiPhoEfficiencySmearer();
virtual const std::string & name() const { return name_; };
virtual bool smearDiPhoton( TLorentzVector & p4, TVector3 & selVtx, float & weight, const int & category, const int & genMassPoint,
const TVector3 & trueVtx, float & idMVA1,float & idMVA2 ,float syst_shift) const ;
void name(const std::string & x) { name_ = x; };
void setEffName(const std::string & x) { effName_ =x; };
bool init();
void passFailWeights(bool x) { passFailWeights_ = x; };
void doVtxEff(bool x) { doVtxEff_ = x; };
void doMvaIdEff(bool x) { doMvaIdEff_ = x; };
diPhoEfficiencySmearingParameters myParameters_;
protected:
double getWeight(double pt, std::string theCategory, float syst_shift) const;
bool passFailWeights_, doVtxEff_, doMvaIdEff_;
std::string name_;
TRandom3 *rgen_;
std::string effName_;
TFile *theDiPhoEfficiencyFile_;
std::map<std::string,TGraphAsymmErrors*> smearing_eff_graph_;
};
#endif