forked from h2gglobe/h2gglobe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoopAll.h
executable file
·1320 lines (1101 loc) · 67.3 KB
/
LoopAll.h
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
#ifndef LoopAll_h
#define LoopAll_h
#include "CommonParameters.h"
#include "TROOT.h"
#include "TChain.h"
#include "TFile.h"
#include "TH1D.h"
#include "TMacro.h"
#include "TClonesArray.h"
#include <sstream>
#include <set>
#include <string>
#include <list>
#include <map>
#include <THStack.h>
#include <TLegend.h>
#include <TAxis.h>
#include "TMVA/Reader.h"
#include "TStopwatch.h"
class BaseAnalysis;
#include "HistoContainer.h"
#include "CounterContainer.h"
#include "SampleContainer.h"
#include "TreeContainer.h"
#include "Cut.h"
#include "branchdef/Limits.h"
#include "RooContainer.h"
#include "VertexAnalysis/interface/HggVertexAnalyzer.h"
#include "VertexAnalysis/interface/HggVertexFromConversions.h"
#include "VertexAnalysis/interface/VertexAlgoParameters.h"
#include "VertexAnalysis/interface/PhotonInfo.h"
#include "VertexAnalysis/interface/VertexAlgoParameters.h"
#include "Macros/Normalization_8TeV.h"
#include "RooFuncReader.h"
#define BRANCH_DICT(NAME) branchDict[# NAME] = branch_info_t(& b ## _ ## NAME, & LoopAll::SetBranchAddress ## _ ## NAME, & LoopAll::Branch ## _ ## NAME )
#define DEBUG 1
class LoopAll {
public :
TTree *fChain;
#include "branchdef/branchdef.h"
#include "branchdef/treedef.h"
#include "branchdef/setbranchaddress.h"
#include "branchdef/treebranch.h"
std::vector<HistoContainer> histoContainer;
std::vector<CounterContainer> counterContainer;
std::vector<SampleContainer> sampleContainer;
std::vector<Cut> cutContainer;
//std::vector<TreeContainer> treeContainer;
std::map<std::string, std::vector<TreeContainer> > treeContainer;
RooContainer *rooContainer;
int sqrtS;
Normalization_8TeV * normalizer();
LoopAll(TTree *tree=0);
virtual ~LoopAll();
virtual Int_t GetEntry(Long64_t entry);
virtual Long64_t LoadTree(Long64_t entry);
virtual void Init(Int_t typerunpass, TTree *tree);
virtual void InitReal(Int_t typerunpass);
virtual void TermReal(Int_t typerunpass);
//virtual void Loop(Double_t a);
virtual Bool_t Notify();
virtual void Show(Long64_t entry = -1);
virtual void InitHistos();
void LoopAndFillHistos(TString treename="event");
void MergeContainers();
//void WriteHist();
//void WriteFits();
//void WriteCounters();
/** @param type is the type of the analysis:
0 for looper.py (filling histograms)
1 for reduce.py (reduction step)
@param n is the name of the output file
*/
void SetTypeRun(int type, const char* n);
//void SetOutputNames(const char* n, const char* n2="");
void StoreProcessedLumis(TTree * tree);
void AddFile(std::string,int);
void ReadInput(int t=0);
void SetSubJob(bool);
/** adds a new entry to sampleContainer and returns a reference
to this entry. */
SampleContainer & DefineSamples(const char *filesshortnam,
int type, int histtoindfromfiles, int histoplotit,
int nred, long long ntot, float intlumi,
float lumi, float xsec, float kfactor,
float scale, bool ignoreEvWeight=false,
int forceVersion=0,
bool addnevents=false, TString pileup="");
void Term();
void checkDuty(int n, float thr, float start) { checkBench=n; benchThr=thr; benchStart=start; }
int checkBench;
TStopwatch stopWatch;
float benchThr, benchStart;
bool is_subjob;
std::vector<TMacro*> configFiles;
std::vector<std::string> files;
std::vector<int> itype;
//int lumireal[MAXFILES];
int nfiles;
float intlumi;
float intlumi_;
// Zee Validaton Flag
bool runZeeValidation;
bool applyEcalIsoPresel;
bool makeDummyTrees;
Float_t * pho_r9_cic;
std::string cicVersion;
bool usePFCiC;
std::vector<TTree*> Trees;
std::vector<TTree*> LumiTrees;
std::vector<TFile*> Files;
std::vector<TTree*> TreesPar;
TTree * outputTree;
TTree * outputTreeLumi;
TTree * outputTreePar;
TTree * plotvartree;
TTree * inputfiletree;
std::vector<TH1*> globalHistos;
void AddGlobalHisto(TH1 * x ) { x->SetDirectory(0); globalHistos.push_back(x); }
TH1D * pileup;
TFile * outputFile;
TString outputFileName;
TString histFileName;
std::string outputTextFileName;
Int_t makeOutputTree;
char inputFilesName[1024];
char countersName[1024];
enum runtypes { kFill=0, kReduce=1, kFillReduce=2 };
Int_t typerun;
Int_t typeread;
std::map<int,int> type2HistVal;
Int_t current; //current file
Int_t current_sample_index; //current file
// global parameters
Int_t tot_events, sel_events, type, version, reductions;
bool createCS_;
float diPhotonBDTOutput;
std::vector<std::string> globalCountersNames;
std::vector<int> globalCounters;
std::vector<int> fileGlobalCounters;
Int_t outputParTot_Events, outputParSel_Events, outputParType, outputParVersion, outputParReductions, outputParRed_Events[20];
std::vector<std::string>* outputParParameters;
std::string* outputParJobMaker;
Int_t currentindexfiles;
std::vector<Float_t> counters;
std::vector<Float_t> countersred;
TFile *hfile;
Int_t outputEvents;
void Loop(Int_t);
void WriteHist();
void WriteFits();
void WriteCounters();
int FillAndReduce(int);
//void BookHistos();
void AddCut(char*,int,int,int,float*,float*);
void InitCounters();
void AddCounter(int, const char*, const char*, const char*, const char*);
int ApplyCut(int, float, int);
int ApplyCut(std::string, float, int);
void FillCutPlots(int icat, int cutset, std::string postfix, float histweight, float countweight);
void myPrintCounters();
void myPrintCountersNew();
virtual void BookHisto(int, int, int, int, int, int,
float, float, float, float, const char*,
const char* xaxis="", const char* yaxis="");
// Cut down (flat) trees for MVA Training
void InitTrees(std::string);
void BookTreeBranch(std::string name, int type, std::string dirName="");
template <class T> void BookExternalTreeBranch(const char * name, T* addr, std::string dirName) {
for(unsigned int ind=0; ind<treeContainer[dirName].size(); ind++) {
treeContainer[dirName][ind].AddExternalBranch<T>(name,addr);
}
}
template <class T> void BookExternalTreeBranch(const char * name, T* addr, const char * type, std::string dirName) {
for(unsigned int ind=0; ind<treeContainer[dirName].size(); ind++) {
treeContainer[dirName][ind].AddExternalBranch<T>(name,addr,type);
}
}
template <class T> void BookExternalTreeBranch(const char * name, T* addr, int bufsize, int splitlevel, std::string dirName) {
for(unsigned int ind=0; ind<treeContainer[dirName].size(); ind++) {
treeContainer[dirName][ind].AddExternalBranch<T>(name,addr,bufsize,splitlevel);
}
}
void FillTreeContainer(std::string dir="");
void FillTree(std::string name, float x, std::string dirName="");
void FillTree(std::string name, double x, std::string dirName="");
void FillTree(std::string name, int x, std::string dirName="");
void FillTree(std::string name, unsigned int x, std::string dirName="");
void FillTree(std::string name, std::string x, std::string dirName="");
void FillTree(std::string name, bool x, std::string dirName="");
void WritePI();
void AddCut2(char*, int, int, int, float*, float*, int, int, int, float, float, char*, char*);
int ApplyCut(int icut, int icat);
int ApplyCut(TString cutname, int icat);
float GetCutValue(TString cutname, int icat, int highcut=0);
//int ApplyCut(int icut, float var, int icat);
//int ApplyCut(TString cutname, float var, int icat);
//DON'T USE THE FOLLOWING ONE, IT MAY BE CONFUSING
int ApplyCut(int icut, int * passcategory); //returns the number of categories
//DON'T USE THE FOLLOWING ONE, IT MAY BE CONFUSING
int ApplyCut(TString cutname, int * passcategory); //returns the number of categories
int ApplyCutsFill(int icat, int cutset, int & ncutsapplied, int & ncutspassed, int & ncutsfailed, float histweight=1.0, float countweight=1.0);
int ApplyCuts(int icat, int cutset, int & ncutsapplied, int & ncutspassed, int & ncutsfailed);
int ApplyCutsFill(int icat, int cutset, float histweight=1.0, float countweight=1.0);
int ApplyCuts(int icat, int cutset);
//DON'T USE THE FOLLOWING ONE, IT MAY BE CONFUSING
int ApplyCuts(int cutset, int * passcategory, int * ncutsapplied, int * ncutspassed, int * ncutsfailed); //returns the number of categories
//DON'T USE THE FOLLOWING ONE, IT MAY BE CONFUSING
int ApplyCuts(int cutset, int * passcategory); //returns the number of categories
int SetCutVariables(int i, float * variables);
int SetCutVariables(TString cutname, float * variables);
void FillHist(std::string, float);
void FillHist2D(std::string, float, float);
void FillHist(std::string, int, float, float wt = 1.0);
void FillHist2D(std::string, int, float, float, float wt = 1.0);
void FillCounter(std::string name, float weight=1., int cat=0);
BaseAnalysis* AddAnalysis(BaseAnalysis*);
template<class T> T * GetAnalysis( const std::string & name ) {
std::vector<BaseAnalysis*>::iterator it=find( analyses.begin(), analyses.end(), name);
if( it != analyses.end() ) { return dynamic_cast<T*>( *it ); }
return 0;
}
/// void SkimBranch(const std::string & name) { skimBranchNames.insert(name); };
void InputBranch(const std::string & name, int typ) { inputBranchNames.insert(std::pair<std::string,int>(name,typ)); };
void OutputBranch(const std::string & name) { if( find(outputBranchNames.begin(), outputBranchNames.end(), name)==outputBranchNames.end() ) { outputBranchNames.push_back(name); } };
void GetBranches(std::map<std::string,int> & names, std::set<TBranch *> & branches);
void SetBranchAddresses(std::map<std::string,int> & names);
void Branches(std::list<std::string> & names);
void GetEntry(std::set<TBranch *> & branches, int jentry);
bool CheckLumiSelection( int run, int lumi );
bool CheckEventList( int run, int lumi, int event );
void StoreConfigFile(std::string);
#ifndef __CINT__
typedef void (LoopAll::*branch_io_t) (TTree *);
struct branch_info_t {
branch_info_t(TBranch ** b=0, branch_io_t r=0, branch_io_t w=0 ) :
branch(b), read(r), write(w)
{};
TBranch ** branch;
branch_io_t read, write;
};
typedef std::map<std::string, branch_info_t> dict_t;
dict_t branchDict;
#endif
//// std::set<std::string> skimBranchNames;
//// std::set<TBranch *> skimBranches;
std::map<std::string,int> inputBranchNames;
std::set<TBranch *> inputBranches;
std::list<std::string> outputBranchNames;
/** list of the analyses to be performed */
std::vector<BaseAnalysis*> analyses;
float pfTkIsoWithVertex(int phoindex, int vtxInd, float dRmax, float dRvetoBarrel, float dRvetoEndcap, float ptMin, float dzMax, float dxyMax, int pfToUse=1);
float pfEcalIso(int phoindex, float dRmax, float dRVetoBarrel, float dRVetoEndcap, float etaStripBarrel, float etaStripEndcap,
float thrBarrel, float thrEndcaps, int pfToUse=4);
RooFuncReader *funcReader_dipho_MIT;
TMVA::Reader *tmvaReaderID_UCSD, * tmvaReader_dipho_UCSD;
TMVA::Reader *tmvaReaderID_MIT_Barrel, *tmvaReaderID_MIT_Endcap;
TMVA::Reader *tmvaReader_dipho_MIT;
TMVA::Reader *tmvaReaderID_Single_Barrel, *tmvaReaderID_Single_Endcap;
TMVA::Reader *tmvaReaderID_2013_Barrel, *tmvaReaderID_2013_Endcap;
TMVA::Reader *tmvaReaderID_2013_7TeV_MIT_Barrel, *tmvaReaderID_2013_7TeV_MIT_Endcap;
Float_t photonIDMVA(Int_t, Int_t, TLorentzVector &, const char*);
Float_t tmva_photonid_pfchargedisogood03;
Float_t tmva_photonid_pfchargedisobad03;
Float_t tmva_photonid_pfphotoniso03;
Float_t tmva_photonid_pfneutraliso03;
Float_t tmva_photonid_sieie;
Float_t tmva_photonid_sieip;
Float_t tmva_photonid_etawidth;
Float_t tmva_photonid_phiwidth;
Float_t tmva_photonid_r9;
Float_t tmva_photonid_scrawe;
Float_t tmva_photonid_s4ratio;
Float_t tmva_photonid_lambdaratio;
Float_t tmva_photonid_sceta;
Float_t tmva_photonid_eventrho;
Float_t tmva_photonid_ESEffSigmaRR;
Float_t tmva_id_ucsd_sieie;
Float_t tmva_id_ucsd_goodpf_iso;
Float_t tmva_id_ucsd_badpf_iso;
Float_t tmva_id_ucsd_drtotk;
Float_t tmva_id_ucsd_hoe;
Float_t tmva_id_ucsd_tkisopf;
Float_t tmva_id_ucsd_r9;
Float_t tmva_id_ucsd_ptom;
Float_t tmva_id_ucsd_eta;
Float_t tmva_id_ucsd_isLeading;
Float_t tmva_dipho_UCSD_subleadptomass;
Float_t tmva_dipho_UCSD_diphoptom;
Float_t tmva_dipho_UCSD_sumptom;
Float_t tmva_dipho_UCSD_subleadmva;
Float_t tmva_dipho_UCSD_leadmva;
Float_t tmva_dipho_UCSD_leadeta;
Float_t tmva_dipho_UCSD_subleadeta;
Float_t tmva_dipho_UCSD_leadr9;
Float_t tmva_dipho_UCSD_subleadr9;
Float_t tmva_dipho_UCSD_dmom;
Float_t tmva_dipho_UCSD_diphocat2r92eta;
Float_t tmva_id_mit_hoe;
Float_t tmva_id_mit_sieie;
Float_t tmva_id_mit_tiso1;
Float_t tmva_id_mit_tiso3;
Float_t tmva_id_mit_tiso2;
Float_t tmva_id_mit_r9;
Float_t tmva_id_mit_ecal;
Float_t tmva_id_mit_hcal;
Float_t tmva_id_mit_e5x5;
Float_t tmva_id_mit_etawidth;
Float_t tmva_id_mit_phiwidth;
Float_t tmva_id_mit_sieip;
Float_t tmva_id_mit_sipip;
Float_t tmva_id_mit_nvtx;
Float_t tmva_id_mit_sceta;
Float_t tmva_id_mit_preshower;
std::vector<Float_t> tmva_dipho_MIT_buf;
std::map<int,std::vector<Float_t> > tmva_dipho_MIT_cache;
Float_t *tmva_dipho_MIT_dmom;
Float_t *tmva_dipho_MIT_dmom_wrong_vtx;
Float_t *tmva_dipho_MIT_vtxprob;
Float_t *tmva_dipho_MIT_ptom1;
Float_t *tmva_dipho_MIT_ptom2;
Float_t *tmva_dipho_MIT_eta1;
Float_t *tmva_dipho_MIT_eta2;
Float_t *tmva_dipho_MIT_dphi;
Float_t *tmva_dipho_MIT_ph1mva;
Float_t *tmva_dipho_MIT_ph2mva;
void GlobeCtIsol(int, TLorentzVector*, float, float, float, Int_t&, Float_t&, Float_t&, Float_t&, Float_t&);
int GlobeMatchIsl(TLorentzVector*, Float_t&);
enum eIDLevel {UltraLoose, VeryLoose, Loose, Medium, Tight, SuperTight, HyperTight1, HyperTight2, HyperTight3, HyperTight4, Robust};
int ElectronClassification(int);
std::pair<bool, bool> ElectronId(int, eIDLevel);
void eIDInfo(Int_t, Int_t&, Int_t&,Int_t eIDMaxLevel=10);
Float_t sipCalculator(int);
// Match the Photon with the merged collection of conversions
PhotonInfo fillPhotonInfos(int p1, int useAllConvs=2, float * energy=0);
int matchPhotonToConversion(int lpho, int useAllConvs=2);
double phiNorm (float &phi);
double etaTransformation( float EtaParticle , float Zvertex);
vector<double> generate_flat10_weights(TH1D* data_npu_estimated);
//----------------------------------------
// Vertex analysis
//----------------------------------------
void vertexAnalysis(HggVertexAnalyzer & vtxAna, PhotonInfo pho1, PhotonInfo pho2);
//std::vector<int> vertexSelection(HggVertexAnalyzer & vtxAna, HggVertexFromConversions & vtxAnaFromConv, int p1, int p2, std::vector<std::string> & vtxVarNames);
/** @return the indices of the vertices ranked by some algorithm */
std::vector<int> vertexSelection(HggVertexAnalyzer & vtxAna, HggVertexFromConversions & vtxAnaFromConv, PhotonInfo & pho1, PhotonInfo & pho2,
std::vector<std::string> & vtxVarNames,
bool useMva=false, TMVA::Reader * reader=0, std::string tmvaMethod="");
//----------------------------------------
bool FindMCLeptons(int index, int& mc1, int& mc2, int& pho, int leptonType=11);
bool FindMCHiggsPhotons(int& higgsind, int& mc1, int& mc2, int& i1, int& i2 );
bool FindMCVBF(int higgsind, int& vbfq1, int& vbfq2 );
bool FindMCVH(int higgsind, int& vh, int& vh1, int& vh2 );
TLorentzVector GetHiggs()
{
TLorentzVector gP4(0,0,0,0);
assert(gh_higgs_p4 != 0 || gp_p4 != 0);
if( gh_higgs_p4 != 0 && gh_higgs_p4->At(0) != 0 ) {
gP4 = *((TLorentzVector*)gh_higgs_p4->At(0));
} else {
for (int gi=0;gi<gp_n;gi++){
if (gp_pdgid[gi]==25){
gP4 = *((TLorentzVector*)gp_p4->At(gi));
break;
}
}
}
return gP4;
};
/** @return the photon four momentum calculated with respect to the given interaction vertex (??) */
TLorentzVector get_pho_p4(int ipho, int ivtx, const float *pho_energy_array=0) const ;
TLorentzVector get_pho_p4(int ipho, TVector3 * vtx, const float * energy=0) const ;
void set_pho_p4(int ipho, int ivtx, float *pho_energy_array=0);
double get_pho_zposfromconv(TVector3 convvtx, TVector3 superclustervtx, TVector3 beamSpot);
// end vertex analysis
void FillCICPFInputs();
void FillCICInputs();
void FillCIC();
// CiC SELECTION CODE BEGIN - SSIMON
// defines photon CiC ID cuts for all cut levels
enum phoCiCIDLevel { phoNOCUTS=0, phoLOOSE, phoMEDIUM, phoTIGHT, phoSUPERTIGHT, phoHYPERTIGHT1, phoHYPERTIGHT2, phoHYPERTIGHT3, phoHYPERTIGHT4, phoHYPERTIGHT5, phoHYPERTIGHT6, phoHYPERTIGHT7, phoHYPERTIGHT8, phoHYPERTIGHT9, phoNCUTLEVELS };
enum phoCiCCuts { phoISOSUMOET=0, phoISOSUMOETBAD, phoTRKISOOETOM, phoSIEIE, phoHOVERE, phoR9, phoDRTOTK_25_99, phoPIXEL, phoNCUTS };
enum phoCiC6Categories { phoCiC6EBhighR9=0, phoCiC6EBmidR9, phoCiC6EBlowR9, phoCiC6EEhighR9, phoCiC6EEmidR9, phoCiC6EElowR9, phoCiC6NCATEGORIES };
enum phoCiC4Categories { phoCiC4EBhighR9=0, phoCiC4EBlowR9, phoCiC4EEhighR9, phoCiC4EElowR9, phoCiC4NCATEGORIES };
/** @param cutlevel (input) is the required level of the cuts (e.g. phoSUPERTIGHT)
@param cic6_cuts_lead (output) will be filled with the CIC6 cut values for the LEADING photon
@param cic6_cuts_sublead, (output) will be filled with the CIC6 cut values for the SUBLEADING photon
@param cic4_cuts_lead (output) will be filled with the CIC4 cut values for the LEADING photon
@param cic4_cuts_sublead (output) will be filled with the CIC4 cut values for the SUBLEADING photon
*/
void SetPhotonCutsInCategories(phoCiCIDLevel cutlevel, float * cic6_cuts_lead, float * cic6_cuts_sublead, float * cic4_cuts_lead, float * cic4_cuts_sublead, float*, float*);
//----------------------------------------------------------------------
// cut values for cuts in categories selection
//
// first index is the level ('tightness') of the selection,
// second index is the category index.
//
// See LoopAll::SetPhotonCutsInCategories(..) in GeneralFunctions_cc.h
// for the actual values.
// initialized in PhotonAnalysis::Init(..)
//
// The (highest) level of selection which a photon passes is
// calculated in LoopAll::PhotonCiCSelectionLevel(..)
//----------------------------------------------------------------------
// 6 categories
// leading photon
float cic6_cut_lead_isosumoet[phoNCUTLEVELS][6];
float cic6_cut_lead_isosumoetbad[phoNCUTLEVELS][6];
float cic6_cut_lead_trkisooet[phoNCUTLEVELS][6];
float cic6_cut_lead_sieie[phoNCUTLEVELS][6];
float cic6_cut_lead_hovere[phoNCUTLEVELS][6];
float cic6_cut_lead_r9[phoNCUTLEVELS][6];
float cic6_cut_lead_drtotk_25_99[phoNCUTLEVELS][6];
float cic6_cut_lead_pixel[phoNCUTLEVELS][6];
// subleading photon
float cic6_cut_sublead_isosumoet[phoNCUTLEVELS][6];
float cic6_cut_sublead_isosumoetbad[phoNCUTLEVELS][6];
float cic6_cut_sublead_trkisooet[phoNCUTLEVELS][6];
float cic6_cut_sublead_sieie[phoNCUTLEVELS][6];
float cic6_cut_sublead_hovere[phoNCUTLEVELS][6];
float cic6_cut_sublead_r9[phoNCUTLEVELS][6];
float cic6_cut_sublead_drtotk_25_99[phoNCUTLEVELS][6];
float cic6_cut_sublead_pixel[phoNCUTLEVELS][6];
// 4 categories
// leading photon
float cic4_cut_lead_isosumoet[phoNCUTLEVELS][4];
float cic4_cut_lead_isosumoetbad[phoNCUTLEVELS][4];
float cic4_cut_lead_trkisooet[phoNCUTLEVELS][4];
float cic4_cut_lead_sieie[phoNCUTLEVELS][4];
float cic4_cut_lead_hovere[phoNCUTLEVELS][4];
float cic4_cut_lead_r9[phoNCUTLEVELS][4];
float cic4_cut_lead_drtotk_25_99[phoNCUTLEVELS][4];
float cic4_cut_lead_pixel[phoNCUTLEVELS][4];
// subleading photon
float cic4_cut_sublead_isosumoet[phoNCUTLEVELS][4];
float cic4_cut_sublead_isosumoetbad[phoNCUTLEVELS][4];
float cic4_cut_sublead_trkisooet[phoNCUTLEVELS][4];
float cic4_cut_sublead_sieie[phoNCUTLEVELS][4];
float cic4_cut_sublead_hovere[phoNCUTLEVELS][4];
float cic4_cut_sublead_r9[phoNCUTLEVELS][4];
float cic4_cut_sublead_drtotk_25_99[phoNCUTLEVELS][4];
float cic4_cut_sublead_pixel[phoNCUTLEVELS][4];
float pfisoOffset;
// leading photon
float cic4pf_cut_lead_isosumoet[phoNCUTLEVELS][4];
float cic4pf_cut_lead_isosumoetbad[phoNCUTLEVELS][4];
float cic4pf_cut_lead_trkisooet[phoNCUTLEVELS][4];
float cic4pf_cut_lead_sieie[phoNCUTLEVELS][4];
float cic4pf_cut_lead_hovere[phoNCUTLEVELS][4];
float cic4pf_cut_lead_r9[phoNCUTLEVELS][4];
float cic4pf_cut_lead_drtotk_25_99[phoNCUTLEVELS][4];
float cic4pf_cut_lead_pixel[phoNCUTLEVELS][4];
// subleading photon
float cic4pf_cut_sublead_isosumoet[phoNCUTLEVELS][4];
float cic4pf_cut_sublead_isosumoetbad[phoNCUTLEVELS][4];
float cic4pf_cut_sublead_trkisooet[phoNCUTLEVELS][4];
float cic4pf_cut_sublead_sieie[phoNCUTLEVELS][4];
float cic4pf_cut_sublead_hovere[phoNCUTLEVELS][4];
float cic4pf_cut_sublead_r9[phoNCUTLEVELS][4];
float cic4pf_cut_sublead_drtotk_25_99[phoNCUTLEVELS][4];
float cic4pf_cut_sublead_pixel[phoNCUTLEVELS][4];
//----------------------------------------------------------------------
/** loops through photons and returns indices to two photons passing desired selection .
if more than one diphoton passes, returns pair with highest lead photon pt, or if lead is same, with highest sublead pt. */
int DiphotonCiCSelection( phoCiCIDLevel LEADCUTLEVEL = phoLOOSE,
phoCiCIDLevel SUBLEADCUTLEVEL = phoLOOSE,
Float_t leadPtMin = 30,
Float_t subleadPtMin = 20,
int ncategories=6,
bool applyPtoverM=false,
float *pho_energy_array=0,
bool split=false, int fixedvtx=-1, std::vector<bool> veto_indices=std::vector<bool>(false),
std::vector<int> cutsbycat=std::vector<int>(0));
std::vector<int> DiphotonCiCSelectionForTaggedChannels( phoCiCIDLevel LEADCUTLEVEL = phoLOOSE,
phoCiCIDLevel SUBLEADCUTLEVEL = phoLOOSE,
Float_t leadPtMin = 30,
Float_t subleadPtMin = 20,
int ncategories=6,
bool applyPtoverM=false,
float *pho_energy_array=0,
bool split=false, int fixedvtx=-1, std::vector<bool> veto_indices=std::vector<bool>(false),
std::vector<int> cutsbycat=std::vector<int>(0));
std::vector<int> DiphotonMITPreSelectionForTaggedChannels(const char * type, Float_t leadPtMin, Float_t subleadPtMin, Float_t phoidMvaCut, bool applyPtoverM, float *pho_energy_array=0, bool vetodipho=false, bool kinonly=false, float dipho_BDT_Cut=-100,int fixedvtx=-1, bool split=false, std::vector<bool> veto_indices=std::vector<bool>(false));
int DiphotonMITPreSelection(const char * type, Float_t leadPtMin, Float_t subleadPtMin, Float_t phoidMvaCut, bool applyPtoverM, float *pho_energy_array=0, bool vetodipho=false, bool kinonly=false, float dipho_BDT_Cut=-100,int fixedvtx=-1, bool split=false, std::vector<bool> veto_indices=std::vector<bool>(false));
float DiphotonMITPreSelectionPerDipho(const char * type, int idipho, Float_t leadPtMin, Float_t subleadPtMin, Float_t phoidMvaCut, bool applyPtoverM, float *pho_energy_array=0, int fixedvtx=-1, bool split=false, bool kinonly=false, std::vector<bool> veto_indices=std::vector<bool>(false));
int DiphotonMITPreSelection2011(Float_t leadPtMin, Float_t subleadPtMin, Float_t phoidMvaCut, bool applyPtoverM, float *pho_energy_array=0, bool kinonly=false);
/** for a photon index, applies all levels of cuts and returns the
index to the highest cut level passed (can do lead and sublead -
same for now). This should be compared to one of the phoCiCIDLevel
enum constants (e.g. phoSUPERTIGHT).
@param ph_passcut will contain flags which cuts the given photon
passes. The first index is the level of the selection
looked at, the second index is the index of the cut.
Will be automatically resized.
@param doSublead zero, if the cuts for the leading photon
should be applied, non-zero if the cuts for the
subleading photon should be applied.
*/
int PhotonCiCPFSelectionLevel( int photon_index, int vertex_index, std::vector<std::vector<bool> > & ph_passcut, int ncategories=6, int doSublead=1, float *pho_energy_array=0);
int PhotonCiCSelectionLevel( int photon_index, int vertex_index, std::vector<std::vector<bool> > & ph_passcut, int ncategories=6, int doSublead=1, float *pho_energy_array=0);
bool PhotonMITPreSelection( int photon_index, int vertex_index,float *pho_energy_array=0);
bool PhotonMITPreSelection2011( int photon_index, int vertex_index,float *pho_energy_array=0);
// Functions to calculate variables used in CiC selection
Float_t DeltaRToTrack(Int_t photon_ind=-1, Int_t vtxind=-1, Float_t PtMin=1., Float_t dzmax=0.2, Float_t dxymax=0.1, int maxlosthits=0);
Float_t IsoEcalHitsSumEtNumCrystal( TVector3 *calopos, Float_t innerConeDR, Float_t outerConeDR, Float_t stripEtaHalfWidth, Float_t stripHalfLength=99.);
std::pair<Int_t, Float_t> WorstSumTrackPtInCone(int ipho, Int_t returnVtxIndex=0, Float_t PtMin=0, Float_t OuterConeRadius=0.3, Float_t InnerConeRadius=0.04, Float_t EtaStripHalfWidth=0.015, Float_t dzmax=0.2, Float_t dxymax=0.1, bool Zee_validation=false);
Float_t SumTrackPtInCone(TLorentzVector *photon_p4, Int_t vtxind, Float_t PtMin=0, Float_t OuterConeRadius=0.3, Float_t InnerConeRadius=0.04, Float_t EtaStripHalfWidth=0.015, Float_t dzmax=0.2, Float_t dxymax=0.1, bool Zee_validation=false, Int_t pho_ind=-1);
//----------------------------------------------------------------------
/** photon category functions (r9 and eta) */
int PhotonCategory(int photonindex, int n_r9cat=3, int n_etacat=2) {
// example: n_r9cat = 2 and n_etacat = 2
// -> return value 0 high R9, barrel
// 1 low R9, barrel
// 2 high R9, endcap
// 3 low R9, endcap
return PhotonR9Category(photonindex,n_r9cat) + n_r9cat * PhotonEtaCategory(photonindex,n_etacat);
}
//----------------------------------------------------------------------
/** @return the photon R9 category number */
Int_t PhotonR9Category(int photonindex, int n_r9cat=3, float r9boundary=0.94) {
if(photonindex < 0) return -1;
if(n_r9cat<2)return 0;
int r9cat=0;
float r9 = pho_r9_cic[photonindex];
if(n_r9cat==3) {
r9cat = (Int_t)(r9<0.94) + (r9<0.9);// 0, 1, or 2 (high r9 --> low r9)
} else if(n_r9cat==2) {
r9cat = (Int_t)(r9<r9boundary);// 0, 1(high r9 --> low r9)
}
return r9cat;
}
//----------------------------------------------------------------------
/** @return the photon eta category number */
int PhotonEtaCategory(int photonindex, int n_etacat=4) {
if(photonindex < 0) return -1;
if(n_etacat<2)return 0;
int etacat;
// Float_t eta = fabs(((TVector3*)pho_calopos->At(photonindex))->Eta());
Float_t eta = fabs(((TVector3*)sc_xyz->At(pho_scind[photonindex]))->Eta());
if(n_etacat==4) {
etacat = (Int_t)(eta>0.9) + (Int_t)(eta>1.479) + (Int_t)(eta>2.1); // 0, 1, 2, or 3 (barrel --> endcap)
} else if(n_etacat==2) {
etacat = (Int_t)(eta>1.479); // 0, 1 (barrel --> endcap)
}
return etacat;
}
//----------------------------------------------------------------------
//diphoton category functions ( r9, eta, and diphoton pt)
int DiphotonCategory(Int_t leadind, Int_t subleadind, float pTh, float pToMh, int n_etacat=4,int n_r9cat=3, float r9boundary=0.94, int n_pThcat=0, int n_pToMhcat=0, int nVtxCategories=0, int nvtx=0, float vtxMva=-1.) {
Int_t r9cat = TMath::Max(PhotonR9Category(leadind,n_r9cat,r9boundary),PhotonR9Category(subleadind,n_r9cat,r9boundary));
Int_t etacat = TMath::Max(PhotonEtaCategory(leadind,n_etacat),PhotonEtaCategory(subleadind,n_etacat));
Int_t pThcat = DiphotonPtCategory(pTh,n_pThcat);
Int_t pToMhcat = DiphotonPtOverMCategory(pToMh,n_pToMhcat);
Int_t vtxCat = DiphotonVtxCategory(nVtxCategories,nvtx);
return (r9cat + n_r9cat*etacat + (n_r9cat*n_etacat)*pThcat) + (n_r9cat*n_etacat*(n_pThcat>0?n_pThcat:1))*pToMhcat + (n_r9cat*n_etacat*(n_pThcat>0?n_pThcat:1)*(n_pToMhcat>0?n_pToMhcat:1))*vtxCat; // (n_r9cat*c_etacat*n_pThcat) categories
}
//----------------------------------------------------------------------
int DijetSubCategory(float mjj, float leadPt, float subledPt, float ncat)
{
if( ncat == 1 ) { return 0; }
return ( mjj < 500. || subledPt < 30. );
}
//----------------------------------------------------------------------
int DiphotonVtxCategory(int nVtxCategories, int nvtx)
{
int cat=0;
if(nVtxCategories==3) {
cat = (Int_t)(nvtx > 18) + (Int_t)(nvtx > 13);
} else if (nVtxCategories==2) {
cat = (Int_t)(nvtx > 15);
}
/// cout << "DiphotonVtxCategory " << cat << " " << vtxMva << " " << nVtxCategories << endl;
return cat;
}
int DiphotonVtxCategory(float vtxMva, int nVtxCategories)
{
int cat=0;
if(nVtxCategories==2) {
cat = (Int_t)(vtxMva > -0.8);
} else if (nVtxCategories>0) {
cat = (Int_t)(vtxMva > -0.8) + (Int_t)(vtxMva > -0.55);
}
/// cout << "DiphotonVtxCategory " << cat << " " << vtxMva << " " << nVtxCategories << endl;
return cat;
}
int DiphotonPtCategory(double pTh, int n_pThcat=0) {
if(n_pThcat<2)return 0;
int pThcat=0;
if(n_pThcat == 2) {
pThcat = (Int_t)(pTh < 40.);
} else if (n_pThcat == 3) {
pThcat = (Int_t)((pTh < 70.) + (pTh < 40.));
}
return pThcat;
}
int DiphotonPtOverMCategory(double pToMh, int n_pToMhcat=0) {
if(n_pToMhcat<2) return 0;
int pToMhcat=0;
if(n_pToMhcat == 2) {
pToMhcat = (Int_t)(pToMh < 40./125.);
} else if (n_pToMhcat == 3) {
pToMhcat = (Int_t)((pToMh < 70./125.) + (pToMh < 40./125.));
}
return pToMhcat;
}
// CiC SELECTION CODE END - SSIMON
// Functions movec from Tools.h
double DeltaPhi(double,double);
///
/// Missing and addition branches
///
// Higgs and company
Int_t gh_gen2reco1;
Int_t gh_gen2reco2;
Int_t gh_vbfq1_pdgid;
Int_t gh_vbfq2_pdgid;
Int_t gh_vh_pdgid;
Int_t gh_vh1_pdgid;
Int_t gh_vh2_pdgid;
TClonesArray *gh_higgs_p4;
TClonesArray *gh_pho1_p4;
TClonesArray *gh_pho2_p4;
TClonesArray *gh_vbfq1_p4;
TClonesArray *gh_vbfq2_p4;
TClonesArray *gh_vh1_p4;
TClonesArray *gh_vh2_p4;
//TClonesArray *METcorrected; //met at analysis step
Float_t rho;
Int_t gv_n;
TClonesArray * gv_pos;
Int_t pu_n;
std::vector<float> * pu_zpos;
std::vector<float> * pu_sumpt_lowpt;
std::vector<float> * pu_sumpt_highpt;
std::vector<int> * pu_ntrks_lowpt;
std::vector<int> * pu_ntrks_highpt;
bool pho_idmva_cached;
float pho_idmva[MAX_PHOTONS][MAX_VERTICES];
#define MAX_DIPHOTONS 50
Int_t dipho_n;
Int_t dipho_leadind[MAX_DIPHOTONS];
Int_t dipho_subleadind[MAX_DIPHOTONS];
Int_t dipho_vtxind[MAX_DIPHOTONS];
Float_t dipho_sumpt[MAX_DIPHOTONS];
Bool_t dipho_sel[MAX_DIPHOTONS];
Float_t dipho_BDT[MAX_DIPHOTONS];
Bool_t pho_genmatched[MAX_PHOTONS];
Float_t pho_regr_energy_otf[MAX_PHOTONS];
Float_t pho_regr_energyerr_otf[MAX_PHOTONS];
Float_t pho_ESEffSigmaRR[MAX_PHOTONS];
Float_t pho_s4ratio[MAX_PHOTONS];
//// Float_t dipho_leadet[MAX_DIPHOTONS];
//// Float_t dipho_subleadet[MAX_DIPHOTONS];
//// Float_t dipho_leadeta[MAX_DIPHOTONS];
//// Float_t dipho_subleadeta[MAX_DIPHOTONS];
//// Int_t dipho_leadci6cindex[MAX_DIPHOTONS];
//// Int_t dipho_subleadci6cindex[MAX_DIPHOTONS];
//// Int_t dipho_leadci4cindex[MAX_DIPHOTONS];
//// Int_t dipho_subleadci4cindex[MAX_DIPHOTONS];
//// Float_t dipho_mass[MAX_DIPHOTONS];
//// Float_t dipho_pt[MAX_DIPHOTONS];
//// Float_t dipho_eta[MAX_DIPHOTONS];
//// Float_t dipho_phi[MAX_DIPHOTONS];
//// Float_t dipho_cts[MAX_DIPHOTONS];
//correctMETinRED
Float_t shiftMET_pt;
Float_t shiftMET_phi;
Float_t smearMET_pt;
Float_t smearMET_phi;
Float_t shiftscaleMET_pt;
Float_t shiftscaleMET_phi;
Float_t shiftsmearMET_pt;
Float_t shiftsmearMET_phi;
Float_t correctedpfMET;
Float_t correctedpfMET_phi;
Float_t shiftMET_eta;
Float_t shiftMET_e;
Float_t shiftscaleMET_eta;
Float_t shiftscaleMET_e;
TBranch *b_gh_gen2reco1;
TBranch *b_gh_gen2reco2;
TBranch *b_gh_vbfq1_pdgid;
TBranch *b_gh_vbfq2_pdgid;
TBranch *b_gh_vh_pdgid;
TBranch *b_gh_vh1_pdgid;
TBranch *b_gh_vh2_pdgid;
//TBranch *b_METcorrected; //met at analysis step
TBranch *b_gh_higgs_p4;
TBranch *b_gh_pho1_p4;
TBranch *b_gh_pho2_p4;
TBranch *b_gh_vbfq1_p4;
TBranch *b_gh_vbfq2_p4;
TBranch *b_gh_vh1_p4;
TBranch *b_gh_vh2_p4;
TBranch * b_dipho_n;
TBranch * b_dipho_leadind;
TBranch * b_dipho_subleadind;
TBranch * b_dipho_vtxind;
TBranch * b_dipho_sumpt;
TBranch * b_pho_genmatched;
TBranch * b_pho_regr_energy_otf;
TBranch * b_pho_regr_energyerr_otf;
//// TBranch * b_dipho_leadet;
//// TBranch * b_dipho_subleadet;
//// TBranch * b_dipho_leadeta;
//// TBranch * b_dipho_subleadeta;
//// TBranch * b_dipho_leadci6cindex;
//// TBranch * b_dipho_subleadci6cindex;
//// TBranch * b_dipho_leadci4cindex;
//// TBranch * b_dipho_subleadci4cindex;
//// TBranch * b_dipho_mass;
//// TBranch * b_dipho_pt;
//// TBranch * b_dipho_eta;
//// TBranch * b_dipho_phi;
//// TBranch * b_dipho_cts;
//correctMETinRED
TBranch * b_shiftMET_pt;
TBranch * b_shiftMET_phi;
TBranch * b_smearMET_pt;
TBranch * b_smearMET_phi;
TBranch * b_shiftscaleMET_pt;
TBranch * b_shiftscaleMET_phi;
TBranch * b_shiftsmearMET_pt;
TBranch * b_shiftsmearMET_phi;
TBranch * b_correctedpfMET;
TBranch * b_correctedpfMET_phi;
TBranch * b_shiftMET_eta;
TBranch * b_shiftMET_e;
TBranch * b_shiftscaleMET_eta;
TBranch * b_shiftscaleMET_e;
//----------------------------------------
// photon and diphoton vertex selection
//----------------------------------------
/** calculated in PhotonAnalysis.cc: vertex selected
for the diphoton pair with highest sum of Pt */
int vtx_std_sel;
std::vector<int> * dipho_vtx_std_sel;
/** calculated e.g. in PhotonAnalysis.cc */
std::vector<std::vector<int> > * vtx_std_ranked_list;
std::vector<float> * vtx_std_evt_mva;
// std::vector<int> * vtx_std_ranked_list;
//----------------------------------------
// CiC inputs
std::vector<std::vector<float> >* pho_mitmva;
std::vector<std::vector<float> >* pho_tkiso_recvtx_030_002_0000_10_01;
Float_t pho_tkiso_badvtx_040_002_0000_10_01[MAX_PHOTONS];
Float_t pho_pfiso_charged_badvtx_04[MAX_PHOTONS];
Int_t pho_pfiso_charged_badvtx_id[MAX_PHOTONS];
Int_t pho_tkiso_badvtx_id[MAX_PHOTONS];
std::vector<std::vector<float> >* pho_ZeeVal_tkiso_recvtx_030_002_0000_10_01;
Float_t pho_ZeeVal_tkiso_badvtx_040_002_0000_10_01[MAX_PHOTONS];
Int_t pho_ZeeVal_tkiso_badvtx_id[MAX_PHOTONS];
Float_t pho_drtotk_25_99[MAX_PHOTONS];
bool runCiC;
/** cut levels of CIC photon identification (stored in the tree).
The first index is the index of the photon object (0..pho_n-1),
the second index is the index of the vertex (0..vtx_std_n-1)
with respect to which the id is calculated.
The contents are the return values of the function
PhotonCiCSelectionLevel(..)
*/
Int_t mu_glo_hasgsftrack[MAX_MUONS];
std::vector<std::vector<Short_t> >* pho_cic6cutlevel_lead;
std::vector<std::vector<std::vector<UInt_t> > >* pho_cic6passcuts_lead;
std::vector<std::vector<Short_t> >* pho_cic6cutlevel_sublead;
std::vector<std::vector<std::vector<UInt_t> > >* pho_cic6passcuts_sublead;
std::vector<std::vector<Short_t> >* pho_cic4cutlevel_lead;
std::vector<std::vector<std::vector<UInt_t> > >* pho_cic4passcuts_lead;
std::vector<std::vector<Short_t> >* pho_cic4cutlevel_sublead;
std::vector<std::vector<std::vector<UInt_t> > >* pho_cic4passcuts_sublead;
std::vector<std::vector<Short_t> >* pho_cic4pfcutlevel_lead;
std::vector<std::vector<std::vector<UInt_t> > >* pho_cic4pfpasscuts_lead;
std::vector<std::vector<Short_t> >* pho_cic4pfcutlevel_sublead;
std::vector<std::vector<std::vector<UInt_t> > >* pho_cic4pfpasscuts_sublead;
std::vector<std::vector<Short_t> >* pho_cutlevel_lead;
std::vector<std::vector<std::vector<UInt_t> > >* pho_passcuts_lead;
std::vector<std::vector<Short_t> >* pho_cutlevel_sublead;
std::vector<std::vector<std::vector<UInt_t> > >* pho_passcuts_sublead;
// Indices of conversions matching the photons
std::vector<int> * pho_matchingConv;
TBranch *b_pho_matchingConv;
TBranch *b_gv_n;
TBranch *b_gv_pos;
TBranch *b_pu_n;
TBranch *b_pu_zpos;
TBranch *b_pu_sumpt_lowpt;
TBranch *b_pu_sumpt_highpt;
TBranch *b_pu_ntrks_lowpt;
TBranch *b_pu_ntrks_highpt;
TBranch *b_vtx_std_sel;
TBranch *b_vtx_std_ranked_list;
TBranch *b_vtx_std_evt_mva;
TBranch * b_pho_mitmva;
TBranch * b_pho_pfiso_charged_badvtx_04;
TBranch * b_pho_pfiso_charged_badvtx_id;
TBranch * b_pho_tkiso_recvtx_030_002_0000_10_01;
TBranch * b_pho_tkiso_badvtx_040_002_0000_10_01;
TBranch * b_pho_tkiso_badvtx_id;
TBranch * b_pho_ZeeVal_tkiso_recvtx_030_002_0000_10_01;
TBranch * b_pho_ZeeVal_tkiso_badvtx_040_002_0000_10_01;
TBranch * b_pho_ZeeVal_tkiso_badvtx_id;
TBranch * b_pho_drtotk_25_99;
TBranch * b_mu_glo_hasgsftrack;
TBranch * b_pho_cic6cutlevel_lead;
TBranch * b_pho_cic6passcuts_lead;
TBranch * b_pho_cic6cutlevel_sublead;
TBranch * b_pho_cic6passcuts_sublead;
TBranch * b_pho_cic4cutlevel_lead;
TBranch * b_pho_cic4passcuts_lead;
TBranch * b_pho_cic4cutlevel_sublead;
TBranch * b_pho_cic4passcuts_sublead;
TBranch * b_pho_cic4pfcutlevel_lead;
TBranch * b_pho_cic4pfpasscuts_lead;
TBranch * b_pho_cic4pfcutlevel_sublead;
TBranch * b_pho_cic4pfpasscuts_sublead;
TBranch * b_pho_cutlevel_lead;
TBranch * b_pho_passcuts_lead;
TBranch * b_pho_cutlevel_sublead;
TBranch * b_pho_passcuts_sublead;
Float_t mc_et[MAX_ELECTRONS];
Float_t mc_eta[MAX_ELECTRONS];
Float_t mc_phi[MAX_ELECTRONS];
Float_t fsr_et[MAX_ELECTRONS];
Float_t fsr_eta[MAX_ELECTRONS];
Float_t fsr_phi[MAX_ELECTRONS];
TLorentzVector* higgs;
TBranch* b_mc_et,*b_mc_eta, *b_mc_phi, *b_higgs, *b_fsr_et, *b_fsr_eta, *b_fsr_phi;
void DefineUserBranches();
void Branch_mc_et(TTree* tree) { tree->Branch("mc_et", &mc_et, "mc_et[100]/F"); };
void Branch_mc_eta(TTree* tree) { tree->Branch("mc_eta", &mc_eta, "mc_eta[100]/F"); };
void Branch_mc_phi(TTree* tree) { tree->Branch("mc_phi", &mc_phi, "mc_phi[100]/F"); };