10 |
|
#include "EfficiencyWeightsInterface.h" |
11 |
|
|
12 |
|
RunLumiRangeMap rlrm; |
13 |
+ |
TH1D * hpu; |
14 |
+ |
|
15 |
|
|
16 |
|
// #include "TH2D.h" |
17 |
|
// extern TH2D * h_mu_eff_idiso_2011a; |
36 |
|
rlrm.AddJSONFile(std::string("./data/Cert_160404-178078_7TeV_PromptReco_Collisions11_JSON.txt")); |
37 |
|
rlrm.AddJSONFile(std::string("./data/Cert_160404-163869_7TeV_May10ReReco_Collisions11_JSON_v3.txt")); |
38 |
|
rlrm.AddJSONFile(std::string("./data/Cert_170249-172619_7TeV_ReReco5Aug_Collisions11_JSON.txt")); |
39 |
+ |
TFile * puf = new TFile("data/PileupReweighting.Summer11DYmm_To_Run2011A.root"); |
40 |
+ |
hpu = (TH1D*)(puf->Get("puWeights")); |
41 |
|
}; |
42 |
|
|
43 |
|
void initRunLumiRangeMap(RunLumiRangeMap &rlrm) { |
121 |
|
<< endl; |
122 |
|
} |
123 |
|
|
124 |
+ |
unsigned npu; double npuw; |
125 |
|
if( !ctrl.mc ) { |
126 |
|
// not accounting for overlap atm |
127 |
|
RunLumiRangeMap::RunLumiPairType rl(info->runNum, info->lumiSec); |
130 |
|
evtfail |= (1<<EVTFAIL_JSON); |
131 |
|
return evtfail; |
132 |
|
} |
133 |
+ |
} else { |
134 |
+ |
npu = info->nPU; |
135 |
+ |
npuw = hpu->GetBinContent(hpu->FindBin(npu)); |
136 |
|
} |
137 |
|
|
138 |
|
|
847 |
|
passtuple->SetBranchAddress("werroff", &werr_offline ); |
848 |
|
passtuple->SetBranchAddress("won", &w_online ); |
849 |
|
passtuple->SetBranchAddress("werron", &werr_online ); |
850 |
+ |
passtuple->SetBranchAddress("npu", &npu ); |
851 |
+ |
passtuple->SetBranchAddress("npuw", &npuw ); |
852 |
+ |
passtuple->SetBranchAddress("gchannel", &gchannel); |
853 |
|
} |
854 |
|
if( ctrl.btag ) { |
855 |
|
passtuple->SetBranchAddress("l3tche", &l3tche); |
862 |
|
passtuple->SetBranchAddress("l4csvMva", &l4csvMva); |
863 |
|
} |
864 |
|
|
854 |
– |
if( ctrl.mc ) passtuple->SetBranchAddress("gchannel", &gchannel); |
865 |
|
passtuple->Fill( ); |
856 |
– |
|
866 |
|
} |
867 |
|
|
868 |
|
if( ctrl.debug ) cout << "run: " << info->runNum |