1 |
|
#define baseClass_cxx |
2 |
|
#include "baseClass.h" |
3 |
|
|
4 |
+ |
#include "TH1I.h" |
5 |
+ |
#include "TFile.h" |
6 |
+ |
|
7 |
|
baseClass::baseClass(string * inputList, string * cutFile, string * treeName, string * outputFileName, string * cutEfficFile) |
8 |
|
{ |
9 |
|
std::cout << "baseClass::baseClass(): begins " << std::endl; |
19 |
|
baseClass::~baseClass() |
20 |
|
{ |
21 |
|
std::cout << "baseClass::~baseClass(): begin " << std::endl; |
22 |
< |
if( !writeCutHistos() ) |
23 |
< |
{ |
24 |
< |
STDOUT("ERROR: writeCutHistos did not complete successfully."); |
25 |
< |
} |
26 |
< |
if( !writeCutEfficFile() ) |
27 |
< |
{ |
28 |
< |
STDOUT("ERROR: writeStatFile did not complete successfully."); |
29 |
< |
} |
22 |
> |
// the following lines are from the jet prompt thing... |
23 |
> |
// if( !writeCutHistos() ) |
24 |
> |
// { |
25 |
> |
// STDOUT("ERROR: writeCutHistos did not complete successfully."); |
26 |
> |
// } |
27 |
> |
// if( !writeCutEfficFile() ) |
28 |
> |
// { |
29 |
> |
// STDOUT("ERROR: writeStatFile did not complete successfully."); |
30 |
> |
// } |
31 |
|
output_root_->Close(); |
32 |
|
std::cout << "baseClass::~baseClass(): end " << std::endl; |
33 |
|
} |
40 |
|
return c; |
41 |
|
} |
42 |
|
|
43 |
+ |
void baseClass::getHLTtable() { |
44 |
+ |
bool printTriggerTable=true; |
45 |
+ |
if(tree_ == NULL){ |
46 |
+ |
std::cout << "baseClass::init(): ERROR: tree_ = NULL " << std::endl; |
47 |
+ |
return; |
48 |
+ |
} |
49 |
+ |
|
50 |
+ |
tree_->GetEntry(); |
51 |
+ |
TFile *f = tree_->GetCurrentFile(); |
52 |
+ |
|
53 |
+ |
cout<<f->GetName()<<endl;; |
54 |
+ |
TH1I *hlt_stats = (TH1I*)f->Get("analyze/HLTTriggerStats"); |
55 |
+ |
cout<<"here 3"<<endl; |
56 |
+ |
|
57 |
+ |
// clear the map |
58 |
+ |
if(!HLTmap.empty()) { |
59 |
+ |
HLTmap.erase(HLTmap.begin(),HLTmap.end()); |
60 |
+ |
} |
61 |
+ |
|
62 |
+ |
for( int i=0; i < hlt_stats->GetNbinsX(); i++ ){ |
63 |
+ |
if(printTriggerTable==true) cout<<i<<": "<<hlt_stats->GetXaxis()->GetBinLabel(i+1)<<endl; |
64 |
+ |
HLTmap[hlt_stats->GetXaxis()->GetBinLabel(i+1)] = i; |
65 |
+ |
} |
66 |
+ |
} |
67 |
+ |
|
68 |
+ |
int baseClass::getHLTtriggerBit(string triggerName) { |
69 |
+ |
if(HLTmap.empty()) { |
70 |
+ |
cerr<<"HLTtrigger: no HLTmap available!"<<endl; |
71 |
+ |
return -1; |
72 |
+ |
} |
73 |
+ |
map<string, int>::iterator iter = HLTmap.find(triggerName); |
74 |
+ |
//cout<<"HLT bit: "<<iter->second<<endl; // iter->second is the HLT trigger bit |
75 |
+ |
if(iter==HLTmap.end()) { |
76 |
+ |
cerr<<"HLTtrigger: trigger name "<<triggerName<< " not found!"<<endl; |
77 |
+ |
return -1; |
78 |
+ |
} |
79 |
+ |
else { |
80 |
+ |
return iter->second; |
81 |
+ |
} |
82 |
+ |
} |
83 |
+ |
|
84 |
|
bool baseClass::triggerBitSelection(int hlt[200], int l1phys[128], int l1tech[64]) |
85 |
|
{ |
86 |
|
bool passed=false; |
184 |
|
double EcalIso=electron.ecalIso[0]; |
185 |
|
double HcalIso=electron.hcalIso[0]; |
186 |
|
double missingHits=electron.numberOfMissingInnerHits[0]; |
187 |
+ |
|
188 |
+ |
|
189 |
|
// get the cuts |
190 |
|
double See_B=cuts[0]; |
191 |
|
double Dphi_B=cuts[1]; |
194 |
|
double TrkIso_B=cuts[4]; |
195 |
|
double EcalIso_B=cuts[5]; |
196 |
|
double HcalIso_B=cuts[6]; |
197 |
< |
double missingHits_B=cuts[7]; |
197 |
> |
double CombIso_B=cuts[7]; |
198 |
> |
double missingHits_B=cuts[16]; |
199 |
|
double See_E=cuts[8]; |
200 |
|
double Dphi_E=cuts[9]; |
201 |
|
double Deta_E=cuts[10]; |
203 |
|
double TrkIso_E=cuts[12]; |
204 |
|
double EcalIso_E=cuts[13]; |
205 |
|
double HcalIso_E=cuts[14]; |
206 |
< |
double missingHits_E=cuts[15]; |
206 |
> |
double CombIso_E=cuts[15]; |
207 |
> |
double missingHits_E=cuts[16]; |
208 |
> |
double dist=cuts[17]; |
209 |
> |
|
210 |
> |
|
211 |
> |
|
212 |
> |
|
213 |
> |
|
214 |
|
// get the cut which should NOT be made |
215 |
|
if(!strcmp(cut,"sigmaIetaIeta")) combination[0]=1; |
216 |
|
else if(!strcmp(cut,"deltaPhi")) combination[1]=1; |
231 |
|
TrkIso<TrkIso_B && |
232 |
|
EcalIso<EcalIso_B && |
233 |
|
HcalIso<HcalIso_B && |
234 |
< |
missingHits<missingHits_B) passed=true; |
234 |
> |
missingHits<=missingHits_B) passed=true; |
235 |
|
// delta phi |
236 |
|
else if(combination[1]==1 && |
237 |
|
See<See_B && |
240 |
|
TrkIso<TrkIso_B && |
241 |
|
EcalIso<EcalIso_B && |
242 |
|
HcalIso<HcalIso_B && |
243 |
< |
missingHits<missingHits_B) passed=true; |
243 |
> |
missingHits<=missingHits_B) passed=true; |
244 |
|
// delta eta |
245 |
|
else if(combination[2]==1 && |
246 |
|
See<See_B && |
249 |
|
TrkIso<TrkIso_B && |
250 |
|
EcalIso<EcalIso_B && |
251 |
|
HcalIso<HcalIso_B && |
252 |
< |
missingHits<missingHits_B) passed=true; |
252 |
> |
missingHits<=missingHits_B) passed=true; |
253 |
|
// H over E |
254 |
|
else if(combination[3]==1 && |
255 |
|
See<See_B && |
258 |
|
TrkIso<TrkIso_B && |
259 |
|
EcalIso<EcalIso_B && |
260 |
|
HcalIso<HcalIso_B && |
261 |
< |
missingHits<missingHits_B) passed=true; |
261 |
> |
missingHits<=missingHits_B) passed=true; |
262 |
|
// Track isolation |
263 |
|
else if(combination[4]==1 && |
264 |
|
See<See_B && |
267 |
|
HoE<HoE_B && |
268 |
|
EcalIso<EcalIso_B && |
269 |
|
HcalIso<HcalIso_B && |
270 |
< |
missingHits<missingHits_B) passed=true; |
270 |
> |
missingHits<=missingHits_B) passed=true; |
271 |
|
// ECAL isolation |
272 |
|
else if(combination[5]==1 && |
273 |
|
See<See_B && |
276 |
|
HoE<HoE_B && |
277 |
|
TrkIso<TrkIso_B && |
278 |
|
HcalIso<HcalIso_B && |
279 |
< |
missingHits<missingHits_B) passed=true; |
279 |
> |
missingHits<=missingHits_B) passed=true; |
280 |
|
// HCAL isolation |
281 |
|
else if(combination[6]==1 && |
282 |
|
See<See_B && |
285 |
|
HoE<HoE_B && |
286 |
|
TrkIso<TrkIso_B && |
287 |
|
EcalIso<EcalIso_B && |
288 |
< |
missingHits<missingHits_B) passed=true; |
288 |
> |
missingHits<=missingHits_B) passed=true; |
289 |
|
// Conversions |
290 |
|
else if(combination[7]==1 && |
291 |
|
See<See_B && |
307 |
|
TrkIso<TrkIso_E && |
308 |
|
EcalIso<EcalIso_E && |
309 |
|
HcalIso<HcalIso_E && |
310 |
< |
missingHits<missingHits_E) passed=true; |
310 |
> |
missingHits<=missingHits_E) passed=true; |
311 |
|
// delta phi |
312 |
|
else if(combination[1]==1 && |
313 |
|
See<See_E && |
316 |
|
TrkIso<TrkIso_E && |
317 |
|
EcalIso<EcalIso_E && |
318 |
|
HcalIso<HcalIso_E && |
319 |
< |
missingHits<missingHits_E) passed=true; |
319 |
> |
missingHits<=missingHits_E) passed=true; |
320 |
|
// delta eta |
321 |
|
else if(combination[2]==1 && |
322 |
|
See<See_E && |
325 |
|
TrkIso<TrkIso_E && |
326 |
|
EcalIso<EcalIso_E && |
327 |
|
HcalIso<HcalIso_E && |
328 |
< |
missingHits<missingHits_E) passed=true; |
328 |
> |
missingHits<=missingHits_E) passed=true; |
329 |
|
// H over E |
330 |
|
else if(combination[3]==1 && |
331 |
|
See<See_E && |
334 |
|
TrkIso<TrkIso_E && |
335 |
|
EcalIso<EcalIso_E && |
336 |
|
HcalIso<HcalIso_E && |
337 |
< |
missingHits<missingHits_E) passed=true; |
337 |
> |
missingHits<=missingHits_E) passed=true; |
338 |
|
// Track isolation |
339 |
|
else if(combination[4]==1 && |
340 |
|
See<See_E && |
343 |
|
HoE<HoE_E && |
344 |
|
EcalIso<EcalIso_E && |
345 |
|
HcalIso<HcalIso_E && |
346 |
< |
missingHits<missingHits_E) passed=true; |
346 |
> |
missingHits<=missingHits_E) passed=true; |
347 |
|
// ECAL isolation |
348 |
|
else if(combination[5]==1 && |
349 |
|
See<See_E && |
352 |
|
HoE<HoE_E && |
353 |
|
TrkIso<TrkIso_E && |
354 |
|
HcalIso<HcalIso_E && |
355 |
< |
missingHits<missingHits_E) passed=true; |
355 |
> |
missingHits<=missingHits_E) passed=true; |
356 |
|
// HCAL isolation |
357 |
|
else if(combination[6]==1 && |
358 |
|
See<See_E && |
361 |
|
HoE<HoE_E && |
362 |
|
TrkIso<TrkIso_E && |
363 |
|
EcalIso<EcalIso_E && |
364 |
< |
missingHits<missingHits_E) passed=true; |
364 |
> |
missingHits<=missingHits_E) passed=true; |
365 |
|
// Conversions |
366 |
|
else if(combination[7]==1 && |
367 |
|
See<See_E && |
380 |
|
return passed; |
381 |
|
} |
382 |
|
|
383 |
+ |
|
384 |
+ |
testEvent baseClass::fillTestEvent() { |
385 |
+ |
// fill the event struct |
386 |
+ |
testEvent event; |
387 |
+ |
for(int i=0; i<NEles;i++) { |
388 |
+ |
TLorentzVector vec; |
389 |
+ |
vec.SetPxPyPzE(ElPx[i],ElPy[i],ElPz[i],ElE[i]); |
390 |
+ |
event.fourMomentum.push_back(vec); |
391 |
+ |
} |
392 |
+ |
return event; |
393 |
+ |
} |
394 |
+ |
|
395 |
+ |
int baseClass::ElectronPreselection(int i) { |
396 |
+ |
// function to make electron preselection |
397 |
+ |
// 0: preselected electron |
398 |
+ |
// 1: not accepted in eta |
399 |
+ |
// 2: not accepted in pt |
400 |
+ |
// 3: not accepted in H/E |
401 |
+ |
// 4: not accepted in dphi |
402 |
+ |
// 5: not accepted in deta |
403 |
+ |
|
404 |
+ |
//double etaMax_B=1.44; |
405 |
+ |
double etaMax_E=2.5; |
406 |
+ |
double ptMin=20; |
407 |
+ |
double HoverEMin=0.15; |
408 |
+ |
double deltaPhiMax=0.15; |
409 |
+ |
double deltaEtaMax=0.02; |
410 |
+ |
|
411 |
+ |
bool cutOn_Eta = true; |
412 |
+ |
bool cutOn_Pt = true; |
413 |
+ |
bool cutOn_HoE = true; |
414 |
+ |
bool cutOn_dPhi= true; |
415 |
+ |
bool cutOn_dEta= true; |
416 |
+ |
|
417 |
+ |
double eta = ElSCEta[i]; |
418 |
+ |
// double eta = ElEta[i]; |
419 |
+ |
|
420 |
+ |
// double dPhiCorr=dphiCorrections(ElEta[i], ElPhi[i]); |
421 |
+ |
// double dEtaCorr=detaCorrections(ElEta[i], ElPhi[i]); |
422 |
+ |
double dPhiCorr=dphiCorrections(eta, ElPhi[i]); |
423 |
+ |
double dEtaCorr=detaCorrections(eta, ElPhi[i]); |
424 |
+ |
|
425 |
+ |
TVector3 track; |
426 |
+ |
track.SetXYZ(ElPx[i], ElPy[i], ElPz[i]); |
427 |
+ |
double trackEta=track.Eta(); |
428 |
+ |
// double pt=ElCaloEnergy[i]/cosh(trackEta); |
429 |
+ |
double pt = ElPt[i]; |
430 |
+ |
|
431 |
+ |
double hoe = ElHcalOverEcal[i]; |
432 |
+ |
double dphi = ElDeltaPhiSuperClusterAtVtx[i] - dPhiCorr; |
433 |
+ |
double deta = ElDeltaEtaSuperClusterAtVtx[i] - dEtaCorr; |
434 |
+ |
// double dphi = ElDeltaPhiSuperClusterAtVtx[i]; |
435 |
+ |
// double deta = ElDeltaEtaSuperClusterAtVtx[i]; |
436 |
+ |
|
437 |
+ |
if(cutOn_Eta) if(fabs(eta) > etaMax_E) return 1; |
438 |
+ |
if(cutOn_Pt) if(pt < ptMin) return 2; |
439 |
+ |
if(cutOn_HoE) if(hoe > HoverEMin) return 3; |
440 |
+ |
if(cutOn_dPhi) if(fabs(dphi) > deltaPhiMax) return 4; |
441 |
+ |
if(cutOn_dEta) if(fabs(deta) > deltaEtaMax) return 5; |
442 |
+ |
|
443 |
+ |
return 0; |
444 |
+ |
} |
445 |
+ |
|
446 |
+ |
int baseClass::WPElectronID(int i, NminusOneCutLabel c, vector<double> cuts) { |
447 |
+ |
// function to ID and isolate electrons |
448 |
+ |
// return values (int): |
449 |
+ |
// 0 totally IDed & isolated electron |
450 |
+ |
// 1 See cut not passed |
451 |
+ |
// 2 dEta cut not passed |
452 |
+ |
// 3 dPhi |
453 |
+ |
// 4 HoE |
454 |
+ |
// 5 combIso |
455 |
+ |
// 6 conversion |
456 |
+ |
|
457 |
+ |
double etaMax_B=1.44; |
458 |
+ |
double etaMin_E=1.56; |
459 |
+ |
double etaMax_E=2.5; |
460 |
+ |
double SeeMax_B=cuts[0]; |
461 |
+ |
double dPhiMax_B=cuts[1]; |
462 |
+ |
double dEtaMax_B=cuts[2]; |
463 |
+ |
double HoEMax_B=cuts[3]; |
464 |
+ |
double TrkIsoMax_B=cuts[4]; |
465 |
+ |
double EcalIsoMax_B=cuts[5]; |
466 |
+ |
double HcalIsoMax_B=cuts[6]; |
467 |
+ |
double combIsoMax_B=cuts[7]; |
468 |
+ |
double SeeMax_E=cuts[8]; |
469 |
+ |
double dPhiMax_E=cuts[9]; |
470 |
+ |
double dEtaMax_E=cuts[10]; |
471 |
+ |
double HoEMax_E=cuts[11]; |
472 |
+ |
double TrkIsoMax_E=cuts[12]; |
473 |
+ |
double EcalIsoMax_E=cuts[13]; |
474 |
+ |
double HcalIsoMax_E=cuts[14]; |
475 |
+ |
double combIsoMax_E=cuts[15]; |
476 |
+ |
int hits=cuts[16]; |
477 |
+ |
double dist=cuts[17]; |
478 |
+ |
double cot=dist; |
479 |
+ |
|
480 |
+ |
bool cutOn_See=true; |
481 |
+ |
bool cutOn_dPhi=true; |
482 |
+ |
bool cutOn_dEta=true; |
483 |
+ |
bool cutOn_HoE=true; |
484 |
+ |
bool cutOn_combIso=true; |
485 |
+ |
bool cutOn_conversion=true; |
486 |
+ |
|
487 |
+ |
// check geometrical acceptance |
488 |
+ |
// for the isolation use the SC eta instead |
489 |
+ |
// of the electron eta |
490 |
+ |
double eta = ElSCEta[i]; |
491 |
+ |
// double eta = ElEta[i]; |
492 |
+ |
|
493 |
+ |
double dPhiCorr=dphiCorrections(eta, ElPhi[i]); |
494 |
+ |
double dEtaCorr=detaCorrections(eta, ElPhi[i]); |
495 |
+ |
|
496 |
+ |
double See = ElSigmaIetaIeta[i]; |
497 |
+ |
// apply the correction for the endcaps |
498 |
+ |
double dPhi = fabs(ElDeltaPhiSuperClusterAtVtx[i]-dPhiCorr); |
499 |
+ |
double dEta = fabs(ElDeltaEtaSuperClusterAtVtx[i]-dEtaCorr); |
500 |
+ |
double HoE = ElHcalOverEcal[i]; |
501 |
+ |
double trkIso = ElDR03TkSumPt[i]; |
502 |
+ |
double ecalIso = ElDR03EcalRecHitSumEt[i]; |
503 |
+ |
double hcalIso = ElDR03HcalTowerSumEt[i]; |
504 |
+ |
double combIso_B = (trkIso + max(0., ecalIso - 1.) + hcalIso) / ElPt[i]; |
505 |
+ |
double combIso_E = (trkIso + ecalIso + hcalIso) / ElPt[i]; |
506 |
+ |
bool isConversion; |
507 |
+ |
if((fabs(ElConvPartnerTrkDist[i])<dist && fabs(ElConvPartnerTrkDCot[i])<cot) || ElNumberOfMissingInnerHits[i]>hits) isConversion=true; |
508 |
+ |
else isConversion=false; |
509 |
+ |
|
510 |
+ |
if(c==see) cutOn_See = false; |
511 |
+ |
if(c==dphi) cutOn_dPhi = false; |
512 |
+ |
if(c==deta) cutOn_dEta = false; |
513 |
+ |
if(c==hoe) cutOn_HoE = false; |
514 |
+ |
if(c==combiso) cutOn_combIso = false; |
515 |
+ |
if(c==conversion) cutOn_conversion = false; |
516 |
+ |
|
517 |
+ |
|
518 |
+ |
// if(Event==27837545 || Event==73939173 || Event==15512525 || Event==191815699 || Event==29377895 || Event==29377895 || Event==74868952 || Event==76643965 || Event==62016483 || Event==4352136) { |
519 |
+ |
// cout<<eta<<endl; |
520 |
+ |
// cout<<combIso_B<<"/"<<combIso_E<<endl; |
521 |
+ |
// cout<<combIsoMax_B<<"/"<<combIsoMax_E<<endl; |
522 |
+ |
// cout<<"See: "<<See<<endl; |
523 |
+ |
// cout<<"dPhi: "<<dPhi<<endl; |
524 |
+ |
// cout<<"dEta: "<<dEta<<endl; |
525 |
+ |
// cout<<"HoE: "<<HoE<<endl; |
526 |
+ |
// cout<<"pt: "<<ElPt[i]<<endl; |
527 |
+ |
// } |
528 |
+ |
|
529 |
+ |
if(fabs(eta)<=etaMax_B) { |
530 |
+ |
if(cutOn_See) if(See > SeeMax_B) return 1; |
531 |
+ |
if(cutOn_dPhi) if(dPhi > dPhiMax_B) return 2; |
532 |
+ |
if(cutOn_dEta) if(dEta > dEtaMax_B) return 3; |
533 |
+ |
if(cutOn_HoE) if(HoE > HoEMax_B) return 4; |
534 |
+ |
if(cutOn_combIso) if(combIso_B > combIsoMax_B) return 5; |
535 |
+ |
if(cutOn_conversion) if(isConversion==true) return 6; |
536 |
+ |
return 0; |
537 |
+ |
} |
538 |
+ |
if(fabs(eta)>etaMin_E && fabs(eta)<etaMax_E) { |
539 |
+ |
if(cutOn_See) if(See > SeeMax_E) return 1; |
540 |
+ |
if(cutOn_dPhi) if(dPhi > dPhiMax_E) return 2; |
541 |
+ |
if(cutOn_dEta) if(dEta > dEtaMax_E) return 3; |
542 |
+ |
if(cutOn_HoE) if(HoE > HoEMax_E) return 4; |
543 |
+ |
if(cutOn_combIso) if(combIso_E > combIsoMax_E) return 5; |
544 |
+ |
if(cutOn_conversion) if(isConversion==true) return 6; |
545 |
+ |
return 0; |
546 |
+ |
} |
547 |
+ |
else { |
548 |
+ |
cout<<"WPelectronID: electron not in ECAL acceptance region!!"<<endl; |
549 |
+ |
return -1; |
550 |
+ |
} |
551 |
+ |
} |
552 |
+ |
|
553 |
+ |
double baseClass::detaCorrections(double etaEle,double phiEle) { |
554 |
+ |
// corrects for misalignement in the endcpas |
555 |
+ |
TF2 f12_fit2("f12_fit2","[0]+(TMath::TanH(y)/325.)*([1]-([2]*TMath::SinH(y)*TMath::Cos(x-[3])))",-TMath::Pi(),TMath::Pi(),-10.,10.); |
556 |
+ |
if (etaEle>1.479) |
557 |
+ |
{ |
558 |
+ |
f12_fit2.SetParameter(0,0.0013); |
559 |
+ |
f12_fit2.SetParameter(1,-0.06); |
560 |
+ |
f12_fit2.SetParameter(2,0.52); |
561 |
+ |
f12_fit2.SetParameter(3,2.17); |
562 |
+ |
} |
563 |
+ |
else if (etaEle<-1.479) |
564 |
+ |
{ |
565 |
+ |
f12_fit2.SetParameter(0,-0.0013); |
566 |
+ |
f12_fit2.SetParameter(1,-0.32); |
567 |
+ |
f12_fit2.SetParameter(2,0.45); |
568 |
+ |
f12_fit2.SetParameter(3,-1.58); |
569 |
+ |
} |
570 |
+ |
return f12_fit2.Eval(phiEle,etaEle); |
571 |
+ |
} |
572 |
+ |
|
573 |
+ |
double baseClass::dphiCorrections(double etaEle,double phiEle) { |
574 |
+ |
// corrects for misalignement in the endcpas |
575 |
+ |
TF2 f12_fit2("f12_fit2","[0]+[1]*(TMath::SinH(y)/325.)*(TMath::Sin([2]-x))",-TMath::Pi(),TMath::Pi(),-10.,10.); |
576 |
+ |
if (etaEle>1.479) |
577 |
+ |
{ |
578 |
+ |
f12_fit2.SetParameter(0,0.0); |
579 |
+ |
f12_fit2.SetParameter(1,0.52); |
580 |
+ |
f12_fit2.SetParameter(2,2.17); |
581 |
+ |
} |
582 |
+ |
else if (etaEle<-1.479) |
583 |
+ |
{ |
584 |
+ |
f12_fit2.SetParameter(0,0.0); |
585 |
+ |
f12_fit2.SetParameter(1,0.45); |
586 |
+ |
f12_fit2.SetParameter(2,-1.58); |
587 |
+ |
} |
588 |
+ |
return f12_fit2.Eval(phiEle,etaEle); |
589 |
+ |
} |
590 |
+ |
|
591 |
+ |
|
592 |
+ |
int baseClass::WSelection(int i, WNminusOneCutLabel c) { |
593 |
+ |
// idea: write cuts into a vector and give the vector to the function |
594 |
+ |
// double etaMax_B=1.44; |
595 |
+ |
double pre_metMin=20; |
596 |
+ |
double pre_ptMin=20; |
597 |
+ |
double metMin=30; |
598 |
+ |
double ptMin=25; |
599 |
+ |
double mtMin=60; |
600 |
+ |
|
601 |
+ |
bool cutOn_Preselection=true; |
602 |
+ |
bool cutOn_Met=true; |
603 |
+ |
bool cutOn_Pt=true; |
604 |
+ |
bool cutOn_Mt=true; |
605 |
+ |
|
606 |
+ |
double met=PFMET; |
607 |
+ |
double pt=ElPt[i]; |
608 |
+ |
double delPhiMet=deltaPhi(ElPhi[i], PFMETphi); |
609 |
+ |
double mt=transverseMass(pt, met, delPhiMet); |
610 |
+ |
// check geometrical acceptance |
611 |
+ |
// for the isolation use the SC eta instead |
612 |
+ |
// of the electron eta |
613 |
+ |
// double eta = ElSCEta[i]; |
614 |
+ |
// double eta = ElEta[i]; |
615 |
+ |
|
616 |
+ |
if(c==pre) cutOn_Preselection = false; |
617 |
+ |
if(c==misset) cutOn_Met = false; |
618 |
+ |
if(c==pt) cutOn_Pt = false; |
619 |
+ |
if(c==mt) cutOn_Mt = false; |
620 |
+ |
|
621 |
+ |
|
622 |
+ |
// if(fabs(eta)<=etaMax_B) { |
623 |
+ |
if(cutOn_Preselection) if(met<pre_metMin || pt<pre_ptMin) return 1; |
624 |
+ |
if(cutOn_Met) if(met<metMin) return 2; |
625 |
+ |
if(cutOn_Pt) if(pt<ptMin) return 3; |
626 |
+ |
if(cutOn_Mt) if(mt<mtMin) return 4; |
627 |
+ |
return 0; |
628 |
+ |
// } |
629 |
+ |
// if(fabs(eta)>etaMax_B) { |
630 |
+ |
// if(cutOn_Preselection) if(met<pre_metMin || pt<pre_ptMin) return 1; |
631 |
+ |
// if(cutOn_Met) if(met<metMin) return 2; |
632 |
+ |
// if(cutOn_Pt) if(pt<ptMin) return 3; |
633 |
+ |
// if(cutOn_Mt) if(mt<mtMin) return 4; |
634 |
+ |
// return 0; |
635 |
+ |
// } |
636 |
+ |
} |
637 |
+ |
|
638 |
+ |
|
639 |
+ |
|
640 |
+ |
// void initializeWP(vector<double>cuts) { |
641 |
+ |
// SeeMax_B=cuts[0]; |
642 |
+ |
// DphiMax_B=cuts[1]; |
643 |
+ |
// DetaMax_B=cuts[2]; |
644 |
+ |
// HoEMax_B=cuts[3]; |
645 |
+ |
// combIsoMax_B=cuts[4]; |
646 |
+ |
// // TrkIsoMax_B=cuts[4]; |
647 |
+ |
// // EcalIsoMax_B=cuts[5]; |
648 |
+ |
// // HcalIsoMax_B=cuts[6]; |
649 |
+ |
// SeeMax_E=cuts[8]; |
650 |
+ |
// DphiMax_E=cuts[9]; |
651 |
+ |
// DetaMax_E=cuts[10]; |
652 |
+ |
// HoEMax_E=cuts[11]; |
653 |
+ |
// // TrkIsoMax_E=cuts[12]; |
654 |
+ |
// // EcalIsoMax_E=cuts[13]; |
655 |
+ |
// // HcalIsoMax_E=cuts[14]; |
656 |
+ |
// combIsoMax_E=cuts[12]; |
657 |
+ |
|
658 |
+ |
// } |
659 |
+ |
|
660 |
|
bool baseClass::ethNminus1(int isECALdriven, double deltaPhi, double deltaEta, double e, double p, double eta, char *cut, bool iso) |
661 |
|
{ |
662 |
|
bool passed=false; |
790 |
|
|
791 |
|
tree_ = NULL; |
792 |
|
readInputList(); |
793 |
< |
readCutFile(); |
793 |
> |
// readCutFile(); // not using cut file, need dummy cut file as input... |
794 |
|
if(tree_ == NULL){ |
795 |
|
std::cout << "baseClass::init(): ERROR: tree_ = NULL " << std::endl; |
796 |
|
return; |
837 |
|
NBeforeSkim_ = NBeforeSkim_ + NBeforeSkim; |
838 |
|
STDOUT("Initial number of events: NBeforeSkim, NBeforeSkim_ = "<<NBeforeSkim<<", "<<NBeforeSkim_); |
839 |
|
} |
840 |
+ |
|
841 |
|
tree_ = chain; |
842 |
|
cout << "baseClass::readInputList: Finished reading list: " << *inputList_ << endl; |
843 |
|
} |