forked from Quantumapple/L1PixEle-Eff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.h
More file actions
1904 lines (1620 loc) · 80 KB
/
test.h
File metadata and controls
1904 lines (1620 loc) · 80 KB
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
//////////////////////////////////////////////////////////
// This class has been automatically generated on
// Thu Sep 17 20:40:59 2015 by ROOT version 5.34/19
// from TTree t/t
// found on file: SingleEle_ntuple_1.root
//////////////////////////////////////////////////////////
#ifndef test_h
#define test_h
#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>
// Header file for the classes stored in the TTree if any.
#include <vector>
#include <vector>
// Fixed size dimensions of array or collections stored in the TTree if any.
#include <iostream>
#include <fstream>
#include <string>
#include <TH2.h>
#include <TStyle.h>
#include <TCanvas.h>
#include <TLorentzVector.h>
//#include "withEM_Tower.h"
#include "../../withEM_SingleCrys_900pre6_v2.h"
#include "../../withoutEM_SingleCrys_900pre6.h"
#include "../../RegionOfInterest.h"
using namespace std;
class test {
private:
map<TString, TH1*> maphist;
public :
TTree *fChain; //!pointer to the analyzed TTree or TChain
Int_t fCurrent; //!current Tree number in a TChain
// Fixed size dimensions of array or collections stored in the TTree if any.
// Declaration of leaf types
Int_t nVtx;
Int_t nMeanPU;
vector<float> *genPartE;
vector<float> *genPartPt;
vector<float> *genPartEta;
vector<float> *genPartPhi;
vector<int> *genPartCharge;
vector<int> *genPartId;
vector<float> *propgenElPartE;
vector<float> *propgenElPartPt;
vector<float> *propgenElPartEta;
vector<float> *propgenElPartPhi;
vector<int> *propgenElPartCharge;
vector<float> *propgenElPartx;
vector<float> *propgenElParty;
vector<float> *propgenElPartz;
Int_t simTrkN;
vector<float> *simTrkPt;
vector<float> *simTrkEta;
vector<float> *simTrkPhi;
vector<int> *simTrkId;
vector<int> *simTrkType;
vector<float> *simTrkVx;
vector<float> *simTrkVy;
vector<float> *simTrkVz;
vector<float> *simVx;
vector<float> *simVy;
vector<float> *simVz;
Float_t maxBrempos;
Float_t lastSimtkpt;
Float_t initialSimtkpt;
Int_t bremflag;
vector<float> *Brempos_radius;
vector<float> *Brempos_x;
vector<float> *Brempos_y;
vector<float> *Brempos_z;
vector<int> *bRecHitLayer;
vector<int> *bRecHitLadder;
vector<int> *bRecHitModule;
vector<int> *fRecHitDisk;
vector<int> *fRecHitBlade;
vector<int> *fRecHitSide;
vector<int> *fRecHitPanel;
vector<int> *fRecHitModule;
Int_t bRecHitN;
Int_t fRecHitN;
vector<float> *fRecHitGx;
vector<float> *fRecHitGy;
vector<float> *fRecHitGz;
vector<float> *fRhSize;
vector<float> *fRhSizeX;
vector<float> *fRhSizeY;
vector<float> *bRecHitGx;
vector<float> *bRecHitGy;
vector<float> *bRecHitGz;
vector<float> *bRhSize;
vector<float> *bRhSizeX;
vector<float> *bRhSizeY;
vector<float> *egCrysE;
vector<float> *egCrysEt;
vector<float> *egCrysEta;
vector<float> *egCrysPhi;
vector<float> *egCrysGx;
vector<float> *egCrysGy;
vector<float> *egCrysGz;
vector<float> *egCrysClusterE;
vector<float> *egCrysClusterEt;
vector<float> *egCrysClusterEta;
vector<float> *egCrysClusterPhi;
vector<float> *egCrysClusterGx;
vector<float> *egCrysClusterGy;
vector<float> *egCrysClusterGz;
vector<float> *egCrysClusterPGx;
vector<float> *egCrysClusterPGy;
vector<float> *egCrysClusterPGz;
vector<bool> *isTrackMatched;
vector<float> *isoConeNTrack;
vector<float> *isoConePtTrack;
vector<float> *trackHighestPt;
vector<float> *trackHighestPtEta;
vector<float> *trackHighestPtPhi;
vector<float> *trackHighestPtChi2;
vector<float> *trackHighestPtCutChi2;
vector<float> *trackHighestPtCutChi2Eta;
vector<float> *trackHighestPtCutChi2Phi;
vector<float> *trackHighestPtCutChi2Chi2;
vector<float> *trackmatchingdR;
vector<bool> *hgcal_isTrackMatched;
vector<float> *hgcal_isoConeNTrack;
vector<float> *hgcal_isoConePtTrack;
vector<float> *hgcal_trackHighestPt;
vector<float> *hgcal_trackHighestPtEta;
vector<float> *hgcal_trackHighestPtPhi;
vector<float> *hgcal_trackHighestPtChi2;
vector<float> *hgcal_trackHighestPtCutChi2;
vector<float> *hgcal_trackHighestPtCutChi2Eta;
vector<float> *hgcal_trackHighestPtCutChi2Phi;
vector<float> *hgcal_trackHighestPtCutChi2Chi2;
vector<float> *hgcal_trackmatchingdR;
Int_t cl3d_n;
vector<float> *cl3d_pt;
vector<float> *cl3d_energy;
vector<float> *cl3d_eta;
vector<float> *cl3d_phi;
vector<int> *cl3d_nclu;
vector<float> *cl3d_x;
vector<float> *cl3d_y;
vector<int> *cl3d_z;
vector<int> *cl3d_coreshowerlength;
vector<float> *cl3d_srrtot;
vector<int> *cl3d_maxlayer;
vector<int> *cl3d_firstlayer;
UShort_t egN;
vector<float> *egEt;
vector<float> *egEta;
vector<float> *egPhi;
vector<float> *egGx;
vector<float> *egGy;
vector<float> *egGz;
vector<short> *egIEt;
vector<short> *egIEta;
vector<short> *egIPhi;
vector<short> *egIso;
vector<short> *egBx;
vector<short> *egTowerIPhi;
vector<short> *egTowerIEta;
vector<short> *egRawEt;
vector<short> *egIsoEt;
vector<short> *egFootprintEt;
vector<short> *egNTT;
vector<short> *egShape;
vector<short> *egTowerHoE;
// List of branches
TBranch *b_nVtx; //!
TBranch *b_nMeanPU; //!
TBranch *b_genPartE; //!
TBranch *b_genPartPt; //!
TBranch *b_genPartEta; //!
TBranch *b_genPartPhi; //!
TBranch *b_genPartCharge; //!
TBranch *b_genPartId; //!
TBranch *b_propgenElPartE; //!
TBranch *b_propgenElPartPt; //!
TBranch *b_propgenElPartEta; //!
TBranch *b_propgenElPartPhi; //!
TBranch *b_propgenElPartCharge; //!
TBranch *b_propgenElPartx; //!
TBranch *b_propgenElParty; //!
TBranch *b_propgenElPartz; //!
TBranch *b_simTrkN; //!
TBranch *b_simTrkPt; //!
TBranch *b_simTrkEta; //!
TBranch *b_simTrkPhi; //!
TBranch *b_simTrkId; //!
TBranch *b_simTrkType; //!
TBranch *b_simTrkVx; //!
TBranch *b_simTrkVy; //!
TBranch *b_simTrkVz; //!
TBranch *b_simVx; //!
TBranch *b_simVy; //!
TBranch *b_simVz; //!
TBranch *b_maxBrempos; //!
TBranch *b_lastSimtkpt; //!
TBranch *b_initialSimtkpt; //!
TBranch *b_bremflag; //!
TBranch *b_Brempos_radius; //!
TBranch *b_Brempos_x; //!
TBranch *b_Brempos_y; //!
TBranch *b_Brempos_z; //!
TBranch *b_bRecHitLayer; //!
TBranch *b_bRecHitLadder; //!
TBranch *b_bRecHitModule; //!
TBranch *b_fRecHitDisk; //!
TBranch *b_fRecHitBlade; //!
TBranch *b_fRecHitSide; //!
TBranch *b_fRecHitPanel; //!
TBranch *b_fRecHitModule; //!
TBranch *b_bRecHitN; //!
TBranch *b_fRecHitN; //!
TBranch *b_fRecHitGx; //!
TBranch *b_fRecHitGy; //!
TBranch *b_fRecHitGz; //!
TBranch *b_fRhSize; //!
TBranch *b_fRhSizeX; //!
TBranch *b_fRhSizeY; //!
TBranch *b_bRecHitGx; //!
TBranch *b_bRecHitGy; //!
TBranch *b_bRecHitGz; //!
TBranch *b_bRhSize; //!
TBranch *b_bRhSizeX; //!
TBranch *b_bRhSizeY; //!
TBranch *b_egCrysE; //!
TBranch *b_egCrysEt; //!
TBranch *b_egCrysEta; //!
TBranch *b_egCrysPhi; //!
TBranch *b_egCrysGx; //!
TBranch *b_egCrysGy; //!
TBranch *b_egCrysGz; //!
TBranch *b_egCrysClusterE; //!
TBranch *b_egCrysClusterEt; //!
TBranch *b_egCrysClusterEta; //!
TBranch *b_egCrysClusterPhi; //!
TBranch *b_egCrysClusterGx; //!
TBranch *b_egCrysClusterGy; //!
TBranch *b_egCrysClusterGz; //!
TBranch *b_egCrysClusterPGx; //!
TBranch *b_egCrysClusterPGy; //!
TBranch *b_egCrysClusterPGz; //!
TBranch *b_isTrackMatched; //!
TBranch *b_isoConeNTrack; //!
TBranch *b_isoConePtTrack; //!
TBranch *b_trackHighestPt; //!
TBranch *b_trackHighestPtEta; //!
TBranch *b_trackHighestPtPhi; //!
TBranch *b_trackHighestPtChi2; //!
TBranch *b_trackHighestPtCutChi2; //!
TBranch *b_trackHighestPtCutChi2Eta; //!
TBranch *b_trackHighestPtCutChi2Phi; //!
TBranch *b_trackHighestPtCutChi2Chi2; //!
TBranch *b_trackmatchingdR;
TBranch *b_hgcal_isTrackMatched; //!
TBranch *b_hgcal_isoConeNTrack; //!
TBranch *b_hgcal_isoConePtTrack; //!
TBranch *b_hgcal_trackHighestPt; //!
TBranch *b_hgcal_trackHighestPtEta; //!
TBranch *b_hgcal_trackHighestPtPhi; //!
TBranch *b_hgcal_trackHighestPtChi2; //!
TBranch *b_hgcal_trackHighestPtCutChi2; //!
TBranch *b_hgcal_trackHighestPtCutChi2Eta; //!
TBranch *b_hgcal_trackHighestPtCutChi2Phi; //!
TBranch *b_hgcal_trackHighestPtCutChi2Chi2; //!
TBranch *b_hgcal_trackmatchingdR;
TBranch *b_cl3d_n; //!
TBranch *b_cl3d_pt; //!
TBranch *b_cl3d_energy; //!
TBranch *b_cl3d_eta; //!
TBranch *b_cl3d_phi; //!
TBranch *b_cl3d_nclu; //!
TBranch *b_cl3d_x; //!
TBranch *b_cl3d_y; //!
TBranch *b_cl3d_z; //!
TBranch *b_cl3d_coreshowerlength;
TBranch *b_cl3d_srrtot;
TBranch *b_cl3d_maxlayer;
TBranch *b_cl3d_firstlayer;
TBranch *b_egN; //!
TBranch *b_egEt; //!
TBranch *b_egEta; //!
TBranch *b_egPhi; //!
TBranch *b_egGx; //!
TBranch *b_egGy; //!
TBranch *b_egGz; //!
TBranch *b_egIEt; //!
TBranch *b_egIEta; //!
TBranch *b_egIPhi; //!
TBranch *b_egIso; //!
TBranch *b_egBx; //!
TBranch *b_egTowerIPhi; //!
TBranch *b_egTowerIEta; //!
TBranch *b_egRawEt; //!
TBranch *b_egIsoEt; //!
TBranch *b_egFootprintEt; //!
TBranch *b_egNTT; //!
TBranch *b_egShape; //!
TBranch *b_egTowerHoE; //!
int Ele, Pos;
int skip;
float EgN;
int eta_region;
int withoutEM_count_Ele, withEM_count_Ele;
bool PixTrkPassed;
int pass_count_wo4thPix, pass_count_wo3thPix, pass_count_wo2thPix, pass_count_wo1thPix;
int woEM_pass_Ele_count_wo4thPix, woEM_pass_Ele_count_wo3thPix, woEM_pass_Ele_count_wo2thPix, woEM_pass_Ele_count_wo1thPix;
int wEM_pass_Ele_count_wo4thPix, wEM_pass_Ele_count_wo3thPix, wEM_pass_Ele_count_wo2thPix, wEM_pass_Ele_count_wo1thPix;
double all_cut_pass_eg;
int all_cut_pass_Ele, withoutEM_pass_Ele, withEM_pass_Ele;
int all_cut_pass_Pos;
int fourth_layer_missing;
int third_layer_missing;
int second_layer_missing;
int first_layer_missing;
int bit1;
int trigger_bit_width_;
int pix_comb_;
bool debug;
double L1_Dphi_cut1, L1_Dphi_cut2;
double L2_Dphi_cut1, L2_Dphi_cut2;
double L3_Dphi_cut1, L3_Dphi_cut2;
double L4_Dphi_cut1, L4_Dphi_cut2;
double D1_Dphi_cut1, D1_Dphi_cut2;
double D2_Dphi_cut1, D2_Dphi_cut2;
double D3_Dphi_cut1, D3_Dphi_cut2;
double dPhi012;
double dPhi013;
double dPhi014;
double dPhi023;
double dPhi024;
double dPhi034;
double L012_DPhi_cut1, L012_DPhi_cut2;
double L013_DPhi_cut1, L013_DPhi_cut2;
double L014_DPhi_cut1, L014_DPhi_cut2;
double L023_DPhi_cut1, L023_DPhi_cut2;
double L024_DPhi_cut1, L024_DPhi_cut2;
double L034_DPhi_cut1, L034_DPhi_cut2;
double L123_DPhi_cut1, L123_DPhi_cut2;
double L123_DEta_cut1, L123_DEta_cut2;
double L124_DPhi_cut1, L124_DPhi_cut2;
double L124_DEta_cut1, L124_DEta_cut2;
double L134_DPhi_cut1, L134_DPhi_cut2;
double L134_DEta_cut1, L134_DEta_cut2;
double L234_DPhi_cut1, L234_DPhi_cut2;
double L234_DEta_cut1, L234_DEta_cut2;
double L12_eta_upper, L13_eta_upper, L14_eta_upper, L23_eta_upper, L24_eta_upper, L34_eta_upper;
double L12_phi_upper, L13_phi_upper, L14_phi_upper, L23_phi_upper, L24_phi_upper, L34_phi_upper;
double L12_eta_bellow, L13_eta_bellow, L14_eta_bellow, L23_eta_bellow, L24_eta_bellow, L34_eta_bellow;
double L12_phi_bellow, L13_phi_bellow, L14_phi_bellow, L23_phi_bellow, L24_phi_bellow, L34_phi_bellow;
double L12_R_bellow, L13_R_bellow, L14_R_bellow, L23_R_bellow, L24_R_bellow, L34_R_bellow;
double dPhi;
double dEta;
double dPhi_1, dPhi_2, dPhi_3;
double dEta_1, dEta_2, dEta_3;
TVector3 first_temp, second_temp;
int _pass_Ele, _pass_Pos;
int L012_pass_Ele, L012_pass_Pos;
int L013_pass_Ele, L013_pass_Pos;
int L014_pass_Ele, L014_pass_Pos;
int L023_pass_Ele, L023_pass_Pos;
int L024_pass_Ele, L024_pass_Pos;
int L034_pass_Ele, L034_pass_Pos;
int L123_pass_Ele, L123_pass_Pos;
int L124_pass_Ele, L124_pass_Pos;
int L134_pass_Ele, L134_pass_Pos;
int L234_pass_Ele, L234_pass_Pos;
int L12_EM_Ele, L12_EM_Pos;
int L13_EM_Ele, L13_EM_Pos;
int L14_EM_Ele, L14_EM_Pos;
int L23_EM_Ele, L23_EM_Pos;
int L24_EM_Ele, L24_EM_Pos;
int L34_EM_Ele, L34_EM_Pos;
std::vector<TVector3> first_layer_hits;
std::vector<TVector3> second_layer_hits;
std::vector<TVector3> third_layer_hits;
std::vector<TVector3> fourth_layer_hits;
double r; // r for radius of pixel tracker layer
int layers[5]; // initialize as 0, layers contain # of hits on each pixel layer
TVector3 emvector;
float EgEt;
float EgEta;
float EgPhi;
std::vector<int> first_layer_hits_Ele_or_Pos;
std::vector<int> second_layer_hits_Ele_or_Pos;
std::vector<int> third_layer_hits_Ele_or_Pos;
std::vector<int> fourth_layer_hits_Ele_or_Pos;
std::vector<int> hitted_layers;
void MakeHistograms(TString hname, int nbins, float xmin, float xmax);
TH1* GetHist(TString hname);
void FillHist(TString histname, float value, float w, float xmin, float xmax, int nbins);
void StorePixelHit( int region);
double StandaloneDPhi( int first_hit, int second_hit, int third_hit, int which_first_hit, int which_second_hit, int which_third_hit );
double StandaloneDEta( int first_hit, int second_hit, int third_hit, int which_first_hit, int which_second_hit, int which_third_hit );
double EMmatchingDEta(TVector3& first_layer, TVector3& second_layer, TVector3& egvector);
double EMmatchingDPhi(TVector3& first_layer, TVector3& second_layer, TVector3& egvector);
int Signal_window_check( double upper, double value, double lower, int Ele_Pos);
void FillCutFlow(TString cut, float weight);
void SetROI(int region);
void SetSingalBoundary(int region, double eg_dphi, double eg_deta, double sa_dphi, double sa_deta);
void TriggeringWith_1st2ndPixel(int nthFirstHit, int nthSecondHit);
void TriggeringWith_1st3rdPixel(int nthFirstHit, int nthSecondHit);
void TriggeringWith_2nd3rdPixel(int nthFirstHit, int nthSecondHit);
void TriggeringWithout_4thPixel(int nthFirstHit, int nthSecondHit, int nthThirdHit);
void TriggeringWithout_3rdPixel(int nthFirstHit, int nthSecondHit, int nthThirdHit);
void TriggeringWithout_2ndPixel(int nthFirstHit, int nthSecondHit, int nthThirdHit);
void TriggeringWithout_1stPixel(int nthFirstHit, int nthSecondHit, int nthThirdHit);
void TriggeringWith_1st2ndPixel_v2(int nthFirstHit, int nthSecondHit);
void TriggeringWith_1st3rdPixel_v2(int nthFirstHit, int nthSecondHit);
void TriggeringWith_1st4thPixel_v2(int nthFirstHit, int nthSecondHit);
void TriggeringWith_2nd3rdPixel_v2(int nthFirstHit, int nthSecondHit);
void TriggeringWith_2nd4thPixel_v2(int nthFirstHit, int nthSecondHit);
void TriggeringWith_3rd4thPixel_v2(int nthFirstHit, int nthSecondHit);
inline float deltaPhi(float phi1, float phi2) {
float result = phi1 - phi2;
while (result > float(M_PI)) result -= float(2*M_PI);
while (result <= -float(M_PI)) result += float(2*M_PI);
return result;
}
test(TTree *tree=0);
virtual ~test();
virtual Int_t Cut(Long64_t entry);
virtual Int_t GetEntry(Long64_t entry);
virtual Long64_t LoadTree(Long64_t entry);
virtual void Init(TTree *tree);
virtual void Loop();
virtual Bool_t Notify();
virtual void Show(Long64_t entry = -1);
TFile *outfile;
TTree* pixtrk_tree;
int count_Entry;
int pass_egobjects_check;
int ntnEg2;
int event_denominator;
int event_nominator;
int nPix123_segments;
int nPix124_segments;
int nPix134_segments;
int nPix234_segments;
vector<float> ntEgEt;
vector<float> ntEgEta;
vector<float> ntEgPhi;
float matchedEgEt;
float matchedEgEta;
float matchedEgPhi;
int fired;
vector<int> PiXTRKbit;
vector<int> pix_comb;
vector<int> trigger_bit_width;
vector<bool> ntCl_match;
vector<bool> isTrack_match;
vector<float> chi2;
vector<float> track_dr;
vector<bool> withoutEM_match;
vector<bool> withEM_match;
vector<int> ntfirstPix;
vector<int> ntsecondPix;
vector<int> ntthirdPix;
vector<int> ntfourthPix;
float nt_lastSimtkpt;
float nt_initialSimtkpt;
float nt_genPhi;
float nt_genEta;
float nt_genPt;
};
#endif
#ifdef test_cxx
test::test(TTree *tree) : fChain(0)
{
// if parameter tree is not specified (or zero), connect the file
// used to generate this class and read the Tree.
if (tree == 0) {
//TChain * chain = new TChain("NtupleMaker/t","");
TChain * chain = new TChain("l1PiXTRKTree/L1PiXTRKTree","");
string line;
ifstream myfile("txt_to_path"); // txt_to_path will be replaced by the name of txt file that contains the location of input files
if (myfile.is_open())
{
while ( getline (myfile,line) )
{
if( line.length() != 0 ){
cout << line << '\n';
char file_path[300];
strcpy(file_path, line.c_str());
chain->Add(file_path);
}
}
myfile.close();
}
tree = chain;
}
Init(tree);
Ele = 1, Pos = 2;
skip = 1;
outfile = new TFile("../output_tmp/Tree_output","recreate");
pixtrk_tree = new TTree("t","t");
count_Entry = 1;
pixtrk_tree->Branch("totalEvent", &count_Entry, "count_Entry/I"); pixtrk_tree->Branch("totalEgN", &EgN, "EgN/F");
pixtrk_tree->Branch("ntnEg2", &ntnEg2, "ntnEg2/I");
pixtrk_tree->Branch("ntEgEt",&ntEgEt);
pixtrk_tree->Branch("ntEgEta",&ntEgEta);
pixtrk_tree->Branch("ntEgPhi",&ntEgPhi);
pixtrk_tree->Branch("PiXTRKbit",&PiXTRKbit);
pixtrk_tree->Branch("trigger_bit_width",&trigger_bit_width);
pixtrk_tree->Branch("pix_comb",&pix_comb);
pixtrk_tree->Branch("nPix123_segments",&nPix123_segments,"nPix123_segments/I");
pixtrk_tree->Branch("nPix124_segments",&nPix124_segments,"nPix124_segments/I");
pixtrk_tree->Branch("nPix134_segments",&nPix134_segments,"nPix134_segments/I");
pixtrk_tree->Branch("nPix234_segments",&nPix234_segments,"nPix234_segments/I");
pixtrk_tree->Branch("ntCl_match",&ntCl_match);
pixtrk_tree->Branch("isTrack_match",&isTrack_match);
pixtrk_tree->Branch("chi2",&chi2);
pixtrk_tree->Branch("track_dr",&track_dr);
pixtrk_tree->Branch("withoutEM_match",&withoutEM_match);
pixtrk_tree->Branch("withEM_match",&withEM_match);
pixtrk_tree->Branch("ntfirstPix",&ntfirstPix);
pixtrk_tree->Branch("ntsecondPix",&ntsecondPix);
pixtrk_tree->Branch("ntthirdPix",&ntthirdPix);
pixtrk_tree->Branch("ntfourthPix",&ntfourthPix);
pixtrk_tree->Branch("nt_genPhi",&nt_genPhi,"nt_genPhi/F");
pixtrk_tree->Branch("nt_genEta",&nt_genEta,"nt_genEta/F");
pixtrk_tree->Branch("nt_genPt",&nt_genPt,"nt_genPt/F");
pixtrk_tree->Branch("matchedEgEt",&matchedEgEt,"matchedEgEt/F");
pixtrk_tree->Branch("matchedEgEta",&matchedEgEta,"matchedEgEta/F");
pixtrk_tree->Branch("matchedEgPhi",&matchedEgPhi,"matchedEgPhi/F");
pixtrk_tree->Branch("nt_lastSimtkpt",&nt_lastSimtkpt,"nt_lastSimtkpt/F");
pixtrk_tree->Branch("nt_initialSimtkpt",&nt_initialSimtkpt,"nt_initialSimtkpt/F");
pixtrk_tree->Branch("fired",&fired,"fired/I");
}
test::~test()
{
if (!fChain) return;
delete fChain->GetCurrentFile();
}
Int_t test::GetEntry(Long64_t entry)
{
// Read contents of entry.
if (!fChain) return 0;
return fChain->GetEntry(entry);
}
Long64_t test::LoadTree(Long64_t entry)
{
// Set the environment to read one entry
if (!fChain) return -5;
Long64_t centry = fChain->LoadTree(entry);
if (centry < 0) return centry;
if (fChain->GetTreeNumber() != fCurrent) {
fCurrent = fChain->GetTreeNumber();
Notify();
}
return centry;
}
void test::Init(TTree *tree)
{
// The Init() function is called when the selector needs to initialize
// a new tree or chain. Typically here the branch addresses and branch
// pointers of the tree will be set.
// It is normally not necessary to make changes to the generated
// code, but the routine can be extended by the user if needed.
// Init() will be called many times when running on PROOF
// (once per file to be processed).
// Set object pointer
genPartE = 0;
genPartPt = 0;
genPartEta = 0;
genPartPhi = 0;
genPartCharge = 0;
genPartId = 0;
propgenElPartE = 0;
propgenElPartPt = 0;
propgenElPartEta = 0;
propgenElPartPhi = 0;
propgenElPartCharge = 0;
propgenElPartx = 0;
propgenElParty = 0;
propgenElPartz = 0;
simTrkPt = 0;
simTrkEta = 0;
simTrkPhi = 0;
simTrkId = 0;
simTrkType = 0;
simTrkVx = 0;
simTrkVy = 0;
simTrkVz = 0;
simVx = 0;
simVy = 0;
simVz = 0;
Brempos_radius = 0;
Brempos_x = 0;
Brempos_y = 0;
Brempos_z = 0;
bRecHitLayer = 0;
bRecHitLadder = 0;
bRecHitModule = 0;
fRecHitDisk = 0;
fRecHitBlade = 0;
fRecHitSide = 0;
fRecHitPanel = 0;
fRecHitModule = 0;
fRecHitGx = 0;
fRecHitGy = 0;
fRecHitGz = 0;
fRhSize = 0;
fRhSizeX = 0;
fRhSizeY = 0;
bRecHitGx = 0;
bRecHitGy = 0;
bRecHitGz = 0;
bRhSize = 0;
bRhSizeX = 0;
bRhSizeY = 0;
egCrysE = 0;
egCrysEt = 0;
egCrysEta = 0;
egCrysPhi = 0;
egCrysGx = 0;
egCrysGy = 0;
egCrysGz = 0;
egCrysClusterE = 0;
egCrysClusterEt = 0;
egCrysClusterEta = 0;
egCrysClusterPhi = 0;
egCrysClusterGx = 0;
egCrysClusterGy = 0;
egCrysClusterGz = 0;
egCrysClusterPGx = 0;
egCrysClusterPGy = 0;
egCrysClusterPGz = 0;
isTrackMatched = 0;
isoConeNTrack = 0;
isoConePtTrack = 0;
trackHighestPt = 0;
trackHighestPtEta = 0;
trackHighestPtPhi = 0;
trackHighestPtChi2 = 0;
trackHighestPtCutChi2 = 0;
trackHighestPtCutChi2Eta = 0;
trackHighestPtCutChi2Phi = 0;
trackHighestPtCutChi2Chi2 = 0;
trackmatchingdR = 0;
hgcal_isTrackMatched = 0;
hgcal_isoConeNTrack = 0;
hgcal_isoConePtTrack = 0;
hgcal_trackHighestPt = 0;
hgcal_trackHighestPtEta = 0;
hgcal_trackHighestPtPhi = 0;
hgcal_trackHighestPtChi2 = 0;
hgcal_trackHighestPtCutChi2 = 0;
hgcal_trackHighestPtCutChi2Eta = 0;
hgcal_trackHighestPtCutChi2Phi = 0;
hgcal_trackHighestPtCutChi2Chi2 = 0;
hgcal_trackmatchingdR = 0;
cl3d_pt = 0;
cl3d_energy = 0;
cl3d_eta = 0;
cl3d_phi = 0;
cl3d_nclu = 0;
cl3d_x = 0;
cl3d_y = 0;
cl3d_z = 0;
cl3d_coreshowerlength = 0;
cl3d_srrtot = 0;
cl3d_maxlayer = 0;
cl3d_firstlayer = 0;
egEt = 0;
egEta = 0;
egPhi = 0;
egGx = 0;
egGy = 0;
egGz = 0;
egIEt = 0;
egIEta = 0;
egIPhi = 0;
egIso = 0;
egBx = 0;
egTowerIPhi = 0;
egTowerIEta = 0;
egRawEt = 0;
egIsoEt = 0;
egFootprintEt = 0;
egNTT = 0;
egShape = 0;
egTowerHoE = 0;
// Set branch addresses and branch pointers
if (!tree) return;
fChain = tree;
fCurrent = -1;
fChain->SetMakeClass(1);
fChain->SetBranchAddress("nVtx", &nVtx, &b_nVtx);
fChain->SetBranchAddress("nMeanPU", &nMeanPU, &b_nMeanPU);
fChain->SetBranchAddress("genPartE", &genPartE, &b_genPartE);
fChain->SetBranchAddress("genPartPt", &genPartPt, &b_genPartPt);
fChain->SetBranchAddress("genPartEta", &genPartEta, &b_genPartEta);
fChain->SetBranchAddress("genPartPhi", &genPartPhi, &b_genPartPhi);
fChain->SetBranchAddress("genPartCharge", &genPartCharge, &b_genPartCharge);
fChain->SetBranchAddress("genPartId", &genPartId, &b_genPartId);
fChain->SetBranchAddress("propgenElPartE", &propgenElPartE, &b_propgenElPartE);
fChain->SetBranchAddress("propgenElPartPt", &propgenElPartPt, &b_propgenElPartPt);
fChain->SetBranchAddress("propgenElPartEta", &propgenElPartEta, &b_propgenElPartEta);
fChain->SetBranchAddress("propgenElPartPhi", &propgenElPartPhi, &b_propgenElPartPhi);
fChain->SetBranchAddress("propgenElPartCharge", &propgenElPartCharge, &b_propgenElPartCharge);
fChain->SetBranchAddress("propgenElPartx", &propgenElPartx, &b_propgenElPartx);
fChain->SetBranchAddress("propgenElParty", &propgenElParty, &b_propgenElParty);
fChain->SetBranchAddress("propgenElPartz", &propgenElPartz, &b_propgenElPartz);
fChain->SetBranchAddress("simTrkN", &simTrkN, &b_simTrkN);
fChain->SetBranchAddress("simTrkPt", &simTrkPt, &b_simTrkPt);
fChain->SetBranchAddress("simTrkEta", &simTrkEta, &b_simTrkEta);
fChain->SetBranchAddress("simTrkPhi", &simTrkPhi, &b_simTrkPhi);
fChain->SetBranchAddress("simTrkId", &simTrkId, &b_simTrkId);
fChain->SetBranchAddress("simTrkType", &simTrkType, &b_simTrkType);
fChain->SetBranchAddress("simTrkVx", &simTrkVx, &b_simTrkVx);
fChain->SetBranchAddress("simTrkVy", &simTrkVy, &b_simTrkVy);
fChain->SetBranchAddress("simTrkVz", &simTrkVz, &b_simTrkVz);
fChain->SetBranchAddress("simVx", &simVx, &b_simVx);
fChain->SetBranchAddress("simVy", &simVy, &b_simVy);
fChain->SetBranchAddress("simVz", &simVz, &b_simVz);
fChain->SetBranchAddress("maxBrempos", &maxBrempos, &b_maxBrempos);
fChain->SetBranchAddress("lastSimtkpt", &lastSimtkpt, &b_lastSimtkpt);
fChain->SetBranchAddress("initialSimtkpt", &initialSimtkpt, &b_initialSimtkpt);
fChain->SetBranchAddress("bremflag", &bremflag, &b_bremflag);
fChain->SetBranchAddress("Brempos_radius", &Brempos_radius, &b_Brempos_radius);
fChain->SetBranchAddress("Brempos_x", &Brempos_x, &b_Brempos_x);
fChain->SetBranchAddress("Brempos_y", &Brempos_y, &b_Brempos_y);
fChain->SetBranchAddress("Brempos_z", &Brempos_z, &b_Brempos_z);
fChain->SetBranchAddress("bRecHitLayer", &bRecHitLayer, &b_bRecHitLayer);
fChain->SetBranchAddress("bRecHitLadder", &bRecHitLadder, &b_bRecHitLadder);
fChain->SetBranchAddress("bRecHitModule", &bRecHitModule, &b_bRecHitModule);
fChain->SetBranchAddress("fRecHitDisk", &fRecHitDisk, &b_fRecHitDisk);
fChain->SetBranchAddress("fRecHitBlade", &fRecHitBlade, &b_fRecHitBlade);
fChain->SetBranchAddress("fRecHitSide", &fRecHitSide, &b_fRecHitSide);
fChain->SetBranchAddress("fRecHitPanel", &fRecHitPanel, &b_fRecHitPanel);
fChain->SetBranchAddress("fRecHitModule", &fRecHitModule, &b_fRecHitModule);
fChain->SetBranchAddress("bRecHitN", &bRecHitN, &b_bRecHitN);
fChain->SetBranchAddress("fRecHitN", &fRecHitN, &b_fRecHitN);
fChain->SetBranchAddress("fRecHitGx", &fRecHitGx, &b_fRecHitGx);
fChain->SetBranchAddress("fRecHitGy", &fRecHitGy, &b_fRecHitGy);
fChain->SetBranchAddress("fRecHitGz", &fRecHitGz, &b_fRecHitGz);
fChain->SetBranchAddress("fRhSize", &fRhSize, &b_fRhSize);
fChain->SetBranchAddress("fRhSizeX", &fRhSizeX, &b_fRhSizeX);
fChain->SetBranchAddress("fRhSizeY", &fRhSizeY, &b_fRhSizeY);
fChain->SetBranchAddress("bRecHitGx", &bRecHitGx, &b_bRecHitGx);
fChain->SetBranchAddress("bRecHitGy", &bRecHitGy, &b_bRecHitGy);
fChain->SetBranchAddress("bRecHitGz", &bRecHitGz, &b_bRecHitGz);
fChain->SetBranchAddress("bRhSize", &bRhSize, &b_bRhSize);
fChain->SetBranchAddress("bRhSizeX", &bRhSizeX, &b_bRhSizeX);
fChain->SetBranchAddress("bRhSizeY", &bRhSizeY, &b_bRhSizeY);
fChain->SetBranchAddress("egCrysE", &egCrysE, &b_egCrysE);
fChain->SetBranchAddress("egCrysEt", &egCrysEt, &b_egCrysEt);
fChain->SetBranchAddress("egCrysEta", &egCrysEta, &b_egCrysEta);
fChain->SetBranchAddress("egCrysPhi", &egCrysPhi, &b_egCrysPhi);
fChain->SetBranchAddress("egCrysGx", &egCrysGx, &b_egCrysGx);
fChain->SetBranchAddress("egCrysGy", &egCrysGy, &b_egCrysGy);
fChain->SetBranchAddress("egCrysGz", &egCrysGz, &b_egCrysGz);
fChain->SetBranchAddress("egCrysClusterE", &egCrysClusterE, &b_egCrysClusterE);
fChain->SetBranchAddress("egCrysClusterEt", &egCrysClusterEt, &b_egCrysClusterEt);
fChain->SetBranchAddress("egCrysClusterEta", &egCrysClusterEta, &b_egCrysClusterEta);
fChain->SetBranchAddress("egCrysClusterPhi", &egCrysClusterPhi, &b_egCrysClusterPhi);
fChain->SetBranchAddress("egCrysClusterGx", &egCrysClusterGx, &b_egCrysClusterGx);
fChain->SetBranchAddress("egCrysClusterGy", &egCrysClusterGy, &b_egCrysClusterGy);
fChain->SetBranchAddress("egCrysClusterGz", &egCrysClusterGz, &b_egCrysClusterGz);
fChain->SetBranchAddress("egCrysClusterPGx", &egCrysClusterPGx, &b_egCrysClusterPGx);
fChain->SetBranchAddress("egCrysClusterPGy", &egCrysClusterPGy, &b_egCrysClusterPGy);
fChain->SetBranchAddress("egCrysClusterPGz", &egCrysClusterPGz, &b_egCrysClusterPGz);
fChain->SetBranchAddress("isTrackMatched", &isTrackMatched, &b_isTrackMatched);
fChain->SetBranchAddress("isoConeNTrack", &isoConeNTrack, &b_isoConeNTrack);
fChain->SetBranchAddress("isoConePtTrack", &isoConePtTrack, &b_isoConePtTrack);
fChain->SetBranchAddress("trackHighestPt", &trackHighestPt, &b_trackHighestPt);
fChain->SetBranchAddress("trackHighestPtEta", &trackHighestPtEta, &b_trackHighestPtEta);
fChain->SetBranchAddress("trackHighestPtPhi", &trackHighestPtPhi, &b_trackHighestPtPhi);
fChain->SetBranchAddress("trackHighestPtChi2", &trackHighestPtChi2, &b_trackHighestPtChi2);
fChain->SetBranchAddress("trackHighestPtCutChi2", &trackHighestPtCutChi2, &b_trackHighestPtCutChi2);
fChain->SetBranchAddress("trackHighestPtCutChi2Eta", &trackHighestPtCutChi2Eta, &b_trackHighestPtCutChi2Eta);
fChain->SetBranchAddress("trackHighestPtCutChi2Phi", &trackHighestPtCutChi2Phi, &b_trackHighestPtCutChi2Phi);
fChain->SetBranchAddress("trackHighestPtCutChi2Chi2", &trackHighestPtCutChi2Chi2, &b_trackHighestPtCutChi2Chi2);
fChain->SetBranchAddress("trackmatchingdR", &trackmatchingdR, &b_trackmatchingdR);
fChain->SetBranchAddress("hgcal_isTrackMatched", &hgcal_isTrackMatched, &b_hgcal_isTrackMatched);
fChain->SetBranchAddress("hgcal_isoConeNTrack", &hgcal_isoConeNTrack, &b_hgcal_isoConeNTrack);
fChain->SetBranchAddress("hgcal_isoConePtTrack", &hgcal_isoConePtTrack, &b_hgcal_isoConePtTrack);
fChain->SetBranchAddress("hgcal_trackHighestPt", &hgcal_trackHighestPt, &b_hgcal_trackHighestPt);
fChain->SetBranchAddress("hgcal_trackHighestPtEta", &hgcal_trackHighestPtEta, &b_hgcal_trackHighestPtEta);
fChain->SetBranchAddress("hgcal_trackHighestPtPhi", &hgcal_trackHighestPtPhi, &b_hgcal_trackHighestPtPhi);
fChain->SetBranchAddress("hgcal_trackHighestPtChi2", &hgcal_trackHighestPtChi2, &b_hgcal_trackHighestPtChi2);
fChain->SetBranchAddress("hgcal_trackHighestPtCutChi2", &hgcal_trackHighestPtCutChi2, &b_hgcal_trackHighestPtCutChi2);
fChain->SetBranchAddress("hgcal_trackHighestPtCutChi2Eta", &hgcal_trackHighestPtCutChi2Eta, &b_hgcal_trackHighestPtCutChi2Eta);
fChain->SetBranchAddress("hgcal_trackHighestPtCutChi2Phi", &hgcal_trackHighestPtCutChi2Phi, &b_hgcal_trackHighestPtCutChi2Phi);
fChain->SetBranchAddress("hgcal_trackHighestPtCutChi2Chi2", &hgcal_trackHighestPtCutChi2Chi2, &b_hgcal_trackHighestPtCutChi2Chi2);
fChain->SetBranchAddress("hgcal_trackmatchingdR", &hgcal_trackmatchingdR, &b_hgcal_trackmatchingdR);
fChain->SetBranchAddress("cl3d_n", &cl3d_n, &b_cl3d_n);
fChain->SetBranchAddress("cl3d_pt", &cl3d_pt, &b_cl3d_pt);
fChain->SetBranchAddress("cl3d_energy", &cl3d_energy, &b_cl3d_energy);
fChain->SetBranchAddress("cl3d_eta", &cl3d_eta, &b_cl3d_eta);
fChain->SetBranchAddress("cl3d_phi", &cl3d_phi, &b_cl3d_phi);
fChain->SetBranchAddress("cl3d_nclu", &cl3d_nclu, &b_cl3d_nclu);
fChain->SetBranchAddress("cl3d_x", &cl3d_x, &b_cl3d_x);
fChain->SetBranchAddress("cl3d_y", &cl3d_y, &b_cl3d_y);
fChain->SetBranchAddress("cl3d_z", &cl3d_z, &b_cl3d_z);
fChain->SetBranchAddress("cl3d_coreshowerlength", &cl3d_coreshowerlength, &b_cl3d_coreshowerlength);
fChain->SetBranchAddress("cl3d_srrtot", &cl3d_srrtot, &b_cl3d_srrtot);
fChain->SetBranchAddress("cl3d_maxlayer", &cl3d_maxlayer, &b_cl3d_maxlayer);
fChain->SetBranchAddress("cl3d_firstlayer", &cl3d_firstlayer, &b_cl3d_firstlayer);
fChain->SetBranchAddress("egN", &egN, &b_egN);
fChain->SetBranchAddress("egEt", &egEt, &b_egEt);
fChain->SetBranchAddress("egEta", &egEta, &b_egEta);
fChain->SetBranchAddress("egPhi", &egPhi, &b_egPhi);
fChain->SetBranchAddress("egGx", &egGx, &b_egGx);
fChain->SetBranchAddress("egGy", &egGy, &b_egGy);
fChain->SetBranchAddress("egGz", &egGz, &b_egGz);
fChain->SetBranchAddress("egIEt", &egIEt, &b_egIEt);
fChain->SetBranchAddress("egIEta", &egIEta, &b_egIEta);
fChain->SetBranchAddress("egIPhi", &egIPhi, &b_egIPhi);
fChain->SetBranchAddress("egIso", &egIso, &b_egIso);
fChain->SetBranchAddress("egBx", &egBx, &b_egBx);
fChain->SetBranchAddress("egTowerIPhi", &egTowerIPhi, &b_egTowerIPhi);
fChain->SetBranchAddress("egTowerIEta", &egTowerIEta, &b_egTowerIEta);
fChain->SetBranchAddress("egRawEt", &egRawEt, &b_egRawEt);
fChain->SetBranchAddress("egIsoEt", &egIsoEt, &b_egIsoEt);
fChain->SetBranchAddress("egFootprintEt", &egFootprintEt, &b_egFootprintEt);
fChain->SetBranchAddress("egNTT", &egNTT, &b_egNTT);
fChain->SetBranchAddress("egShape", &egShape, &b_egShape);
fChain->SetBranchAddress("egTowerHoE", &egTowerHoE, &b_egTowerHoE);
Notify();
}
Bool_t test::Notify()
{
// The Notify() function is called when a new file is opened. This
// can be either for a new TTree in a TChain or when when a new TTree
// is started when using PROOF. It is normally not necessary to make changes
// to the generated code, but the routine can be extended by the
// user if needed. The return value is currently not used.
return kTRUE;
}
void test::Show(Long64_t entry)
{
// Print contents of entry.
// If entry is not specified, print current entry
if (!fChain) return;
fChain->Show(entry);
}
Int_t test::Cut(Long64_t entry)
{
// This function may be called from Loop.
// returns 1 if entry is accepted.
// returns -1 otherwise.
return 1;
}
void test::MakeHistograms(TString hname, int nbins, float xmin, float xmax){
maphist[hname] = new TH1F(hname.Data(),hname.Data(),nbins,xmin,xmax);
}
TH1* test::GetHist(TString hname){
TH1* h = NULL;
std::map<TString, TH1*>::iterator mapit = maphist.find(hname);
if(mapit != maphist.end()) return mapit->second;
return h;
}
void test::FillHist(TString histname, float value, float w, float xmin, float xmax, int nbins){
if(GetHist(histname)) GetHist(histname)->Fill(value, w);
else{
// cout << "Making histogram..." << endl;
MakeHistograms(histname, nbins, xmin, xmax);
if(GetHist(histname)) GetHist(histname)->Fill(value, w);
}
}
double test::StandaloneDPhi( int first_hit, int second_hit, int third_hit, int which_first_hit, int which_second_hit, int which_third_hit ){
if( first_hit == 0 ){
TVector3 temp;
if( second_hit == 1 ) temp.SetXYZ( first_layer_hits[which_second_hit].X(), first_layer_hits[which_second_hit].Y(), first_layer_hits[which_second_hit].Z() );
if( second_hit == 2 ) temp.SetXYZ( second_layer_hits[which_second_hit].X(), second_layer_hits[which_second_hit].Y(), second_layer_hits[which_second_hit].Z() );
if( second_hit == 3 ) temp.SetXYZ( third_layer_hits[which_second_hit].X(), third_layer_hits[which_second_hit].Y(), third_layer_hits[which_second_hit].Z() );
if( third_hit == 2 ) return deltaPhi( (second_layer_hits[which_third_hit] - temp).Phi(), temp.Phi());
if( third_hit == 3 ) return deltaPhi( (third_layer_hits[which_third_hit] - temp).Phi(), temp.Phi());
if( third_hit == 4 ) return deltaPhi( (fourth_layer_hits[which_third_hit] - temp).Phi(), temp.Phi());
}
if( first_hit != 0 ){
TVector3 temp_first_layer;
TVector3 temp_second_layer;
TVector3 temp_third_layer;
if( first_hit == 1 ) temp_first_layer = first_layer_hits[which_first_hit];
if( first_hit == 2 ) temp_first_layer = second_layer_hits[which_first_hit];
if( second_hit == 2 ) temp_second_layer = second_layer_hits[which_second_hit];
if( second_hit == 3 ) temp_second_layer = third_layer_hits[which_second_hit];
if( third_hit == 3 ) temp_third_layer = third_layer_hits[which_third_hit];
if( third_hit == 4 ) temp_third_layer = fourth_layer_hits[which_third_hit];
return deltaPhi( (temp_third_layer - temp_second_layer).Phi(), (temp_second_layer - temp_first_layer).Phi());
}
return 0.;
}
double test::StandaloneDEta( int first_hit, int second_hit, int third_hit, int which_first_hit, int which_second_hit, int which_third_hit ){
TVector3 temp_first_layer;
TVector3 temp_second_layer;
TVector3 temp_third_layer;
if( first_hit == 1 ) temp_first_layer = first_layer_hits[which_first_hit];
if( first_hit == 2 ) temp_first_layer = second_layer_hits[which_first_hit];
if( second_hit == 2 ) temp_second_layer = second_layer_hits[which_second_hit];
if( second_hit == 3 ) temp_second_layer = third_layer_hits[which_second_hit];