forked from cms-hcal-trigger/Validation
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rates.cxx
3031 lines (2798 loc) · 199 KB
/
rates.cxx
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
// Script for calculating rate histograms
// Originally from Aaron Bundock
// Edited by Gillian Kopp for multiplicity studies for LLP L1 trigger using HCAL depth and timing (2020)
#include "TMath.h"
#include "TFile.h"
#include "TTree.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TCanvas.h"
#include "TProfile.h"
#include "TGraph.h"
#include "TH1.h"
#include "TH2.h"
#include "TChain.h"
#include <iostream>
#include <fstream>
#include <string>
#include "TLorentzVector.h"
#include "Math/LorentzVector.h"
#include "L1Trigger/L1TNtuples/interface/L1AnalysisEventDataFormat.h"
#include "L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeDataFormat.h"
#include "L1Trigger/L1TNtuples/interface/L1AnalysisRecoVertexDataFormat.h"
#include "L1Trigger/L1TNtuples/interface/L1AnalysisCaloTPDataFormat.h"
#include "L1Trigger/L1TNtuples/interface/L1AnalysisL1CaloTowerDataFormat.h"
#include "L1Trigger/L1TNtuples/interface/L1AnalysisGeneratorDataFormat.h"
typedef ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > LorentzVector;
/* TODO: put errors in rates...
creates the the rates and distributions for l1 trigger objects
How to use:
1. input the number of bunches in the run (~line 35)
2. change the variables "newConditionsNtuples" and "oldConditionsNtuples" to ntuple paths
3. If good run JSON is not applied during ntuple production, modify isGoodLumiSection()
Optionally, if you want to rescale to a given instantaneous luminosity:
1. input the instantaneous luminosity of the run (~line 32) [only if we scale to 2016 nominal]
2. select whether you rescale to L=1.5e34 (~line606??...) generally have it setup to rescale
nb: for 2&3 I have provided the info in runInfoForRates.txt
*/
// configurable parameters
double numBunch = 2556; //1537; //the number of bunches colliding for the run of interest -- comparing rates to Run II conditions, so use the number of bunches at end of Run II
double runLum = 0.02; // 0.44: 275783 0.58: 276363 //luminosity of the run of interest (*10^34)
double expectedLum = 1.15; //expected luminosity of 2016 runs (*10^34)
void rates(bool newConditions, const std::string& inputFileDirectory);
int main(int argc, char *argv[])
{
bool newConditions = true;
std::string ntuplePath("");
if (argc != 3) {
std::cout << "Usage: rates.exe [new/def] [path to ntuples]\n"
<< "[new/def] indicates new or default (existing) conditions" << std::endl;
exit(1);
}
else {
std::string par1(argv[1]);
std::transform(par1.begin(), par1.end(), par1.begin(), ::tolower);
if(par1.compare("new") == 0) newConditions = true;
else if(par1.compare("def") == 0) newConditions = false;
else {
std::cout << "First parameter must be \"new\" or \"def\"" << std::endl;
exit(1);
}
ntuplePath = argv[2];
}
rates(newConditions, ntuplePath);
return 0;
}
// only need to edit this section if good run JSON
// is not used during ntuple production
bool isGoodLumiSection(int lumiBlock)
{
if (lumiBlock >= 1
|| lumiBlock <= 10000) {
return true;
}
return false;
}
// functions to calculate eta from ieta, phi from iphi, delta eta, delta phi, and deltaR. Code from https://github.com/gk199/cms-hcal-debug/blob/PulseShape/plugins/HcalCompareUpgradeChains.cc#L894-L954
double deltaPhi(double phi1, double phi2) {
double result = phi1 - phi2;
if(fabs(result) > 9999) return result;
while (result > TMath::Pi()) result -= 2*TMath::Pi();
while (result <= -TMath::Pi()) result += 2*TMath::Pi();
return result;
}
double deltaR(double eta1, double phi1, double eta2, double phi2) {
double deta = eta1 - eta2;
double dphi = deltaPhi(phi1, phi2);
return sqrt(deta*deta + dphi*dphi);
}
double etaVal(int ieta) { // calculate eta given ieta
double etavl;
if (ieta <= -24){
etavl = .1695*ieta + 1.9931;
}
else if (ieta <= -1){
etavl = .0875*ieta + .0489;
}
else if (ieta < 24){
etavl = .0875*ieta - .0489;
}
else {
etavl = .1695*ieta - 1.9931;
}
return etavl;
}
double phiVal(int iphi) { // calculate phi given iphi
double phiBins=72.;
double phivl;
phivl=double(iphi)*(2.*TMath::Pi()/phiBins);
if (iphi > 36) phivl -= 2.*TMath::Pi();
return phivl;
}
// sorting Lorentz vector
struct ptsort: public std::binary_function<LorentzVector, LorentzVector, bool>
{
bool operator () (const LorentzVector & x, const LorentzVector & y)
{ return ( x.pt() > y.pt() ) ; }
};
// this is a correction function for the eta phi value of the intersection of a particle not resulting from the IP
// used since the b quark is matched to the TP based on eta phi, but the b quark results from a LLP decay so has a different vertex
// from HcalCompareUpgradeChains intersect function https://github.com/gk199/cms-hcal-debug/blob/PulseShape/plugins/HcalCompareUpgradeChains.cc#L961
std::vector<double> intersect(double vx, double vy,double vz, double px, double py, double pz) {
double lightSpeed = 29979245800;
double radius = 179; // 130 for calorimeters (ECAL + HCAL)
double length = 388; // 300 for calorimeters (ECAL + HCAL)
double energy = sqrt(px*px + py*py + pz*pz);
// First work out intersection with cylinder (barrel)
double a = (px*px + py*py)*lightSpeed*lightSpeed/(energy*energy);
double b = 2*(vx*px + vy*py)*lightSpeed/energy;
double c = (vx*vx + vy*vy) - radius*radius;
double sqrt_disc = sqrt(b*b - 4*a*c);
double tCircle1 = (-b + sqrt_disc)/(2*a);
double tCircle2 = (-b - sqrt_disc)/(2*a);
// If intersection in the past it doesn't count
if (tCircle1 < 0) tCircle1 = 1E9;
if (tCircle2 < 0) tCircle2 = 1E9;
// If the intsersection occurs outside the barrel length it doesn't count
double zPosCircle1 = tCircle1*(pz/energy)*lightSpeed + vz;
double zPosCircle2 = tCircle2*(pz/energy)*lightSpeed + vz;
if (zPosCircle1 > length) tCircle1 = 1E9;
if (zPosCircle2 > length) tCircle2 = 1E9;
// Now work out if it intersects the endcap
double tPlane1 = (length-vz)*energy/(pz*lightSpeed);
double tPlane2 = (-length-vz)*energy/(pz*lightSpeed);
// If intersection in the past it doesn't count
if (tPlane1 < 0) tPlane1 = 1E9;
if (tPlane2 < 0) tPlane2 = 1E9;
double xPosPlane1 = tPlane1*(px/energy)*lightSpeed + vx;
double yPosPlane1 = tPlane1*(py/energy)*lightSpeed + vy;
double xPosPlane2 = tPlane2*(px/energy)*lightSpeed + vx;
double yPosPlane2 = tPlane2*(py/energy)*lightSpeed + vy;
// If the intsersection occurs outside the endcap radius it doesn't count
if (sqrt(xPosPlane1*xPosPlane1 + yPosPlane1*yPosPlane1) > radius) tPlane1 = 1E9;
if (sqrt(xPosPlane2*xPosPlane2+yPosPlane2*yPosPlane2) > radius) tPlane2 = 1E9;
// Find the first intersection
double tInter = std::min({tCircle1,tCircle2,tPlane1,tPlane2});
// Return 1000,1000 if not intersection with barrel or endcap
std::vector<double> etaphi;
if (tInter > 1E6)
{
etaphi.push_back(1000);
etaphi.push_back(1000);
return etaphi;
}
// Find position of intersection
double xPos = tInter*(px/energy)*lightSpeed + vx;
double yPos = tInter*(py/energy)*lightSpeed + vy;
double zPos = tInter*(pz/energy)*lightSpeed + vz;
// Find eta/phi of intersection
double phi = atan2(yPos,xPos); // return the arc tan in radians
double theta = acos(zPos/sqrt(xPos*xPos + yPos*yPos + zPos*zPos));
double eta = -log(tan(theta/2.));
etaphi.push_back(eta);
etaphi.push_back(phi);
return etaphi;
}
void rates(bool newConditions, const std::string& inputFileDirectory){
bool hwOn = true; //are we using data from hardware? (upgrade trigger had to be running!!!)
bool emuOn = true; //are we using data from emulator?
if (hwOn==false && emuOn==false)
{
std::cout << "exiting as neither hardware or emulator selected" << std::endl;
return;
}
std::string inputFile(inputFileDirectory);
inputFile += "/L1Ntuple_*.root";
std::string outputDirectory = "emu"; //***runNumber, triggerType, version, hw/emu/both***MAKE SURE IT EXISTS
std::string outputFilename = "rates_def.root";
if(newConditions) outputFilename = "rates_new_cond.root";
TFile* kk = TFile::Open( outputFilename.c_str() , "recreate");
// make trees
std::cout << "Loading up the TChain..." << std::endl;
TChain * treeL1emu = new TChain("l1UpgradeEmuTree/L1UpgradeTree");
if (emuOn){
treeL1emu->Add(inputFile.c_str());
}
TChain * treeL1hw = new TChain("l1UpgradeTree/L1UpgradeTree");
if (hwOn){
treeL1hw->Add(inputFile.c_str());
}
TChain * treeL1Towemu = new TChain("l1CaloTowerEmuTree/L1CaloTowerTree");
if (emuOn){
treeL1Towemu->Add(inputFile.c_str());
}
TChain * treeL1CaloTPemu = new TChain("l1CaloTowerEmuTree/L1CaloTowerTree");
if (emuOn){
treeL1CaloTPemu->Add(inputFile.c_str());
}
TChain * treeL1CaloTPhw = new TChain("l1CaloTowerTree/L1CaloTowerTree");
if (hwOn){
treeL1CaloTPhw->Add(inputFile.c_str());
}
TChain * eventTree = new TChain("l1EventTree/L1EventTree");
eventTree->Add(inputFile.c_str());
TChain * genTree = new TChain("l1GeneratorTree/L1GenTree");
genTree->Add(inputFile.c_str());
// In case you want to include PU info
// TChain * vtxTree = new TChain("l1RecoTree/RecoTree");
// if(binByPileUp){
// vtxTree->Add(inputFile.c_str());
// }
L1Analysis::L1AnalysisL1UpgradeDataFormat *l1emu_ = new L1Analysis::L1AnalysisL1UpgradeDataFormat();
treeL1emu->SetBranchAddress("L1Upgrade", &l1emu_);
L1Analysis::L1AnalysisL1UpgradeDataFormat *l1hw_ = new L1Analysis::L1AnalysisL1UpgradeDataFormat();
treeL1hw->SetBranchAddress("L1Upgrade", &l1hw_);
L1Analysis::L1AnalysisL1CaloTowerDataFormat *l1Towemu_ = new L1Analysis::L1AnalysisL1CaloTowerDataFormat();
treeL1Towemu->SetBranchAddress("L1CaloTower", &l1Towemu_);
L1Analysis::L1AnalysisCaloTPDataFormat *l1CaloTPemu_ = new L1Analysis::L1AnalysisCaloTPDataFormat();
treeL1CaloTPemu->SetBranchAddress("CaloTP", &l1CaloTPemu_);
L1Analysis::L1AnalysisEventDataFormat *event_ = new L1Analysis::L1AnalysisEventDataFormat();
eventTree->SetBranchAddress("Event", &event_);
L1Analysis::L1AnalysisCaloTPDataFormat *l1CaloTPhw_ = new L1Analysis::L1AnalysisCaloTPDataFormat();
treeL1CaloTPhw->SetBranchAddress("CaloTP", &l1CaloTPhw_);
L1Analysis::L1AnalysisGeneratorDataFormat *generator_ = new L1Analysis::L1AnalysisGeneratorDataFormat();
genTree->SetBranchAddress("Generator", &generator_);
// L1Analysis::L1AnalysisRecoVertexDataFormat *vtx_ = new L1Analysis::L1AnalysisRecoVertexDataFormat();
// vtxTree->SetBranchAddress("Vertex", &vtx_);
// get number of entries
Long64_t nentries;
if (emuOn) nentries = treeL1emu->GetEntries();
else nentries = treeL1hw->GetEntries();
int goodLumiEventCount = 0;
std::string outputTxtFilename = "output_rates/" + outputDirectory + "/extraInfo.txt";
std::ofstream myfile; // save info about the run, including rates for a given lumi section, and number of events we used.
myfile.open(outputTxtFilename.c_str());
eventTree->GetEntry(0);
myfile << "run number = " << event_->run << std::endl;
std::ofstream EffRate_file;
EffRate_file.open("Eff_Rates.txt", std::ios_base::app); // append instead of overwrite
// set parameters for histograms
// jet bins
int nJetBins = 400;
float jetLo = 0.;
float jetHi = 400.;
float jetBinWidth = (jetHi-jetLo)/nJetBins;
// EG bins
int nEgBins = 300;
float egLo = 0.;
float egHi = 300.;
float egBinWidth = (egHi-egLo)/nEgBins;
// tau bins
int nTauBins = 300;
float tauLo = 0.;
float tauHi = 300.;
float tauBinWidth = (tauHi-tauLo)/nTauBins;
// htSum bins
int nHtSumBins = 1200; // 600
float htSumLo = 0.;
float htSumHi = 1200.;
float htSumBinWidth = (htSumHi-htSumLo)/nHtSumBins;
// mhtSum bins
int nMhtSumBins = 300;
float mhtSumLo = 0.;
float mhtSumHi = 300.;
float mhtSumBinWidth = (mhtSumHi-mhtSumLo)/nMhtSumBins;
// etSum bins
int nEtSumBins = 1200; // 600
float etSumLo = 0.;
float etSumHi = 1200.;
float etSumBinWidth = (etSumHi-etSumLo)/nEtSumBins;
// metSum bins
int nMetSumBins = 300;
float metSumLo = 0.;
float metSumHi = 300.;
float metSumBinWidth = (metSumHi-metSumLo)/nMetSumBins;
// metHFSum bins
int nMetHFSumBins = 300;
float metHFSumLo = 0.;
float metHFSumHi = 300.;
float metHFSumBinWidth = (metHFSumHi-metHFSumLo)/nMetHFSumBins;
// tp bins
int nTpBins = 130;
float tpLo = 0.;
float tpHi = 130.;
std::string axR = ";Threshold E_{T} (GeV);rate (Hz, unnormalized)";
std::string axD = ";E_{T} (GeV);events/bin";
std::string mult = ";Hit Multiplicity;Fraction of Entries (normalized)";
//make histos
TH1F* singleJetRates_emu = new TH1F("singleJetRates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* doubleJetRates_emu = new TH1F("doubleJetRates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* tripleJetRates_emu = new TH1F("tripleJetRates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJetRates_emu = new TH1F("quadJetRates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleJet_th1_Rates_emu = new TH1F("singleJet_th1_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleJet_th2_Rates_emu = new TH1F("singleJet_th2_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleJet_th3_Rates_emu = new TH1F("singleJet_th3_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleJet_th4_Rates_emu = new TH1F("singleJet_th4_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleJet_th5_Rates_emu = new TH1F("singleJet_th5_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleJet_th6_Rates_emu = new TH1F("singleJet_th6_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleJet_th7_Rates_emu = new TH1F("singleJet_th7_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJet_th1_Rates_emu = new TH1F("quadJet_th1_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJet_th2_Rates_emu = new TH1F("quadJet_th2_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJet_th3_Rates_emu = new TH1F("quadJet_th3_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJet_th4_Rates_emu = new TH1F("quadJet_th4_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJet_th5_Rates_emu = new TH1F("quadJet_th5_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJet_th6_Rates_emu = new TH1F("quadJet_th6_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJet_th7_Rates_emu = new TH1F("quadJet_th7_Rates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* htSum_th1_Rates_emu = new TH1F("htSum_th1_Rates_emu",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* htSum_th2_Rates_emu = new TH1F("htSum_th2_Rates_emu",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* htSum_th3_Rates_emu = new TH1F("htSum_th3_Rates_emu",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* htSum_th4_Rates_emu = new TH1F("htSum_th4_Rates_emu",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* htSum_th5_Rates_emu = new TH1F("htSum_th5_Rates_emu",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* htSum_th6_Rates_emu = new TH1F("htSum_th6_Rates_emu",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* htSum_th7_Rates_emu = new TH1F("htSum_th7_Rates_emu",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
// for mult and frac around one jet
std::map<int, TH1F*> htSum_timing_1GeV_Rates_emu, htSum_timing_2GeV_Rates_emu, htSum_timing_3GeV_Rates_emu, htSum_timing_4GeV_Rates_emu;
for (int TDCns=0; TDCns < 8; TDCns++) {
htSum_timing_1GeV_Rates_emu[TDCns] = new TH1F(Form("htSum_timing_1GeV%dns_Rates_emu",TDCns),axR.c_str(), nHtSumBins, htSumLo, htSumHi);
htSum_timing_2GeV_Rates_emu[TDCns] = new TH1F(Form("htSum_timing_2GeV%dns_Rates_emu",TDCns),axR.c_str(), nHtSumBins, htSumLo, htSumHi);
htSum_timing_3GeV_Rates_emu[TDCns] = new TH1F(Form("htSum_timing_3GeV%dns_Rates_emu",TDCns),axR.c_str(), nHtSumBins, htSumLo, htSumHi);
htSum_timing_4GeV_Rates_emu[TDCns] = new TH1F(Form("htSum_timing_4GeV%dns_Rates_emu",TDCns),axR.c_str(), nHtSumBins, htSumLo, htSumHi);
}
TH1F* singleJetGlobalRates_emu = new TH1F("singleJetGlobalRates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* doubleJetGlobalRates_emu = new TH1F("doubleJetGlobalRates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* tripleJetGlobalRates_emu = new TH1F("tripleJetGlobalRates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJetGlobalRates_emu = new TH1F("quadJetGlobalRates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleJetOriginalRates_emu = new TH1F("singleJetOriginalRates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJetOriginalRates_emu = new TH1F("quadJetOriginalRates_emu", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleEgRates_emu = new TH1F("singleEgRates_emu", axR.c_str(), nEgBins, egLo, egHi);
TH1F* doubleEgRates_emu = new TH1F("doubleEgRates_emu", axR.c_str(), nEgBins, egLo, egHi);
TH1F* singleTauRates_emu = new TH1F("singleTauRates_emu", axR.c_str(), nTauBins, tauLo, tauHi);
TH1F* doubleTauRates_emu = new TH1F("doubleTauRates_emu", axR.c_str(), nTauBins, tauLo, tauHi);
TH1F* singleISOEgRates_emu = new TH1F("singleISOEgRates_emu", axR.c_str(), nEgBins, egLo, egHi);
TH1F* doubleISOEgRates_emu = new TH1F("doubleISOEgRates_emu", axR.c_str(), nEgBins, egLo, egHi);
TH1F* singleISOTauRates_emu = new TH1F("singleISOTauRates_emu", axR.c_str(), nTauBins, tauLo, tauHi);
TH1F* doubleISOTauRates_emu = new TH1F("doubleISOTauRates_emu", axR.c_str(), nTauBins, tauLo, tauHi);
TH1F* htSum1jetRates_emu = new TH1F("htSum1jetRates_emu",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* htSum4jetRates_emu = new TH1F("htSum4jetRates_emu",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* htSumGlobalRates_emu = new TH1F("htSumGlobalRates_emu",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* htSumOriginalRates_emu = new TH1F("htSumOriginalRates_emu",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* mhtSumRates_emu = new TH1F("mhtSumRates_emu",axR.c_str(), nMhtSumBins, mhtSumLo, mhtSumHi);
TH1F* etSumRates_emu = new TH1F("etSumRates_emu",axR.c_str(), nEtSumBins, etSumLo, etSumHi);
TH1F* etSumGlobalRates_emu = new TH1F("etSumGlobalRates_emu",axR.c_str(), nEtSumBins, etSumLo, etSumHi);
TH1F* metSumRates_emu = new TH1F("metSumRates_emu",axR.c_str(), nMetSumBins, metSumLo, metSumHi);
TH1F* metHFSumRates_emu = new TH1F("metHFSumRates_emu",axR.c_str(), nMetHFSumBins, metHFSumLo, metHFSumHi);
TH1F* singleJetRates_hw = new TH1F("singleJetRates_hw", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* doubleJetRates_hw = new TH1F("doubleJetRates_hw", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* tripleJetRates_hw = new TH1F("tripleJetRates_hw", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJetRates_hw = new TH1F("quadJetRates_hw", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleJetGlobalRates_hw = new TH1F("singleJetGlobalRates_hw", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* doubleJetGlobalRates_hw = new TH1F("doubleJetGlobalRates_hw", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* tripleJetGlobalRates_hw = new TH1F("tripleJetGlobalRates_hw", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJetGlobalRates_hw = new TH1F("quadJetGlobalRates_hw", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleJetOriginalRates_hw = new TH1F("singleJetOriginalRates_hw", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* quadJetOriginalRates_hw = new TH1F("quadJetOriginalRates_hw", axR.c_str(), nJetBins, jetLo, jetHi);
TH1F* singleEgRates_hw = new TH1F("singleEgRates_hw", axR.c_str(), nEgBins, egLo, egHi);
TH1F* doubleEgRates_hw = new TH1F("doubleEgRates_hw", axR.c_str(), nEgBins, egLo, egHi);
TH1F* singleTauRates_hw = new TH1F("singleTauRates_hw", axR.c_str(), nTauBins, tauLo, tauHi);
TH1F* doubleTauRates_hw = new TH1F("doubleTauRates_hw", axR.c_str(), nTauBins, tauLo, tauHi);
TH1F* singleISOEgRates_hw = new TH1F("singleISOEgRates_hw", axR.c_str(), nEgBins, egLo, egHi);
TH1F* doubleISOEgRates_hw = new TH1F("doubleISOEgRates_hw", axR.c_str(), nEgBins, egLo, egHi);
TH1F* singleISOTauRates_hw = new TH1F("singleISOTauRates_hw", axR.c_str(), nTauBins, tauLo, tauHi);
TH1F* doubleISOTauRates_hw = new TH1F("doubleISOTauRates_hw", axR.c_str(), nTauBins, tauLo, tauHi);
TH1F* htSum1jetRates_hw = new TH1F("htSum1jetRates_hw",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* htSum4jetRates_hw = new TH1F("htSum4jetRates_hw",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* htSumGlobalRates_hw = new TH1F("htSumGlobalRates_hw",axR.c_str(), nHtSumBins, htSumLo, htSumHi);
TH1F* mhtSumRates_hw = new TH1F("mhtSumRates_hw",axR.c_str(), nMhtSumBins, mhtSumLo, mhtSumHi);
TH1F* etSumRates_hw = new TH1F("etSumRates_hw",axR.c_str(), nEtSumBins, etSumLo, etSumHi);
TH1F* etSumGlobalRates_hw = new TH1F("etSumGlobalRates_hw",axR.c_str(), nEtSumBins, etSumLo, etSumHi);
TH1F* metSumRates_hw = new TH1F("metSumRates_hw",axR.c_str(), nMetHFSumBins, metHFSumLo, metHFSumHi);
TH1F* metHFSumRates_hw = new TH1F("metHFSumRates_hw",axR.c_str(), nMetHFSumBins, metHFSumLo, metHFSumHi);
TH1F* hcalTP_emu = new TH1F("hcalTP_emu", "HCAL TP ET;TP E_{T}; # Entries", nTpBins, tpLo, tpHi);
TH1F* ecalTP_emu = new TH1F("ecalTP_emu", "ECAL TP ET;TP E_{T}; # Entries", nTpBins, tpLo, tpHi);
TH1F* hcalTP_hw = new TH1F("hcalTP_hw", ";TP E_{T}; # Entries", nTpBins, tpLo, tpHi);
TH1F* ecalTP_hw = new TH1F("ecalTP_hw", ";TP E_{T}; # Entries", nTpBins, tpLo, tpHi);
TH1D * hJetEt = new TH1D("jetET","L1 Jet ET;E_{T};# Entries",100,0,1000);
TH1D * hJetEt_1 = new TH1D("jetET_1","1st L1 Jet ET;E_{T};# Entries",100,0,1000);
TH1D * hJetEt_2 = new TH1D("jetET_2","2nd L1 Jet ET;E_{T};# Entries",100,0,1000);
TH1D * hJetEt_3 = new TH1D("jetET_3","3rd L1 Jet ET;E_{T};# Entries",100,0,1000);
TH1D * hJetEt_4 = new TH1D("jetET_4","4th L1 Jet ET;E_{T};# Entries",100,0,1000);
// Delayed hit fraction
std::map<int, TH1F*> DelayedHitFraction1GeV, DelayedHitFraction2GeV, DelayedHitFraction3GeV, DelayedHitFraction4GeV;
for (int TDCns=0; TDCns < 21; TDCns++) {
// 1D histograms plotting the fraction of hits over energy and scanned time threshold
DelayedHitFraction1GeV[TDCns] = new TH1F(Form("DelayedHitFraction1GeV%dns",TDCns),Form("Fraction of Hits that are > 1GeV and also > %dns;Fraction of Hits;Number of Events",TDCns),22,0,1.1);
DelayedHitFraction2GeV[TDCns] = new TH1F(Form("DelayedHitFraction2GeV%dns",TDCns),Form("Fraction of Hits that are > 2GeV and also > %dns;Fraction of Hits;Number of Events",TDCns),22,0,1.1);
DelayedHitFraction3GeV[TDCns] = new TH1F(Form("DelayedHitFraction3GeV%dns",TDCns),Form("Fraction of Hits that are > 3GeV and also > %dns;Fraction of Hits;Number of Events",TDCns),22,0,1.1);
DelayedHitFraction4GeV[TDCns] = new TH1F(Form("DelayedHitFraction4GeV%dns",TDCns),Form("Fraction of Hits that are > 4GeV and also > %dns;Fraction of Hits;Number of Events",TDCns),22,0,1.1);
}
// 2D histograms plotting the fraction of hits over energy and scanned time threshold
TH2F * DelayedHit2D_Fraction1GeV = new TH2F("DelayedHit2D_Fraction1GeV","Fraction of Delayed Hits vs. Delayed Timing Threshold above 1GeV;Delayed Timing Threshold;Fraction of Delayed Hits",30,0,30,50,0,1);
TH2F * DelayedHit2D_Fraction2GeV = new TH2F("DelayedHit2D_Fraction2GeV","Fraction of Delayed Hits vs. Delayed Timing Threshold above 2GeV;Delayed Timing Threshold;Fraction of Delayed Hits",30,0,30,50,0,1);
TH2F * DelayedHit2D_Fraction3GeV = new TH2F("DelayedHit2D_Fraction3GeV","Fraction of Delayed Hits vs. Delayed Timing Threshold above 3GeV;Delayed Timing Threshold;Fraction of Delayed Hits",30,0,30,50,0,1);
TH2F * DelayedHit2D_Fraction4GeV = new TH2F("DelayedHit2D_Fraction4GeV","Fraction of Delayed Hits vs. Delayed Timing Threshold above 4GeV;Delayed Timing Threshold;Fraction of Delayed Hits",30,0,30,50,0,1);
// 2D histograms plotting the number of hits over energy and time threshold
TH2F * DelayedHit2D_Number1GeV = new TH2F("DelayedHit2D_Number1GeV","Number of Delayed Hits vs. Delayed Timing Threshold above 1GeV;Delayed Timing Threshold;Number of Delayed Hits",30,0,30,50,0,50);
TH2F * DelayedHit2D_Number2GeV = new TH2F("DelayedHit2D_Number2GeV","Number of Delayed Hits vs. Delayed Timing Threshold above 2GeV;Delayed Timing Threshold;Number of Delayed Hits",30,0,30,50,0,50);
TH2F * DelayedHit2D_Number3GeV = new TH2F("DelayedHit2D_Number3GeV","Number of Delayed Hits vs. Delayed Timing Threshold above 3GeV;Delayed Timing Threshold;Number of Delayed Hits",30,0,30,50,0,50);
TH2F * DelayedHit2D_Number4GeV = new TH2F("DelayedHit2D_Number4GeV","Number of Delayed Hits vs. Delayed Timing Threshold above 4GeV;Delayed Timing Threshold;Number of Delayed Hits",30,0,30,50,0,50);
// Number of TPs above energy threshold as a function of timing values
// TH2F * NumberTPtiming_3GeV = new TH2F("NumberTPtiming_3GeV","Number of TPs Above 3GeV vs. TDC Values;TDC Value;Number of TPs",20,0,20,100,0,100);
std::map<int, TH1F*> NumberTPtiming, NumberTPavgtiming_jet1, NumberTPavgtiming_jet2, NumberTPavgtiming_jet3, NumberTPavgtiming_jet4, NumberTPavgtiming_jetMax, NumberTPtotalhits_jet1, NumberTPtotalhits_jet2, NumberTPtotalhits_jet3, NumberTPtotalhits_jet4, NumberTPtiming_depth1, NumberTPtiming_depth2, NumberTPtiming_depth3, NumberTPtiming_depth4;
for (int GeV=0; GeV<6; GeV++) {
NumberTPtiming[GeV] = new TH1F(Form("NumberTPtiming_%dGeV",GeV),Form("Number of Cells Above %dGeV vs. Timing Value;Timing (ns);Number of Cells",GeV),25,0,25);
NumberTPavgtiming_jet1[GeV] = new TH1F(Form("NumberTPavgtiming_jet1_%dGeV",GeV),Form("Number of Events Above %dGeV vs. Average Timing Value;Average Timing (ns);Number of Events",GeV),25,0,25);
NumberTPavgtiming_jet2[GeV] = new TH1F(Form("NumberTPavgtiming_jet2_%dGeV",GeV),Form("Number of Events Above %dGeV vs. Average Timing Value;Average Timing (ns);Number of Events",GeV),25,0,25);
NumberTPavgtiming_jet3[GeV] = new TH1F(Form("NumberTPavgtiming_jet3_%dGeV",GeV),Form("Number of Events Above %dGeV vs. Average Timing Value;Average Timing (ns);Number of Events",GeV),25,0,25);
NumberTPavgtiming_jet4[GeV] = new TH1F(Form("NumberTPavgtiming_jet4_%dGeV",GeV),Form("Number of Events Above %dGeV vs. Average Timing Value;Average Timing (ns);Number of Events",GeV),25,0,25);
NumberTPavgtiming_jetMax[GeV] = new TH1F(Form("NumberTPavgtiming_jetMax_%dGeV",GeV),Form("Number of Events Above %dGeV vs. Average Timing Value;Average Timing (ns);Number of Events",GeV),25,0,25);
NumberTPtotalhits_jet1[GeV] = new TH1F(Form("NumberTPtotalhits_jet1_%dGeV",GeV),Form("Number of Events Above %dGeV vs. Average Timing Value;Number hits;Number of Events",GeV),25,0,25);
NumberTPtotalhits_jet2[GeV] = new TH1F(Form("NumberTPtotalhits_jet2_%dGeV",GeV),Form("Number of Events Above %dGeV vs. Average Timing Value;Number hits;Number of Events",GeV),25,0,25);
NumberTPtotalhits_jet3[GeV] = new TH1F(Form("NumberTPtotalhits_jet3_%dGeV",GeV),Form("Number of Events Above %dGeV vs. Average Timing Value;Number hits;Number of Events",GeV),25,0,25);
NumberTPtotalhits_jet4[GeV] = new TH1F(Form("NumberTPtotalhits_jet4_%dGeV",GeV),Form("Number of Events Above %dGeV vs. Average Timing Value;Number hits;Number of Events",GeV),25,0,25);
NumberTPtiming_depth1[GeV] = new TH1F(Form("NumberTPtiming_%dGeV_depth1",GeV),Form("Number of Cells Above %dGeV vs. Timing Value;Timing (ns);Number of Cells",GeV),25,0,25);
NumberTPtiming_depth2[GeV] = new TH1F(Form("NumberTPtiming_%dGeV_depth2",GeV),Form("Number of Cells Above %dGeV vs. Timing Value;Timing (ns);Number of Cells",GeV),25,0,25);
NumberTPtiming_depth3[GeV] = new TH1F(Form("NumberTPtiming_%dGeV_depth3",GeV),Form("Number of Cells Above %dGeV vs. Timing Value;Timing (ns);Number of Cells",GeV),25,0,25);
NumberTPtiming_depth4[GeV] = new TH1F(Form("NumberTPtiming_%dGeV_depth4",GeV),Form("Number of Cells Above %dGeV vs. Timing Value;Timing (ns);Number of Cells",GeV),25,0,25);
}
TH2F * NumberTPtiming_energy = new TH2F("NumberTPtiming_energy","Number of Cells vs. Energy vs. Timing Value;Timing (ns);Cell Energy Value",30,0,30,45,0,45);
TH2F * NumberEvents_Fraction_Mult = new TH2F("NumberEvents_Fraction_Mult","Number of Events vs. Delayed Fraction vs. Delayed Hit Count;Delayed Fraction;Number of Delayed Hits",50,0,1,40,0,40);
// Fraction of TPs above energy threshold as a function of timing values
// TH2F * FractionTPtiming_3GeV = new TH2F("FractionTPtiming_3GeV","Fraction of TPs Above 3GeV vs. TDC Values;TDC Value;Fraction of TPs",20,0,20,20,0,20);
// 3 GeV energy cuts, scanning time cuts
// inclusive
std::map<int, TH1F*> dt3GeVMult_emu, dt3GeVHEMult_emu, dt3GeVHBMult_emu, dt2GeVMult_emu, dt2GeVHEMult_emu, dt2GeVHBMult_emu, dt1GeVMult_emu, dt1GeVHEMult_emu, dt1GeVHBMult_emu;
std::map<int, TH1F*> dt0GeVHBJetMult_emu, dt1GeVJetMult_emu, dt1GeVHEJetMult_emu, dt1GeVHBJetMult_emu, dt2GeVJetMult_emu, dt2GeVHEJetMult_emu, dt2GeVHBJetMult_emu, dt3GeVJetMult_emu, dt3GeVHEJetMult_emu, dt3GeVHBJetMult_emu;
for (int TDCns=1; TDCns <= 5; TDCns++) {
// inclusive, no L1 jet matching
// 1GeV
dt1GeVMult_emu[TDCns] = new TH1F(Form("dt1GeV%dnsMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 1 GeV (inclusive);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),400,0,400);
dt1GeVHEMult_emu[TDCns] = new TH1F(Form("dt1GeV%dnsHEMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 1 GeV (HE);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),400,0,400);
dt1GeVHBMult_emu[TDCns] = new TH1F(Form("dt1GeV%dnsHBMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 1 GeV (HB);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),400,0,400);
// 2GeV
dt2GeVMult_emu[TDCns] = new TH1F(Form("dt2GeV%dnsMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 2 GeV (inclusive);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),200,0,200);
dt2GeVHEMult_emu[TDCns] = new TH1F(Form("dt2GeV%dnsHEMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 2 GeV (HE);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),200,0,200);
dt2GeVHBMult_emu[TDCns] = new TH1F(Form("dt2GeV%dnsHBMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 2 GeV (HB);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),200,0,200);
// 3GeV
dt3GeVMult_emu[TDCns] = new TH1F(Form("dt3GeV%dnsMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 3 GeV (inclusive);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),120,0,120);
dt3GeVHEMult_emu[TDCns] = new TH1F(Form("dt3GeV%dnsHEMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 3 GeV (HE);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),120,0,120);
dt3GeVHBMult_emu[TDCns] = new TH1F(Form("dt3GeV%dnsHBMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 3 GeV (HB);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),120,0,120);
// for HCAL TP matched with L1 jet
// 0GeV
dt0GeVHBJetMult_emu[TDCns] = new TH1F(Form("dt0GeV%dnsHBJetMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 0 GeV (HB, match TP with L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),120,0,120); // HB
// 1GeV
dt1GeVJetMult_emu[TDCns] = new TH1F(Form("dt1GeV%dnsJetMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 1 GeV (inclusive, match TP with L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),400,0,400); // inclusive
dt1GeVHEJetMult_emu[TDCns] = new TH1F(Form("dt1GeV%dnsHEJetMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 1 GeV (HE, match TP with L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),400,0,400); // HE
dt1GeVHBJetMult_emu[TDCns] = new TH1F(Form("dt1GeV%dnsHBJetMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 1 GeV (HB, match TP with L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),400,0,400); // HB
// 2GeV
dt2GeVJetMult_emu[TDCns] = new TH1F(Form("dt2GeV%dnsJetMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 2 GeV (inclusive, match TP with L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),200,0,200); // inclusive
dt2GeVHEJetMult_emu[TDCns] = new TH1F(Form("dt2GeV%dnsHEJetMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 2 GeV (HE, match TP with L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),200,0,120); // HE
dt2GeVHBJetMult_emu[TDCns] = new TH1F(Form("dt2GeV%dnsHBJetMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 2 GeV (HB, match TP with L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),200,0,200); // HB
// 3GeV
dt3GeVJetMult_emu[TDCns] = new TH1F(Form("dt3GeV%dnsJetMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 3 GeV (inclusive, match TP with L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),120,0,120); // inclusive
dt3GeVHEJetMult_emu[TDCns] = new TH1F(Form("dt3GeV%dnsHEJetMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 3 GeV (HE, match TP with L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),120,0,120); // HE
dt3GeVHBJetMult_emu[TDCns] = new TH1F(Form("dt3GeV%dnsHBJetMult_emu",TDCns),Form("Multiplicity of %dns delayed cells above 3 GeV (HB, match TP with L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",TDCns),120,0,120); // HB
}
// include all HCAL TPs included in DR cone of a L1 jet
TH1F * dt3GeV3nsHBQuadJetMult_emu = new TH1F("dt3GeV3nsHBQuadJetMult_emu","Quad Jet Sum Multiplicity of 3ns delayed cells above 3 GeV (HB, dR(TP,L1Jet)<0.5);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV3nsHBTripleJetMult_emu = new TH1F("dt3GeV3nsHBTripleJetMult_emu","Triple Jet Sum Multiplicity of 3ns delayed cells above 3 GeV (HB, dR(TP,L1Jet)<0.5);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV3nsHBDoubleJetMult_emu = new TH1F("dt3GeV3nsHBDoubleJetMult_emu","Double Jet Sum Multiplicity of 3ns delayed cells above 3 GeV (HB, dR(TP,L1Jet)<0.5);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV3nsHBSingleJetMult_emu = new TH1F("dt3GeV3nsHBSingleJetMult_emu","Single Jet Sum Multiplicity of 3ns delayed cells above 3 GeV (HB, dR(TP,L1Jet)<0.5);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV3nsHBJet1Mult_emu = new TH1F("dt3GeV3nsHBJet1Mult_emu","Multiplicity of 3ns delayed cells above 3 GeV (HB, all TPs within DR<0.5 1st L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV3nsHBJet2Mult_emu = new TH1F("dt3GeV3nsHBJet2Mult_emu","Multiplicity of 3ns delayed cells above 3 GeV (HB, all TPs within DR<0.5 2nd L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV3nsHBJet3Mult_emu = new TH1F("dt3GeV3nsHBJet3Mult_emu","Multiplicity of 3ns delayed cells above 3 GeV (HB, all TPs within DR<0.5 3rd L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV3nsHBJet4Mult_emu = new TH1F("dt3GeV3nsHBJet4Mult_emu","Multiplicity of 3ns delayed cells above 3 GeV (HB, all TPs within DR<0.5 4th L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV2nsHBQuadJet_depth1_Mult_emu = new TH1F("dt3GeV2nsHBQuadJet_depth1_Mult_emu","Quad Jet Multiplicity of 2ns delayed cells above 3 GeV (HB, dR(TP,L1Jet)<0.5, depth 1);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV2nsHBQuadJet_depth2_Mult_emu = new TH1F("dt3GeV2nsHBQuadJet_depth2_Mult_emu","Quad Jet Multiplicity of 2ns delayed cells above 3 GeV (HB, dR(TP,L1Jet)<0.5, depth 2);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV2nsHBQuadJet_depth3_Mult_emu = new TH1F("dt3GeV2nsHBQuadJet_depth3_Mult_emu","Quad Jet Multiplicity of 2ns delayed cells above 3 GeV (HB, dR(TP,L1Jet)<0.5, depth 3);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV2nsHBQuadJet_depth4_Mult_emu = new TH1F("dt3GeV2nsHBQuadJet_depth4_Mult_emu","Quad Jet Multiplicity of 2ns delayed cells above 3 GeV (HB, dR(TP,L1Jet)<0.5, depth 4);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV2nsHBHEQuadJet_depth1_Mult_emu = new TH1F("dt3GeV2nsHBHEQuadJet_depth1_Mult_emu","Quad Jet Multiplicity of 2ns delayed cells above 3 GeV (HBHE, dR(TP,L1Jet)<0.5, depth 1);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV2nsHBHEQuadJet_depth2_Mult_emu = new TH1F("dt3GeV2nsHBHEQuadJet_depth2_Mult_emu","Quad Jet Multiplicity of 2ns delayed cells above 3 GeV (HBHE, dR(TP,L1Jet)<0.5, depth 2);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV2nsHBHEQuadJet_depth3_Mult_emu = new TH1F("dt3GeV2nsHBHEQuadJet_depth3_Mult_emu","Quad Jet Multiplicity of 2ns delayed cells above 3 GeV (HBHE, dR(TP,L1Jet)<0.5, depth 3);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt3GeV2nsHBHEQuadJet_depth4_Mult_emu = new TH1F("dt3GeV2nsHBHEQuadJet_depth4_Mult_emu","Quad Jet Multiplicity of 2ns delayed cells above 3 GeV (HBHE, dR(TP,L1Jet)<0.5, depth 4);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
// include all HCAL TPs included in DR cone of a L1 jet
TH1F * dt0GeV5nsHBQuadJetMult_emu = new TH1F("dt0GeV5nsHBQuadJetMult_emu","Quad Jet Sum Multiplicity of 5ns delayed cells above 0 GeV (HB, dR(TP,L1Jet)<0.5);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt0GeV5nsHBTripleJetMult_emu = new TH1F("dt0GeV5nsHBTripleJetMult_emu","Triple Jet Sum Multiplicity of 5ns delayed cells above 0 GeV (HB, dR(TP,L1Jet)<0.5);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt0GeV5nsHBDoubleJetMult_emu = new TH1F("dt0GeV5nsHBDoubleJetMult_emu","Double Jet Sum Multiplicity of 5ns delayed cells above 0 GeV (HB, dR(TP,L1Jet)<0.5);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt0GeV5nsHBSingleJetMult_emu = new TH1F("dt0GeV5nsHBSingleJetMult_emu","Single Jet Sum Multiplicity of 5ns delayed cells above 0 GeV (HB, dR(TP,L1Jet)<0.5);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt0GeV5nsHBJet1Mult_emu = new TH1F("dt0GeV5nsHBJet1Mult_emu","Multiplicity of 5ns delayed cells above 0 GeV (HB, all TPs within DR<2 1st L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt0GeV5nsHBJet2Mult_emu = new TH1F("dt0GeV5nsHBJet2Mult_emu","Multiplicity of 5ns delayed cells above 0 GeV (HB, all TPs within DR<2 2nd L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt0GeV5nsHBJet3Mult_emu = new TH1F("dt0GeV5nsHBJet3Mult_emu","Multiplicity of 5ns delayed cells above 0 GeV (HB, all TPs within DR<2 3rd L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * dt0GeV5nsHBJet4Mult_emu = new TH1F("dt0GeV5nsHBJet4Mult_emu","Multiplicity of 5ns delayed cells above 0 GeV (HB, all TPs within DR<2 4th L1Jet);Hit Multiplicity;Fraction of Entries (normalized)",120,0,120);
TH1F * DepthVariable = new TH1F("DepthVariable","Depth 4 / Depth 1;Hit Multiplicity; Fraction of Entries (normalized)",50,0,50);
// HB by ieta regions to scan energy cuts. These are in barrel region, considering caloTowers of 4x4 in ieta, iphi, and using all same ieta values, with 2pi of iphi (4 total regions)
TH1F * dt1GeVcaloT1Mult_emu = new TH1F("dt1GeVcaloT1Mult_emu","Multiplicity of cells above 1 GeV, CaloTower 1 (iEta 1-4);Hit Multiplicity;Number of Entries",120,0,120);
TH1F * dt1GeVcaloT2Mult_emu = new TH1F("dt1GeVcaloT2Mult_emu","Multiplicity of cells above 1 GeV, CaloTower 2 (iEta 5-8);Hit Multiplicity;Number of Entries",120,0,120);
TH1F * dt1GeVcaloT3Mult_emu = new TH1F("dt1GeVcaloT3Mult_emu","Multiplicity of cells above 1 GeV, CaloTower 3 (iEta 9-12);Hit Multiplicity;Number of Entries",120,0,120);
TH1F * dt1GeVcaloT4Mult_emu = new TH1F("dt1GeVcaloT4Mult_emu","Multiplicity of cells above 1 GeV, CaloTower 4 (iEta 13-16);Hit Multiplicity;Number of Entries",120,0,120);
TH1F * dt2GeVcaloT1Mult_emu = new TH1F("dt2GeVcaloT1Mult_emu","Multiplicity of cells above 2 GeV, CaloTower 1 (iEta 1-4);Hit Multiplicity;Number of Entries",120,0,120);
TH1F * dt2GeVcaloT2Mult_emu = new TH1F("dt2GeVcaloT2Mult_emu","Multiplicity of cells above 2 GeV, CaloTower 2 (iEta 5-8);Hit Multiplicity;Number of Entries",120,0,120);
TH1F * dt2GeVcaloT3Mult_emu = new TH1F("dt2GeVcaloT3Mult_emu","Multiplicity of cells above 2 GeV, CaloTower 3 (iEta 9-12);Hit Multiplicity;Number of Entries",120,0,120);
TH1F * dt2GeVcaloT4Mult_emu = new TH1F("dt2GeVcaloT4Mult_emu","Multiplicity of cells above 2 GeV, CaloTower 4 (iEta 13-16);Hit Multiplicity;Number of Entries",120,0,120);
TH1F * dt3GeVcaloT1Mult_emu = new TH1F("dt3GeVcaloT1Mult_emu","Multiplicity of cells above 3 GeV, CaloTower 1 (iEta 1-4);Hit Multiplicity;Number of Entries",120,0,120);
TH1F * dt3GeVcaloT2Mult_emu = new TH1F("dt3GeVcaloT2Mult_emu","Multiplicity of cells above 3 GeV, CaloTower 2 (iEta 5-8);Hit Multiplicity;Number of Entries",120,0,120);
TH1F * dt3GeVcaloT3Mult_emu = new TH1F("dt3GeVcaloT3Mult_emu","Multiplicity of cells above 3 GeV, CaloTower 3 (iEta 9-12);Hit Multiplicity;Number of Entries",120,0,120);
TH1F * dt3GeVcaloT4Mult_emu = new TH1F("dt3GeVcaloT4Mult_emu","Multiplicity of cells above 3 GeV, CaloTower 4 (iEta 13-16);Hit Multiplicity;Number of Entries",120,0,120);
// making TH2F for the energy depth plots
TH2F * Energy_Depth = new TH2F("Energy_Depth", "TP Energy Fraction vs. Depth;HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
TH2F * Timing_Depth = new TH2F("Timing_Depth", "TP Timing Value vs. Depth;HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5, 60, 0, 30);
TH2F * Energy_DepthHE = new TH2F("Energy_DepthHE", "TP Energy Fraction vs. Depth in HE;HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
TH2F * Timing_DepthHE = new TH2F("Timing_DepthHE", "TP Timing Value vs. Depth in HE;HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5, 60, 0, 30);
TH2F * Energy_DepthHB = new TH2F("Energy_DepthHB", "TP Energy Fraction vs. Depth in HB;HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
TH2F * Timing_DepthHB = new TH2F("Timing_DepthHB", "TP Timing Value vs. Depth in HB;HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5, 60, 0, 30);
// making TH2F for the energy depth plots for high energy TPs
TH2F * Energy_Depth_HighE = new TH2F("Energy_Depth_HighE", "TP Energy Fraction vs. Depth for TP E_{T} > 10 GeV;HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
TH2F * Energy_DepthHE_HighE = new TH2F("Energy_DepthHE_HighE", "TP Energy Fraction vs. Depth in HE for TP E_{T} > 10 GeV;HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
TH2F * Energy_DepthHB_HighE = new TH2F("Energy_DepthHB_HighE", "TP Energy Fraction vs. Depth in HB for TP E_{T} > 10 GeV;HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
// TH2F for energy depth, where matched to jets
TH2F * Energy_Depth_Jets = new TH2F("Energy_Depth_Jets", "TP Energy Fraction vs. Depth (TP matched w/ L1 Jets);HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
TH2F * Timing_Depth_Jets = new TH2F("Timing_Depth_Jets", "TP Timing Value vs. Depth (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5, 60, 0, 30);
TH2F * Energy_DepthHE_Jets = new TH2F("Energy_DepthHE_Jets", "TP Energy Fraction vs. Depth in HE (TP matched w/ L1 Jets);HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
TH2F * Energy_DepthHE_Jets_1ns = new TH2F("Energy_DepthHE_Jets_1ns", "TP Energy Fraction vs. Depth in HE (TP matched w/ L1 Jets, hits over 1ns);HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 20);
TH2F * Energy_DepthHE_Jets_2ns = new TH2F("Energy_DepthHE_Jets_2ns", "TP Energy Fraction vs. Depth in HE (TP matched w/ L1 Jets, hits over 2ns);HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 20);
TH2F * Timing_DepthHE_Jets = new TH2F("Timing_DepthHE_Jets", "TP Timing Value vs. Depth in HE (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5, 60, 0, 30);
TH2F * Energy_DepthHB_Jets = new TH2F("Energy_DepthHB_Jets", "TP Energy Fraction vs. Depth in HB (TP matched w/ L1 Jets);HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
TH2F * Energy_DepthHB_Jets_1ns = new TH2F("Energy_DepthHB_Jets_1ns", "TP Energy Fraction vs. Depth in HB (TP matched w/ L1 Jets, hits over 1ns);HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 20);
TH2F * Energy_DepthHB_Jets_2ns = new TH2F("Energy_DepthHB_Jets_2ns", "TP Energy Fraction vs. Depth in HB (TP matched w/ L1 Jets, hits over 2ns);HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 20);
TH2F * Timing_DepthHB_Jets = new TH2F("Timing_DepthHB_Jets", "TP Timing Value vs. Depth in HB (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5, 60, 0, 30);
// TH2F for energy depth, where matched to jets for high energy TPs
TH2F * Energy_Depth_Jets_HighE = new TH2F("Energy_Depth_Jets_HighE", "TP Energy Fraction vs. Depth for TP E_{T} > 10 GeV (TP matched w/ L1 Jets);HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
TH2F * Energy_DepthHE_Jets_HighE = new TH2F("Energy_DepthHE_Jets_HighE", "TP Energy Fraction vs. Depth in HE for TP E_{T} > 10 GeV (TP matched w/ L1 Jets);HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
TH2F * Energy_DepthHB_Jets_HighE = new TH2F("Energy_DepthHB_Jets_HighE", "TP Energy Fraction vs. Depth in HB for TP E_{T} > 10 GeV (TP matched w/ L1 Jets);HCAL Depth;Energy Fraction", 8, -0.5, 7.5, 60, 0, 1.2);
TH2F * VolTiming_Depth_Jets = new TH2F("VolTiming_Depth_Jets", "TP Timing Value vs. Depth in HCAL Volume (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5, 60, 0, 30);
TH2F * VolTiming_DepthHB_Jets = new TH2F("VolTiming_DepthHB_Jets", "TP Timing Value vs. Depth in HCAL Volume, HB (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5, 60, 0, 30);
TH2F * VolTiming_DepthHE_Jets = new TH2F("VolTiming_DepthHE_Jets", "TP Timing Value vs. Depth in HCAL Volume, HE (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5, 60, 0, 30);
// making TH1D for the ProfileX() from the TH2F of energy_depth or timing_depth plots
TH1D * Energy_Depth_avg = new TH1D("Energy_Depth_avg", "TP Avg Energy Fraction vs. Depth;HCAL Depth;Energy Fraction", 8, -0.5, 7.5);
TH1D * Timing_Depth_avg = new TH1D("Timing_Depth_avg", "TP Avg Timing Value vs. Depth;HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5);
TH1D * Energy_DepthHE_avg = new TH1D("Energy_DepthHE_avg", "TP Avg Energy Fraction vs. Depth in HE;HCAL Depth;Energy Fraction", 8, -0.5, 7.5);
TH1D * Timing_DepthHE_avg = new TH1D("Timing_DepthHE_avg", "TP Avg Timing Value vs. Depth in HE;HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5);
TH1D * Energy_DepthHB_avg = new TH1D("Energy_DepthHB_avg", "TP Avg Energy Fraction vs. Depth in HB;HCAL Depth;Energy Fraction", 8, -0.5, 7.5);
TH1D * Timing_DepthHB_avg = new TH1D("Timing_DepthHB_avg", "TP Avg Timing Value vs. Depth in HB;HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5);
// TH1D for the ProfileX(), where matched to jets
TH1D * Energy_Depth_avg_Jets = new TH1D("Energy_Depth_avg_Jets", "TP Avg Energy Fraction vs. Depth (TP matched w/ L1 Jets);HCAL Depth;Energy Fraction", 8, -0.5, 7.5);
TH1D * Timing_Depth_avg_Jets = new TH1D("Timing_Depth_avg_Jets", "TP Avg Timing Value vs. Depth (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5);
TH1D * Energy_DepthHE_avg_Jets = new TH1D("Energy_DepthHE_avg_Jets", "TP Avg Energy Fraction vs. Depth in HE (TP matched w/ L1 Jets);HCAL Depth;Energy Fraction", 8, -0.5, 7.5);
TH1D * Energy_DepthHE_avg_Jets_1ns = new TH1D("Energy_DepthHE_avg_Jets_1ns", "TP Avg Energy Fraction vs. Depth in HE (TP matched w/ L1 Jets, hits over 1ns);HCAL Depth;Energy Fraction", 8, -0.5, 7.5);
TH1D * Energy_DepthHE_avg_Jets_2ns = new TH1D("Energy_DepthHE_avg_Jets_2ns", "TP Avg Energy Fraction vs. Depth in HE (TP matched w/ L1 Jets, hits over 2ns);HCAL Depth;Energy Fraction", 8, -0.5, 7.5);
TH1D * Timing_DepthHE_avg_Jets = new TH1D("Timing_DepthHE_avg_Jets", "TP Avg Timing Value vs. Depth in HE (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5);
TH1D * Energy_DepthHB_avg_Jets = new TH1D("Energy_DepthHB_avg_Jets", "TP Avg Energy Fraction vs. Depth in HB (TP matched w/ L1 Jets);HCAL Depth;Energy Fraction", 8, -0.5, 7.5);
TH1D * Energy_DepthHB_avg_Jets_1ns = new TH1D("Energy_DepthHB_avg_Jets_1ns", "TP Avg Energy Fraction vs. Depth in HB (TP matched w/ L1 Jets, hits over 1ns);HCAL Depth;Energy Fraction", 8, -0.5, 7.5);
TH1D * Energy_DepthHB_avg_Jets_2ns = new TH1D("Energy_DepthHB_avg_Jets_2ns", "TP Avg Energy Fraction vs. Depth in HB (TP matched w/ L1 Jets, hits over 2ns);HCAL Depth;Energy Fraction", 8, -0.5, 7.5);
TH1D * Timing_DepthHB_avg_Jets = new TH1D("Timing_DepthHB_avg_Jets", "TP Avg Timing Value vs. Depth in HB (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5);
TH1D * VolTiming_Depth_avg_Jets = new TH1D("VolTiming_Depth_avg_Jets", "TP Avg Timing Value vs. Depth in HCAL Volume (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5);
TH1D * VolTiming_DepthHE_avg_Jets = new TH1D("VolTiming_DepthHE_avg_Jets", "TP Avg Timing Value vs. Depth in HCAL Volume, HE (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5);
TH1D * VolTiming_DepthHB_avg_Jets = new TH1D("VolTiming_DepthHB_avg_Jets", "TP Avg Timing Value vs. Depth in HCAL Volume, HB (TP matched w/ L1 Jets);HCAL Depth;Timing Value (ns)", 8, -0.5, 7.5);
// Ratio of energy in HCAL depth layers
TH1F * Ratio_Depth = new TH1F("Ratio_Depth", "Ratio of 3,4 HCAL Layers to E_{T};Ratio;Number of Events", 50,0,1);
TH1F * Ratio_DepthHE = new TH1F("Ratio_DepthHE", "Ratio of 3,4 HCAL Layers to E_{T} in HE;Ratio;Number of Events", 50,0,1);
TH1F * Ratio_DepthHB = new TH1F("Ratio_DepthHB", "Ratio of 3,4 HCAL Layers to E_{T} in HB;Ratio;Number of Events", 50,0,1);
TH1F * Ratio_Depth_Jets = new TH1F("Ratio_Depth_Jets", "Ratio of 3,4 HCAL Layers to E_{T}, matched w/Jets;Ratio;Number of Events", 50,0,1);
TH1F * Ratio_DepthHE_Jets = new TH1F("Ratio_DepthHE_Jets", "Ratio of 3,4 HCAL Layers to E_{T} in HE, matched w/Jets;Ratio;Number of Events", 50,0,1);
TH1F * Ratio_DepthHB_Jets = new TH1F("Ratio_DepthHB_Jets", "Ratio of 3,4 HCAL Layers to E_{T} in HB, matched w/Jets;Ratio;Number of Events", 50,0,1);
// delta R plot for HCAL TP max energy near L1 jet
TH1F * DeltaR_TP_L1Jet_1 = new TH1F("DeltaR_TP_L1Jet_1", "DeltaR Between First L1 Jet and Closest HCAL TP; DeltaR;Number of Events",50,0,0.5);
TH1F * DeltaR_TP_L1Jet_2 = new TH1F("DeltaR_TP_L1Jet_2", "DeltaR Between Second L1 Jet and Closest HCAL TP; DeltaR;Number of Events",50,0,0.5);
TH1F * DeltaR_TP_L1Jet_3 = new TH1F("DeltaR_TP_L1Jet_3", "DeltaR Between Third L1 Jet and Closest HCAL TP; DeltaR;Number of Events",50,0,0.5);
TH1F * DeltaR_TP_L1Jet_4 = new TH1F("DeltaR_TP_L1Jet_4", "DeltaR Between Fourth L1 Jet and Closest HCAL TP; DeltaR;Number of Events",50,0,0.5);
TH1F * DeltaR_partons_L1Jet_1 = new TH1F("DeltaR_partons_L1Jet_1", "DeltaR Between First L1 Jet and Closest Parton; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_partons_L1Jet_2 = new TH1F("DeltaR_partons_L1Jet_2", "DeltaR Between Second L1 Jet and Closest Parton; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_partons_L1Jet_3 = new TH1F("DeltaR_partons_L1Jet_3", "DeltaR Between Third L1 Jet and Closest Parton; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_partons_L1Jet_4 = new TH1F("DeltaR_partons_L1Jet_4", "DeltaR Between Fourth L1 Jet and Closest Parton; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_partonsHCAL_L1Jet_1 = new TH1F("DeltaR_partonsHCAL_L1Jet_1", "DeltaR Between First L1 Jet and Closest Parton with HCAL volume vertex; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_partonsHCAL_L1Jet_2 = new TH1F("DeltaR_partonsHCAL_L1Jet_2", "DeltaR Between Second L1 Jet and Closest Parton with HCAL volume vertex; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_partonsHCAL_L1Jet_3 = new TH1F("DeltaR_partonsHCAL_L1Jet_3", "DeltaR Between Third L1 Jet and Closest Parton with HCAL volume vertex; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_partonsHCAL_L1Jet_4 = new TH1F("DeltaR_partonsHCAL_L1Jet_4", "DeltaR Between Fourth L1 Jet and Closest Parton with HCAL volume vertex; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_TPall_L1Jet_1 = new TH1F("DeltaR_TPall_L1Jet_1", "DeltaR Between First L1 Jet and All HCAL TPs; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_TPall_L1Jet_2 = new TH1F("DeltaR_TPall_L1Jet_2", "DeltaR Between Second L1 Jet and All HCAL TPs; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_TPall_L1Jet_3 = new TH1F("DeltaR_TPall_L1Jet_3", "DeltaR Between Third L1 Jet and All HCAL TPs; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_TPall_L1Jet_4 = new TH1F("DeltaR_TPall_L1Jet_4", "DeltaR Between Fourth L1 Jet and All HCAL TPs; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_TPet_L1Jet_1 = new TH1F("DeltaR_TPet_L1Jet_1", "DeltaR Between First L1 Jet and HCAL TPs above energy, time cuts; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_TPet_L1Jet_2 = new TH1F("DeltaR_TPet_L1Jet_2", "DeltaR Between Second L1 Jet and HCAL TPs above energy, time cuts; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_TPet_L1Jet_3 = new TH1F("DeltaR_TPet_L1Jet_3", "DeltaR Between Third L1 Jet and HCAL TPs above energy, time cuts; DeltaR;Number of Events",50,0,5);
TH1F * DeltaR_TPet_L1Jet_4 = new TH1F("DeltaR_TPet_L1Jet_4", "DeltaR Between Fourth L1 Jet and HCAL TPs above energy, time cuts; DeltaR;Number of Events",50,0,5);
// delta R plots between each L1 jet
TH1F * DeltaR_L1Jets_1_2 = new TH1F("DeltaR_L1Jets_1_2", "DeltaR Between 1st and 2nd L1 Jets;DeltaR;Number of Events",90,0,6);
TH1F * DeltaR_L1Jets_1_3 = new TH1F("DeltaR_L1Jets_1_3", "DeltaR Between 1st and 3rd L1 Jets;DeltaR;Number of Events",90,0,6);
TH1F * DeltaR_L1Jets_1_4 = new TH1F("DeltaR_L1Jets_1_4", "DeltaR Between 1st and 4th L1 Jets;DeltaR;Number of Events",90,0,6);
TH1F * DeltaR_L1Jets_2_3 = new TH1F("DeltaR_L1Jets_2_3", "DeltaR Between 2nd and 3rd L1 Jets;DeltaR;Number of Events",90,0,6);
TH1F * DeltaR_L1Jets_2_4 = new TH1F("DeltaR_L1Jets_2_4", "DeltaR Between 2nd and 4th L1 Jets;DeltaR;Number of Events",90,0,6);
TH1F * DeltaR_L1Jets_3_4 = new TH1F("DeltaR_L1Jets_3_4", "DeltaR Between 3rd and 4th L1 Jets;DeltaR;Number of Events",90,0,6);
// plot how many LLPs decay in HCAL
TH1F * LLPdecayDetAcceptance = new TH1F("LLPdecayDetAcceptance", "LLPs decaying within detector acceptance; Number of LLPs;Number of Events",5,0,5);
TH2F * LLPdecayRadiusDetAcceptance = new TH2F("LLPdecayRadiusDetAcceptance", "Decay Radius for LLPs within detector acceptance;Decay Position (z); Decay Radius (cm)",100,0,600,50,0,300);
TH1F * LLPdecayXyzDetAcceptance = new TH1F("LLPdecayXyzDetAcceptance", "LLPs decaying within detector acceptance;Decay Radius (x,y,z);Number of Events",100,0,600);
// timing values for center of barrel
TH1F * centralTiming = new TH1F("centralTiming", "Time of arrival - TOF (central barrel iEta);Time (ns);Number of Events",50,-10,40);
// eta, ieta, phi, iphi plots to check
TH1F * JetiEta_1 = new TH1F("JetiEta_1", "iEta position of First L1Jet;iEta;Number of Events",80,-40,40);
TH1F * JetiPhi_1 = new TH1F("JetiPhi_1", "iPhi position of First L1Jet;iPhi;Number of Events",74,0,74);
TH1F * JetEta_1 = new TH1F("JetEta_1", "Eta position of First L1Jet;Eta;Number of Events",100,-4,4);
TH1F * JetEta_2 = new TH1F("JetEta_2", "Eta position of Second L1Jet;Eta;Number of Events",100,-4,4);
TH1F * JetEta_3 = new TH1F("JetEta_3", "Eta position of Third L1Jet;Eta;Number of Events",100,-4,4);
TH1F * JetEta_4 = new TH1F("JetEta_4", "Eta position of Fourth L1Jet;Eta;Number of Events",100,-4,4);
TH1F * JetPhi_1 = new TH1F("JetPhi_1", "Phi position of First L1Jet;Phi;Number of Events",77,-3.32,3.32);
TH1F * JetPhi_2 = new TH1F("JetPhi_2", "Phi position of Second L1Jet;Phi;Number of Events",77,-3.32,3.32);
TH1F * JetPhi_3 = new TH1F("JetPhi_3", "Phi position of Third L1Jet;Phi;Number of Events",77,-3.32,3.32);
TH1F * JetPhi_4 = new TH1F("JetPhi_4", "Phi position of Fourth L1Jet;Phi;Number of Events",77,-3.32,3.32);
TH1F * HCALTPEta = new TH1F("HCALTPEta", "Eta position of HCALTP;Eta;Number of Events",100,-4,4);
TH1F * HCALTPiEta = new TH1F("HCALTPiEta", "iEta position of HCALTP;iEta;Number of Events",80,-40,40);
TH1F * HCALTPPhi = new TH1F("HCALTPPhi", "Phi position of HCALTP;Phi;Number of Events",77,-3.32,3.32);
TH1F * HCALTPiPhi = new TH1F("HCALTPiPhi", "iPhi position of HCALTP;iPhi;Number of Events",74,-1,73);
TH1F * htSumDistribution = new TH1F("htSumDistribution","htSum Distribution;HT Sum;Number of Events",100,0,1000);
// TGraph for eta phi of HCAL TPs and L1 jets
TGraph * etaphiTP = new TGraph();
TGraph * etaphiJet = new TGraph();
// Create a TTree Object so multiplicities can be sent to TMVA analyzer
TTree *tree = new TTree("MultForTMVA","MultForTMVA");
// Int_t event;
// Float_t mult_Jet1, mult_Jet2, mult_Jet3, mult_Jet4;
// Float_t event_htSum, AllHits2GeV, AllHits2GeV_jet2, AllHits2GeV_jet3, AllHits2GeV_jet4;
// Float_t DelayedHits2GeV, DelayedHits2GeV_jet2, DelayedHits2GeV_jet3, DelayedHits2GeV_jet4;
// Float_t Jet1eta, Jet2eta, Jet3eta, Jet4eta;
// Float_t ET_Jet1(0);
// Int_t event;
Float_t x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20;
tree->Branch("x0",&x0,"x0/F"); // mult_Jet1
tree->Branch("x1",&x1,"x1/F"); // mult_Jet2
tree->Branch("x2",&x2,"x2/F"); // mult_Jet3
tree->Branch("x3",&x3,"x3/F"); // mult_Jet4
tree->Branch("x4",&x4,"x4/F"); // event_htSum
tree->Branch("x5",&x5,"x5/F"); // AllHits2GeV
tree->Branch("x6",&x6,"x6/F"); // AllHits2GeV_jet2
tree->Branch("x7",&x7,"x7/F"); // AllHits2GeV_jet3
tree->Branch("x8",&x8,"x8/F"); // AllHits2GeV_jet4
tree->Branch("x9",&x9,"x9/F"); // DelayedHits2GeV
tree->Branch("x10",&x10,"x10/F"); // DelayedHits2GeV_jet2
tree->Branch("x11",&x11,"x11/F"); // DelayedHits2GeV_jet3
tree->Branch("x12",&x12,"x12/F"); // DelayedHits2GeV_jet4
tree->Branch("x13",&x13,"x13/F"); // Jet1eta
tree->Branch("x14",&x14,"x14/F"); // Jet2eta
tree->Branch("x15",&x15,"x15/F"); // Jet3eta
tree->Branch("x16",&x16,"x16/F"); // Jet4eta
tree->Branch("x17",&x17,"x17/F"); // jetEt_1
tree->Branch("x18",&x18,"x18/F"); // event
tree->Branch("x19",&x19,"x19/F"); // 3GeV 2ns HE
tree->Branch("x20",&x20,"x20/F"); // 3GeV 3ns HE
/*
tree->Branch("mult_Jet1",&mult_Jet1,"mult_Jet1/F");
tree->Branch("mult_Jet2",&mult_Jet2,"mult_Jet2/F");
tree->Branch("mult_Jet3",&mult_Jet3,"mult_Jet3/F");
tree->Branch("mult_Jet4",&mult_Jet4,"mult_Jet4/F");
tree->Branch("event_htSum",&event_htSum,"event_htSum/F");
tree->Branch("AllHits2GeV",&AllHits2GeV,"AllHits2GeV/F");
tree->Branch("AllHits2GeV_jet2",&AllHits2GeV_jet2,"AllHits2GeV_jet2/F");
tree->Branch("AllHits2GeV_jet3",&AllHits2GeV_jet3,"AllHits2GeV_jet3/F");
tree->Branch("AllHits2GeV_jet4",&AllHits2GeV_jet4,"AllHits2GeV_jet4/F");
tree->Branch("DelayedHits2GeV",&DelayedHits2GeV,"DelayedHits2GeV/F");
tree->Branch("DelayedHits2GeV_jet2",&DelayedHits2GeV_jet2,"DelayedHits2GeV_jet2/F");
tree->Branch("DelayedHits2GeV_jet3",&DelayedHits2GeV_jet3,"DelayedHits2GeV_jet3/F");
tree->Branch("DelayedHits2GeV_jet4",&DelayedHits2GeV_jet4,"DelayedHits2GeV_jet4/F");
tree->Branch("Jet1eta",&Jet1eta,"Jet1eta/F");
tree->Branch("Jet2eta",&Jet2eta,"Jet2eta/F");
tree->Branch("Jet3eta",&Jet3eta,"Jet3eta/F");
tree->Branch("Jet4eta",&Jet4eta,"Jet4eta/F");
tree->Branch("ET_Jet1",&ET_Jet1,"ET_Jet1/F");
tree->Branch("event",&event,"event/I");
*/
// counting LLP efficiencies -- need to reset on a per event basis
double passedAvgTimeCut(0);
double totalJets(0), passedMultJets(0), passedMultJets_120(0), passedMultJets_350(0);
double passedMultJets3GeV3_1(0), passedMultJets3GeV3_2(0), passedMultJets3GeV3_3(0), passedMultJets3GeV3_4(0), passedMultJets3GeV3_5(0), passedMultJets3GeV3_6(0), passedMultJets3GeV3_7(0);
double passedMultJets3GeV3_ht120_1(0), passedMultJets3GeV3_ht120_2(0), passedMultJets3GeV3_ht120_3(0), passedMultJets3GeV3_ht120_4(0), passedMultJets3GeV3_ht120_5(0), passedMultJets3GeV3_ht120_6(0), passedMultJets3GeV3_ht120_7(0);
double totalGlobal(0), passedMultGlobal(0), passedMultGlobal_120(0), passedMultGlobal_350(0), passedHtSum120(0), passedHtSum350(0), passedHtSum360(0);
double passedDelayedHitFraction1GeV_ht120[11][11][25] = {{{0}}}; // [frac delayed][number delayed][ns delayed]
double passedDelayedHitFraction2GeV_ht120[11][11][25] = {{{0}}};
double passedDelayedHitFraction3GeV_ht120[11][11][25] = {{{0}}};
double passedDelayedHitFraction4GeV_ht120[11][11][25] = {{{0}}};
// change these variables to change the multiplicity thresholds that are set
uint GeV3ns3Global_threshold = 3;
// uint GeV3ns0Jet_threshold = 3;
uint GeV3ns3Jet_threshold = 2;
double DR_threshold = 0.5;
double frac_delayed_scan[11] = {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1};
double frac_delayed = 0.6;
uint frac_delayed_x10 = 6;
uint min_num_delayed_scan[11] = {0,1,2,3,4,5,6,7,8,9,10};
uint min_num_delayed = 6;
uint min_num_delayed_jetsum = 0;
int min_num_jets_passed = 1;
/////////////////////////////////
// loop through all the entries//
/////////////////////////////////
for (Long64_t jentry=0; jentry<nentries; jentry++){
// std::cout << "new event" << std::endl;
if((jentry%10000)==0) std::cout << "Done " << jentry << " events of " << nentries << std::endl;
//lumi break clause
eventTree->GetEntry(jentry);
//skip the corresponding event
if (!isGoodLumiSection(event_->lumi)) continue;
goodLumiEventCount++;
//do routine for L1 emulator quantites
if (emuOn){
treeL1Towemu->GetEntry(jentry);
treeL1CaloTPemu->GetEntry(jentry);
treeL1emu->GetEntry(jentry);
genTree->GetEntry(jentry); // used for gen particle matching later
double tpEt(0.);
for(int i=0; i < l1CaloTPemu_->nHCALTP; i++){
tpEt = l1CaloTPemu_->hcalTPet[i];
hcalTP_emu->Fill(tpEt);
}
for(int i=0; i < l1CaloTPemu_->nECALTP; i++){
tpEt = l1CaloTPemu_->ecalTPet[i];
ecalTP_emu->Fill(tpEt);
}
// get jetEt*, egEt*, tauEt, htSum, mhtSum, etSum, metSum
// ALL EMU OBJECTS HAVE BX=0...
double jetEt_1 = 0;
double jetEt_2 = 0;
double jetEt_3 = 0;
double jetEt_4 = 0;
if (l1emu_->nJets>0) jetEt_1 = l1emu_->jetEt[0];
if (l1emu_->nJets>1) jetEt_2 = l1emu_->jetEt[1];
if (l1emu_->nJets>2) jetEt_3 = l1emu_->jetEt[2];
if (l1emu_->nJets>3) jetEt_4 = l1emu_->jetEt[3];
double egEt_1 = 0;
double egEt_2 = 0;
//EG pt's are not given in descending order...bx?
for (UInt_t c=0; c<l1emu_->nEGs; c++){
if (l1emu_->egEt[c] > egEt_1){
egEt_2 = egEt_1;
egEt_1 = l1emu_->egEt[c];
}
else if (l1emu_->egEt[c] <= egEt_1 && l1emu_->egEt[c] > egEt_2){
egEt_2 = l1emu_->egEt[c];
}
}
double tauEt_1 = 0;
double tauEt_2 = 0;
//tau pt's are not given in descending order
for (UInt_t c=0; c<l1emu_->nTaus; c++){
if (l1emu_->tauEt[c] > tauEt_1){
tauEt_2 = tauEt_1;
tauEt_1 = l1emu_->tauEt[c];
}
else if (l1emu_->tauEt[c] <= tauEt_1 && l1emu_->tauEt[c] > tauEt_2){
tauEt_2 = l1emu_->tauEt[c];
}
}
double egISOEt_1 = 0;
double egISOEt_2 = 0;
//EG pt's are not given in descending order...bx?
for (UInt_t c=0; c<l1emu_->nEGs; c++){
if (l1emu_->egEt[c] > egISOEt_1 && l1emu_->egIso[c]==1){
egISOEt_2 = egISOEt_1;
egISOEt_1 = l1emu_->egEt[c];
}
else if (l1emu_->egEt[c] <= egISOEt_1 && l1emu_->egEt[c] > egISOEt_2 && l1emu_->egIso[c]==1){
egISOEt_2 = l1emu_->egEt[c];
}
}
double tauISOEt_1 = 0;
double tauISOEt_2 = 0;
//tau pt's are not given in descending order
for (UInt_t c=0; c<l1emu_->nTaus; c++){
if (l1emu_->tauEt[c] > tauISOEt_1 && l1emu_->tauIso[c]>0){
tauISOEt_2 = tauISOEt_1;
tauISOEt_1 = l1emu_->tauEt[c];
}
else if (l1emu_->tauEt[c] <= tauISOEt_1 && l1emu_->tauEt[c] > tauISOEt_2 && l1emu_->tauIso[c]>0){
tauISOEt_2 = l1emu_->tauEt[c];
}
}
double htSum(0.0);
double mhtSum(0.0);
double etSum(0.0);
double metSum(0.0);
double metHFSum(0.0);
for (unsigned int c=0; c<l1emu_->nSums; c++){
if( l1emu_->sumBx[c] != 0 ) continue;
if( l1emu_->sumType[c] == L1Analysis::kTotalEt ) etSum = l1emu_->sumEt[c];
if( l1emu_->sumType[c] == L1Analysis::kTotalHt ) htSum = l1emu_->sumEt[c];
if( l1emu_->sumType[c] == L1Analysis::kMissingEt ) metSum = l1emu_->sumEt[c];
if( l1emu_->sumType[c] == L1Analysis::kMissingEtHF ) metHFSum = l1emu_->sumEt[c];
if( l1emu_->sumType[c] == L1Analysis::kMissingHt ) mhtSum = l1emu_->sumEt[c];
}
int seedTowerIEta(-1);
int seedTowerIPhi(-1);
int nDepth(-1);
double nCaloTPemu(0), tpEtaemu(0), tpPhiemu(0), tpEtemu(0);
uint nJetemu(0);
nCaloTPemu = l1CaloTPemu_->nHCALTP;
nJetemu = l1emu_->nJets;
// hcalTPdepth and hcalTPtiming will store the timing and depth variables from the 7 HCAL layers
double hcalTPdepth[7] = {0};
double hcalTPtiming[7] = {0};
std::map<const TString, std::vector<double> > TimingVariablesAllJets;
std::map<const TString, std::vector<double> > DepthVariablesAllJets;
// multiplicity for all HCAL TPs in an entry
double mult3GeV[6] = {0};
double mult3GeVHE[6] = {0};
double mult3GeVHB[6] = {0};
double mult2GeV[6] = {0};
double mult2GeVHE[6] = {0};
double mult2GeVHB[6] = {0};
double mult1GeV[6] = {0};
double mult1GeVHE[6] = {0};
double mult1GeVHB[6] = {0};
// multiplicity for ieta regions of caloTowers (4x4 ieta iphi) in the barrel regions
double mult1GeVcaloT1(0), mult2GeVcaloT1(0), mult3GeVcaloT1(0); // abs(ieta) between 1-4
double mult1GeVcaloT2(0), mult2GeVcaloT2(0), mult3GeVcaloT2(0); // abs(ieta) between 5-8
double mult1GeVcaloT3(0), mult2GeVcaloT3(0), mult3GeVcaloT3(0); // abs(ieta) between 9-12
double mult1GeVcaloT4(0), mult2GeVcaloT4(0), mult3GeVcaloT4(0); // abs(ieta) between 13-16
// multiplicity for when HCAL TP is matched with Jets
double mult3GeV2ns_Jets_depth1(0), mult3GeV2ns_Jets_depth2(0), mult3GeV2ns_Jets_depth3(0), mult3GeV2ns_Jets_depth4(0);
double mult3GeV2ns_Jets_depth1HB(0), mult3GeV2ns_Jets_depth2HB(0), mult3GeV2ns_Jets_depth3HB(0), mult3GeV2ns_Jets_depth4HB(0);
double mult3GeV_Jets[6] = {0};
double mult3GeVHE_Jets[6]= {0};
double mult3GeVHB_Jets[6]= {0};
double mult2GeV_Jets[6]= {0};
double mult2GeVHE_Jets[6]= {0};
double mult2GeVHB_Jets[6]= {0};
double mult1GeV_Jets[6]= {0};
double mult1GeVHE_Jets[6]= {0};
double mult1GeVHB_Jets[6]= {0};
double mult0GeVHB_Jets[6]= {0};
double mult3GeV3nsHB_Jet0(0), mult3GeV3nsHB_Jet1(0), mult3GeV3nsHB_Jet2(0), mult3GeV3nsHB_Jet3(0);
double mult0GeV5nsHB_Jet0(0), mult0GeV5nsHB_Jet1(0), mult0GeV5nsHB_Jet2(0), mult0GeV5nsHB_Jet3(0);
double DepthVariableMult(0);
double JetEta1(0), JetEta2(0), JetEta3(0), JetEta4(0);
double JetPhi1(0), JetPhi2(0), JetPhi3(0), JetPhi4(0);
int genJetRequirementPassed = 0; // keeps track of for this event, were there L1 jets that passed the gen matching requirement of L1 jet to parton?
double DelayedHitCounter1GeV[26] = {0};
double DelayedHitCounter2GeV[26] = {0};
double DelayedHitCounter3GeV[26] = {0};
double DelayedHitCounter4GeV[26] = {0};
double DelayedHitCounter1GeV_jet2[26] = {0};
double DelayedHitCounter2GeV_jet2[26] = {0};
double DelayedHitCounter3GeV_jet2[26] = {0};
double DelayedHitCounter4GeV_jet2[26] = {0};
double DelayedHitCounter1GeV_jet3[26] = {0};
double DelayedHitCounter2GeV_jet3[26] = {0};
double DelayedHitCounter3GeV_jet3[26] = {0};
double DelayedHitCounter4GeV_jet3[26] = {0};
double DelayedHitCounter1GeV_jet4[26] = {0};
double DelayedHitCounter2GeV_jet4[26] = {0};
double DelayedHitCounter3GeV_jet4[26] = {0};
double DelayedHitCounter4GeV_jet4[26] = {0};
double AllHitCounter0GeV(0), AllHitCounter1GeV(0), AllHitCounter2GeV(0), AllHitCounter3GeV(0), AllHitCounter4GeV(0), AllHitCounter0GeV_jet2(0), AllHitCounter1GeV_jet2(0), AllHitCounter2GeV_jet2(0), AllHitCounter3GeV_jet2(0), AllHitCounter4GeV_jet2(0), AllHitCounter0GeV_jet3(0), AllHitCounter1GeV_jet3(0), AllHitCounter2GeV_jet3(0), AllHitCounter3GeV_jet3(0), AllHitCounter4GeV_jet3(0), AllHitCounter0GeV_jet4(0), AllHitCounter1GeV_jet4(0), AllHitCounter2GeV_jet4(0), AllHitCounter3GeV_jet4(0), AllHitCounter4GeV_jet4(0);
double avgTimeJet1[6] = {0};
double numHitsJet1[6] = {0};
double avgTimeJet2[6] = {0};
double numHitsJet2[6] = {0};
double avgTimeJet3[6] = {0};
double numHitsJet3[6] = {0};
double avgTimeJet4[6] = {0};
double numHitsJet4[6] = {0};
// loop over L1 jets, and only do first four (4 highest energy L1 jets from 4 leptons)
for(uint jetIt=0; jetIt < nJetemu && jetIt < 4; jetIt++){
hJetEt->Fill(l1emu_->jetEt[jetIt]); // these are already in order of highest E_T
// if ((jetIt == 0) && (l1emu_->jetEt[jetIt] < 1000) ) ET_Jet1 = l1emu_->jetEt[jetIt];
if (jetIt == 0 ) hJetEt_1->Fill(l1emu_->jetEt[jetIt]);
if (jetIt == 1 ) hJetEt_2->Fill(l1emu_->jetEt[jetIt]);
if (jetIt == 2 ) hJetEt_3->Fill(l1emu_->jetEt[jetIt]);
if (jetIt == 3 ) hJetEt_4->Fill(l1emu_->jetEt[jetIt]);
seedTowerIPhi = l1emu_->jetTowerIPhi[jetIt];
seedTowerIEta = l1emu_->jetTowerIEta[jetIt];
double Jet_eta;
double Jet_phi;
Jet_eta = l1emu_->jetEta[jetIt]; // etaVal(seedTowerIEta);
Jet_phi = l1emu_->jetPhi[jetIt]; //phiVal(seedTowerIPhi);
// positions and deltaR between each jet to understand spatial information
if (jetIt == 0 ) {
JetiEta_1->Fill(seedTowerIEta);
JetEta_1->Fill(Jet_eta);
JetiPhi_1->Fill(seedTowerIPhi);
JetPhi_1->Fill(Jet_phi);
JetEta1 = Jet_eta;
JetPhi1 = Jet_phi;
}
if (jetIt == 1) {
JetEta_2->Fill(Jet_eta);
JetPhi_2->Fill(Jet_phi);
JetEta2= Jet_eta;
JetPhi2= Jet_phi;
}
if (jetIt == 2){
JetEta_3->Fill(Jet_eta);
JetPhi_3->Fill(Jet_phi);
JetEta3= Jet_eta;
JetPhi3= Jet_phi;
}
if (jetIt == 3){
JetEta_4->Fill(Jet_eta);
JetPhi_4->Fill(Jet_phi);
JetEta4= Jet_eta;
JetPhi4= Jet_phi;
}
if(jentry == 1) { // eta phi position of 4 L1 jets
if (l1emu_->jetEt[jetIt] < 20) continue; // only consider jets that are greater than 20 GeV
etaphiJet->SetMarkerColor(2); // red marker color for jets
etaphiJet->SetPoint(jetIt,Jet_eta,Jet_phi);
}
double min_DeltaR = 100; // used for storing min deltaR value between a L1 jet and a HCAL TP
if (l1emu_->jetEt[jetIt] < 20 ) continue; // require jet is greater than 20 GeV to attempt matching to HCAL TP
// ************* GEN PARTICLE MATCHING CODE ******************
// already got the entries from genTree at start of event loop
double min_deltaR_partonGen_L1jet = 1000;
double min_deltaR_partonGenHCAL_L1jet = 1000; // min dR defined per each L1 jet
for (int partonN = 0; partonN < generator_->nPart; partonN ++) {
// reset values for eta, phi of partons (w/ and w/o requirement of vertex within HCAL volume), and for dR between parton and L1 jet on a per-parton basis
double partonEta = 1000;
double partonPhi = 1000;
double partonEtaHCAL = 1000;
double partonPhiHCAL = 1000;