forked from h2gglobe/h2gglobe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PdfWeightSmearer.h
46 lines (32 loc) · 1.28 KB
/
PdfWeightSmearer.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
#ifndef __PDFWEIGHTSMEARER__
#define __PDFWEIGHTSMEARER__
#include "BaseSmearer.h"
#include <string>
#include <map>
#include "TFile.h"
#include "TGraphAsymmErrors.h"
#include "TH2F.h"
// ------------------------------------------------------------------------------------
class PdfWeightSmearer : public BaseGenLevelSmearer
{
public:
std::string efficiency_file;
// downId and upId set according to prescription of Jun 3, 2011
PdfWeightSmearer(const std::string &efficiency_file, std::string downId, std::string upId) ;
virtual ~PdfWeightSmearer();
virtual const std::string & name() const { return name_; };
virtual bool smearEvent( float & weight, const TLorentzVector & p4, const int nPu, const int sample_type, float syst_shift=0. ) const ;
void name(const std::string & x) { name_ = x; };
void setKFName(const std::string & x) { KFName_ =x; };
bool init();
protected:
double getWeight( const TLorentzVector & p4, const int nPu, float syst_shift=0.) const;
std::string name_;
std::string KFName_;
TFile *thePdfWeightFile_;
std::vector<TH2F*> kFactorSmearers_;
void readFile(std::string uId, std::string dId );
double getPdfWeight(int genMassPoint, int id, double gPT , double gY) const;
std::string downId, upId;
};
#endif