forked from h2gglobe/h2gglobe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EfficiencySmearer.h
61 lines (44 loc) · 1.58 KB
/
EfficiencySmearer.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
#ifndef __EFFICIENCYSMEARER__
#define __EFFICIENCYSMEARER__
#include "BaseSmearer.h"
#include <string>
#include <map>
#include "TFile.h"
#include "TGraphAsymmErrors.h"
class PhotonReducedInfo;
class TRandom3;
// ------------------------------------------------------------------------------------
class EfficiencySmearer : public BaseSmearer
{
public:
struct efficiencySmearingParameters
{
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;
std::string efficiency_file;
};
EfficiencySmearer(const efficiencySmearingParameters& par) ;
virtual ~EfficiencySmearer();
virtual const std::string & name() const { return name_; };
virtual bool smearPhoton( PhotonReducedInfo & pho, float & weight, int run, float syst_shift=0. ) const;
void name(const std::string & x) { name_ = x; };
void setEffName(std::string x) { effName_ =x; };
void doPhoId(bool x) { doPhoId_ =x; };
void doR9(bool x) { doR9_ =x; };
bool init();
efficiencySmearingParameters myParameters_;
protected:
std::string photonCategory(PhotonReducedInfo &) const;
double getWeight(double pt, std::string theCategory, float syst_shift) const;
std::string name_;
TRandom3 *rgen_;
std::string effName_;
bool doPhoId_, doR9_;
TFile *theEfficiencyFile_;
std::map<std::string,TGraphAsymmErrors*> smearing_eff_graph_;
};
#endif