1 #ifndef PhysicsTools_Utilities_interface_LumiReWeighting_h
2 #define PhysicsTools_Utilities_interface_LumiReWeighting_h
22 #include <boost/shared_ptr.hpp>
44 static double p0_minus[20] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
45 static double p1_minus[20] = {
67 static double p2_minus[20] = {
90 static double p1_expoM[5] = {
98 static double p2_expoM[5] = {
107 static double p0_plus[20] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
108 static double p1_plus[20] = {
130 static double p2_plus[20] = {
153 static double p1_expoP[5] = {
161 static double p2_expoP[5] = {
173 for (
int ibin=0;ibin<20;ibin++) {
176 Pweight_[ibin] = p0_minus[ibin] + p1_minus[ibin]*Shift + p2_minus[ibin]*Shift*Shift;
179 Pweight_[ibin] = p0_plus[ibin] + p1_plus[ibin]*Shift + p2_plus[ibin]*Shift*Shift;
185 for (
int ibin=20;ibin<25;ibin++) {
187 Pweight_[ibin] = p1_expoM[ibin-20]*
exp(p2_expoM[ibin-20]*Shift);
190 Pweight_[ibin] = p1_expoP[ibin-20]*
exp(p2_expoP[ibin-20]*Shift);
198 if(ibin<25 && ibin>=0) {
return Pweight_[ibin]; }
205 int ibin = int(pvnum);
207 if(ibin<25 && ibin>=0) {
return Pweight_[ibin]; }
228 std::string dataFile,
229 std::string GenHistName,
230 std::string DataHistName);
232 LumiReWeighting( std::vector< float > MC_distr, std::vector< float > Lumi_distr);
236 double weight(
int npv ) ;
238 double weight(
float npv ) ;
std::string DataHistName_
double WeightOOTPU_[25][25]
boost::shared_ptr< TH1 > MC_distr_
double ShiftWeight(int ibin)
double weightOOT(const edm::EventBase &e)
double ShiftWeight(float pvnum)
boost::shared_ptr< TFile > dataFile_
boost::shared_ptr< TFile > generatedFile_
boost::shared_ptr< TH1 > Data_distr_
std::string dataFileName_
boost::shared_ptr< TH1 > weights_
PoissonMeanShifter(float Shift)
std::string generatedFileName_