46 |
|
#include "SampleWeight.h" |
47 |
|
#include "Selection.h" |
48 |
|
#include "HZZCiCElectronSelection.h" |
49 |
+ |
#include "HZZLikelihoodElectronSelection.h" |
50 |
|
#include "SampleWeight.h" |
51 |
|
|
52 |
|
//#define THEIR_EVENTS |
73 |
|
} |
74 |
|
ctrl.dump(); |
75 |
|
|
76 |
+ |
map<string,double> entrymap; // number of unskimmed entries in each file |
77 |
+ |
|
78 |
|
// |
79 |
|
// File I/O |
80 |
|
//-------------------------------------------------------------------------------------------------------------- |
82 |
|
ifstream f(ctrl.inputfile.c_str()); |
83 |
|
string fname; |
84 |
|
while (f >> fname) { |
85 |
< |
if( !(strncmp( fname.c_str(), "#", 1 ) ) ) continue; // skip commented lines |
85 |
> |
if( !(strncmp( fname.c_str(), "#", 1 ) ) ) continue; // skip commented lines |
86 |
|
cout << "adding inputfile : " << fname.c_str() << endl; |
87 |
+ |
entrymap[string(fname.c_str())] = unskimmedEntries(fname.c_str()); |
88 |
|
chain->AddFile(fname.c_str()); |
89 |
|
} |
90 |
|
|
95 |
|
// Setup |
96 |
|
//-------------------------------------------------------------------------------------------------------------- |
97 |
|
TH1F * h_evt = new TH1F("hevt", "hevt", 2, 0, 2 ); |
98 |
< |
TH1F * h_evtfail = new TH1F("hevtfail", "hevtfail", 1024, 0, 1024 ); |
98 |
> |
TH1F * h_evtfail = new TH1F("hevtfail", "hevtfail", 1024, 0, 1024 ); |
99 |
|
TNtuple * passtuple = new TNtuple( "passtuple", "passtuple", "run:evt:lumi:channel:mZ1:mZ2:m4l:pt4l:w" ); |
100 |
|
initCiCSelection(); |
101 |
+ |
initLikSelection(); |
102 |
|
initRunLumiRangeMap(); |
103 |
|
|
99 |
– |
|
104 |
|
// |
105 |
|
// Loop |
106 |
|
//-------------------------------------------------------------------------------------------------------------- |
133 |
|
|
134 |
|
cout << "nEntries: " << chain->GetEntries() << endl; |
135 |
|
for(UInt_t ientry=0; ientry<chain->GetEntries(); ientry++) { |
136 |
< |
|
136 |
> |
|
137 |
|
chain->GetEntry(ientry); |
138 |
+ |
if(!(ientry%100000)) cout << "entry: " << ientry << endl; |
139 |
|
|
140 |
|
// get event weight for this file |
141 |
< |
double xs=1,eventweight=1; |
142 |
< |
if(ctrl.mc) eventweight = xstab.Get(getname(chain).c_str()) / chain->GetEntries(); |
141 |
> |
double eventweight=1; |
142 |
> |
if(ctrl.mc) eventweight = getWeight(xstab,entrymap,chain); |
143 |
|
|
144 |
|
#ifdef THEIR_EVENTS |
145 |
|
if( !( info->evtNum == 504867308 || |
166 |
|
info->evtNum == 107360878 ) ) continue; |
167 |
|
#endif |
168 |
|
|
169 |
< |
unsigned evtfail = fails_HZZ4L_selection(ctrl, info, electronArr, muonArr, eventweight, passtuple ); |
169 |
> |
unsigned evtfail = fails_HZZ4L_selection(ctrl, info, electronArr, muonArr, eventweight, passtuple); |
170 |
|
h_evtfail->Fill( evtfail, eventweight ); |
171 |
< |
cout << endl << endl; |
171 |
> |
if( ctrl.debug ) cout << endl << endl; |
172 |
|
|
173 |
|
} //end loop over data |
174 |
|
|