80 |
|
// |
81 |
|
// globals |
82 |
|
//---------------------------------------------------------------------------- |
83 |
< |
TH1D * hpu; |
83 |
> |
TH1D *hpu_2011, *hpu_2012; |
84 |
|
mithep::RunLumiRangeMap rlrm; |
85 |
|
vector<SimpleLepton> failingLeptons ; // for fake estimation |
86 |
|
vector<SimpleLepton> passingLeptons; // for fake estimation |
96 |
|
// prototypes |
97 |
|
//---------------------------------------------------------------------------- |
98 |
|
void initRunLumiRangeMap(); |
99 |
< |
void initPUWeights(); |
100 |
< |
double getPUWeight(unsigned npu); |
99 |
> |
|
100 |
|
|
101 |
|
// |
102 |
|
// MAIN |
108 |
|
string cmsswpath(CMSSW_BASE); |
109 |
|
cmsswpath.append("/src"); |
110 |
|
std::bitset<1024> triggerBits; |
112 |
– |
vector<vector<string> > inputFiles; |
113 |
– |
inputFiles.push_back(vector<string>()); |
111 |
|
map<string,unsigned> entrymap; // number of unskimmed entries in each file |
112 |
|
|
113 |
|
// |
222 |
|
// |
223 |
|
// Setup tree I/O |
224 |
|
//-------------------------------------------------------------------------------------------------------------- |
228 |
– |
TFile *inputFile=0; |
229 |
– |
TTree *eventTree=0; |
225 |
|
string currentFile(""); |
226 |
|
|
227 |
|
mithep::EventHeader *info = new mithep::EventHeader(); |
356 |
|
foTree.Fill(); |
357 |
|
|
358 |
|
if( ctrl.mc) |
359 |
< |
setEffiencyWeights(ret4l, weights); |
359 |
> |
setEffiencyWeights(ctrl.era, ret4l, weights); |
360 |
|
|
361 |
|
nt.Fill(); |
362 |
|
} |
384 |
|
rlrm.AddJSONFile(std::string("./data/Cert_190456-194479_8TeV_PromptReco_Collisions12_JSON.txt")); |
385 |
|
|
386 |
|
}; |
392 |
– |
|
393 |
– |
|
394 |
– |
//---------------------------------------------------------------------------- |
395 |
– |
void initPUWeights() |
396 |
– |
//---------------------------------------------------------------------------- |
397 |
– |
{ |
398 |
– |
TFile * puf = new TFile("data/PileupReweighting.Summer11DYmm_To_Full2011.root"); |
399 |
– |
hpu = (TH1D*)(puf->Get("puWeights")); |
400 |
– |
} |
401 |
– |
|
402 |
– |
//---------------------------------------------------------------------------- |
403 |
– |
double getPUWeight(unsigned npu) |
404 |
– |
//---------------------------------------------------------------------------- |
405 |
– |
{ |
406 |
– |
return hpu->GetBinContent(hpu->FindBin(npu)); |
407 |
– |
} |
408 |
– |
|