-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOutput.cc
executable file
·1074 lines (876 loc) · 39.8 KB
/
Output.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "Output.h"
#include <TRandom3.h>
#include <TBranch.h>
#include <TStyle.h>
#include <TSystem.h>
#include <TString.h>
#include <algorithm>
Output::Output( string datacardfile ) {
Input = AnaInput::Instance() ;
select = new DPSelection( datacardfile ) ;
normV = Input->NormalizeComponents( datacardfile );
SkipEvents = 0 ;
Input->GetParameters("ProcessEvents", &ProcessEvents ) ;
Input->GetParameters("SkipEvents", &SkipEvents ) ;
Input->GetParameters("Path", &hfolder ) ;
Input->GetParameters("HFileName", &hfName ) ;
Input->GetParameters("TimeCalib", &timeCalib) ;
Input->GetParameters("JetCuts", &jetCuts) ;
Input->GetParameters("PhotonCuts", &photonCuts) ;
Input->GetParameters("SystType", &systType ) ;
Input->GetParameters("TCut", &TCut ) ;
// Define time scope
n_t_bin = 48 ;
t_low = TCut[2] ;
t_up = TCut[3] ;
printf(" Observe time window: %f ~ %f \n", t_low, t_up ) ;
}
Output::~Output(){
theFile->Close() ;
cout<<" File closed ! "<<endl ;
delete select ;
//delete Input ;
cout<<" done ! "<<endl ;
}
void Output::CreateHisto() {
gSystem->mkdir( hfolder.c_str() );
TString Path_fName = hfolder + hfName + ".root" ;
theFile = new TFile( Path_fName, "RECREATE" );
theFile->cd() ;
h_dataTimeBFD= new TH1D("h_dataTimeBFD", "Photon Seed Time from data - Full Range", 100, -9.5, 15.5);
h_dataTimeAEC= new TH1D("h_dataTimeAEC", "Photon Seed Time from data - Full Range", 100, -9.5, 15.5);
h_sgTimeBFD = new TH1D("h_sgTimeBFD", "Photon Seed Time from signal MC - Full Range", 100, -9.5, 15.5);
h_sgTimeAEC = new TH1D("h_sgTimeAEC", "Photon Seed Time from signal MC - Full Range", 100, -9.5, 15.5);
h_dataTime = new TH1D("h_dataTime", "Photon Seed Time from data", n_t_bin, t_low, t_up);
h_dataTimeA = new TH1D("h_dataTimeA", "Photon Ave. Cluster Time from data", n_t_bin, t_low, t_up);
h_bgTime = new TH1D("h_bgTime", "Photon Seed Time of background ", n_t_bin, t_low, t_up);
h_bgTimeA = new TH1D("h_bgTimeA", "Photon Ave. Cluster Time of background ", n_t_bin, t_low, t_up);
h_sgTime = new TH1D("h_sgTime", "Photon Seed Time of signal ", n_t_bin, t_low, t_up);
h_sgTimeA = new TH1D("h_sgTimeA", "Photon Ave. Cluster Time of signal ", n_t_bin, t_low, t_up);
// ABCD use
// x is eta region , each is 0.28
// y is different sample, 0:total, 1:halo, 2: spike, 3: cosmic
// z is jet mulitplicity
hBg_F = new TH3D( "hBg_F", "Background in F region ", 5, 0., 5, 4, 0, 4, 3, 0, 3 ) ;
hBg_E = new TH3D( "hBg_E", "Background in E region ", 5, 0., 5, 4, 0, 4, 3, 0, 3 ) ;
hBg_D = new TH3D( "hBg_D", "Background in D region ", 5, 0., 5, 4, 0, 4, 3, 0, 3 ) ;
hBg_C = new TH3D( "hBg_C", "Background in C region ", 5, 0., 5, 4, 0, 4, 3, 0, 3 ) ;
hBg_B = new TH3D( "hBg_B", "Background in B region ", 5, 0., 5, 4, 0, 4, 3, 0, 3 ) ;
hBg_A = new TH3D( "hBg_A", "Background in A region ", 5, 0., 5, 4, 0, 4, 3, 0, 3 ) ;
hCol_F = new TH3D( "hCol_F", "Background in |t| < 2ns region", 5, 0, 5, 4, 0, 4, 3, 0, 3 ) ;
hCol_E = new TH3D( "hCol_E", "Background in |t| < 2ns region", 5, 0, 5, 4, 0, 4, 3, 0, 3 ) ;
hCol_D = new TH3D( "hCol_D", "Background in D (signal) region", 5, 0, 5, 4, 0, 4, 3, 0, 3 ) ;
hCol_C = new TH3D( "hCol_C", "Background in C ", 5, 0, 5, 4, 0, 4, 3, 0, 3 ) ;
hCol_B = new TH3D( "hCol_B", "Background in B ", 5, 0, 5, 4, 0, 4, 3, 0, 3 ) ;
hCol_A = new TH3D( "hCol_A", "Background in A ", 5, 0, 5, 4, 0, 4, 3, 0, 3 ) ;
theFile->cd() ;
}
void Output::Produce() {
CreateHisto() ;
string dataFileNames ;
Input->GetParameters( "TheData", &dataFileNames );
//vector<string> mcFileNames ;
//Input->GetParameters( "TheMC", &mcFileNames );
RunData( dataFileNames ) ;
/*
for ( size_t i=0 ; i < mcFileNames.size() ; i++ ) {
RunMC( mcFileNames[i], normV[i] ) ;
}
*/
}
void Output::ProduceMC() {
CreateHisto() ;
vector<string> mcFileNames ;
Input->GetParameters( "TheMC", &mcFileNames );
vector<string> mcIdx ;
Input->GetParameters( "mcIndex", &mcIdx );
double br ;
Input->GetParameters( "BR", &br );
double totalR = (br*br) + (2.*(1.-br)*br) ;
printf(" BR = %f => total Ratio %.4f \n", br, totalR ) ;
for ( size_t i=0 ; i < mcFileNames.size() ; i++ ) {
RunMC( mcFileNames[i], mcIdx[i], normV[i]*totalR ) ;
}
}
void Output::ProduceGen() {
CreateHisto() ;
vector<string> mcFileNames ;
Input->GetParameters( "TheMC", &mcFileNames );
// use official 6000 mm sample as base , normalize every sample to the number*scale factor
//double n6k = 5.681 ;
//double scale[6] = { 0.412, 0.807, 1.004, 0.948, 0.721, 0.488 } ;
string ctau_Id[6] = { "500", "1000", "2000", "3000", "6000", "12000" } ;
for ( size_t i=0 ; i < mcFileNames.size() ; i++ ) {
RunGenOnly( mcFileNames[i], ctau_Id[i], normV[i], 1. ) ;
}
}
// Produce Data and Background histogram for statistical test
void Output::RunData( string dataName ) {
float phoPx[MAXPHO], phoPy[MAXPHO], phoPz[MAXPHO], phoE[MAXPHO] ;
float seedTime[MAXPHO], seedSwissX[MAXPHO], aveTime[MAXPHO], aveTime1[MAXPHO], timeChi2[MAXPHO] ;
float metE ;
int nPhotons, nJets ;
float cscdPhi[MAXPHO], sMinPho[MAXPHO], sMajPho[MAXPHO], dtdPhi[MAXPHO], dtdEta[MAXPHO] ;
int nXtals[MAXPHO] ;
//TTree* tr = Input->TreeMap( dataName );
string dataFileNames ;
if ( dataName != "0" ) {
dataFileNames = dataName ;
} else {
Input->GetParameters( "TheData", &dataFileNames );
}
TTree* tr = Input->GetTree( dataFileNames, "DPAnalysis" );
// clone the tree for event selection
TChain* tr1 = (TChain*) tr->Clone() ;
tr->SetBranchAddress("nPhotons", &nPhotons);
tr->SetBranchAddress("nJets", &nJets);
tr->SetBranchAddress("met", &metE );
tr->SetBranchAddress("phoPx", phoPx );
tr->SetBranchAddress("phoPy", phoPy );
tr->SetBranchAddress("phoPz", phoPz );
tr->SetBranchAddress("phoE", phoE );
tr->SetBranchAddress("seedTime", seedTime );
tr->SetBranchAddress("aveTime", aveTime );
tr->SetBranchAddress("aveTime1", aveTime1 );
tr->SetBranchAddress("timeChi2", timeChi2 );
tr->SetBranchAddress("sMinPho", sMinPho );
tr->SetBranchAddress("sMajPho", sMajPho );
tr->SetBranchAddress("seedSwissX", seedSwissX );
tr->SetBranchAddress("nXtals", nXtals );
tr->SetBranchAddress("cscdPhi", cscdPhi );
tr->SetBranchAddress("dtdPhi", dtdPhi );
tr->SetBranchAddress("dtdEta", dtdEta );
// initialize selection
select->Init( tr1 ) ;
select->ResetCounter() ;
int totalN = tr->GetEntries();
cout<<" **** from "<< dataName <<" total entries = "<< totalN <<" Process "<< ProcessEvents <<endl;
int nEvt = 0 ;
int beginEvent = SkipEvents + 1 ;
cout<<" Event start from : "<< beginEvent << endl ;
for ( int i= beginEvent ; i< totalN ; i++ ) {
if ( ProcessEvents > 0 && i > ( ProcessEvents + beginEvent - 1 ) ) break;
if ( i % 100000 == 0 && i > 99999 ) printf(" ----- processed %8d Events \n", i ) ;
tr->GetEntry( i );
tr1->GetEntry( i );
// 1. Reset the cuts and collectors
select->ResetCuts() ;
select->ResetCollection() ;
nEvt++;
uint32_t evtType = select->EventIdentification();
// Type = 2 : Control sample , at least one photon pt > 45 GeV
bool wanted = ( (evtType >> 1) & 1 ) ;
bool passHLT = ( (evtType >> 5) & 1 ) ;
if ( !wanted || !passHLT ) continue ;
selectJets.clear() ;
select->GetCollection("Jet", selectJets ) ;
selectPho.clear() ;
select->GetCollection("Photon", selectPho ) ;
newMET = select->newMET ;
noPhotMET = select->noPhotMET ;
//cout<<" EVT# : "<< nEvt <<endl ;
// Signal Region - Photon Pt > 80
// pick the photon if more than one in the event
int k = 0 ;
int j = 0 ;
for ( j = 0 ; j < (int)selectPho.size() ; j++) {
int m = selectPho[j].first ;
if ( seedTime[m] > TCut[2] && seedTime[m] < TCut[3] ) {
k = m ;
break ;
} else if ( seedTime[m] > TCut[0] && seedTime[m] < TCut[1] ) {
k = m ;
break ;
} else {
k = selectPho[0].first ;
break ;
}
}
//for ( size_t j =0 ; j < selectPho.size() ; j++ ) {
//int k = selectPho[j].first ;
TLorentzVector gP4_ = TLorentzVector( phoPx[k], phoPy[k], phoPz[k], phoE[k] ) ;
// Background Tagging
bool haloTag = select->HaloTag( cscdPhi[k] , sMajPho[k] , sMinPho[k] , gP4_.Eta() ) ;
bool spikeTag = select->SpikeTag( nXtals[k] , sMajPho[k] , sMinPho[k], seedSwissX[k], gP4_.Eta() ) ;
bool cosmicTag = select->CosmicTag( dtdEta[k] , dtdPhi[k] ) ;
bool ghostTag = ( haloTag || spikeTag || cosmicTag ) ? true : false ;
int ih = ( fabs(gP4_.Eta()) >= 1.4 ) ? 4 : ( fabs(gP4_.Eta()) / 0.28 ) ;
int nj = ( selectJets.size() > 2 ) ? 2 : (int)selectJets.size() ;
// Seperation of collision and halo backgrounds
bool passABCDSelection = ( newMET.E() > jetCuts[4] && timeChi2[k] < 4 && selectPho[0].second.Pt() > photonCuts[8] ) ;
bool passCollSelection = ( newMET.E() < jetCuts[4] && timeChi2[k] < 4 && selectPho[0].second.Pt() > photonCuts[8] ) ;
// *************************
// * Halo-type Backgorunds *
// *************************
// Overall time shape - This is for validation
if ( passABCDSelection && !ghostTag && selectJets.size() >= jetCuts[2] && selectJets.size() <= jetCuts[3] ) {
if ( noPhotMET.E() > jetCuts[4] ) h_dataTimeBFD->Fill( seedTime[k] ) ;
if ( noPhotMET.E() < jetCuts[4] ) h_dataTimeAEC->Fill( seedTime[k] ) ;
}
// Region E,F |t| < 2 ns
if ( fabs( seedTime[k]) < 2. && passABCDSelection ) {
if ( noPhotMET.E() > jetCuts[4] ) hBg_F->Fill( ih, 0.5, nj );
if ( noPhotMET.E() < jetCuts[4] ) hBg_E->Fill( ih, 0.5, nj );
}
// Background template
// A and B region
if ( seedTime[k] > TCut[0] && seedTime[k] < TCut[1] && passABCDSelection ) {
// Region A
if ( noPhotMET.E() < jetCuts[4] ) {
hBg_A->Fill( ih, 0.5, nj );
if ( haloTag && !cosmicTag && !spikeTag ) hBg_A->Fill( ih, 1.5, nj );
if ( spikeTag && !cosmicTag ) hBg_A->Fill( ih, 2.5, nj );
if ( cosmicTag ) hBg_A->Fill( ih, 3.5, nj );
}
// Region B
if ( noPhotMET.E() > jetCuts[4] ) {
hBg_B->Fill( ih, 0.5, nj );
if ( haloTag && !cosmicTag && !spikeTag ) hBg_B->Fill( ih, 1.5, nj );
if ( spikeTag && !cosmicTag ) hBg_B->Fill( ih, 2.5, nj );
if ( cosmicTag ) hBg_B->Fill( ih, 3.5, nj );
}
}
// C and D region
if ( seedTime[k] > t_low && seedTime[k] < t_up && passABCDSelection ) {
// Region C
if ( noPhotMET.E() < jetCuts[4] ) {
hBg_C->Fill( ih, 0.5, nj );
if ( haloTag && !cosmicTag && !spikeTag ) hBg_C->Fill( ih, 1.5, nj );
if ( spikeTag && !cosmicTag ) hBg_C->Fill( ih, 2.5, nj );
if ( cosmicTag ) hBg_C->Fill( ih, 3.5, nj );
// Background shape selection - C region
if ( !ghostTag && selectJets.size() >= jetCuts[2] && selectJets.size() <= jetCuts[3] ) {
h_bgTime->Fill( seedTime[k] ) ;
h_bgTimeA->Fill( aveTime[k] ) ;
}
}
// Region D
if ( noPhotMET.E() > jetCuts[4] ) {
hBg_D->Fill( ih, 0.5, nj );
if ( haloTag && !cosmicTag && !spikeTag ) hBg_D->Fill( ih, 1.5, nj );
if ( spikeTag && !cosmicTag ) hBg_D->Fill( ih, 2.5, nj );
if ( cosmicTag ) hBg_D->Fill( ih, 3.5, nj );
// Final signal sample - D region
if ( !ghostTag && selectJets.size() >= jetCuts[2] && selectJets.size() <= jetCuts[3] ) {
h_dataTime->Fill( seedTime[k] ) ;
h_dataTimeA->Fill( aveTime[k] ) ;
}
}
}
// ******************************
// * Collision-type Backgorunds *
// ******************************
// Region E/F , |t| < 2 ns
if ( fabs(seedTime[k]) < 2. && passCollSelection ) {
if ( noPhotMET.E() > jetCuts[4] ) hCol_F->Fill( ih, 0.5, nj );
if ( noPhotMET.E() < jetCuts[4] ) hCol_E->Fill( ih, 0.5, nj );
}
if ( seedTime[k] > TCut[0] && seedTime[k] < TCut[1] && passCollSelection ) {
// Region B
if ( noPhotMET.E() > jetCuts[4] ) {
hCol_B->Fill( ih, 0.5, nj );
if ( haloTag && !cosmicTag && !spikeTag ) hCol_B->Fill( ih, 1.5, nj );
if ( spikeTag && !cosmicTag ) hCol_B->Fill( ih, 2.5, nj );
if ( cosmicTag ) hCol_B->Fill( ih, 3.5, nj );
}
// Region A
if ( noPhotMET.E() < jetCuts[4] ) {
hCol_A->Fill( ih, 0.5, nj );
if ( haloTag && !cosmicTag && !spikeTag ) hCol_A->Fill( ih, 1.5, nj );
if ( spikeTag && !cosmicTag ) hCol_A->Fill( ih, 2.5, nj );
if ( cosmicTag ) hCol_A->Fill( ih, 3.5, nj );
}
}
// ******************
// Region C and D
// ******************
if ( seedTime[k] > t_low && seedTime[k] < t_up && passCollSelection ) {
// Region D
if ( noPhotMET.E() > jetCuts[4] ) {
hCol_D->Fill( ih, 0.5, nj );
if ( haloTag && !cosmicTag && !spikeTag ) hCol_D->Fill( ih, 1.5, nj );
if ( spikeTag && !cosmicTag ) hCol_D->Fill( ih, 2.5, nj );
if ( cosmicTag ) hCol_D->Fill( ih, 3.5, nj );
}
// Region C
if ( noPhotMET.E() < jetCuts[4] ) {
hCol_C->Fill( ih, 0.5, nj );
if ( haloTag && !cosmicTag && !spikeTag ) hCol_C->Fill( ih, 1.5, nj );
if ( spikeTag && !cosmicTag ) hCol_C->Fill( ih, 2.5, nj );
if ( cosmicTag ) hCol_C->Fill( ih, 3.5, nj );
}
}
//}
} // end of event looping
// Background estimation
TH3D* ACols[] = { hCol_A, hCol_B, hCol_C, hCol_D, hCol_E, hCol_F } ;
vector<TH3D*> hColls( ACols, ACols+6 ) ;
TH3D* AMIBs[] = { hBg_A, hBg_B, hBg_C, hBg_D, hBg_E, hBg_F } ;
vector<TH3D*> hMIBs( AMIBs, AMIBs+6 ) ;
vector<double> predictBG = select->ABCD_ABCD( hColls, hMIBs ) ;
double bgScale = ( h_bgTime->Integral() > 0. ) ? predictBG[0] / h_bgTime->Integral() : 1. ;
if ( h_bgTime->Integral() == 0 ) {
// if the predicted background == 0, use the upward 1-sigam as the background
// otherwise the background is set to be 1
//double theCount = ( predictBG[0] > 0. ) ? predictBG[0] : predictBG[1] ;
//if ( theCount == 0 ) theCount = 1 ;
// average the count in each bin
double nbin = (double) h_bgTime->GetNbinsX() ;
double c_bin = predictBG[0] / nbin ;
for ( int i =1 ; i <= h_bgTime->GetNbinsX() ; i++ ) {
h_bgTime->SetBinContent( i , c_bin ) ;
h_bgTime->SetBinError( i , predictBG[1]/sqrt( nbin ) ) ;
}
}
h_bgTime->Scale( bgScale ) ;
h_bgTimeA->Scale( bgScale ) ;
rh_dataTime = RebinHistogram( h_dataTime, "rh_dataTime", -1.*t_low , t_low ) ;
rh_dataTimeA = RebinHistogram( h_dataTimeA, "rh_dataTimeA", -1.*t_low , t_low ) ;
rh_dataTimeBFD = RebinHistogram( h_dataTimeBFD, "rh_dataTimeBFD", -1.*t_low , t_low ) ;
rh_dataTimeAEC = RebinHistogram( h_dataTimeAEC, "rh_dataTimeAEC", -1.*t_low , t_low ) ;
rh_bgTime = RebinHistogram( h_bgTime, "rh_bgTime", -1.*t_low , t_low ) ;
rh_bgTimeA = RebinHistogram( h_bgTimeA, "rh_bgTimeA", -1.*t_low , t_low ) ;
WriteDataHisto() ;
cout<<" ======== CutFlow for Data ======== "<<endl ;
select->PrintCutFlow() ;
}
// This is for signal MC
void Output::RunMC( string mcName, string ctau_Id, double weight ) {
// Efficiency log file
string EffFileName = hfolder + hfName + "_eff.txt" ;
FILE* logfile = fopen( EffFileName.c_str() ,"a");
fprintf(logfile," Efficinecy for %s ", ctau_Id.c_str() );
//string mcTag = mcName.substr( 8, mcName.size() - 8 ) ;
string mcTag = ctau_Id ;
char hName1[32] , hName2[32], hName5[32], hName6[32] ;
sprintf( hName1, "h_sgTime_%s", mcTag.c_str() ) ;
sprintf( hName2, "h_sgTimeA_%s", mcTag.c_str() ) ;
sprintf( hName5, "h_sgTimeBFD_%s", mcTag.c_str() ) ;
sprintf( hName6, "h_sgTimeAEC_%s", mcTag.c_str() ) ;
// Reset the histogram
h_sgTime->SetName( hName1 ) ;
h_sgTimeA->SetName( hName2 ) ;
h_sgTimeBFD->SetName( hName5 ) ;
h_sgTimeAEC->SetName( hName6 ) ;
h_sgTime->Reset() ;
h_sgTimeA->Reset() ;
h_sgTimeBFD->Reset() ;
h_sgTimeAEC->Reset() ;
float phoPx[MAXPHO], phoPy[MAXPHO], phoPz[MAXPHO], phoE[MAXPHO] ;
float cscdPhi[MAXPHO], sMinPho[MAXPHO], sMajPho[MAXPHO], dtdPhi[MAXPHO], dtdEta[MAXPHO] ;
float seedTime[MAXPHO], aveTime[MAXPHO], aveTime1[MAXPHO], timeChi2[MAXPHO], seedSwissX[MAXPHO] ;
int nXtals[MAXPHO] ;
float metE ;
int nPhotons, nJets ;
TTree* tr = Input->GetTree( mcName, "DPAnalysis" );
// clone the tree for event selection
TChain* tr1 = (TChain*) tr->Clone() ;
tr->SetBranchAddress("nPhotons", &nPhotons);
tr->SetBranchAddress("nJets", &nJets);
tr->SetBranchAddress("met", &metE );
tr->SetBranchAddress("phoPx", phoPx );
tr->SetBranchAddress("phoPy", phoPy );
tr->SetBranchAddress("phoPz", phoPz );
tr->SetBranchAddress("phoE", phoE );
tr->SetBranchAddress("seedTime", seedTime );
tr->SetBranchAddress("aveTime", aveTime );
tr->SetBranchAddress("aveTime1", aveTime1 );
tr->SetBranchAddress("timeChi2", timeChi2 );
tr->SetBranchAddress("sMinPho", sMinPho );
tr->SetBranchAddress("sMajPho", sMajPho );
tr->SetBranchAddress("nXtals", nXtals );
tr->SetBranchAddress("cscdPhi", cscdPhi );
tr->SetBranchAddress("dtdPhi", dtdPhi );
tr->SetBranchAddress("dtdEta", dtdEta );
// initialize selection
select->Init( tr1 ) ;
select->ResetCounter() ;
int totalN = tr->GetEntries();
cout<<" **** from "<< mcName <<" total entries = "<< totalN <<" Process "<< ProcessEvents <<endl;
// Set up gaussian smearing for timing correction
TRandom3* tRan = new TRandom3();
tRan->SetSeed( 0 );
int nEvt = 0 ; // total Number of events
int nPass = 0 ;
int nPassPhot = 0 ;
int beginEvent = SkipEvents + 1 ;
cout<<" Event start from : "<< beginEvent << endl ;
double br = 0 ;
for ( int i= beginEvent ; i< totalN ; i++ ) {
if ( ProcessEvents > 0 && i > ( ProcessEvents + beginEvent - 1 ) ) break;
tr->GetEntry( i );
tr1->GetEntry( i );
// 1. Reset the cuts and collectors
select->ResetCuts() ;
select->ResetCollection() ;
bool eventPass = false;
br = select->BR() ; // calculate BR ;
nEvt++;
// Type = 2 : Control sample , at least one photon pt > 45 GeV
uint32_t evtType = select->EventIdentification();
bool wanted = ( (evtType >> 1) & 1 ) ; // pass photon and vtx select
bool passHLT = ( (evtType >> 5) & 1 ) ; // pass hlt
if ( !wanted || !passHLT ) continue ;
selectJets.clear() ;
select->GetCollection("Jet", selectJets ) ;
selectPho.clear() ;
select->GetCollection("Photon", selectPho ) ;
newMET = select->newMET ;
noPhotMET = select->noPhotMET ;
// Pick up photon
int k = 0 ;
int j = 0 ;
for ( j = 0 ; j < (int)selectPho.size() ; j++) {
int m = selectPho[j].first ;
if ( seedTime[m] > TCut[2] && seedTime[m] < TCut[3] ) {
k = m ;
break ;
} else if ( seedTime[m] > TCut[0] && seedTime[m] < TCut[1] ) {
k = m ;
break ;
} else {
k = selectPho[j].first ;
break ;
}
}
//cout<<" EVT# : "<< nEvt <<endl ;
bool passBasic = false ;
//for ( size_t j =0 ; j < selectPho.size() ; j++ ) {
//int k = selectPho[j].first ;
// Background Tagging
bool haloTag = select->HaloTag( cscdPhi[k] , sMajPho[k] , sMinPho[k] , selectPho[j].second.Eta() ) ;
bool spikeTag = select->SpikeTag( nXtals[k] , sMajPho[k] , sMinPho[k], seedSwissX[k], selectPho[j].second.Eta() ) ;
bool cosmicTag = select->CosmicTag( dtdEta[k] , dtdPhi[k] ) ;
bool ghostTag = ( haloTag || spikeTag || cosmicTag ) ? true : false ;
if ( ghostTag && j ==0 && selectPho.size() < 2 ) continue ;
if ( ghostTag ) continue ;
bool passABCDSelection = newMET.E() > jetCuts[4] && noPhotMET.E() > jetCuts[4] ;
passBasic = (selectPho[0].second.Pt() > photonCuts[8]) && (selectJets.size() >= jetCuts[2]) && (selectJets.size() <= jetCuts[3] ) ;
// timing correction : central shift = 0.1211 , sigma = 0.4
float tRes = ( systType == 7 ) ? timeCalib[1]*2. : timeCalib[1] ;
float tShift = ( systType == 9 ) ? timeCalib[0]*2. : timeCalib[0] ;
if ( systType == 10 ) tShift = 0. ;
float tCorr = ( systType == 8 ) ? ( seedTime[k]- tShift ) : tRan->Gaus(seedTime[k], tRes ) - tShift ;
if ( passABCDSelection && passBasic ) {
h_sgTimeBFD->Fill( tCorr, weight ) ;
if ( tCorr > t_low && tCorr < t_up ) {
nPassPhot++ ;
if ( !eventPass ) nPass++ ;
eventPass = true ;
h_sgTime->Fill( tCorr, weight ) ;
h_sgTimeA->Fill( aveTime[k], weight ) ;
}
}
if ( newMET.E() > jetCuts[4] && noPhotMET.E() < jetCuts[4] && passBasic ) {
h_sgTimeAEC->Fill( tCorr, weight ) ;
}
//}
} // end of event looping
char rhName1[32] , rhName2[32], rhName5[32], rhName6[32] ;
sprintf( rhName1, "rh_sgTime_%s", mcTag.c_str() ) ;
sprintf( rhName2, "rh_sgTimeA_%s", mcTag.c_str() ) ;
sprintf( rhName5, "rh_sgTimeBFD_%s", mcTag.c_str() ) ;
sprintf( rhName6, "rh_sgTimeAEC_%s", mcTag.c_str() ) ;
// rebin two tails
rh_sgTime = RebinHistogram( h_sgTime, rhName1, -1.*t_low , t_low ) ;
rh_sgTimeA = RebinHistogram( h_sgTimeA, rhName2, -1.*t_low , t_low ) ;
rh_sgTimeBFD = RebinHistogram( h_sgTimeBFD, rhName5, -1.*t_low , t_low ) ;
rh_sgTimeAEC = RebinHistogram( h_sgTimeAEC, rhName6, -1.*t_low , t_low ) ;
printf(" [%s] Observe number = %.3f \n", ctau_Id.c_str(), rh_sgTime->Integral() ) ;
WriteMcHisto() ;
fprintf(logfile,"Observe: %f Event Eff: %f , nPhot/nEvt = %f , BR = %.4f \n",
rh_sgTime->Integral(), (double)nPass / (double)nEvt , (double)nPassPhot/(double)nEvt, br );
fclose( logfile ) ;
printf(" *** Event Efficiency : %f -> %f \n", (double)nPass / (double)nEvt , (double)nPassPhot / (double)nEvt ) ;
cout<<" ======== CutFlow for Signal MC ======== "<<endl ;
select->PrintCutFlow() ;
}
void Output::RunGenOnly( string mcName, string ctau_Id, double weight, double scale_ ) {
// Efficiency log file
string EffFileName = hfolder + hfName + "_eff.txt" ;
FILE* logfile = fopen( EffFileName.c_str() ,"a");
fprintf(logfile," Efficinecy for %s ", mcName.c_str() );
string mcTag = ctau_Id ;
//string mcTag = mcName.substr( 8, mcName.size() - 8 ) ;
char hName1[32] , hName2[32], hName5[32], hName6[32] ;
sprintf( hName1, "h_sgTime_%s", mcTag.c_str() ) ;
sprintf( hName2, "h_sgTimeA_%s", mcTag.c_str() ) ;
sprintf( hName5, "h_sgTimeBFD_%s", mcTag.c_str() ) ;
sprintf( hName6, "h_sgTimeAEC_%s", mcTag.c_str() ) ;
// Reset the histogram
h_sgTime->SetName( hName1 ) ;
h_sgTimeA->SetName( hName2 ) ;
h_sgTimeBFD->SetName( hName5 ) ;
h_sgTimeAEC->SetName( hName6 ) ;
h_sgTime->Reset() ;
h_sgTimeA->Reset() ;
h_sgTimeBFD->Reset() ;
h_sgTimeAEC->Reset() ;
float genPx[MAXGEN], genPy[MAXGEN], genPz[MAXGEN], genE[MAXGEN] ;
float genVx[MAXGEN], genVy[MAXGEN], genVz[MAXGEN], genT[MAXGEN] ;
int pdgId[MAXGEN], momId[MAXGEN] ;
float jetPx[10], jetPy[10], jetPz[10], jetE[10] ;
float metPx, metPy, metE ;
int nGen, nJets ;
TTree* tr = Input->GetTree( mcName, "DPGenAnalysis" );
tr->SetBranchAddress("nJets", &nJets);
tr->SetBranchAddress("nGen", &nGen);
tr->SetBranchAddress("metPx", &metPx );
tr->SetBranchAddress("metPy", &metPy );
tr->SetBranchAddress("met", &metE );
tr->SetBranchAddress("jetPx", jetPx );
tr->SetBranchAddress("jetPy", jetPy );
tr->SetBranchAddress("jetPz", jetPz );
tr->SetBranchAddress("jetE", jetE );
tr->SetBranchAddress("genPx", genPx );
tr->SetBranchAddress("genPy", genPy );
tr->SetBranchAddress("genPz", genPz );
tr->SetBranchAddress("genE", genE );
tr->SetBranchAddress("genT", genT ); // tau*gamma*beta
tr->SetBranchAddress("pdgId", pdgId );
tr->SetBranchAddress("momId", momId );
tr->SetBranchAddress("genVx", genVx );
tr->SetBranchAddress("genVy", genVy );
tr->SetBranchAddress("genVz", genVz );
int totalN = tr->GetEntries();
cout<<" **** from "<< mcName <<" total entries = "<< totalN <<" Process "<< ProcessEvents <<endl;
// Set up gaussian smearing for timing correction
TRandom3* tRan = new TRandom3();
tRan->SetSeed( 0 );
//int nEvt = 0 ;
int beginEvent = SkipEvents + 1 ;
cout<<" Event start from : "<< beginEvent << endl ;
//vector<double> v_time ;
//vector<TLorentzVector> v_p4 ;
double finalCount = 0 ;
for ( int i= beginEvent ; i< totalN ; i++ ) {
if ( ProcessEvents > 0 && i > ( ProcessEvents + beginEvent - 1 ) ) break;
tr->GetEntry( i );
// Count number of jets
int nPassJet = 0 ;
for ( int k=0 ; k < nJets; k++ ) {
TLorentzVector jP4 = TLorentzVector( jetPx[k], jetPy[k], jetPz[k], jetE[k] ) ;
if ( fabs( jP4.Eta()) > jetCuts[1] ) continue ;
if ( jP4.Pt() > jetCuts[0] ) nPassJet++ ;
}
// Gen MET
TLorentzVector met = TLorentzVector( metPx, metPy, 0., metE ) ;
noPhotMET = met ;
// Photon signal
//v_time.clear() ;
//v_p4.clear() ;
double maxPhoPt = 0 ;
for ( int k=0; k< nGen ; k++) {
if ( pdgId[k] != 22 ) continue ;
TLorentzVector gP4 = TLorentzVector( genPx[k], genPy[k], genPz[k], genE[k] ) ;
int mId = momId[k] ;
if ( mId < 0 ) continue ;
TLorentzVector xP4 = TLorentzVector( genPx[mId], genPy[mId], genPz[mId], genE[mId] ) ;
// This is where the neutralino decays
double vx = genVx[k] ;
double vy = genVy[k] ;
double vz = genVz[k] ;
double ctbgT = sqrt( (vx*vx) + (vy*vy) ) ;
double EcalTime = genT[mId] ; // tau*gamma
// *************************************************************
// * Main propagator - to make sure decay photon will hit ECAL *
// *************************************************************
bool hasEcalTime = Propagator( gP4, vx, vy, vz, EcalTime ) ;
if ( !hasEcalTime ) continue ;
double d_x = vx - 0 ;
double d_y = vy - 0 ;
double d_z = vz - 0 ;
double d_r = sqrt( (d_x*d_x) + (d_y*d_y) + (d_z*d_z) );
double t0 = d_r /30. ; // t0 -> ecaltime assuming photon is from original
// This is the measured ECAL time for gen photons
// timing correction : central shift = 0.162 , sigma = 0.354
// Syst 7: tRes up , 8: tRes down , 9 : tShift up , 10: tShift down
float tRes = 0.4356 ;
float tShift = 0.0322 ;
if ( systType == 7 ) tRes = tRes + timeCalib[1] ;
if ( systType == 8 ) tRes = tRes - timeCalib[1] ;
if ( systType == 9 ) tShift = tShift + timeCalib[0] ;
if ( systType == 10) tShift = tShift - timeCalib[0] ;
double dT = EcalTime - t0 ;
float tCorr = tRan->Gaus( dT, tRes ) - tShift ;
// Build the P4 for gen photon from reconstruction point of view
TLorentzVector genRecoP4 = TLorentzVector( d_x, d_y, d_z, d_r ) ;
genRecoP4 = genRecoP4 * ( gP4.E() / d_r ) ;
noPhotMET += genRecoP4 ;
if ( genRecoP4.Pt() < 1. || fabs(genRecoP4.Eta()) > photonCuts[1] ) continue ;
if ( genRecoP4.Pt() > maxPhoPt ) maxPhoPt = genRecoP4.Pt() ;
//v_time.push_back( tCorr ) ;
//v_p4.push_back( genRecoP4 ) ;
double scale_1 = Input->RecoWeight( xP4.Pt() , ctbgT*10./(xP4.Beta()*xP4.Gamma()) ) ;
finalCount += (scale_1*weight) ;
h_sgTime->Fill( tCorr, weight) ;
h_sgTimeA->Fill( tCorr, weight ) ;
h_sgTimeBFD->Fill( tCorr, weight ) ;
h_sgTimeAEC->Fill( tCorr, weight ) ;
}
//bool passABCDSelection = (met.E() > jetCuts[4] && noPhotMET.E() > jetCuts[4] ) ;
//bool passBasic = (maxPhoPt > photonCuts[8]) && (nPassJet >= jetCuts[2]) && (nPassJet < jetCuts[3]) ;
} // end of event looping
char rhName1[64] , rhName2[64], rhName5[64], rhName6[64] ;
sprintf( rhName1, "rh_sgTime_%s", mcTag.c_str() ) ;
sprintf( rhName2, "rh_sgTimeA_%s", mcTag.c_str() ) ;
sprintf( rhName5, "rh_sgTimeBFD_%s", mcTag.c_str() ) ;
sprintf( rhName6, "rh_sgTimeAEC_%s", mcTag.c_str() ) ;
// rebin two tails
rh_sgTime = RebinHistogram( h_sgTime, rhName1, -1.*t_low , t_low ) ;
rh_sgTimeA = RebinHistogram( h_sgTimeA, rhName2, -1.*t_low , t_low ) ;
rh_sgTimeBFD = RebinHistogram( h_sgTimeBFD, rhName5, -1.*t_low , t_low ) ;
rh_sgTimeAEC = RebinHistogram( h_sgTimeAEC, rhName6, -1.*t_low , t_low ) ;
double scale_factor = finalCount / rh_sgTime->Integral() ;
printf(" orignal: %.3f , scale factor = %.3f ", rh_sgTime->Integral() , scale_factor ) ;
rh_sgTime->Scale( scale_factor ) ;
rh_sgTimeA->Scale( scale_factor ) ;
rh_sgTimeBFD->Scale( scale_factor ) ;
rh_sgTimeAEC->Scale( scale_factor ) ;
h_sgTime->Scale( scale_factor ) ;
h_sgTimeA->Scale( scale_factor ) ;
h_sgTimeBFD->Scale( scale_factor ) ;
h_sgTimeAEC->Scale( scale_factor ) ;
printf(" scaled N: %.3f , should be : %.3f \n", rh_sgTime->Integral(), scale_ ) ;
WriteMcHisto() ;
fprintf(logfile,"Observe: %f \n", rh_sgTime->Integral() );
fclose( logfile ) ;
//printf(" *** Event Efficiency : %f -> %f \n", (double)nPass / (double)nEvt , (double)nPassPhot / (double)nEvt ) ;
}
// Shift peak of h1 to the position of the peak of h2
void Output::ShiftPeak( TH1D* h1 , TH1D* h2 ) {
// get the bin number of h2 peak
int b2 = h2->GetMaximumBin() ;
int nBin = h2->GetNbinsX() ;
// copy original h1 information
int b1 = h1->GetMaximumBin() ;
TH1D* h1tmp = (TH1D*) h1->Clone() ;
h1->Reset() ;
// Refill h1
int shift = b2 - b1 ;
double binV = 0 ;
double bin0V = 0 ;
for ( int i=1; i<= nBin ; i++ ) {
if ( i-shift > nBin ) binV = 0 ;
if ( i-shift < 1) {
bin0V += h1tmp->GetBinContent(i) ;
continue ;
}
binV = h1tmp->GetBinContent( i - shift ) ;
h1->SetBinContent( i, binV ) ;
}
h1->SetBinContent( 0 , bin0V ) ;
}
// Rebin two-side tails - Current used method
//TH1D* Output::RebinHistogram( TH1D* h1, string newHistoName, double center, double width ) {
TH1D* Output::RebinHistogram( TH1D* h1, string newHistoName, double lowX, double upX ) {
int lowBound = h1->FindBin( lowX ) - 1;
int upBound = h1->FindBin( upX ) - 1;
double aveBC0 = 0 ;
double sumBC0 = 0 ;
double rbin0 = 0 ;
double aveBC1 = 0 ;
double sumBC1 = 0 ;
double rbin1 = 0 ;
for ( int i= 1 ; i<= h1->GetNbinsX() ; i++ ) {
double bc_ = h1->GetBinContent(i) ;
if ( i < lowBound ) {
sumBC0 += bc_ ;
rbin0 ++ ;
aveBC0 = sumBC0 /rbin0 ;
}
if ( i > upBound ) {
sumBC1 += bc_ ;
rbin1 ++ ;
aveBC1 = sumBC1 /rbin1 ;
}
}
TH1D* h2 = (TH1D*) h1->Clone() ;
h2->SetName( newHistoName.c_str() ) ;
for ( int i= 1 ; i<= h1->GetNbinsX() ; i++ ) {
// reset each bin
h2->SetBinContent(i, 0 ) ;
if ( i < lowBound ) {
h2->SetBinContent( i, aveBC0 ) ;
} else if ( i > upBound ) {
h2->SetBinContent( i, aveBC1 ) ;
} else {
h2->SetBinContent( i, h1->GetBinContent(i) ) ;
}
}
return h2 ;
}
// Automatic rebin
TH1D* Output::RebinHistogram( TH1D* h1, string newHistoName, double minBC ) {
// accumuate bin information
vector<double> xV ;
vector<double> yV ;
double aveBC = 0 ;
double sumBC = 0 ;
double rbin_ = 0 ;
for ( int i= 1 ; i<= h1->GetNbinsX() ; i++ ) {
double bc_ = h1->GetBinContent(i) ;
double x_ = h1->GetBinCenter(i) ;
double bc1_ = ( i == h1->GetNbinsX() ) ? minBC+1 : h1->GetBinContent(i+1) ;
//cout<<" x: "<< x_ <<" y:"<< bc_ ;
if ( aveBC < minBC ) {
sumBC += bc_ ;
rbin_ += 1. ;
aveBC = sumBC / rbin_ ;
if ( (aveBC > minBC && bc1_ > minBC) || i == h1->GetNbinsX() ) {
xV.push_back( x_ ) ;
yV.push_back( aveBC ) ;
//cout<<" aveBC: "<< aveBC<<" from sum:"<< sumBC<<"/"<<rbin_ ;
sumBC = 0 ;
rbin_ = 0 ;
}
aveBC = 0 ;
}
//cout<<" "<<endl ;
}
//cout<<" ====================== "<<endl ;
// refill the histogram
TH1D* h2 = (TH1D*) h1->Clone() ;
h2->SetName( newHistoName.c_str() ) ;
int ii = 0 ;
for ( int i= 1 ; i<= h1->GetNbinsX() ; i++ ) {
h2->SetBinContent(i, 0 ) ;
for ( size_t j= ii ; j< xV.size(); j++ ) {
double x_ = h2->GetBinCenter(i) ;
if ( x_ <= xV[j] ) {
h2->SetBinContent(i, yV[j] ) ;
ii = j ;
//cout<<" x: "<< x_ <<" xB:"<< xV[j]<<" y: "<< yV[j] <<endl ;
break ;
}
}
}
return h2 ;
}
void Output::WriteDataHisto() {
h_dataTime->Write() ;
h_dataTimeA->Write() ;
h_dataTimeBFD->Write() ;
h_dataTimeAEC->Write() ;
h_bgTime->Write() ;
h_bgTimeA->Write() ;
rh_dataTime->Write() ;
rh_dataTimeA->Write() ;
rh_dataTimeBFD->Write() ;
rh_dataTimeAEC->Write() ;
rh_bgTime->Write() ;
rh_bgTimeA->Write() ;
hBg_A->Write() ;
hBg_B->Write() ;
hBg_C->Write() ;
hBg_D->Write() ;
hBg_E->Write() ;
hBg_F->Write() ;
hCol_A->Write() ;
hCol_B->Write() ;
hCol_C->Write() ;
hCol_D->Write() ;
hCol_E->Write() ;
hCol_F->Write() ;
}
void Output::WriteMcHisto() {
h_sgTime->Write() ;
h_sgTimeA->Write() ;
h_sgTimeBFD->Write() ;
h_sgTimeAEC->Write() ;
rh_sgTime->Write() ;
rh_sgTimeA->Write() ;
rh_sgTimeBFD->Write() ;
rh_sgTimeAEC->Write() ;
}
void Output::ReadHisto( TFile* hFile ) {
if ( hFile == NULL ) {
TString Path_fName = hfolder + hfName + ".root" ;
theFile = new TFile( Path_fName, "UPDATE" );
cout<<" file opened ! "<<endl ;
} else {
theFile = hFile ;
}
/*
h_dataTime = (TH1D*) theFile->Get("h_dataTime") ;
h_dataTimeA = (TH1D*) theFile->Get("h_dataTimeA") ;
h_dataTimeBFD = (TH1D*) theFile->Get("h_dataTimeBFD") ;
h_dataTimeAEC = (TH1D*) theFile->Get("h_dataTimeAEC") ;
h_bgTime = (TH1D*) theFile->Get("h_bgTime") ;
h_bgTimeA = (TH1D*) theFile->Get("h_bgTimeA") ;
rh_dataTime = (TH1D*) theFile->Get("rh_dataTime") ;
rh_dataTimeA = (TH1D*) theFile->Get("rh_dataTimeA") ;
rh_dataTimeBFD = (TH1D*) theFile->Get("rh_dataTimeBFD") ;
rh_dataTimeAEC = (TH1D*) theFile->Get("rh_dataTimeAEC") ;
rh_bgTime = (TH1D*) theFile->Get("rh_bgTime") ;
rh_bgTimeA = (TH1D*) theFile->Get("rh_bgTimeA") ;
*/
hBg_A = (TH3D*) theFile->Get("hBg_A") ;
hBg_B = (TH3D*) theFile->Get("hBg_B") ;
hBg_C = (TH3D*) theFile->Get("hBg_C") ;
hBg_D = (TH3D*) theFile->Get("hBg_D") ;
hBg_E = (TH3D*) theFile->Get("hBg_E") ;
hBg_F = (TH3D*) theFile->Get("hBg_F") ;
hCol_A = (TH3D*) theFile->Get("hCol_A") ;
hCol_B = (TH3D*) theFile->Get("hCol_B") ;
hCol_C = (TH3D*) theFile->Get("hCol_C") ;
hCol_D = (TH3D*) theFile->Get("hCol_D") ;
hCol_E = (TH3D*) theFile->Get("hCol_E") ;
hCol_F = (TH3D*) theFile->Get("hCol_F") ;