-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEventCalculator_cfA.C
14849 lines (12357 loc) · 628 KB
/
EventCalculator_cfA.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "EventCalculator_cfA.h"
#include "PUConstants.h"
#include "TSystem.h"
#include "TH1.h"
#include "TH2.h"
#include "TH3.h"
#include "TRandom3.h"
#include "TTree.h"
#include "TFile.h"
#include "TMatrixT.h"
#include "TMatrixDEigen.h"
#include "TStopwatch.h"
#include "TRegexp.h"
#include "TVector3.h"
#include "Math/Vector4D.h"
#include "Math/Boost.h"
#include "inJSON2012.h"
#include "MiscUtil.cxx"
//needed only for thrust calculations
/*
#include <RooRealVar.h>
#include <RooMinuit.h>
#include "RooTransverseThrustVar.h"
*/
#include <cassert>
#include <fstream>
#include <algorithm>
//#include <iomanip>
#include "BTagWeight2.h"
using namespace std;
EventCalculator::EventCalculator(const TString & sampleName, const vector<string> inputFiles, jetType theJetType, METType theMETType, isoType theIsoType) :
sampleName_(sampleName),
sampleIsSignal_(false),
cfAversion_(0),
theScanType_(kNotScan),
theMETType_(theMETType),
theJetType_(theJetType),
theIsoType_(theIsoType),
theJESType_(kJES0),
theJERType_(kJER0),
theMETuncType_(kMETunc0),
thePUuncType_(kPUunc0),
theBTagEffType_(kBTagEff05),
theHLTEffType_(kHLTEff0),
theBTaggerType_(kCSVM),
crossSectionTanb40_10_(0),
crossSectionTanb40_05_(0),
crossSectionTanb40_20_(0),
crossSectionpMSSM_(0),
smsCrossSectionFile_(0),
f_trigeff_(0),
hnum_ht400to500_0L(0),
hnum_ht500to800_0L(0),
hnum_ht800to1000_0L(0),
hnum_ht1000toInf_0L(0),
hnum_ht400to500_ele(0),
hnum_ht500to800_ele(0),
hnum_ht800to1000_ele(0),
hnum_ht1000toInf_ele(0),
hnum_ht400to500_mu(0),
hnum_ht500to800_mu(0),
hnum_ht800to1000_mu(0),
hnum_ht1000toInf_mu(0),
hden_ht400to500_0L(0),
hden_ht500to800_0L(0),
hden_ht800to1000_0L(0),
hden_ht1000toInf_0L(0),
hden_ht400to500_ele(0),
hden_ht500to800_ele(0),
hden_ht800to1000_ele(0),
hden_ht1000toInf_ele(0),
hden_ht400to500_mu(0),
hden_ht500to800_mu(0),
hden_ht800to1000_mu(0),
hden_ht1000toInf_mu(0),
f_tageff_(0),
fDataJetRes_(0),
cachedEvent_(new jmt::eventID(0,0,0)),
//
//2011 values, to be used for code validation only
ResJetPar_(new JetCorrectorParameters("JESfiles/START53_V7F_L2L3Residual_AK5PFchs.txt") ),
L3JetPar_(new JetCorrectorParameters("JESfiles/START53_V7F_L3Absolute_AK5PFchs.txt") ),
L2JetPar_(new JetCorrectorParameters("JESfiles/START53_V7F_L2Relative_AK5PFchs.txt") ),
L1JetPar_(new JetCorrectorParameters("JESfiles/START53_V7F_L1FastJet_AK5PFchs.txt") ),
JetCorrector_(0 ),
jecUnc_(new JetCorrectionUncertainty("JESfiles/START53_V7F_Uncertainty_AK5PFchs.txt")),
starttime_(0),
recalculatedVariables_(false),
watch_(0),
minHiggsJetPt_(20), //defines the min jet pT of the higgs candidates (mass diff method)
//new cfA stuff
chainB( new TChain("/configurableAnalysis/eventB")),
chainV( 0),
chainA( new TChain("configurableAnalysis/eventA"))
{
if (sampleName_.Contains("v69")) cfAversion_=69;
else if (sampleName_.Contains("v68")) cfAversion_=68;
else if (sampleName_.Contains("v67")) cfAversion_=67;
else if (sampleName_.Contains("v66")) cfAversion_=66;
else if (sampleName_.Contains("v65")) cfAversion_=65;
else if (sampleName_.Contains("v64")) cfAversion_=64;
else if (sampleName_.Contains("v63")) cfAversion_=63;
else if (sampleName_.Contains("v71")) cfAversion_=71;
cout<<" Found cfA version = "<<cfAversion_<<endl;
assert(cfAversion_>0);
if (cfAversion_>=69) cout<<" --> this is a v69 or later sample. PU beta and METsig2012 enabled"<<endl;
else cout<<" =========> This is a pre-v69 sample! PU beta and METsig2012 DISabled!"<<endl;
if ( sampleName_.Contains("mSUGRA") ) {
theScanType_ = kmSugra;
std::cout<<"\tDetected that I'm running over an mSugra scan!"<<std::endl;
sampleIsSignal_=true;
}
else if (sampleName_.Contains("T1bbbb") ||
sampleName_.Contains("T2bb") ||
sampleName_.Contains("T2tt") ||
sampleName_.Contains("T1tttt")||
sampleName_.Contains("T5tttt")||
sampleName_.Contains("T7btw")||
sampleName_.Contains("T4tW") ||
sampleName_.Contains("TChihh")||
sampleName_.Contains("TChiHH")||
sampleName_.Contains("TChiZH")||
sampleName_.Contains("T6tthh")||
sampleName_.Contains("T6cchh")||
sampleName_.Contains("T6bbHH")||
sampleName_.Contains("T6ttHH")||
sampleName_.Contains("T1tbbb")||
sampleName_.Contains("T1ttbb")||
sampleName_.Contains("T1tttb")||
sampleName_.Contains("T2tb")
) {
theScanType_ = kSMS;
std::cout<<"\tDetected that I'm running over an SMS scan!"<<std::endl;
sampleIsSignal_=true;
}
else if (sampleName_.Contains("pMSSM")) {
theScanType_ = kpmssm;
std::cout<<"\tDetected that I'm running over a pMSSM scan!"<<std::endl;
sampleIsSignal_=true;
}
else if (sampleName_.Contains("LM")) {
sampleIsSignal_=true;
std::cout<<"\tDetected that I'm running over a SUSY sample!"<<std::endl;
}
else std::cout<<"\tRunning on a SM sample"<<std::endl;
initEnumNames();
loadSusyScanCrossSections();
// checkConsistency();
loadTriggerHistos();
loadDataJetRes();
loadECALStatus();//could also be in reducedTree
vPar_.clear(); //should be overkill
vPar_.push_back(*L1JetPar_);
vPar_.push_back(*L2JetPar_);
vPar_.push_back(*L3JetPar_);
vPar_.push_back(*ResJetPar_);
JetCorrector_ = new FactorizedJetCorrector(vPar_);
//finally, initialize the TBraches for cfA
for (unsigned int ii = 0; ii<inputFiles.size(); ++ii) {
chainB->Add(inputFiles.at(ii).c_str());
chainA->Add(inputFiles.at(ii).c_str());
}
InitializeB(chainB);
InitializeA(chainA);
cout<<sampleName_<<endl;
if (sampleIsSignal_) {
cout<<" init PDFs"<<endl;
LHAPDF::initPDFSet(1, "cteq66.LHgrid");
LHAPDF::initPDFSet(2, "MSTW2008nlo68cl.LHgrid");
LHAPDF::initPDFSet(3, "NNPDF20_100.LHgrid");
cout<<" done with PDF init"<<endl;
}
else cout<<"Skipping PDF init"<<endl;
}
EventCalculator::~EventCalculator() {
//turns out the program does a segv at terminate if i don't properly delete these
delete chainA;
delete chainB;
delete f_trigeff_;
delete JetCorrector_;
delete ResJetPar_;
delete L3JetPar_;
delete L2JetPar_;
delete L1JetPar_;
delete jecUnc_;
cout<<"EventCalculator dead"<<endl;
}
float EventCalculator::getPDFweight(const int ipdfset, const int imember ) {
//return 1; //for debugging
assert(ipdfset>=1 && ipdfset<=3);
LHAPDF::usePDFMember(ipdfset, imember); // where ipdf=1,2 or 3 is the pdf set index and imember is the error member.
double fx1 = LHAPDF::xfx(ipdfset, mc_pdf_x1->at(0), mc_pdf_q->at(0), TMath::Nint(mc_pdf_id1->at(0)))/mc_pdf_x1->at(0);
double fx2 = LHAPDF::xfx(ipdfset, mc_pdf_x2->at(0), mc_pdf_q->at(0), TMath::Nint(mc_pdf_id2->at(0)))/mc_pdf_x2->at(0);
if ( std::isnan(fx1) || std::isnan(fx2) ) {cout<<"Found PDF NaN! (LHAPDF)"<<endl; return 1;}
return float(fx1*fx2);
}
float EventCalculator::getTopPtWeight(float & topPt) {
//the "original recipe" from Darren Puigh (the ttH recipe)
topPt=-1;
//only for use with ttbar
//(2 string comparisons for every event is not so good for performance, but oh well)
if (sampleName_.BeginsWith("TTJets") || sampleName_.BeginsWith("TT_")) {
//code from Darren converted to cfA
for ( unsigned int i=0; i< mc_doc_id->size(); i++ ) {
// look for the *top* (not antitop) pT
if ( mc_doc_id->at(i)==6 ) { topPt = mc_doc_pt->at(i); break; }
}
if (topPt<0) return 1;
const double p0 = 1.18246e+00;
const double p1 = 4.63312e+02;
const double p2 = 2.10061e-06;
double x=topPt;
if ( x>p1 ) x = p1; //use flat factor above 463 GeV
double result = p0 + p2 * x * ( x - 2 * p1 );
return float(result);
}
return 1;
}
float EventCalculator::getTopPtWeight_official() {
float topweight=-1;
//official recipe from
// https://twiki.cern.ch/twiki/bin/viewauth/CMS/TopPtReweighting
//(2 string comparisons for every event is not so good for performance, but oh well)
if (sampleName_.BeginsWith("TTJets") || sampleName_.BeginsWith("TT_")) {
float topPt=-1;
float topbarPt=-1;
for ( unsigned int i=0; i< mc_doc_id->size(); i++ ) {
// look for the *top* (not antitop) pT
if ( mc_doc_id->at(i)== 6 ) { topPt = mc_doc_pt->at(i); }
if ( mc_doc_id->at(i)== -6 ) { topbarPt = mc_doc_pt->at(i); }
if (topPt>=0 && topbarPt >=0) break; //check to see if we're done
}
//SF(x)=exp(a+bx)
const double a = 0.156; //combined 8 TeV values
const double b = -0.00137 ;
//important choice -- I've decided to use the 400 GeV value for values above 400 GeV
//an alternative would be to just blindly use the formula
if (topPt >400) topPt=400;
if (topbarPt >400) topbarPt=400;
double SFt = exp(a + b*topPt);
double SFtbar = exp(a + b*topbarPt);
topweight = sqrt( SFt * SFtbar );
}
if (topweight <0) topweight=1;
return topweight;
}
void EventCalculator::initEnumNames() {
theBTaggerNames_[kSSVM]="SSVHEM";
theBTaggerNames_[kTCHET]="TCHET";
theBTaggerNames_[kSSVHPT]="SSVHPT";
theBTaggerNames_[kTCHPT]="TCHPT";
theBTaggerNames_[kTCHPM]="TCHPM";
theBTaggerNames_[kCSVM]="CSVM";
theMETNames_[kPFMET] = "PFMET";
theMETNames_[kPFMETTypeI] = "PFMETTypeI";
theJetNames_[kPF2PAT]="PF2PATjets";
theJetNames_[kRECOPF]="RecoPFjets";
theIsoNames_[kIso0]="Iso0";
theIsoNames_[kIsoup]="IsoUp";
theIsoNames_[kIsodown]="IsoDown";
theJESNames_[kJES0]="JES0";
theJESNames_[kJESup]="JESup";
theJESNames_[kJESdown]="JESdown";
// theJESNames_[kJESFLY]="JESFLY"; //disable this
theMETuncNames_[kMETunc0]="METunc0";
theMETuncNames_[kMETuncUp]="METuncUp";
theMETuncNames_[kMETuncDown]="METuncDown";
thePUuncNames_[kPUunc0]="PUunc0";
thePUuncNames_[kPUuncUp]="PUuncUp";
thePUuncNames_[kPUuncDown]="PUuncDown";
theBTagEffNames_[kBTagEff0]="BTagEff0";
theBTagEffNames_[kBTagEffup]="BTagEffup";
theBTagEffNames_[kBTagEffdown]="BTagEffdown";
theBTagEffNames_[kBTagEff02]="BTagEff02";
theBTagEffNames_[kBTagEffup2]="BTagEffup2";
theBTagEffNames_[kBTagEffdown2]="BTagEffdown2";
theBTagEffNames_[kBTagEff03]="BTagEff03";
theBTagEffNames_[kBTagEffup3]="BTagEffup3";
theBTagEffNames_[kBTagEffdown3]="BTagEffdown3";
theBTagEffNames_[kBTagEff05]="BTagEff05";
theBTagEffNames_[kBTagEffup5]="BTagEffup5";
theBTagEffNames_[kBTagEffdown5]="BTagEffdown5";
theHLTEffNames_[kHLTEff0]="HLTEff0";
theHLTEffNames_[kHLTEffup]="HLTEffup";
theHLTEffNames_[kHLTEffdown]="HLTEffdown";
theJERNames_[kJER0]="JER0";
theJERNames_[kJERup]="JERup";
theJERNames_[kJERbias]="JERbias";
theJERNames_[kJERra2]="JERra2";
theJERNames_[kJERdown]="JERdown";
}
void EventCalculator::stopTimer(const Long64_t ntotal) {
TDatime stoptime; //default ctor is for current time
double elapsed= stoptime.Convert() - starttime_->Convert();
std::cout<<"events / time = "<<ntotal<<" / "<<elapsed<<" = "<<double(ntotal)/double(elapsed)<<" Hz"<<std::endl;
delete starttime_;
starttime_=0;
}
bool EventCalculator::isSampleRealData() {
if (sampleName_.BeginsWith("HT_Run2012A")) return true;
if (sampleName_.BeginsWith("HTMHT_Run2012")) return true;
if (sampleName_.BeginsWith("JetHT_Run2012")) return true;
if (sampleName_.BeginsWith("MET_Run2012")) return true;
if (sampleName_.BeginsWith("MuEG_Run2012")) return true;
if (sampleName_.BeginsWith("DoubleElectron_Run2012")) return true;
if (sampleName_.BeginsWith("DoubleMu_Run2012")) return true;
if (sampleName_.BeginsWith("ElectronHad_Run2012")) return true;
if (sampleName_.BeginsWith("MuHad_Run2012")) return true;
if (sampleName_.BeginsWith("SingleMu_Run2012")) return true;
if (sampleName_.BeginsWith("SingleElectron_Run2012")) return true;
if (sampleName_.BeginsWith("Photon_Run2012")) return true;
if (sampleName_.BeginsWith("PhotonHad_Run2012")) return true;
return false;
}
void EventCalculator::loadSusyScanCrossSections() {
if (theScanType_ == kmSugra ) {
crossSectionTanb40_10_ = new CrossSectionTable("NLOxsec_tanb40_10.txt");
crossSectionTanb40_05_ = new CrossSectionTable("NLOxsec_tanb40_05.txt");
crossSectionTanb40_20_ = new CrossSectionTable("NLOxsec_tanb40_20.txt");
}
else if (theScanType_==kpmssm) {
crossSectionpMSSM_ = new CrossSectionTable("xsect_batch1.txt","pMSSM");
crossSectionpMSSM_->appendFileToDatabasePMSSM("xsect_batch2.txt");
crossSectionpMSSM_->appendFileToDatabasePMSSM("xsect_batch3.txt");
crossSectionpMSSM_->appendFileToDatabasePMSSM("xsect_batch4.txt");
}
}
void EventCalculator::setOptions( const TString & opt) {
//cannot set the b tagger, or the jet type, or the met type, or the scan type
//but all other options must be set here
if (opt=="") return;
cout<<opt<<endl;
//i wish i could think of a more clever way to code this
if ( getOptPiece("JES",opt)== theJESNames_[kJES0]) theJESType_ = kJES0;
else if ( getOptPiece("JES",opt)== theJESNames_[kJESup]) theJESType_ = kJESup;
else if ( getOptPiece("JES",opt)== theJESNames_[kJESdown]) theJESType_ = kJESdown;
// else if ( getOptPiece("JES",opt)== theJESNames_[kJESFLY]) theJESType_ = kJESFLY;
else {cout<<"problem with opt in JES"<<endl; assert(0) ;} //enforce a complete set of options!
if ( getOptPiece("JER",opt)== theJERNames_[kJER0]) theJERType_ = kJER0;
else if ( getOptPiece("JER",opt)== theJERNames_[kJERup]) theJERType_ = kJERup;
else if ( getOptPiece("JER",opt)== theJERNames_[kJERdown]) theJERType_ = kJERdown;
else if ( getOptPiece("JER",opt)== theJERNames_[kJERbias]) theJERType_ = kJERbias;
else if ( getOptPiece("JER",opt)== theJERNames_[kJERra2]) theJERType_ = kJERra2;
else {cout<<"problem with opt in JER"<<endl; assert(0);} //enforce a complete set of options!
if ( getOptPiece("METunc",opt)== theMETuncNames_[kMETunc0]) theMETuncType_ = kMETunc0;
else if ( getOptPiece("METunc",opt)== theMETuncNames_[kMETuncUp]) theMETuncType_ = kMETuncUp;
else if ( getOptPiece("METunc",opt)== theMETuncNames_[kMETuncDown]) theMETuncType_ = kMETuncDown;
else {cout<<"problem with opt in METunc"<<endl; assert(0) ;} //enforce a complete set of options!
if ( getOptPiece("PUunc",opt)== thePUuncNames_[kPUunc0]) thePUuncType_ = kPUunc0;
else if ( getOptPiece("PUunc",opt)== thePUuncNames_[kPUuncUp]) thePUuncType_ = kPUuncUp;
else if ( getOptPiece("PUunc",opt)== thePUuncNames_[kPUuncDown]) thePUuncType_ = kPUuncDown;
else {cout<<"problem with opt in PU"<<endl; assert(0) ;} //enforce a complete set of options!
if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEff0]) theBTagEffType_ = kBTagEff0;
else if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEffup]) theBTagEffType_ = kBTagEffup;
else if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEffdown]) theBTagEffType_ = kBTagEffdown;
else if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEff02]) theBTagEffType_ = kBTagEff02;
else if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEffup2]) theBTagEffType_ = kBTagEffup2;
else if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEffdown2]) theBTagEffType_ = kBTagEffdown2;
else if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEff03]) theBTagEffType_ = kBTagEff03;
else if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEffup3]) theBTagEffType_ = kBTagEffup3;
else if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEffdown3]) theBTagEffType_ = kBTagEffdown3;
else if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEff05]) theBTagEffType_ = kBTagEff05;
else if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEffup5]) theBTagEffType_ = kBTagEffup5;
else if ( getOptPiece("BTag",opt)== theBTagEffNames_[kBTagEffdown5]) theBTagEffType_ = kBTagEffdown5;
else {cout<<"problem with opt in btag"<<endl; assert(0) ;} //enforce a complete set of options!
if ( getOptPiece("HLT",opt)== theHLTEffNames_[kHLTEff0]) theHLTEffType_ = kHLTEff0;
else if ( getOptPiece("HLT",opt)== theHLTEffNames_[kHLTEffup]) theHLTEffType_ = kHLTEffup;
else if ( getOptPiece("HLT",opt)== theHLTEffNames_[kHLTEffdown]) theHLTEffType_ = kHLTEffdown;
else {cout<<"problem with opt in HLT"<<endl;assert(0) ;} //enforce a complete set of options!
cout<<"Got options: "<<endl
<<theJESNames_[theJESType_]<<endl
<<theJERNames_[theJERType_]<<endl
<<theMETuncNames_[theMETuncType_]<<endl
<<thePUuncNames_[thePUuncType_]<<endl
<<theBTagEffNames_[theBTagEffType_]<<endl
<<theHLTEffNames_[theHLTEffType_]<<endl;
}
double EventCalculator::getWeight(Long64_t nentries) {
if( isSampleRealData() ) return 1;
if (theScanType_==kmSugra) return 1;//special weighting in effect
else if (theScanType_==kSMS) return 1;//special weighting in effect
else if (theScanType_==kpmssm) return 1;//special weighting in effect
double sigma = getCrossSection();
double w = lumi_ * sigma / double(nentries);
// if (sampleName_.Contains("QCD_Pt_15to3000_TuneZ2_Flat_7TeV_pythia6")) w *= weight;
return w;
}
//1d reweighting
//https://twiki.cern.ch/twiki/bin/viewauth/CMS/PileupMCReweightingUtilities
float EventCalculator::getPUWeight( reweight::LumiReWeighting lumiWeights ) {
if (isSampleRealData() ) return 1;
// cout<<" ----"<<endl;
float weight=1;
float npv = -1;
for ( unsigned int i = 0; i<PU_bunchCrossing->size() ; i++) {
//consider only in-time PU
int BX =PU_bunchCrossing->at(i) ;
if(BX == 0) {
npv =PU_TrueNumInteractions->at(i);
}
}
//in-time PU only
weight = lumiWeights.weight( npv );
return weight;
}
float EventCalculator::PU_sumpt(int index,bool highpt) {
std::vector<std::vector<float> > * my_sumpt = highpt ? PU_sumpT_highpT : PU_sumpT_lowpT;
float sum=0;
size_t npu=my_sumpt->at(index).size();
for (size_t i=0; i<npu; ++i) {
sum += my_sumpt->at(index).at(i);
}
return sum;
}
//3d pu reweighting deprecated for 2012
float EventCalculator::getMuonRelIso(const unsigned int k) {
// now isolation with delta beta corrections are recommended with DelR cone of 0.4
float isoNeutral = pf_mus_pfIsolationR04_sumNeutralHadronEt->at(k) + pf_mus_pfIsolationR04_sumPhotonEt->at(k) - 0.5*pf_mus_pfIsolationR04_sumPUPt->at(k);
isoNeutral = ( isoNeutral > 0) ? isoNeutral : 0;
float muRelIso = (pf_mus_pfIsolationR04_sumChargedHadronPt->at(k) + isoNeutral) / pf_mus_pt->at(k);
return muRelIso;
}
bool EventCalculator::isGoodMuon(const unsigned int k, const bool disableRelIso, const float ptthreshold,int & lossCode) {
// updated for 2012...basically just copying keith's code
//sanity check
if ( k >= pf_mus_pt->size() ) {lossCode=5; return false;}
if (!isGoodPV(0)) {lossCode=5; return false;}
if (fabs(pf_mus_eta->at(k)) >= 2.4 ) {lossCode=1; return false; }
if (pf_mus_pt->at(k) < ptthreshold) {lossCode=2; return false;}
//i like to use TMath::Nint for quantities stored as float that are really integers. just to be safe
if ( TMath::Nint(pf_mus_id_GlobalMuonPromptTight->at(k)) == 0) {lossCode=3; return false; }
// GlobalMuonPromptTight includes: isGlobal, globalTrack()->normalizedChi2() < 10, numberOfValidMuonHits() > 0
if ( TMath::Nint(pf_mus_numberOfMatchedStations->at(k)) <= 1 ) {lossCode=3; return false; }
// At least one matched station includes requirement of arbitrated tracker muon, so no need for that explicitly
const float beamx = beamSpot_x->at(0);
const float beamy = beamSpot_y->at(0);
float d0 = pf_mus_tk_d0dum->at(k) - beamx*sin(pf_mus_tk_phi->at(k)) + beamy*cos(pf_mus_tk_phi->at(k));
if ( fabs(d0) >= 0.2 ) {lossCode=3; return false; }
if ( fabs(pf_mus_tk_vz->at(k) - pv_z->at(0) ) >= 0.5 ) {lossCode=3; return false; }
if ( TMath::Nint(pf_mus_tk_numvalPixelhits->at(k)) == 0 ) {lossCode=3; return false; }
if ( TMath::Nint(pf_mus_tk_LayersWithMeasurement->at(k)) <= 5 ) {lossCode=3; return false; }
float muRelIso = getMuonRelIso(k);
float maxRelIso = 0.2;
if(theIsoType_ == kIsoup) maxRelIso = 0.56;
else if(theIsoType_ == kIsodown) maxRelIso = 0.102;
if ( (disableRelIso==false) && (muRelIso >= maxRelIso) ) {lossCode=4; return false;}
//if we haven't failed anything yet...then it's good
lossCode=0;
return true;
}
bool EventCalculator::isGoodTightMuon(const unsigned int k, const bool disableRelIso, const float ptthreshold) {
//For MET-Reweighting
//sanity check
if ( k >= pf_mus_pt->size() ) return false;
if (!isGoodPV(0)) return false;
if (pf_mus_pt->at(k) < ptthreshold) return false;
if (fabs(pf_mus_eta->at(k)) >= 2.1 ) return false; //DIFFERENT FROM isGoodMuon!
//i like to use TMath::Nint for quantities stored as float that are really integers. just to be safe
if ( TMath::Nint(pf_mus_id_GlobalMuonPromptTight->at(k)) == 0) return false;
// GlobalMuonPromptTight includes: isGlobal, globalTrack()->normalizedChi2() < 10, numberOfValidMuonHits() > 0
if ( TMath::Nint(pf_mus_numberOfMatchedStations->at(k)) <= 1 ) return false;
// At least one matched station includes requirement of arbitrated tracker muon, so no need for that explicitly
const float beamx = beamSpot_x->at(0);
const float beamy = beamSpot_y->at(0);
float d0 = pf_mus_tk_d0dum->at(k) - beamx*sin(pf_mus_tk_phi->at(k)) + beamy*cos(pf_mus_tk_phi->at(k));
if ( fabs(d0) >= 0.2 ) return false;
if ( fabs(pf_mus_tk_vz->at(k) - pv_z->at(0) ) >= 0.5 ) return false;
if ( TMath::Nint(pf_mus_tk_numvalPixelhits->at(k)) == 0 ) return false;
if ( TMath::Nint(pf_mus_tk_LayersWithMeasurement->at(k)) <= 5 ) return false;
// now isolation with delta beta corrections are recommended with DelR cone of 0.4
float isoNeutral = pf_mus_pfIsolationR04_sumNeutralHadronEt->at(k) + pf_mus_pfIsolationR04_sumPhotonEt->at(k) - 0.5*pf_mus_pfIsolationR04_sumPUPt->at(k);
isoNeutral = ( isoNeutral > 0) ? isoNeutral : 0;
float muRelIso = (pf_mus_pfIsolationR04_sumChargedHadronPt->at(k) + isoNeutral) / pf_mus_pt->at(k);
if (muRelIso >= 0.1) return false; //DIFFERENT FROM isGoodMuon!
//if we haven't failed anything yet...then it's good
return true;
}
void EventCalculator::fillGenTopInfo(const int ttbarDecayCode, const int leptonicTop, float &genTopPtLep,float & genWPtLep,float & genTopPtHad,float & genWPtHad) {
genTopPtLep=-1;
genWPtLep=-1;
genTopPtHad=-1;
genWPtHad=-1;
//only consider 1lepton decays of ttbar
if (ttbarDecayCode<=2 || ttbarDecayCode>=8) return;
//loop over gen particles
for (unsigned int kk=0; kk<mc_doc_id->size(); kk++) {
if ( TMath::Nint(mc_doc_status->at(kk))!=3) continue;
if (abs(TMath::Nint(mc_doc_id->at(kk))) ==6) { //found a top
if (TMath::Nint(mc_doc_id->at(kk))==leptonicTop) {
genTopPtLep = mc_doc_pt->at(kk);
}
else { //must be the hadronic top
genTopPtHad = mc_doc_pt->at(kk);
}
}
else if (abs(TMath::Nint(mc_doc_id->at(kk))) ==24) { //found a W
if ( jmt::signOf(mc_doc_id->at(kk)) == jmt::signOf(leptonicTop)) genWPtLep = mc_doc_pt->at(kk);
else genWPtHad = mc_doc_pt->at(kk);
}
}
}
float EventCalculator::getMinDeltaRToJet(const float eta, const float phi,int &jetflavor) {
//this is for finding the closest *gen level* parton to the input lepton direction
jetflavor=-99;
float mindr = 1e9;
int minindex=-1;
//loop over gen particles
for (unsigned int kk=0; kk<mc_doc_id->size(); kk++) {
int absid = abs(TMath::Nint(mc_doc_id->at(kk)));
bool isqg = (absid>=1 && absid<=5) || (absid==21); //not top quark! ie partons that will end up as jets
if ( isqg && TMath::Nint(mc_doc_status->at(kk))==3) { //is status 3 and udscb / g
if ( mc_doc_pt->at(kk)< 30) continue; //pt cut is something of a guess, but i think we're interested in really hard jets here
float thisdr = jmt::deltaR(eta,phi,mc_doc_eta->at(kk),mc_doc_phi->at(kk));
if (thisdr<mindr) {
mindr=thisdr;
minindex=kk;
}
}
}
if (minindex>=0) jetflavor = std::abs(mc_doc_id->at(minindex));
return mindr;
}
float EventCalculator::getMinDeltaRLeptonToJet() {
float mindr = 1e9;
//loop over muons
for (unsigned int imu=0; imu < pf_mus_pt->size(); ++imu) {
if ( isGoodMuon(imu,true)) { //true means disable RelIso cut
float eta = pf_mus_eta->at(imu);
float phi = pf_mus_phi->at(imu);
//have a muon. now loop over the jets.
for (size_t jj = 0; jj < jets_AK5PF_pt->size(); jj++) {
if (isGoodJet(jj, 30)) {
float thisdr = jmt::deltaR(eta, phi, jets_AK5PF_eta->at(jj), jets_AK5PF_phi->at(jj));
if(thisdr<mindr) mindr = thisdr;
}//is good jet
}//loop over jets
}//is good muon
}//loop over muons
//loop over electrons
for (unsigned int iel=0; iel < pf_els_pt->size(); ++iel) {
if ( isGoodElectron(iel,true)) { //true means disable RelIso cut
float eta = pf_els_eta->at(iel);
float phi = pf_els_phi->at(iel);
//have an electron. now loop over the jets.
for (size_t jj = 0; jj < jets_AK5PF_pt->size(); jj++) {
if (isGoodJet(jj, 30)) {
float thisdr = jmt::deltaR(eta, phi, jets_AK5PF_eta->at(jj), jets_AK5PF_phi->at(jj));
if(thisdr<mindr) mindr = thisdr;
}//is good jet
}//loop over jets
}//is good electron
}//loop over electrons
return mindr;
}
bool EventCalculator::isGoodRecoMuon(const unsigned int imuon, const bool disableRelIso, const float ptthreshold) {
assert(disableRelIso); //the iso calculation below is completely worthless. it uses PF quantities on RECO muons.
return true; //FIXME CFA
/*
if (myMuonsRECO->at(imuon).pt >= ptthreshold
&& fabs(myMuonsRECO->at(imuon).eta)<2.4
&& myMuonsRECO->at(imuon).GlobalMuonPromptTight == 1
&& myMuonsRECO->at(imuon).isTrackerMuon == 1
&& myMuonsRECO->at(imuon).innerTrack_numberOfValidHits >=11
&& myMuonsRECO->at(imuon).track_hitPattern_numberOfValidPixelHits >= 1
&& fabs(myMuonsRECOhelper->at(imuon).dxywrtBeamSpot) < 0.02
&& fabs(myMuonsRECO->at(imuon).vz - myVertex->at(0).z ) <1
&& ((myMuonsRECO->at(imuon).chargedHadronIso
+ myMuonsRECO->at(imuon).photonIso
+ myMuonsRECO->at(imuon).neutralHadronIso)/myMuonsRECO->at(imuon).pt <0.2 ||disableRelIso)
) {
return true;
}
*/
return false;
}
bool EventCalculator::isCleanMuon(const unsigned int imuon, const float ptthreshold, const bool disableRelIso, int & lossCode) {
if (!isGoodMuon(imuon,disableRelIso,ptthreshold,lossCode)) return false;
//clean muons if using reco-pfjets
if(theJetType_ == kRECOPF) {
bool isNearJet = false;
for ( unsigned int j = 0; j< jets_AK5PF_pt->size(); j++) {
if( isGoodJet(j) && jmt::deltaR( jets_AK5PF_eta->at(j), jets_AK5PF_phi->at(j),pf_mus_eta->at(imuon), pf_mus_phi->at(imuon))<0.3 ) {
isNearJet = true ; break;
}
}
if(isNearJet) return false;
}
return true;
}
bool EventCalculator::isCleanTightMuon(const unsigned int imuon, const float ptthreshold) {
if (!isGoodTightMuon(imuon,false,ptthreshold)) return false;
//clean muons if using reco-pfjets
assert(theJetType_ != kRECOPF);
return true;
}
float EventCalculator::getElectronRelIso(const unsigned int k, const bool use2012id) {
// now recommended isolation is PF relative isolation with cone = 0.3 with rho (effective area) corrections for PU
// isocorr = PFChargedIso (PFNoPU) + max(PFIso(γ+NH) - rho * Aeff(γ+NH), 0.)
float rho = rho_kt6PFJetsForIsolation2011;
// get effective area from delR=0.3 2011 data table for neutral+gamma based on supercluster eta pf_els_scEta->at(k)
float AE = 0.10;
if (use2012id) { //2012 id R=0.3
rho = rho_kt6PFJetsForIsolation2012;
float abseta = fabs(pf_els_scEta->at(k) );
if ( abseta < 1.0 ) AE = 0.13;
else if ( abseta >=1.0 && abseta <1.479) AE = 0.14;
else if ( abseta >=1.479&&abseta <2.0) AE = 0.07;
else if ( abseta >=2.0 && abseta <2.2) AE = 0.09;
else if ( abseta >=2.2 && abseta <2.3) AE = 0.11;
else if ( abseta >=2.3 && abseta <2.4) AE = 0.11;
else if ( abseta >=2.4 ) AE = 0.14;
}
else { //2011 id R=0.3
if ( fabs( pf_els_scEta->at(k) ) > 1.0 ) AE = 0.12;
if ( fabs( pf_els_scEta->at(k) ) > 1.479 ) AE = 0.085;
if ( fabs( pf_els_scEta->at(k) ) > 2.0 ) AE = 0.11;
if ( fabs( pf_els_scEta->at(k) ) > 2.2 ) AE = 0.12;
if ( fabs( pf_els_scEta->at(k) ) > 2.3 ) AE = 0.12;
if ( fabs( pf_els_scEta->at(k) ) > 2.4 ) AE = 0.13;
}
float eleIso = pf_els_PFphotonIsoR03->at(k) + pf_els_PFneutralHadronIsoR03->at(k) - rho*AE;
float elRelIso = ( pf_els_PFchargedHadronIsoR03->at(k) + ( eleIso > 0 ? eleIso : 0.0 ) )/pf_els_pt->at(k);
return elRelIso;
}
//this bool could be turned into a more powerful selector for N-1 studies. keep it simple for now
bool EventCalculator::isGoodElectron(const unsigned int k, const bool disableRelIso, const float ptthreshold, const bool use2012id,const bool tkBugFix,int &lossCode) {
//sanity check
if ( k >= pf_els_pt->size() ) {lossCode=5; return false;}
if ( (pf_els_pt->size() != pf_els_PFphotonIsoR03->size()) || (pf_els_pt->size() != pf_els_PFneutralHadronIsoR03->size()) || (pf_els_pt->size() != pf_els_PFchargedHadronIsoR03->size()) ) {lossCode=5; return false;}
if (!isGoodPV(0)) {lossCode=5; return false;}
// keep same pt and eta cuts (except no explicit exclusion of gap region)
//move the Eta and Pt cuts up here in the cut flow so that we preserve the logic when tabulating why leptons are lost (first eta, then pT, then quality and iso)
if (fabs(pf_els_scEta->at(k)) >= 2.5 ) {lossCode=1; return false;}
if (pf_els_pt->at(k) < ptthreshold) {lossCode=2; return false;}
const float beamx = beamSpot_x->at(0);
const float beamy = beamSpot_y->at(0);
// new electron selection for 2012. Use "cut based" Veto selection:
/* selection now split into endcap and barrel with different cuts for each.
barrel endcap
defined as: pf_els_isEB pf_els_isEE // no explicit veto on gap any more?
dEtaIn 0.007 0.01
dPhiIn 0.8 0.7
sigmaiEtaiEta 0.01 0.03
H/E 0.15 --
d0 0.04 0.04
dZ 0.2 0.2
PF isolation 0.15 0.15 // now done with rho corrections
*/
int ndone=0;
if ( TMath::Nint(pf_els_isEB->at(k)) == 1) {
++ndone;
if ( fabs(pf_els_dEtaIn->at(k)) > 0.007) { lossCode=3; return false; }
if ( fabs(pf_els_dPhiIn->at(k)) > 0.8) { lossCode=3; return false; }
if (pf_els_sigmaIEtaIEta->at(k) > 0.01) { lossCode=3; return false; }
if (pf_els_hadOverEm->at(k) > 0.15) { lossCode=3; return false; }
}
if (TMath::Nint(pf_els_isEE->at(k)) == 1) {
++ndone;
if ( fabs(pf_els_dEtaIn->at(k)) > 0.01) { lossCode=3; return false; }
if ( fabs(pf_els_dPhiIn->at(k)) > 0.7) { lossCode=3; return false; }
if (pf_els_sigmaIEtaIEta->at(k) > 0.03) { lossCode=3; return false; }
}
if (ndone != 1) { //sanity
cout<<"[isGoodElectron] I went through "<<ndone<<" of the barrel+endcap checks. Weird!"<<endl;
}
float d0 = tkBugFix ?
pf_els_d0dum->at(k) - beamx*sin(pf_els_tk_phi->at(k)) + beamy*cos(pf_els_tk_phi->at(k)) :
pf_els_d0dum->at(k) - beamx*sin(pf_els_phi->at(k)) + beamy*cos(pf_els_phi->at(k)) ;
if ( fabs(d0) >= 0.04 ) { lossCode=3; return false; }
if ( fabs(pf_els_vz->at(k) - pv_z->at(0) ) >= 0.2 ) { lossCode=3; return false; }
float elRelIso = getElectronRelIso(k, use2012id);
float maxRelIso = 0.15;
if(theIsoType_ == kIsoup) maxRelIso = 0.73;
else if(theIsoType_ == kIsodown) maxRelIso = 0.072;
if ( (disableRelIso == false) && (elRelIso >= maxRelIso) ) {lossCode=4; return false;}
lossCode=0;
return true;
}
unsigned int EventCalculator::countEle(const float ptthreshold, const bool use2012id,const bool tkBugFix, const bool disableRelIso, const int ttbarDecayCode,int & lostLeptonCode,const float genEta,const float genPhi) {
//count good electrons.
unsigned int ngoodele=0;
for (unsigned int i=0; i <pf_els_pt->size() ; i++) {
int whyLeptonLost=-1;
if (isGoodElectron(i,disableRelIso,ptthreshold,use2012id,tkBugFix,whyLeptonLost)) ++ngoodele;
//if ttbarDecayCode is 3 (single e at gen level), then also return lostLeptonCode information
if (ttbarDecayCode==3&& lostLeptonCode==5) {
//check that this reco lepton is a loose DR match to the gen one
if ( jmt::deltaR(genEta,genPhi, pf_els_eta->at(i),pf_els_phi->at(i))<0.5) lostLeptonCode = whyLeptonLost;
}
}
return ngoodele;
}
unsigned int EventCalculator::countMu(const float ptthreshold, const bool disableRelIso, const int ttbarDecayCode, int & lostLeptonCode,const float genEta,const float genPhi) {
unsigned int ngoodmu=0;
unsigned int nmu = pf_mus_pt->size();
for ( unsigned int i = 0; i< nmu; i++) {
int whyLost=-1;
if (isCleanMuon(i,ptthreshold,disableRelIso,whyLost)) {
//once we reach here we've got a good muon in hand
++ngoodmu;
}
if (ttbarDecayCode==4 && lostLeptonCode==5) { //if single mu at gen level, then also return lostLeptonCode information
//loose DR match between gen and reco -- ie only store the "why lost" info for a reco lepton that actually matches the gen
if ( jmt::deltaR(genEta,genPhi, pf_mus_eta->at(i),pf_mus_phi->at(i))<0.5) lostLeptonCode=whyLost;
}
}
return ngoodmu;
}
unsigned int EventCalculator::countTightMu(const float ptthreshold) {
//pT>25, rel iso<0.1, and |eta|<2.1. -- MET-Reweighting
unsigned int ngoodmu=0;
unsigned int nmu = pf_mus_pt->size();
for ( unsigned int i = 0; i< nmu; i++) {
if (isCleanTightMuon(i,ptthreshold)) {
//once we reach here we've got a good muon in hand
++ngoodmu;
}
}
return ngoodmu;
}
//eventually we might want to get more info, but for now this is good enough
float EventCalculator::getBestZCandidate(const float pt_threshold1,const float pt_threshold2) {
float mee = getBestZeeCandidate(pt_threshold1,pt_threshold2);
float mmm = getBestZmmCandidate(pt_threshold1,pt_threshold2);
float best = ( fabs(mee-mZ_) < fabs(mmm-mZ_)) ? mee : mmm;
return best;
}
float EventCalculator::getBestZeeCandidate(const float pt_threshold1,const float pt_threshold2) {
//code copied from Zmm code below (ugly solution)
//cout<<"Zee"<<endl;
assert(pt_threshold1>=pt_threshold2);
//my comment -- it pains me that the structure of this code needs to be duplicated for ee and mm, but i don't feel like being more clever
float best_mll = -99;
//give me lists of all the indices of the good, high pt muons
std::vector<uint> goodeles1;
std::vector<uint> goodeles2;
unsigned int nmu = pf_els_pt->size();
for ( unsigned int i = 0; i< nmu; i++) {
if (isGoodElectron(i,pt_threshold1)) goodeles1.push_back( i );
if (isGoodElectron(i,pt_threshold2)) goodeles2.push_back( i );
}
//need to have at least 2 leptons, and 1 of them must be above the higher pt threshold
if( goodeles1.size() >=1 && goodeles2.size()>=2 ) {
//loop through the lepton pairs, and check if they are
//opposite-signed and form an invariant mass within the Z-mass
for ( unsigned int i = 0; i< goodeles1.size(); i++) {
for ( unsigned int j = 0; j< goodeles2.size(); j++) {
//check opposite charge
if (TMath::Nint(pf_els_charge->at( goodeles1.at(i) )) != TMath::Nint(pf_els_charge->at( goodeles2.at(j) )) ) {
//check invariant mass
double z_en = pf_els_energy->at(goodeles1.at(i)) + pf_els_energy->at(goodeles2.at(j));
double z_px = pf_els_pt->at(goodeles1.at(i))*cos( pf_els_phi->at(goodeles1.at(i))) + pf_els_pt->at(goodeles2.at(j))*cos( pf_els_phi->at(goodeles2.at(j)));
double z_py = pf_els_pt->at(goodeles1.at(i))*sin( pf_els_phi->at(goodeles1.at(i))) + pf_els_pt->at(goodeles2.at(j))*sin( pf_els_phi->at(goodeles2.at(j)));
double z_pz = pf_els_pt->at(goodeles1.at(i))*sinh(pf_els_eta->at(goodeles1.at(i))) + pf_els_pt->at(goodeles2.at(j))*sinh(pf_els_eta->at(goodeles2.at(j)));
float thismll = sqrt(z_en*z_en - z_px*z_px - z_py*z_py - z_pz*z_pz);
if ( fabs(thismll - mZ_) < fabs(best_mll-mZ_)) best_mll=thismll;
}
}// j loop
}//i loop
} //two high pt leptons
//cout<<"done"<<endl;
return best_mll;
}
float EventCalculator::getBestZmmCandidate(const float pt_threshold1,const float pt_threshold2) {
//code lifted from Don and converted for cfA
//also adapted to work with two different pt thresholds (i hope)
//cout<<"Zmm"<<endl;