-
Notifications
You must be signed in to change notification settings - Fork 1
/
RAA_read_data.C
1504 lines (1159 loc) · 62.2 KB
/
RAA_read_data.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
// Raghav Kunnawalkam Elayavalli
// June 4th 2014
// CERN
//
// read all the data files and create the required histograms needed for analysis. I'll create a new macro to read only the MC files.
//
// most of this macro is taken from the merge_pbpb_pp_HLT.C inside WORK/CMSSW_6_0_0/src/RAA/
// june 18th - check the TMath::Max(chargedMax ,neutralMax) / TMath::Max(chargedSum, neutralSum) should be LESS than 0.975
// june 19th - would have to make this macro run on condor scripts by utilizing multiple files for Jet55or65 and here it gets tricky for the other MB and Jet80 datasets since they are only one file.
// would have to somehow split them up interms of the number of events in the event loop (which would be the easiest of the lot to implement), or can do it interms of run, or lumi etc.. need to study this.
// June 23rd -
// also now that we have the new Jet55or65 dataset, need the lumimask to find out what lumi that particular trigger saw which is necessary when adding the triggers.
// Now we have to make the macro able to run on condor jobs so we have to split the required files into 11 jobs to match the jet55or65 file list.
// for this I have to create an array for the jet80 file showing the no of events and each job will go from one array element to the other. which means that i have to stop doing the ttree project method.
// I would have to think of another way to do that for the project.
// the best way i think would be to just use the unmerged files for the condor script. that way once we have a TChain of all the files everything below would work.
// NOW THE # for LUMI NORMALIZATION is WRONG!!!! need to change that once we get the full dataset. I already have the lumi mask. will get the required numbers from that.
// Lumi seen by the respective triggers
// Jet65 - 139.571 ub-1
// Jet55 - 75.086 ub-1
// Jet80 - 149.427 ub-1
// the above is old. for updated values check the RAA twiki.
// And it looks like we have to separate the pp side from this macro due to condor job submission
#include <iostream>
#include <stdio.h>
#include <fstream>
static const int nbins_pt = 29;
static const double boundaries_pt[nbins_pt+1] = {22, 27, 33, 39, 47, 55, 64, 74, 84, 97, 114, 133, 153, 174, 196, 220, 245, 272, 300, 330, 362, 395, 430, 468, 507, 548, 592, 638, 790, 967};
//only for the jet80 merged file
static const int job_no = 11;
static const double boundaries_loopno_job[job_no+1] = {0,100000,200000,300000,400000,50000,600000,700000,800000,900000,1000000,1152308};
static const double boundaries_fileno_job[job_no+1] = {0, 413, 826, 1239, 1652, 2065, 2478, 2891, 3304, 3717, 4130, 4542};
// divide by bin width
void divideBinWidth(TH1 *h)
{
h->Sumw2();
for (int i=0;i<=h->GetNbinsX();i++)
{
Float_t val = h->GetBinContent(i);
Float_t valErr = h->GetBinError(i);
val/=h->GetBinWidth(i);
valErr/=h->GetBinWidth(i);
h->SetBinContent(i,val);
h->SetBinError(i,valErr);
}
h->GetXaxis()->CenterTitle();
h->GetYaxis()->CenterTitle();
}
class JetData
{
public:
JetData(char *fileName, char *jetTree, char *genJetTree, bool loadGenJet = 0,bool isPbPb = 0) {
cout <<"Open "<<fileName<<endl;
tFile = new TFile(fileName,"read");
tEvt = (TTree*)tFile->Get("hiEvtAnalyzer/HiTree");
tSkim = (TTree*)tFile->Get("skimanalysis/HltTree");
tJet = (TTree*)tFile->Get(jetTree);
tJet->SetBranchAddress("jtpt" , jtpt );
tJet->SetBranchAddress("trackMax" , trackMax );
tJet->SetBranchAddress("chargedMax",chargedMax);
tJet->SetBranchAddress("refpt", refpt);
tJet->SetBranchAddress("nref" ,&njets);
tJet->SetBranchAddress("jteta", jteta);
tJet->SetBranchAddress("jtm",jtmass);
tJet->SetBranchAddress("pthat",&pthat);
if (loadGenJet) tGenJet = (TTree*)tFile->Get(genJetTree);
if (loadGenJet) tGenJet->SetBranchAddress("ngen" ,&ngen);
if (loadGenJet) tGenJet->SetBranchAddress("genpt", genpt);
if (loadGenJet) tGenJet->SetBranchAddress("gensubid", gensubid);
tEvt->SetBranchAddress("hiBin",&bin);
tEvt->SetBranchAddress("vz",&vz);
tSkim->SetBranchAddress("pHBHENoiseFilter",&pHBHENoiseFilter);
if(isPbPb) tSkim->SetBranchAddress("pcollisionEventSelection",&pcollisionEventSelection);
else tSkim->SetBranchAddress("pPAcollisionEventSelectionPA",&pPAcollisionEventSelectionPA);
tJet->AddFriend(tEvt);
tJet->AddFriend(tSkim);
};
TFile *tFile;
TTree *tJet;
TTree *tGenJet;
TTree *tEvt;
TTree* tSkim;
float jtpt[1000];
float refpt[1000];
float jteta[1000];
float jtmass[1000];
float trackMax[1000];
float chargedMax[1000];
float genpt[1000];
int gensubid[1000];
float vz;
float pthat;
int njets;
int ngen;
int bin;
int pHBHENoiseFilter;
int pPAcollisionEventSelectionPA;
int pcollisionEventSelection;
};
using namespace std;
void RAA_read_data(int startfile = 0, int endfile = 1, int radius = 3, char *algo = "Vs"){
TH1::SetDefaultSumw2();
gStyle->SetOptStat(0);
TStopwatch timer;
timer.Start();
cout<<"Running for Radius = "<<radius<<" and Algo = "<<algo<<endl;
// number convension:
// 0 - MB
// 1 - 55 or 65
// 2 - 80 or 95
// 80 is the unprescaled trigger - yes
//
//data files - PbPb
TFile *fpbpb0_old = TFile::Open("/mnt/hadoop/cms/store/user/velicanu/HIMinBias2011_GR_R_53_LV6_CMSSW_5_3_16_Forest_Track8_Jet21/0.root");
//this one is actually new, but im not going to change the title of the TFile for now.
TFile *fpbpb0_old = TFile::Open("/mnt/hadoop/cms/store/user/velicanu/HIMinBias2011_GR_R_53_LV6_CMSSW_5_3_16_lumi2_FOREST_TRY2merged/0.root");
TFile *fpbpb1_old = TFile::Open("/mnt/hadoop/cms/store/user/velicanu/hiForest_Jet55or65_GR_R_53_LV6_12Mar2014_0000CET_Track8_Jet21/0.root");
TFile *fpbpb1 = TFile::Open("/mnt/hadoop/cms/store/user/velicanu/hiForest_Jet55or65_GR_R_53_LV6_25Mar2014_0200CET_Track8_Jet26_TRY2_full/0.root");
TFile *fpbpb2_old = TFile::Open("/mnt/hadoop/cms/store/user/velicanu/hiForest_Jet80or95_GR_R_53_LV6_12Mar2014_0000CET_Track8_Jet21/0.root");
//TFile *fpbpb2 = TFile::Open("/mnt/hadoop/cms/store/user/velicanu/hiForest_Jet80or95_GR_R_53_LV6_25Mar2014_0200CET_Track8_Jet26_full/0.root"); //this one is obsolete
// new Jet80 file (merged) is /mnt/hadoop/cms/store/user/velicanu/HIRun2011-14Mar2014-v2-6lumi-jet80-forest-v4ANDv9-merged/0.root
TFile *fpbpb2 = TFile::Open("/mnt/hadoop/cms/store/user/velicanu/HIRun2011-14Mar2014-v2-6lumi-jet80-forest-v4ANDv9-merged/0.root");
// data files - pp
TFile *fpp1_v2 = TFile::Open("/mnt/hadoop/cms/store/user/rkunnawa/rootfiles/PP/2013/data/ntuple_2013_JEC_applied_ppJet80_v2.root");
TFile *fpp2_v2 = TFile::Open("/mnt/hadoop/cms/store/user/rkunnawa/rootfiles/PP/2013/data/ntuple_2013_JEC_applied_ppJet40_v2.root");
/*
// Now im going to change the file reading here for PbPb to look at the unmerged files through condor.
std::string infile1;
infile1 = "jet55or65_filelist.txt";
std::string infile2;
infile2 = "jet80_filelist.txt";
std::ifstream instr1(infile1.c_str(),std::ifstream::in);
std::string filename1;
std::ifstream instr2(infile1.c_str(),std::ifstream::in);
std::string filename2;
cout<<"reading from "<<startfile<<" to "<<endfile<<endl;
for(int ifile = 0;ifile<startfile;ifile++){
instr1>>filename1;
}
for(int ifile = 0;ifile<boundaries_fileno_job[startfile];i++){
instr2>>filename2;
}
//TChain *jetpbpb2 = new TChain(Form("ak%s%dPFJetAnalyzer/t",algo,radius));
//TChain *evtpbpb2 = new TChain("hiEvtAnalyzer/HiTree");
//TChain *hltpbpb2 = new TChain("hltanalysis/HltTree");
//TChain *skmpbpb2 = new TChain("skimanalysis/HltTree");
//TChain *hltobjpbpb2 = new TChain("hltobject/jetObjTree");
// data files for PbPb Jet55or66 are a list. So we need to TChain them first and then we should be able to use those chaing to get the events. they will have the same names as we used here.
//TChain *jetpbpb1 = new TChain(Form("ak%s%dPFJetAnalyzer/t",algo,radius));
//TChain *evtpbpb1 = new TChain("hiEvtAnalyzer/HiTree");
//TChain *hltpbpb1 = new TChain("hltanalysis/HltTree");
//TChain *skmpbpb1 = new TChain("skimanalysis/HltTree");
//TChain *hltobjpbpb1 = new TChain("hltobject/jetObjTree");
const int N = 5;
TChain *jetpbpb1[N];
TChain *jetpbpb2[N];
string dir[N] = {
"hltanalysis",
"skimanalysis",
//"hcalNoise",
Form("ak%s%dPFJetAnalyzer",algo,radius),
//"akPu5PFJetAnalyzer",
//"multiPhotonAnalyzer",
//"ppTrack",
//"pfcandAnalyzer",
//"anaMET",
//"muonTree",
"hiEvtAnalyzer",
"hltobject"
};
string trees[N] = {
"HltTree",
"HltTree",
//"hbhenoise",
"t",
//"t",
//"photon",
//"trackTree",
//"pfTree",
//"metTree",
//"HLTMuTree",
"HiTree",
"jetObjTree"
};
for(int ifile = startfile;ifile<endfile;ifile++){
instr1>>filename1;
cout<<"File: "<<filename1<<endl;
for(int i = 0;i<N;i++){
jetpbpb1[i] = new TChain(string(dir[i]+"/"+trees[i]).data()) ;
jetpbpb1[i]->Add(filename1.c_str());
cout << "Tree loaded " << string(dir[i]+"/"+trees[i]).data() << endl;
cout << "Entries : " << jetpbpb1[i]->GetEntries() << endl;
}
//jetpbpb1->Add(filename.c_str());
//hltpbpb1->Add(filename.c_str());
//skmpbpb1->Add(filename.c_str());
//hltobjpbpb1->Add(filename.c_str());
//evtpbpb1->Add(filename.c_str());
//cout<<"Entries = "<<jetpbpb1->GetEntries()<<endl;
}
jetpbpb1[2]->AddFriend(jetpbpb1[0]);
jetpbpb1[2]->AddFriend(jetpbpb1[1]);
jetpbpb1[2]->AddFriend(jetpbpb1[3]);
jetpbpb1[2]->AddFriend(jetpbpb1[4]);
for(int ifile = boundaries_fileno_job[startfile];ifile<boundaries_fileno_job[endfile];ifile++){
instr2>>filename2;
cout<<"File: "<<filename2<<endl;
for(int i = 0;i<N;i++){
jetpbpb2[i] = new TChain(string(dir[i]+"/"+trees[i]).data()) ;
jetpbpb2[i]->Add(filename2.c_str());
cout << "Tree loaded " << string(dir[i]+"/"+trees[i]).data() << endl;
cout << "Entries : " << jetpbpb2[i]->GetEntries() << endl;
}
//jetpbpb1->Add(filename.c_str());
//hltpbpb1->Add(filename.c_str());
//skmpbpb1->Add(filename.c_str());
//hltobjpbpb1->Add(filename.c_str());
//evtpbpb1->Add(filename.c_str());
//cout<<"Entries = "<<jetpbpb1->GetEntries()<<endl;
}
jetpbpb2[2]->AddFriend(jetpbpb2[0]);
jetpbpb2[2]->AddFriend(jetpbpb2[1]);
jetpbpb2[2]->AddFriend(jetpbpb2[3]);
jetpbpb2[2]->AddFriend(jetpbpb2[4]);
*/
// Ok this should now work.
// This below is the old way of reading in files and trees. dont follow that now.
//
// file list - are all named like this: /mnt/hadoop/cms/store/user/dgulhan/HIMC/Jet55or65/HIRun2011-14Mar2014-v2-6lumi-jet55or65-forest-v9/merged/HiForest_Pythia_Hydjet_Jet80_Track8_Jet19_STARTHI53_LV1_merged_forest_##.root
// where ## goes from 0-11
for(int i = 0;i<=11;i++){
if(i==9)continue;
jetpbpb1->Add(Form("/mnt/hadoop/cms/store/user/dgulhan/HIMC/Jet55or65/HIRun2011-14Mar2014-v2-6lumi-jet55or65-forest-v9/merged/HiForest_Pythia_Hydjet_Jet80_Track8_Jet19_STARTHI53_LV1_merged_forest_%d.root",i));
hltpbpb1->Add(Form("/mnt/hadoop/cms/store/user/dgulhan/HIMC/Jet55or65/HIRun2011-14Mar2014-v2-6lumi-jet55or65-forest-v9/merged/HiForest_Pythia_Hydjet_Jet80_Track8_Jet19_STARTHI53_LV1_merged_forest_%d.root",i));
skmpbpb1->Add(Form("/mnt/hadoop/cms/store/user/dgulhan/HIMC/Jet55or65/HIRun2011-14Mar2014-v2-6lumi-jet55or65-forest-v9/merged/HiForest_Pythia_Hydjet_Jet80_Track8_Jet19_STARTHI53_LV1_merged_forest_%d.root",i));
evtpbpb1->Add(Form("/mnt/hadoop/cms/store/user/dgulhan/HIMC/Jet55or65/HIRun2011-14Mar2014-v2-6lumi-jet55or65-forest-v9/merged/HiForest_Pythia_Hydjet_Jet80_Track8_Jet19_STARTHI53_LV1_merged_forest_%d.root",i));
hltobjpbpb1->Add(Form("/mnt/hadoop/cms/store/user/dgulhan/HIMC/Jet55or65/HIRun2011-14Mar2014-v2-6lumi-jet55or65-forest-v9/merged/HiForest_Pythia_Hydjet_Jet80_Track8_Jet19_STARTHI53_LV1_merged_forest_%d.root",i));
}
// grab the trees from the data files.
TTree *jetpbpb0_old = (TTree*)fpbpb0_old->Get(Form("ak%s%dPFJetAnalyzer/t",algo,radius));
//TTree *jetpbpb1 = (TTree*)fpbpb1->Get(Form("ak%s%dPFJetAnalyzer/t",algo,radius));
TTree *jetpbpb1_old = (TTree*)fpbpb1_old->Get(Form("ak%s%dPFJetAnalyzer/t",algo,radius));
TTree *jetpbpb2 = (TTree*)fpbpb2->Get(Form("ak%s%dPFJetAnalyzer/t",algo,radius));
TTree *jetpbpb2_old = (TTree*)fpbpb2_old->Get(Form("ak%s%dPFJetAnalyzer/t",algo,radius));
TTree *evtpbpb0_old = (TTree*)fpbpb0_old->Get("hiEvtAnalyzer/HiTree");
//TTree *evtpbpb1 = (TTree*)fpbpb1->Get("hiEvtAnalyzer/HiTree");
TTree *evtpbpb1_old = (TTree*)fpbpb1_old->Get("hiEvtAnalyzer/HiTree");
TTree *evtpbpb2 = (TTree*)fpbpb2->Get("hiEvtAnalyzer/HiTree");
TTree *evtpbpb2_old = (TTree*)fpbpb2_old->Get("hiEvtAnalyzer/HiTree");
TTree* hltpbpb0_old = (TTree*)fpbpb0_old->Get("hltanalysis/HltTree");
//TTree* hltpbpb1 = (TTree*)fpbpb1->Get("hltanalysis/HltTree");
TTree* hltpbpb1_old = (TTree*)fpbpb1_old->Get("hltanalysis/HltTree");
TTree* hltpbpb2 = (TTree*)fpbpb2->Get("hltanalysis/HltTree");
TTree* hltpbpb2_old = (TTree*)fpbpb2_old->Get("hltanalysis/HltTree");
TTree* skmpbpb0_old = (TTree*)fpbpb0_old->Get("skimanalysis/HltTree");
//TTree* skmpbpb1 = (TTree*)fpbpb1->Get("skimanalysis/HltTree");
TTree* skmpbpb1_old = (TTree*)fpbpb1_old->Get("skimanalysis/HltTree");
TTree* skmpbpb2 = (TTree*)fpbpb2->Get("skimanalysis/HltTree");
TTree* skmpbpb2_old = (TTree*)fpbpb2_old->Get("skimanalysis/HltTree");
TTree* hltobjpbpb0_old = (TTree*)fpbpb0_old->Get("hltobject/jetObjTree");
//TTree* hltobjpbpb1 = (TTree*)fpbpb1->Get("hltobject/jetObjTree");
TTree* hltobjpbpb1_old = (TTree*)fpbpb1_old->Get("hltobject/jetObjTree");
TTree* hltobjpbpb2 = (TTree*)fpbpb2->Get("hltobject/jetObjTree");
TTree* hltobjpbpb2_old = (TTree*)fpbpb2_old->Get("hltobject/jetObjTree");
jetpbpb0_old->AddFriend(evtpbpb0_old);
jetpbpb1->AddFriend(evtpbpb1);
jetpbpb1_old->AddFriend(evtpbpb1_old);
jetpbpb2->AddFriend(evtpbpb2);
jetpbpb2_old->AddFriend(evtpbpb2_old);
jetpbpb0_old->AddFriend(hltpbpb0_old);
jetpbpb1->AddFriend(hltpbpb1);
jetpbpb1_old->AddFriend(hltpbpb1_old);
jetpbpb2->AddFriend(hltpbpb2);
jetpbpb2_old->AddFriend(hltpbpb2_old);
jetpbpb0_old->AddFriend(skmpbpb0_old);
jetpbpb1->AddFriend(skmpbpb1);
jetpbpb1_old->AddFriend(skmpbpb1_old);
jetpbpb2->AddFriend(skmpbpb2);
jetpbpb2_old->AddFriend(skmpbpb2_old);
jetpbpb0_old->AddFriend(hltobjpbpb0_old);
jetpbpb1->AddFriend(hltobjpbpb1);
jetpbpb1_old->AddFriend(hltobjpbpb1_old);
jetpbpb2->AddFriend(hltobjpbpb2);
jetpbpb2_old->AddFriend(hltobjpbpb2_old);
//do it for the pp - need to check up on this.
TTree *jetpp1_v2 = (TTree*)fpp1_v2->Get(Form("jetR%d",radius));
TTree *jetpp2_v2 = (TTree*)fpp2_v2->Get(Form("jetR%d",radius));
TTree *evtpp1_v2 = (TTree*)fpp1_v2->Get("evt");
TTree *evtpp2_v2 = (TTree*)fpp2_v2->Get("evt");
jetpp1_v2->AddFriend(evtpp1_v2);
jetpp2_v2->AddFriend(evtpp2_v2);
//get all the pp spectra here:
TCut pp3 = "abs(eta)<2&&jet40&&!jet60&&!jet80&&(chMax/pt)>0.01&&(TMath::Max(neMax,chMax)/TMath::Max(chSum,neSum))>=0.975";
TH1F *hpp1 = new TH1F("hpp1","Spectra from Jet 80",1000,0,1000);
TH1F *hpp2 = new TH1F("hpp2","Spectra from Jet 60 & !Jet80",1000,0,1000);
TH1F *hpp3 = new TH1F("hpp3","Spectra from Jet 40 & !Jet60 & !Jet80",1000,0,1000);
TH1F *hppComb = new TH1F("hppComb","Combined spectra according to 12003 method",1000,0,1000);
//get the prescl factor information.
//Float_t presclpbpb3 = (Float_t)jetpbpb1_v2->GetEntries("jet80")/jetpbpb1_v2->GetEntries("jet55&&jet80");
//cout<<"pbpb prescl3 = "<<presclpbpb3<<endl;//1.99871
//Float_t presclpp3 = (Float_t)jetpp1_v2->GetEntries("jet80")/jetpp1_v2->GetEntries("jet40&&jet80");
//cout<<"pp prescl3 = "<<presclpp3<<endl; //9.24968
//root [9] (Float_t)jet->GetEntries("HLT_HIJet80_v1")/jet->GetEntries("HLT_HIJet80_v1&&HLT_HIJet55_v1")
//(double)2.34995051108819153e+00
//ive commented this below - to just check for the pbpb histograms to load.
// include the neutralMax/ max(chargedSum, neutralSum)>0.975 cut here
// because whatever cut we use in PbPb, we have to use in pp.
jetpp1_v2->Project("hpp1","pt","abs(eta)<2&&jet80&&(chMax/pt)>0.01&&(TMath::Max(chMax,neMax)/TMath::Max(chSum,neSum))>=0.975");
hpp1->Print("base");
jetpp2_v2->Project("hpp2","pt","abs(eta)<2&&jet60&&!jet80&&(chMax/pt)>0.01&&(TMath::Max(chMax,neMax)/TMath::Max(chSum,neSum))>=0.975");
hpp2->Print("base");
jetpp2_v2->Project("hpp3","pt","9.25038"*pp3);
// 9.25038 was the value.
//jetpp2_v2->Project("hpp3","pt","jet40_p"*pp3);
hpp3->Print("base");
hpp1->Scale(1./5300e6);//pp lumi
hpp2->Scale(1./5300e6);
hpp3->Scale(1./5300e6);
hpp1->Scale(1./4);//delta eta
hpp2->Scale(1./4);
hpp3->Scale(1./4);
hppComb->Add(hpp1,1);
hppComb->Add(hpp2,1);
hppComb->Add(hpp3,1);
hppComb->Print("base");
hppComb = (TH1F*)hppComb->Rebin(nbins_pt,"hppComb",boundaries_pt);
hpp3 = (TH1F*)hpp3->Rebin(nbins_pt,"hpp3",boundaries_pt);
hpp2 = (TH1F*)hpp2->Rebin(nbins_pt,"hpp2",boundaries_pt);
hpp1 = (TH1F*)hpp1->Rebin(nbins_pt,"hpp1",boundaries_pt);
divideBinWidth(hppComb);
divideBinWidth(hpp1);
divideBinWidth(hpp2);
divideBinWidth(hpp3);
//these were for doing it from the forests directly without the proper JEC's
//add the centrality cuts:
const int nbins_cent = 6;
Double_t boundaries_cent[nbins_cent+1] = {0,2,4,12,20,28,36};// multiply by 2.5 to get your actual centrality % (old 2011 data)
Double_t ncoll[nbins_cent] = { 1660, 1310, 745, 251, 62.8, 10.8 };
//const int nbins_cent = 1;
//Double_t boundaries_cent[nbins_cent+1] = {0,40};// multiply by 2.5 to get your actual centrality % (old 2011 data)
//Double_t ncoll[nbins_cent] = { 362.24};
//Double_t jet55or65CentWeight[nbins_cent] = {0.3734,0.2509,0.3222,0.0352,0.0066,0.0010}; //total = 0.9983
//Double_t jet80or90CentWeight[nbins_cent] = {0.2334,0.1764,0.3601,0.1117,0.0283,0.0054}; //total = 0.9153
// ok so this is pretty important here:
// the structure of the macro realies heavily on the centrality loop. so histograms arrays from 0 to nbins_cent-1 will have the spectra for the pbpb at different centrality classes. the one at nbins_cent contains the spectra for the 0-200 bin. so its the full spectra. this was done as a cross check rather than just adding the other histograms.
TCut pbpb0 = "abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIZeroBiasPizel_SingleTrack_v1&&chargedMax/jtpt>0.01";//this is just for the MB file. not really used here so far.
TCut pbpb1[nbins_cent+1];
TCut pbpb2[nbins_cent+1];
TCut pbpb3[nbins_cent+1];
TCut pbpb80[nbins_cent+1];
TCut pbpb65[nbins_cent+1];
TCut pbpb55[nbins_cent+1];
TH1F *hpbpb1[nbins_cent+1],*hpbpb2[nbins_cent+1],*hpbpb3[nbins_cent+1];
TH1F *hpbpbComb[nbins_cent+1];
//TH1F* htest = new TH1F("htest","",1000,0,1000);
TH1F *hpbpb_80[nbins_cent+1],*hpbpb_65[nbins_cent+1],*hpbpb_55[nbins_cent+1]; //histos to check the separate spectra, weighted by event by event prescl
// I should also add the trigger objects merging method.
//old way of finding trigger turn on which didnt work since we dont have a good MB sample.
TH1F* hTurnon80_old = new TH1F("hTurnon80_old","",150,0,150);
TH1F* hTurnon65_old = new TH1F("hTurnon65_old","",150,0,150);
TH1F* hTurnon55_old = new TH1F("hTurnon55_old","",150,0,150);
TH1F* hTriggerMerged_old = new TH1F("hTriggerMerged_old","",150,0,150);
TH1F* htest80_old = new TH1F("htest80_old","",150,0,150);
TH1F* htest65_old = new TH1F("htest65_old","",150,0,150);
TH1F* htest55_old = new TH1F("htest55_old","",150,0,150);
// check the trigger turn on curve from the MB file.
TH1F* hMB_old = new TH1F("hMB_old","",150,0,150);
//jetpbpb2->Project("htest80","jtpt","HLT_HIJet80_v1");
//htest80->Print("base");
//jetpbpb1->Project("htest65","jtpt","HLT_HIJet65_v1&&!HLT_HIJet80_v1");
//htest65->Print("base");
//jetpbpb1->Project("htest55","jtpt","HLT_HIJet55_v1_Prescl*(HLT_HIJet55_v1&&!HLT_HIJet65_v1&&!HLT_HIJet80_v1)");
//htest55->Print("base");
jetpbpb0_old->Project("hTurnon80_old","jtpt","HLT_HIJet80_v1_Prescl*HLT_HIJet80_v1");
jetpbpb0_old->Project("hTurnon65_old","jtpt","HLT_HIJet65_v1_Prescl*HLT_HIJet65_v1");
jetpbpb0_old->Project("hTurnon55_old","jtpt","HLT_HIJet55_v1_Prescl*HLT_HIJet55_v1");
TCut MB_prescl = "HLT_HIMinBiasHfOrBSC_v1_Prescl*HLT_HIMinBiasHfOrBSC_v1";
jetpbpb0_old->Project("hMB_old","jtpt","30"*MB_prescl);
//hTurnon80->Print("base");
//hTurnon65->Print("base");
//hTurnon55->Print("base");
//hTriggerMerged->Add(htest80);
//hTriggerMerged->Add(htest65);
//hTriggerMerged->Add(htest55);
hTurnon80_old->Divide(hMB_old);
hTurnon65_old->Divide(hMB_old);
hTurnon55_old->Divide(hMB_old);
//centrality loop for the pbpb files/histograms
for(int i = 0;i<nbins_cent;i++){
cout<<"centrality boundary = "<<boundaries_cent[i]*5<<" - "<<boundaries_cent[i+1]*5<<endl;
/*
Ok so i screwed up the convention here. the tcuts and the histogram has the number appendage going from
1 - 80
2 - 65
3 - 55
but thats the reverse for the jet trees.
2 - HLT_80 or HLT_95
1 - HLT_55 or HLT_65
so be careful when moving through the code.
*/
//list of cuts we are using to remove all the fake jets.
// chMax/jtpt>0.01 - studied
// neMax/jtpt>0.01 - just what im trying out now - needs to be studied
// TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975 used by kurt in 14007 and in 12003 as well.
//
// lets talk about the actual events/jets which are irritating here. the so called supernova events.
// they come from smaller jet triggers but still have larger jet pt.
pbpb1[i] = Form("abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet80_v1&&(chargedMax/jtpt)>0.01&&hiBin>=%2.0f&&hiBin<%2.0f&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975",5*boundaries_cent[i],5*boundaries_cent[i+1]);
pbpb2[i] = Form("abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet65_v1&&!HLT_HIJet80_v1&&(chargedMax/jtpt)>0.01&&hiBin>=%2.0f&&hiBin<%2.0f&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975",5*boundaries_cent[i],5*boundaries_cent[i+1]);
pbpb3[i] = Form("abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet55_v1&&!HLT_HIJet65_v1&&!HLT_HIJet80_v1&&(chargedMax/jtpt)>0.01&&hiBin>=%2.0f&&hiBin<%2.0f&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975",5*boundaries_cent[i],5*boundaries_cent[i+1]);
pbpb80[i] = Form("abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet80_v1&&(chargedMax/jtpt)>0.01&&hiBin>=%2.0f&&hiBin<%2.0f&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975",5*boundaries_cent[i],5*boundaries_cent[i+1]);
pbpb65[i] = Form("abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet65_v1&&(chargedMax/jtpt)>0.01&&hiBin>=%2.0f&&hiBin<%2.0f&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975",5*boundaries_cent[i],5*boundaries_cent[i+1]);
pbpb55[i] = Form("abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet55_v1&&(chargedMax/jtpt)>0.01&&hiBin>=%2.0f&&hiBin<%2.0f&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975",5*boundaries_cent[i],5*boundaries_cent[i+1]);
hpbpb1[i] = new TH1F(Form("hpbpb1_cent%d",i),Form("spectra from Jet 80 %2.0f - %2.0f cent",5*boundaries_cent[i],5*boundaries_cent[i+1]),1000,0,1000);
//hpbpb1[i]->Print("base");
hpbpb2[i] = new TH1F(Form("hpbpb2_cent%d",i),Form("spectra from jet 65 & !jet 80 %2.0f - %2.0f cent",5*boundaries_cent[i],5*boundaries_cent[i+1]),1000,0,1000);
hpbpb3[i] = new TH1F(Form("hpbpb3_cent%d",i),Form("spectra from jet 55 & !jet 65 & !jet 80 %2.0f - %2.0f cent",5*boundaries_cent[i],5*boundaries_cent[i+1]),1000,0,1000);
hpbpbComb[i] = new TH1F(Form("hpbpbComb_cent%d",i),Form("Spectra Combined using 12003 method %2.0f - %2.0f cent",5*boundaries_cent[i],5*boundaries_cent[i+1]),1000,0,1000);
hpbpb_80[i] = new TH1F(Form("hpbpb_80_cent%d",i),Form("Spectra from Jet80 trigger alone %2.0f - %2.0f cent",5*boundaries_cent[i],5*boundaries_cent[i+1]),1000,0,1000);
hpbpb_65[i] = new TH1F(Form("hpbpb_65_cent%d",i),Form("Spectra from Jet65 trigger alone %2.0f - %2.0f cent",5*boundaries_cent[i],5*boundaries_cent[i+1]),1000,0,1000);
hpbpb_55[i] = new TH1F(Form("hpbpb_55_cent%d",i),Form("Spectra from Jet55 trigger alone %2.0f - %2.0f cent",5*boundaries_cent[i],5*boundaries_cent[i+1]),1000,0,1000);
jetpbpb2->Project(Form("hpbpb1_cent%d",i),"jtpt",pbpb1[i]);
hpbpb1[i]->Print("base");
//divideBinWidth(hpbpb1);
jetpbpb1->Project(Form("hpbpb2_cent%d",i),"jtpt",pbpb2[i]);
hpbpb2[i]->Print("base");
//divideBinWidth(hpbpb2);
jetpbpb1->Project(Form("hpbpb3_cent%d",i),"jtpt","HLT_HIJet55_v1_Prescl"*pbpb3[i]);
//jetpbpb1->Project("hpbpb3","jtpt","2.34995"*pbpb3);
hpbpb3[i]->Print("base");
//divideBinWidth(hpbpb3);
jetpbpb2->Project(Form("hpbpb_80_cent%d",i),"jtpt","HLT_HIJet80_v1_Prescl"*pbpb80[i]);
hpbpb_80[i]->Print("base");
jetpbpb1->Project(Form("hpbpb_65_cent%d",i),"jtpt","HLT_HIJet65_v1_Prescl"*pbpb65[i]);
hpbpb_65[i]->Print("base");
jetpbpb1->Project(Form("hpbpb_55_cent%d",i),"jtpt","HLT_HIJet55_v1_Prescl"*pbpb55[i]);
hpbpb_55[i]->Print("base");
//scale the PbPb histograms before adding them
//we have to scale them according to the lumi of the Jet80 file.
// HLT file | Lumi inverse micro barns
// HLT_80 | 149.382
// HLT_65 | 3.195
// HLT_55 | 2.734
//
// the files which im using now is only a fraction of events of that:
// for the PbPb 55 or 65 file its 0.977
// for the PbPb 80 file its 0.304
// now using the full sample file
hpbpb1[i]->Scale(1./149.382e6);//respective lumi seen by the trigger all in inverse micro barns
hpbpb2[i]->Scale(1./3.195e6);
hpbpb3[i]->Scale(1./2.734e6);
hpbpb1[i]->Scale(1./4);//delta eta
hpbpb2[i]->Scale(1./4);
hpbpb3[i]->Scale(1./4);
//hpbpb1[i]->Scale(1./0.025/(boundaries_cent[i+1]-boundaries_cent[i])/jet80or95CentWeight[i]);//centrality bin width and scaling by the centrality events fraction.
//hpbpb2[i]->Scale(1./0.025/(boundaries_cent[i+1]-boundaries_cent[i])/jet55or65CentWeight[i]);
//hpbpb3[i]->Scale(1./0.025/(boundaries_cent[i+1]-boundaries_cent[i])/jet55or65CentWeight[i]);
hpbpb1[i]->Scale(1./0.005/(5*boundaries_cent[i+1]-5*boundaries_cent[i]));//centrality bin width
hpbpb2[i]->Scale(1./0.005/(5*boundaries_cent[i+1]-5*boundaries_cent[i]));
hpbpb3[i]->Scale(1./0.005/(5*boundaries_cent[i+1]-5*boundaries_cent[i]));
//might have to end up adding a centrality weight - the ratio of events per centrality class.
//add the histograms
hpbpbComb[i]->Add(hpbpb1[i]);
hpbpbComb[i]->Add(hpbpb2[i]);
hpbpbComb[i]->Add(hpbpb3[i]);
hpbpbComb[i]->Print("base");
hpbpbComb[i] = (TH1F*)hpbpbComb[i]->Rebin(nbins_pt,Form("hpbpbComb_cent%d",i),boundaries_pt);
hpbpb3[i] = (TH1F*)hpbpb3[i]->Rebin(nbins_pt,Form("hpbpb3_cent%d",i),boundaries_pt);
hpbpb2[i] = (TH1F*)hpbpb2[i]->Rebin(nbins_pt,Form("hpbpb2_cent%d",i),boundaries_pt);
hpbpb1[i] = (TH1F*)hpbpb1[i]->Rebin(nbins_pt,Form("hpbpb1_cent%d",i),boundaries_pt);
divideBinWidth(hpbpbComb[i]);
divideBinWidth(hpbpb3[i]);
divideBinWidth(hpbpb2[i]);
divideBinWidth(hpbpb1[i]);
}
// doing it the 0-200 centrality bin
pbpb1[nbins_cent] = "abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet80_v1&&(chargedMax/jtpt)>0.01&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975";
pbpb2[nbins_cent] = "abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet65_v1&&!HLT_HIJet80_v1&&(chargedMax/jtpt)>0.01&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975";
pbpb3[nbins_cent] = "abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet55_v1&&!HLT_HIJet65_v1&&!HLT_HIJet80_v1&&(chargedMax/jtpt)>0.01&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975";
pbpb80[nbins_cent] = "abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet80_v1&&(chargedMax/jtpt>0.01)&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975";
pbpb65[nbins_cent] = "abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet65_v1&&(chargedMax/jtpt>0.01&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975";
pbpb55[nbins_cent] = "abs(vz)<15&&pcollisionEventSelection&&pHBHENoiseFilter&&abs(jteta)<2&&HLT_HIJet55_v1&&(chargedMax/jtpt)>0.01&&TMath::Max(chargedMax,neutralMax)/TMath::Max(chargedSum,neutralSum)<0.975";
hpbpb1[nbins_cent] = new TH1F(Form("hpbpb1_cent%d",nbins_cent),"Spectra from Jet80 0-200 cent",1000,0,1000);
//hpbpb1[i]->Print("base");
hpbpb2[nbins_cent] = new TH1F(Form("hpbpb2_cent%d",nbins_cent),"Spectra from Jet 65 & !Jet80 0-200 cent",1000,0,1000);
hpbpb3[nbins_cent] = new TH1F(Form("hpbpb3_cent%d",nbins_cent),"Spectra from Jet 55 & !Jet65 & !Jet80 0-200 cent",1000,0,1000);
hpbpbComb[nbins_cent] = new TH1F(Form("hpbpbComb_cent%d",nbins_cent),"Combined Jet spectra 12003 method 0-200 cent",1000,0,1000);
hpbpb_80[nbins_cent] = new TH1F(Form("hpbpb_80_cent%d",nbins_cent),"Spectra from Jet 80 alone 0-200 cent",1000,0,1000);
hpbpb_65[nbins_cent] = new TH1F(Form("hpbpb_65_cent%d",nbins_cent),"Spectra from Jet 65 alone 0-200 cent",1000,0,1000);
hpbpb_55[nbins_cent] = new TH1F(Form("hpbpb_55_cent%d",nbins_cent),"Spectra from Jet 55 alone 0-200 cent",1000,0,1000);
jetpbpb2->Project(Form("hpbpb1_cent%d",nbins_cent),"jtpt",pbpb1[nbins_cent]);
hpbpb1[nbins_cent]->Print("base");
//divideBinWidth(hpbpb1);
jetpbpb1->Project(Form("hpbpb2_cent%d",nbins_cent),"jtpt",pbpb2[nbins_cent]);
hpbpb2[nbins_cent]->Print("base");
//divideBinWidth(hpbpb2);
jetpbpb1->Project(Form("hpbpb3_cent%d",nbins_cent),"jtpt","HLT_HIJet55_v1_Prescl"*pbpb3[nbins_cent]);
//jetpbpb1->Project("hpbpb3","jtpt","2.34995"*pbpb3);
hpbpb3[nbins_cent]->Print("base");
//divideBinWidth(hpbpb3);
//following histograms are for the trigger turnon curve. no cuts apart from the trigger selection.
jetpbpb2->Project(Form("hpbpb_80_cent%d",nbins_cent),"jtpt","HLT_HIJet80_v1_Prescl*HLT_HIJet80_v1");
hpbpb_80[nbins_cent]->Print("base");
jetpbpb1->Project(Form("hpbpb_65_cent%d",nbins_cent),"jtpt","HLT_HIJet65_v1_Prescl*HLT_HIJet65_v1");
hpbpb_65[nbins_cent]->Print("base");
jetpbpb1->Project(Form("hpbpb_55_cent%d",nbins_cent),"jtpt","HLT_HIJet55_v1_Prescl*HLT_HIJet55_v1");
hpbpb_55[nbins_cent]->Print("base");
//scale the PbPb histograms before adding them
//we have to scale them according to the lumi of the Jet80 file.
// HLT file | Lumi inverse micro barns
// HLT_80 | 149.382
// HLT_65 | 3.195
// HLT_55 | 2.734
//
// the files which im using now is only a fraction of events of that:
// for the PbPb 55 or 65 file its 0.977
// for the PbPb 80 file its 0.304
// now using the full sample file
hpbpb1[nbins_cent]->Scale(1./149.382e6);//respective lumi seen by the trigger all in inverse micro barns
hpbpb2[nbins_cent]->Scale(1./3.195e6);
hpbpb3[nbins_cent]->Scale(1./2.734e6);
hpbpb1[nbins_cent]->Scale(1./4);//delta eta
hpbpb2[nbins_cent]->Scale(1./4);
hpbpb3[nbins_cent]->Scale(1./4);
//might have to end up adding a centrality weight - the ratio of events per centrality class.
//add the histograms
hpbpbComb[nbins_cent]->Add(hpbpb1[nbins_cent]);
hpbpbComb[nbins_cent]->Add(hpbpb2[nbins_cent]);
hpbpbComb[nbins_cent]->Add(hpbpb3[nbins_cent]);
hpbpbComb[nbins_cent]->Print("base");
hpbpbComb[nbins_cent] = (TH1F*)hpbpbComb[nbins_cent]->Rebin(nbins_pt,Form("hpbpbComb_cent%d",nbins_cent),boundaries_pt);
hpbpb3[nbins_cent] = (TH1F*)hpbpb3[nbins_cent]->Rebin(nbins_pt,Form("hpbpb3_cent%d",nbins_cent),boundaries_pt);
hpbpb2[nbins_cent] = (TH1F*)hpbpb2[nbins_cent]->Rebin(nbins_pt,Form("hpbpb2_cent%d",nbins_cent),boundaries_pt);
hpbpb1[nbins_cent] = (TH1F*)hpbpb1[nbins_cent]->Rebin(nbins_pt,Form("hpbpb1_cent%d",nbins_cent),boundaries_pt);
divideBinWidth(hpbpbComb[nbins_cent]);
divideBinWidth(hpbpb3[nbins_cent]);
divideBinWidth(hpbpb2[nbins_cent]);
divideBinWidth(hpbpb1[nbins_cent]);
//ok now we have the spectra for the 0-200% centrality.
// do the trigger object merging here:
// this has to be done in the event loop which means that we have to get the
// create the trees and set the branch address
// jet tree
// similarly here 0 - MB file, 1 - 55or65, 2 - 80or95
//file 0:
// jet tree
int nrefe_0;
float pt_0[1000];
//float old_pt3[1000];
float raw_0[1000];
float eta_0[1000];
float eta_0_CM[1000];
float phi_0[1000];
float chMax_0[1000];
float trkMax_0[1000];
float chSum_0[1000];
float phSum_0[1000];
float neSum_0[1000];
float trkSum_0[1000];
float phMax_0[1000];
float neMax_0[1000];
// event tree
int evt_0;
int run_0;
int lumi_0;
int hiBin_0;
float vx_0;
float vy_0;
float vz_0;
int hiNtracks_0;
float hiHFminus_0;
float hiHFplus_0;
float hiHFplusEta4_0;
float hiHFminusEta4_0;
int pcollisionEventSelection_0;
int pHBHENoiseFilter_0;
int pprimaryvertexFilter_0;
int pVertexFilterCutGplus_0;
// trigger tree
int L1_MB_0;
int L1_MB_p_0;
int jetMB_0;
int jet55_0;
int jet65_0;
int jet80_0;
int jetMB_p_0;
int jet55_p_0;
int jet65_p_0;
int jet80_p_0;
// trigger object tree - this contains the maximum value of the particular trigger object.
float trgObj_id_0;
float trgObj_pt_0;
float trgObj_eta_0;
float trgObj_phi_0;
float trgObj_mass_0;
//file 1:
// jet tree
int nrefe_1;
float pt_1[1000];
//float old_pt3[1000];
float raw_1[1000];
float eta_1[1000];
float eta_1_CM[1000];
float phi_1[1000];
float chMax_1[1000];
float trkMax_1[1000];
float chSum_1[1000];
float phSum_1[1000];
float neSum_1[1000];
float trkSum_1[1000];
float phMax_1[1000];
float neMax_1[1000];
// event tree
int evt_1;
int run_1;
int lumi_1;
int hiBin_1;
float vx_1;
float vy_1;
float vz_1;
int hiNtracks_1;
float hiHFminus_1;
float hiHFplus_1;
float hiHFplusEta4_1;
float hiHFminusEta4_1;
int pcollisionEventSelection_1;
int pHBHENoiseFilter_1;
int pprimaryvertexFilter_1;
int pVertexFilterCutGplus_1;
// trigger tree
int L1_MB_1;
int L1_MB_p_1;
int jetMB_1;
int jet55_1;
int jet65_1;
int jet80_1;
int jetMB_p_1;
int jet55_p_1;
int jet65_p_1;
int jet80_p_1;
// trigger object tree - this contains the maximum value of the particular trigger object.
float trgObj_id_1;
float trgObj_pt_1;
float trgObj_eta_1;
float trgObj_phi_1;
float trgObj_mass_1;
//file 2:
// jet tree
int nrefe_2;
float pt_2[1000];
//float old_pt3[1000];
float raw_2[1000];
float eta_2[1000];
float eta_2_CM[1000];
float phi_2[1000];
float chMax_2[1000];
float trkMax_2[1000];
float chSum_2[1000];
float phSum_2[1000];
float neSum_2[1000];
float trkSum_2[1000];
float phMax_2[1000];
float neMax_2[1000];
// event tree
int evt_2;
int run_2;
int lumi_2;
int hiBin_2;
float vx_2;
float vy_2;
float vz_2;
int hiNtracks_2;
float hiHFminus_2;
float hiHFplus_2;
float hiHFplusEta4_2;
float hiHFminusEta4_2;
int pcollisionEventSelection_2;
int pHBHENoiseFilter_2;
int pprimaryvertexFilter_2;
int pVertexFilterCutGplus_2;
// trigger tree
int L1_MB_2;
int L1_MB_p_2;
int jetMB_2;
int jet55_2;
int jet65_2;
int jet80_2;
int jetMB_p_2;
int jet55_p_2;
int jet65_p_2;
int jet80_p_2;
// trigger object tree - this contains the maximum value of the particular trigger object.
float trgObj_id_2;
float trgObj_pt_2;
float trgObj_eta_2;
float trgObj_phi_2;
float trgObj_mass_2;
//set the branch addresses: - one of the most boring parts of the code:
jetpbpb0_old->SetBranchAddress("evt",&evt_0);
jetpbpb0_old->SetBranchAddress("run",&run_0);
jetpbpb0_old->SetBranchAddress("lumi",&lumi_0);
jetpbpb0_old->SetBranchAddress("hiBin",&hiBin_0);
jetpbpb0_old->SetBranchAddress("vz",&vz_0);
jetpbpb0_old->SetBranchAddress("vx",&vx_0);
jetpbpb0_old->SetBranchAddress("vy",&vy_0);
jetpbpb0_old->SetBranchAddress("hiNtracks",&hiNtracks_0);
jetpbpb0_old->SetBranchAddress("hiHFminus",&hiHFminus_0);
jetpbpb0_old->SetBranchAddress("hiHFplus",&hiHFplus_0);
jetpbpb0_old->SetBranchAddress("hiHFplusEta4",&hiHFplusEta4_0);
jetpbpb0_old->SetBranchAddress("hiHFminusEta4",&hiHFminusEta4_0);
jetpbpb0_old->SetBranchAddress("pcollisionEventSelection",&pcollisionEventSelection_0);
jetpbpb0_old->SetBranchAddress("pHBHENoiseFilter",&pHBHENoiseFilter_0);
//jetpbpb0_old->SetBranchAddress("pprimaryvertexFilter",&pprimaryvertexFilter_0);
//jetpbpb0_old->SetBranchAddress("pVertexFilterCutGplus",&pVertexFilterCutGplus_0);
jetpbpb0_old->SetBranchAddress("nref",&nrefe_0);
jetpbpb0_old->SetBranchAddress("jtpt",&pt_0);
jetpbpb0_old->SetBranchAddress("jteta",&eta_0);
jetpbpb0_old->SetBranchAddress("jtphi",&phi_0);
jetpbpb0_old->SetBranchAddress("rawpt",&raw_0);
jetpbpb0_old->SetBranchAddress("chargedMax",&chMax_0);
jetpbpb0_old->SetBranchAddress("chargedSum",&chSum_0);
jetpbpb0_old->SetBranchAddress("trackMax",&trkMax_0);
jetpbpb0_old->SetBranchAddress("trackSum",&trkSum_0);
jetpbpb0_old->SetBranchAddress("photonMax",&phMax_0);
jetpbpb0_old->SetBranchAddress("photonSum",&phSum_0);
jetpbpb0_old->SetBranchAddress("neutralMax",&neMax_0);
jetpbpb0_old->SetBranchAddress("neutralSum",&neSum_0);
/*
jetTree->SetBranchAddress("nTrk",&nTrack);
jetTree->SetBranchAddress("trkPt",&trkPt);
jetTree->SetBranchAddress("trkEta",&trkEta);
jetTree->SetBranchAddress("trkPhi",&trkPhi);
jetTree->SetBranchAddress("highPurity",&highPurity);
jetTree->SetBranchAddress("trkDz1",&trkDz1);
jetTree->SetBranchAddress("trkDzError1",&trkDzError1);
jetTree->SetBranchAddress("trkDxy1",&trkDxy1);
jetTree->SetBranchAddress("trkDxyError1",&trkDxyError1);
*/
//jetpbpb0_old->SetBranchAddress("HLT_PAZeroBiasPixel_SingleTrack_v1",&jetMB_0);
//jetpbpb0_old->SetBranchAddress("HLT_PAZeroBiasPixel_SingleTrack_v1_Prescl",&jetMB_p_0);
//jetpbpb0_old->SetBranchAddress("L1_ZeroBias",&L1_MB_0);
//jetpbpb0_old->SetBranchAddress("L1_ZeroBias_Prescl",&L1_MB_p_0);
jetpbpb0_old->SetBranchAddress("HLT_HIJet55_v1",&jet55_0);
jetpbpb0_old->SetBranchAddress("HLT_HIJet55_v1_Prescl",&jet55_p_0);
jetpbpb0_old->SetBranchAddress("HLT_HIJet65_v1",&jet65_0);
jetpbpb0_old->SetBranchAddress("HLT_HIJet65_v1_Prescl",&jet65_p_0);
jetpbpb0_old->SetBranchAddress("HLT_HIJet80_v1",&jet80_0);
jetpbpb0_old->SetBranchAddress("HLT_HIJet80_v1_Prescl",&jet80_p_0);
/*
jetpbpb0_old->SetBranchAddress("id",&trgObj_id_0);
jetpbpb0_old->SetBranchAddress("pt",&trgObj_pt_0);
jetpbpb0_old->SetBranchAddress("eta",&trgObj_eta_0);
jetpbpb0_old->SetBranchAddress("phi",&trgObj_phi_0);
jetpbpb0_old->SetBranchAddress("mass",&trgObj_mass_0);
*/
//set the branch addresses: - one of the most boring parts of the code:
jetpbpb1->SetBranchAddress("evt",&evt_1);
jetpbpb1->SetBranchAddress("run",&run_1);
jetpbpb1->SetBranchAddress("lumi",&lumi_1);
jetpbpb1->SetBranchAddress("hiBin",&hiBin_1);
jetpbpb1->SetBranchAddress("vz",&vz_1);
jetpbpb1->SetBranchAddress("vx",&vx_1);
jetpbpb1->SetBranchAddress("vy",&vy_1);
jetpbpb1->SetBranchAddress("hiNtracks",&hiNtracks_1);
jetpbpb1->SetBranchAddress("hiHFminus",&hiHFminus_1);
jetpbpb1->SetBranchAddress("hiHFplus",&hiHFplus_1);
jetpbpb1->SetBranchAddress("hiHFplusEta4",&hiHFplusEta4_1);
jetpbpb1->SetBranchAddress("hiHFminusEta4",&hiHFminusEta4_1);
jetpbpb1->SetBranchAddress("pcollisionEventSelection",&pcollisionEventSelection_1);
jetpbpb1->SetBranchAddress("pHBHENoiseFilter",&pHBHENoiseFilter_1);
//jetpbpb1->SetBranchAddress("pprimaryvertexFilter",&pprimaryvertexFilter_1);
//jetpbpb1->SetBranchAddress("pVertexFilterCutGplus",&pVertexFilterCutGplus_1);
jetpbpb1->SetBranchAddress("nref",&nrefe_1);
jetpbpb1->SetBranchAddress("jtpt",&pt_1);
jetpbpb1->SetBranchAddress("jteta",&eta_1);
jetpbpb1->SetBranchAddress("jtphi",&phi_1);
jetpbpb1->SetBranchAddress("rawpt",&raw_1);
jetpbpb1->SetBranchAddress("chargedMax",&chMax_1);
jetpbpb1->SetBranchAddress("chargedSum",&chSum_1);
jetpbpb1->SetBranchAddress("trackMax",&trkMax_1);
jetpbpb1->SetBranchAddress("trackSum",&trkSum_1);
jetpbpb1->SetBranchAddress("photonMax",&phMax_1);
jetpbpb1->SetBranchAddress("photonSum",&phSum_1);
jetpbpb1->SetBranchAddress("neutralMax",&neMax_1);
jetpbpb1->SetBranchAddress("neutralSum",&neSum_1);
//jetpbpb1->SetBranchAddress("HLT_PAZeroBiasPixel_SingleTrack_v1",&jetMB_1);
//jetpbpb1->SetBranchAddress("HLT_PAZeroBiasPixel_SingleTrack_v1_Prescl",&jetMB_p_1);
//jetpbpb1->SetBranchAddress("L1_ZeroBias",&L1_MB_1);
//jetpbpb1->SetBranchAddress("L1_ZeroBias_Prescl",&L1_MB_p_1);
jetpbpb1->SetBranchAddress("HLT_HIJet55_v1",&jet55_1);
jetpbpb1->SetBranchAddress("HLT_HIJet55_v1_Prescl",&jet55_p_1);
jetpbpb1->SetBranchAddress("HLT_HIJet65_v1",&jet65_1);
jetpbpb1->SetBranchAddress("HLT_HIJet65_v1_Prescl",&jet65_p_1);
jetpbpb1->SetBranchAddress("HLT_HIJet80_v1",&jet80_1);
jetpbpb1->SetBranchAddress("HLT_HIJet80_v1_Prescl",&jet80_p_1);
jetpbpb1->SetBranchAddress("id",&trgObj_id_1);
jetpbpb1->SetBranchAddress("pt",&trgObj_pt_1);
jetpbpb1->SetBranchAddress("eta",&trgObj_eta_1);
jetpbpb1->SetBranchAddress("phi",&trgObj_phi_1);
jetpbpb1->SetBranchAddress("mass",&trgObj_mass_1);
//set the branch addresses: - one of the most boring parts of the code:
jetpbpb2->SetBranchAddress("evt",&evt_2);
jetpbpb2->SetBranchAddress("run",&run_2);
jetpbpb2->SetBranchAddress("lumi",&lumi_2);
jetpbpb2->SetBranchAddress("hiBin",&hiBin_2);
jetpbpb2->SetBranchAddress("vz",&vz_2);
jetpbpb2->SetBranchAddress("vx",&vx_2);
jetpbpb2->SetBranchAddress("vy",&vy_2);
jetpbpb2->SetBranchAddress("hiNtracks",&hiNtracks_2);
jetpbpb2->SetBranchAddress("hiHFminus",&hiHFminus_2);
jetpbpb2->SetBranchAddress("hiHFplus",&hiHFplus_2);
jetpbpb2->SetBranchAddress("hiHFplusEta4",&hiHFplusEta4_2);