forked from JeffersonLab/clas12-timeline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeneralMon.java
More file actions
3864 lines (3687 loc) · 183 KB
/
GeneralMon.java
File metadata and controls
3864 lines (3687 loc) · 183 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
package org.jlab.clas.timeline.histograms;
import java.util.*;
import org.jlab.groot.data.H1F;
import org.jlab.groot.data.H2F;
import org.jlab.io.base.DataBank;
import org.jlab.io.base.DataEvent;
import org.jlab.groot.data.GraphErrors;
import org.jlab.groot.data.TDirectory;
import org.jlab.clas.physics.Vector3;
import org.jlab.clas.physics.LorentzVector;
import org.jlab.utils.groups.IndexedTable;
import org.jlab.detector.calib.utils.ConstantsManager;
import org.jlab.clas.timeline.util.RunDependentCut;
/**
* General Monitoring histograms (a.k.a. General Monolith)
*/
public class GeneralMon {
/**
* Assume 1+6 bit groupings, one for each bit in the given
* offsets, and determine whether the given sector triggered.
* @param trigger event trigger word
* @param sector CLAS12 sector in question
* @param offsets mask of electron bit group offsets
* @return whether the given sector triggered
*/
static boolean testTriggerSector(long trigger, int sector, long offsets) {
for (int i=0; i<32-6; i++) {
if (0 != (offsets & (1<<i)) ) {
if (0 != (trigger & ( 1 << (i+sector)))) {
return true;
}
}
}
return false;
}
/**
* Determine whether the given sector triggered.
* @param sector CLAS sector in question
* @return whether the given sector triggered
*/
boolean testTriggerSector(int sector) {
// FIXME: move to CCDB
if (RunDependentCut.findDataset(runNum) == "rgd") {
// RG-D: used three different primary electron triggers (0/7/14):
return testTriggerSector(TriggerWord, sector, 0x4081);
}
if (RunDependentCut.runIsInRange(runNum, 16043, 16078, false)) {
// RG-C 2.2 GeV: non-standard primary electron trigger:
return testTriggerSector(TriggerWord, sector, 0x4081);
}
if (RunDependentCut.runIsInRange(runNum, 22731, 23016, false)) {
// RG-L 2.2 GeV: no sector specific trigger bit is set
return true;
}
// Default: the primary electron trigger is the first (7) bits:
return testTriggerSector(TriggerWord, sector, 0x1);
}
boolean userTimeBased;
int Nevts, Nelecs, Ntrigs, runNum;
public String outputDir;
public int Nmuons, Nmuontrigs;
public float rfPeriod, rfoffset1, rfoffset2;
public int rf_large_integer;
int[] Nmuonpairs, Ntrackspair, Ntrackspairpn, Ntrackspairnp;
boolean[] trigger_bits;
public float EB, Ebeam;
public float RFtime1, RFtime2, startTime, BCG;
public long TriggerWord;
public float STT;
public int trig_part_ind, trig_sect, trig_track_ind;
public int trig_muon_sect;
public float trig_HTCC_theta;
public int e_part_ind, e_sect, e_track_ind, hasLTCC, ngammas, pip_part_ind, pip_track_ind, pip_sect, pim_part_ind, pim_track_ind, pim_sect, foundCVT, CVTcharge;
public int found_e_FMM, found_eTraj, found_eHTCC;
public float[] e_FMMmom, e_FMMtheta, e_FMMphi, e_FMMvz;
public float e_ecal_T_PCAL, e_ecal_T_ECIN, e_ecal_T_ECOU;
public float e_mom, e_theta, e_phi, e_vx, e_vy, e_vz, e_Ivy, e_Ivz, e_ecal_X, e_ecal_Y, e_ecal_Z, e_ecal_E, e_track_chi2, e_vert_time, e_vert_time_RF, e_Q2, e_xB, e_W;
public float e_HTCC, e_LTCC, e_pcal_e, e_etot_e, e_TOF_X, e_TOF_Y, e_TOF_Z, e_HTCC_X, e_HTCC_Y, e_HTCC_Z, e_HTCC_tX, e_HTCC_tY, e_HTCC_tZ, e_HTCC_nphe;
public float e_DCR1_X, e_DCR1_Y, e_DCR1_Z, e_DCR2_X, e_DCR2_Y, e_DCR2_Z, e_DCR3_X, e_DCR3_Y, e_DCR3_Z;
public float g1_e, g1_theta, g1_phi, g2_e, g2_theta, g2_phi;
public float pip_mom, pip_theta, pip_phi, pip_vx, pip_vy, pip_vz, pip_vert_time, pip_beta, pip_track_chi2;
public float pim_mom, pim_theta, pim_phi, pim_vx, pim_vy, pim_vz, pim_vert_time, pim_beta, pim_track_chi2;
public float CVT_mom, CVT_theta, CVT_phi, CVT_vz, CVT_chi2, CVT_pathlength;
public int CVT_ndf;
public LorentzVector VB, VT, Ve, VG1, VG2, VPI0, VPIP, VPIM;
public GraphErrors G_FCcur_evn, G_gatedFCcur_evn, G_FC_live_ratio, G_accCharge;
public GraphErrors G_Clock_evn, G_gatedClock_evn, G_Clock_ratio;
public H1F[][] H_trig_phi_theta_S;
public H1F[] H_trig_PCAL_vt_S, H_trig_ECIN_vt_S, H_trig_ECOU_vt_S;
public H2F[] H_trig_theta_mom_S, H_trig_phi_mom_S, H_trig_theta_phi_S, H_trig_vz_mom_S, H_trig_vy_vz_S, H_trig_vz_theta_S;
public H2F[] H_trig_ECALsampl_S, H_trig_PCALECAL_S, H_trig_HTCCn_theta_S, H_trig_LTCCn_theta_S;
public H2F[] H_trig_ECAL_pos_S, H_trig_TOF_pos_S, H_trig_HTCC_pos_S, H_trig_DCR1_pos_S, H_trig_DCR2_pos_S, H_trig_DCR3_pos_S;
public H1F[] H_trig_S_HTCC_theta;
public H2F[] H_e_theta_mom_S;
public H1F[] H_e_W_S;
public H1F[] H_e_Q2_S;
public H2F[] H_e_W_phi_S;
public H2F H_e_theta_phi, H_e_theta_mom, H_e_phi_mom, H_XY_ECal, H_ESampl_ECal, H_e_LTCC_xy, H_e_HTCC_xy, H_e_HTCC_txy, H_e_HTCC_nphe_txy, H_e_vxy, H_e_vz_phi, H_e_vz_p, H_e_vz_theta, H_e_TOF_xy, H_e_TOF_t_path;
public H2F H_e_xB_Q2, H_e_W_Q2, H_e_xB_W;
public H1F H_e_W, H_e_Q2, H_e_xB, H_e_vz, H_e_LTCC_nphe, H_e_HTCC_nphe, H_e_vt1, H_e_vt2;
public H2F[] H_muontrig_theta_mom_S;
public H2F H_muontrig_theta_phi, H_muontrig_theta_mom, H_muontrig_phi_mom, H_muontrig_XY_ECal, H_muontrig_ESampl_ECal, H_muontrig_LTCC_xy, H_muontrig_HTCC_xy, H_muontrig_HTCC_txy;
public H2F H_muontrig_HTCC_nphe_txy, H_muontrig_vxy, H_muontrig_vz_phi, H_muontrig_vz_p, H_muontrig_vz_theta, H_muontrig_TOF_xy, H_muontrig_TOF_t_path;
public H1F H_muontrig_vz, H_muontrig_LTCC_nphe, H_muontrig_HTCC_nphe;
public H1F[] H_muontrig_ecal_en_neg_S, H_muontrig_ecal_en_pos_S, H_muontrig_pcal_en_neg_S, H_muontrig_pcal_en_pos_S;
public H2F[] H_muontrig_ECECOUT_en_S;
public H2F H_positive_theta_mom, H_negative_theta_mom, H_electron_theta_mom;
public H1F H_e_vz_S1, H_e_vz_S2, H_e_vz_S3, H_e_vz_S4, H_e_vz_S5, H_e_vz_S6;
public H1F H_e_FMMvz_S1, H_e_FMMvz_S2, H_e_FMMvz_S3, H_e_FMMvz_S4, H_e_FMMvz_S5, H_e_FMMvz_S6;
public H2F[][] H_e_FMMmom_mom, H_e_FMMtheta_theta, H_e_FMMphi_phi, H_e_FMMvz_vz;
public H2F H_o_TOF;
public H1F H_o_vt;
public H2F H_dcm_theta_phi, H_dcm_theta_mom, H_dcm_phi_mom, H_dcm_vz_phi, H_dcm_vz_p, H_dcm_vz_theta, H_dcm_phiK_mom;
public H2F H_dcm_R1th_R1ph, H_dcm_R1the_mom, H_dcm_R1ph_mom, H_dcm_pvz_phi, H_dcm_pvz_p, H_dcm_pvz_theta, H_dcm_pvt_pvz;
public H2F H_dcp_theta_phi, H_dcp_theta_mom, H_dcp_phi_mom, H_dcp_vz_phi, H_dcp_vz_p, H_dcp_vz_theta, H_dcp_phiK_mom;
public H2F H_dcp_R1th_R1ph, H_dcp_R1the_mom, H_dcp_R1ph_mom, H_dcp_pvz_phi, H_dcp_pvz_p, H_dcp_pvz_theta, H_dcp_pvt_pvz;
public H2F H2_dcm_vz_phi, H2_dcp_vz_phi;
public H1F H_dcm_W, H_dcm_W_zoom;
public H1F H_negHBTrk_sect, H_posHBTrk_sect, H_negRECHB_sect, H_posRECHB_sect;
public H1F H_negTBTrk_sect, H_posTBTrk_sect, H_negREC_sect, H_posREC_sect;
public H1F[] H_dcm_vz, H_dcm_chi2;
public H2F[] H_R1_dcm_XY, H_R2_dcm_XY, H_R3_dcm_XY, H_R1_dcm_uXY, H_R2_dcm_uXY, H_R3_dcm_uXY;
public H2F[] H_R1phiDm_mom;
public H1F[] H_dcp_vz, H_dcp_chi2;
public H2F[] H_R1_dcp_XY, H_R2_dcp_XY, H_R3_dcp_XY, H_R1_dcp_uXY, H_R2_dcp_uXY, H_R3_dcp_uXY;
public H2F[] H_R1phiDp_mom;
public H1F[] H_dce_chi2;
public GraphErrors g_m_ESampl_ECal, g_s_ESampl_ECal;
public H2F H_gg_open_a, H_g1_tf, H_g2_tf, H_g1_te, H_g2_te;
public H1F H_gg_m;
public H2F H_CVT_ft, H_CVT_pt, H_CVT_pf, H_CVT_zf, H_CVT_zp, H_CVT_zt;
public H1F H_CVT_p, H_CVT_t, H_CVT_f, H_CVT_z, H_CVT_chi2, H_CVT_ndf, H_CVT_pathlength;
public H1F H_CVT_z_pos, H_CVT_z_neg, H_CVT_d0_pos, H_CVT_d0_neg, H_CVT_absd0_pos, H_CVT_absd0_neg, H_CVT_chi2_pos, H_CVT_chi2_neg;
public H1F H_CVT_d0, H_CVT_charge;
public H2F H_CVT_vz_mom, H_CVT_vz_phi, H_CVT_vz_theta, H_CVT_vx_vy, H_CVT_vx_vz, H_CVT_vz_vy;
public H1F H_CVT_mom, H_CVT_theta, H_CVT_phi, H_CVT_vz, H_CVT_vx, H_CVT_vy;
public H1F H_CD_vx, H_CD_vy, H_CD_vz;
public H2F H_CD_vz_mom, H_CD_vz_phi, H_CD_vz_theta, H_CD_vx_vy, H_CD_vx_vz, H_CD_vz_vy;
public H1F[] H_MM_epip_Spip, H_MM_epip_Se;
public H1F H_MM_epip, H_MM_epip_zoom, H_pip_vtd, H_pip_vz_ve_diff, H_pip_Dphi;
public H1F H_pim_vtd;
public H2F H_pip_theta_phi, H_pip_theta_mom, H_pip_phi_mom, H_pip_vz_phi, H_pip_vz_theta, H_pip_vz_mom, H_pip_e_vt, H_pip_vz_ve;
public H2F H_pip_vz_ve_diff_mom, H_pip_vz_ve_diff_theta, H_pip_vz_ve_diff_phi, H_pip_vz_ve_diff_Dphi;
public H2F H_MM_epip_phi, H_pip_beta_p, H_pip_beta2_p, H_pip_vtd_mom, H_pip_vtd_theta, H_pip_vtd_phi;
public H2F H_epip_e_theta_phi, H_epip_e_theta_mom, H_epip_e_phi_mom, H_epip_xB_Q2, H_epip_e_W_Q2, H_epip_e_t_phi;
public H1F H_rho_IM, H_rho_MM;
public H2F H_rho_Q2_xB, H_rho_Q2_W;
public H2F H_rho_prot, H_rho_pip_beta, H_rho_pim_beta;
public H1F H_trig_sector_count, H_trig_sector_elec, H_trig_sector_elec_rat, H_rand_trig_sector_count;
public H1F H_muon_trig_sector_count, H_trig_sector_muon, H_trig_sector_muon_rat, H_trig_sector_muontrack, H_trig_sector_muontrack_rat;
public H1F H_trig_sector_prot, H_trig_sector_piplus, H_trig_sector_piminus, H_trig_sector_kplus, H_trig_sector_kminus, H_trig_sector_photon, H_trig_sector_neutron, H_trig_sector_deut;
public H1F H_trig_sector_prot_rat, H_trig_sector_piplus_rat, H_trig_sector_piminus_rat, H_trig_sector_kplus_rat, H_trig_sector_kminus_rat, H_trig_sector_photon_rat, H_trig_sector_neutron_rat, H_trig_sector_deut_rat;
public H1F H_trig_sector_positive_rat, H_trig_sector_negative_rat, H_trig_sector_neutral_rat;
public H1F H_Nclust_ev, H_clust1_E, H_clust2_E;
public H1F H_trig_S1_ETOT_E, H_trig_S1_ECAL_E, H_trig_S1_PCAL_E, H_trig_S1_HTCC_n, H_trig_S1_HTCC_N, H_trig_S1_HTCC_N_track;
public H1F H_trig_S2_ETOT_E, H_trig_S2_ECAL_E, H_trig_S2_PCAL_E, H_trig_S2_HTCC_n, H_trig_S2_HTCC_N, H_trig_S2_HTCC_N_track;
public H1F H_trig_S3_ETOT_E, H_trig_S3_ECAL_E, H_trig_S3_PCAL_E, H_trig_S3_HTCC_n, H_trig_S3_HTCC_N, H_trig_S3_HTCC_N_track;
public H1F H_trig_S4_ETOT_E, H_trig_S4_ECAL_E, H_trig_S4_PCAL_E, H_trig_S4_HTCC_n, H_trig_S4_HTCC_N, H_trig_S4_HTCC_N_track;
public H1F H_trig_S5_ETOT_E, H_trig_S5_ECAL_E, H_trig_S5_PCAL_E, H_trig_S5_HTCC_n, H_trig_S5_HTCC_N, H_trig_S5_HTCC_N_track;
public H1F H_trig_S6_ETOT_E, H_trig_S6_ECAL_E, H_trig_S6_PCAL_E, H_trig_S6_HTCC_n, H_trig_S6_HTCC_N, H_trig_S6_HTCC_N_track;
public H2F H_trig_S1_PCAL_XY, H_trig_S1_HTCC_XY;
public H2F H_trig_S2_PCAL_XY, H_trig_S2_HTCC_XY;
public H2F H_trig_S3_PCAL_XY, H_trig_S3_HTCC_XY;
public H2F H_trig_S4_PCAL_XY, H_trig_S4_HTCC_XY;
public H2F H_trig_S5_PCAL_XY, H_trig_S5_HTCC_XY;
public H2F H_trig_S6_PCAL_XY, H_trig_S6_HTCC_XY;
public H2F missTrig_S1_ft, missTrig_S1_mt, missTrig_S1_mf;
public H2F missTrig_S2_ft, missTrig_S2_mt, missTrig_S2_mf;
public H2F missTrig_S3_ft, missTrig_S3_mt, missTrig_S3_mf;
public H2F missTrig_S4_ft, missTrig_S4_mt, missTrig_S4_mf;
public H2F missTrig_S5_ft, missTrig_S5_mt, missTrig_S5_mf;
public H2F missTrig_S6_ft, missTrig_S6_mt, missTrig_S6_mf;
public H1F PCAL_Thresh_S1, PCAL_Thresh_S2, PCAL_Thresh_S3, PCAL_Thresh_S4, PCAL_Thresh_S5, PCAL_Thresh_S6;
public H2F ETOT_Sampl_S1, ETOT_Sampl_S2, ETOT_Sampl_S3, ETOT_Sampl_S4, ETOT_Sampl_S5, ETOT_Sampl_S6;
public H1F H_TOF_vt_S1m, H_TOF_vt_S2m, H_TOF_vt_S3m, H_TOF_vt_S4m, H_TOF_vt_S5m, H_TOF_vt_S6m;
public H2F H_TOF_vt_mom_S1m, H_TOF_vt_mom_S2m, H_TOF_vt_mom_S3m, H_TOF_vt_mom_S4m, H_TOF_vt_mom_S5m, H_TOF_vt_mom_S6m;
public H1F H_TOF_vt_S1p, H_TOF_vt_S2p, H_TOF_vt_S3p, H_TOF_vt_S4p, H_TOF_vt_S5p, H_TOF_vt_S6p;
public H2F H_TOF_vt_mom_S1p, H_TOF_vt_mom_S2p, H_TOF_vt_mom_S3p, H_TOF_vt_mom_S4p, H_TOF_vt_mom_S5p, H_TOF_vt_mom_S6p;
public H2F H_CVT_e_corr_vz, H_CVT_e_corr_phi, H_CVT_corr_e_theta;
public H2F H_elast_e_p_th, H_elast_W_sect, H_CVT_corr_e_mom;
public H1F H_CVT_e_vz_diff, H_CVT_e_phi_diff, H_elast_W;
public H1F[] H_e_RFtime1_FD_S , H_pip_RFtime1_FD_S, H_pim_RFtime1_FD_S, H_p_RFtime1_FD_S;
public H1F H_pip_RFtime1_CD, H_pim_RFtime1_CD, H_p_RFtime1_CD;
public H1F H_RFtimediff, H_RFtimediff_corrected;
public H1F hbstOccupancy,hbmtOccupancy,htrks,hpostrks,hnegtrks,hndf,hchi2norm,hp,hpt,hpathlen,hbstOnTrkLayers,hbmtOnTrkLayers;
public H1F hpostrks_rat, hnegtrks_rat;
public H1F H_trig_central_prot_rat, H_trig_central_deut_rat, H_trig_central_piplus_rat,H_trig_central_piminus_rat,H_trig_central_kplus_rat,H_trig_central_kminus_rat;
public IndexedTable InverseTranslationTable;
public IndexedTable calibrationTranslationTable;
public IndexedTable rfTable, rfTableOffset;
public ConstantsManager ccdb;
public GeneralMon(int reqrunNum, String reqOutputDir, float reqEB, boolean reqTimeBased) {
runNum = reqrunNum;EB=reqEB;userTimeBased=reqTimeBased;
outputDir = reqOutputDir;
Nevts=0;Nelecs=0;Ntrigs=0;
Nmuons=0;Nmuontrigs=0;
found_eTraj = 0;
found_eHTCC = 0;
trigger_bits = new boolean[32];
Ebeam = EB;
System.out.println("Beam energy = "+Ebeam);
String choiceTracking = " warning! Unspecified tracking";
if(userTimeBased)choiceTracking=" using TIME BASED tracking";
if(!userTimeBased)choiceTracking=" using HIT BASED tracking";
System.out.println("Eb="+Ebeam+" (EB="+EB+") , run="+runNum+" , "+choiceTracking);
try {
Thread.sleep(10000);// in ms
}catch (Exception e) {
System.out.println(e);
}
Ntrackspair = new int[3];
Nmuonpairs = new int[3];
Ntrackspairpn = new int[6];
Ntrackspairnp = new int[6];
float tofvt1 = 0;
float tofvt2 = 300;
rfPeriod = 4.008f;
ccdb = new ConstantsManager();
ccdb.init(Arrays.asList(new String[]{"/daq/tt/fthodo", "/calibration/eb/rf/config", "/calibration/eb/rf/offset"}));
rfTable = ccdb.getConstants(runNum, "/calibration/eb/rf/config");
if (rfTable.hasEntry(1, 1, 1)) {
System.out.println(String.format("RF period from ccdb for run %d: %f", runNum, rfTable.getDoubleValue("clock", 1, 1, 1)));
rfPeriod = (float) rfTable.getDoubleValue("clock", 1, 1, 1);
}
rf_large_integer = 1000;
rfTableOffset = ccdb.getConstants(runNum,"/calibration/eb/rf/offset");
if (rfTableOffset.hasEntry(1, 1, 1)){
rfoffset1 = (float)rfTableOffset.getDoubleValue("offset",1,1,1);
rfoffset2 = (float)rfTableOffset.getDoubleValue("offset",1,1,2);
System.out.println(String.format("RF1 offset from ccdb for run %d: %f",runNum,rfoffset1));
System.out.println(String.format("RF2 offset from ccdb for run %d: %f",runNum,rfoffset2));
}
//Initialiing Two-sector trigger histograms
H_muontrig_ecal_en_neg_S = new H1F[6];
H_muontrig_ecal_en_pos_S = new H1F[6];
H_muontrig_pcal_en_neg_S = new H1F[6];
H_muontrig_pcal_en_pos_S = new H1F[6];
H_muontrig_ECECOUT_en_S = new H2F[6];
for (int i = 0; i < 6; i++) {
H_muontrig_ecal_en_neg_S[i] = new H1F(String.format("H_muontrig_ECAL_Energy_NegS%d", i + 1), String.format("H_muontrig_ECAL_Energy_NegS%d", i + 1), 1000, -0.5, 200.5);
H_muontrig_ecal_en_neg_S[i].setTitle(String.format("Two-Sector Trig ECAL_En Neg, S%d", i + 1));
H_muontrig_ecal_en_neg_S[i].setTitleX("E_ecal (MeV)");
H_muontrig_ecal_en_pos_S[i] = new H1F(String.format("H_muontrig_ECAL_Energy_PosS%d", i + 1), String.format("H_muontrig_ECAL_Energy_Pos_S%d", i + 1), 1000, -0.5, 200.5);
H_muontrig_ecal_en_pos_S[i].setTitle(String.format("Two-Sector Trig ECAL_En Pos, S%d", i + 1));
H_muontrig_ecal_en_pos_S[i].setTitleX("E_ecal (MeV)");
H_muontrig_pcal_en_neg_S[i] = new H1F(String.format("H_muontrig_PCAL_Energy_NegS%d", i + 1), String.format("H_muontrig_PCAL_Energy_NegS%d", i + 1), 1000, -0.5, 100.5);
H_muontrig_pcal_en_neg_S[i].setTitle(String.format("Two-Sector Trig PCAL_En Neg, S%d", i + 1));
H_muontrig_pcal_en_neg_S[i].setTitleX("E_pcal (MeV)");
H_muontrig_pcal_en_pos_S[i] = new H1F(String.format("H_muontrig_PCAL_Energy_PosS%d", i + 1), String.format("H_muontrig_PCAL_Energy_PosS%d", i + 1), 1000, -0.5, 100.5);
H_muontrig_pcal_en_pos_S[i].setTitle(String.format("Two-Sector Trig PCAL_En Pos, S%d", i + 1));
H_muontrig_pcal_en_pos_S[i].setTitleX("E_pcal (MeV)");
H_muontrig_ECECOUT_en_S[i] = new H2F("H_muontrig_EC-ECOUT_en_S", "H_muontrig_EC-ECOUT_en_S", 200, 0, 400, 200, 0, 200);
H_muontrig_ECECOUT_en_S[i].setTitle("ECout vs EC");
H_muontrig_ECECOUT_en_S[i].setTitleX("EC_energy (MeV)");
H_muontrig_ECECOUT_en_S[i].setTitleY("ECout_energy (MeV)");
}
//Initializing rf histograms.
H_RFtimediff = new H1F("H_RFtimediff","H_RFtimediff",5000,-5.,5.);
H_RFtimediff.setTitle("RF time difference (1-2)");
H_RFtimediff.setTitleX("RF1-RF2 (ns)");
H_RFtimediff_corrected = new H1F("H_RFtimediff_corrected","H_RFtimediff_corrected",5000,-5.,5.);
H_RFtimediff_corrected.setTitle("RF time difference (1-2), offset corrected");
H_RFtimediff_corrected.setTitleX("RF1+rfoffset1-RF2-rfoffset2 (ns)");
H_e_RFtime1_FD_S = new H1F[6];
H_pip_RFtime1_FD_S = new H1F[6];
H_pim_RFtime1_FD_S = new H1F[6];
H_p_RFtime1_FD_S = new H1F[6];
for(int i=0;i<6;i++){
H_e_RFtime1_FD_S[i] = new H1F(String.format("H_e_RFtime1_S%d",i+1),String.format("H_e_RFtime1_S%d",i+1),1000,-5.,5.);
H_e_RFtime1_FD_S[i].setTitle(String.format("FD elec vertex_t - RF1_t, S%d",i+1));
H_e_RFtime1_FD_S[i].setTitleX("v_t-RF1_t (ns)");
H_pip_RFtime1_FD_S[i] = new H1F(String.format("H_pip_RFtime1_S%d",i+1),String.format("H_pip_RFtime1_S%d",i+1),1000,-5.,5.);
H_pip_RFtime1_FD_S[i].setTitle(String.format("FD #pi^+ vertex_t - RF1_t, S%d",i+1));
H_pip_RFtime1_FD_S[i].setTitleX("v_t-RF1_t (ns)");
H_pim_RFtime1_FD_S[i] = new H1F(String.format("H_pim_RFtime1_S%d",i+1),String.format("H_pim_RFtime1_S%d",i+1),1000,-5.,5.);
H_pim_RFtime1_FD_S[i].setTitle(String.format("FD #pi^- vertex_t - RF1_t, S%d",i+1));
H_pim_RFtime1_FD_S[i].setTitleX("v_t-RF1_t (ns)");
H_p_RFtime1_FD_S[i] = new H1F(String.format("H_p_RFtime1_S%d",i+1),String.format("H_p_RFtime1_S%d",i+1),1000,-5.,5.);
H_p_RFtime1_FD_S[i].setTitle(String.format("FD prot vertex_t - RF1_t, S%d",i+1));
H_p_RFtime1_FD_S[i].setTitleX("v_t-RF1_t (ns)");
}
H_pip_RFtime1_CD = new H1F("H_pip_RFtime1","H_pip_RFtime1",1000,-5.,5.);
H_pip_RFtime1_CD.setTitle("CD #pi^+ vertex_t - RF1_t");
H_pip_RFtime1_CD.setTitleX("v_t-RF1_t (ns)");
H_pim_RFtime1_CD = new H1F("H_pim_RFtime1","H_pim_RFtime1",1000,-5.,5.);
H_pim_RFtime1_CD.setTitle("CD #pi^- vertex_t - RF1_t");
H_pim_RFtime1_CD.setTitleX("v_t-RF1_t (ns)");
H_p_RFtime1_CD = new H1F("H_p_RFtime1","H_p_RFtime1",1000,-5.,5.);
H_p_RFtime1_CD.setTitle("CD prot vertex_t - RF1_t");
H_p_RFtime1_CD.setTitleX("v_t-RF1_t (ns)");
H_TOF_vt_S1m = new H1F("H_TOF_vt_S1n","H_TOF_vt_S1n",100,tofvt1,tofvt2);
H_TOF_vt_S1m.setTitle("S1 neg TOF vert t");
H_TOF_vt_S1m.setTitleX("vert t (ns)");
H_TOF_vt_S2m = new H1F("H_TOF_vt_S2n","H_TOF_vt_S2n",100,tofvt1,tofvt2);
H_TOF_vt_S2m.setTitle("S2 neg TOF vert t");
H_TOF_vt_S2m.setTitleX("vert t (ns)");
H_TOF_vt_S3m = new H1F("H_TOF_vt_S3n","H_TOF_vt_S3n",100,tofvt1,tofvt2);
H_TOF_vt_S3m.setTitle("S3 neg TOF vert t");
H_TOF_vt_S3m.setTitleX("vert t (ns)");
H_TOF_vt_S4m = new H1F("H_TOF_vt_S4n","H_TOF_vt_S4n",100,tofvt1,tofvt2);
H_TOF_vt_S4m.setTitle("S4 neg TOF vert t");
H_TOF_vt_S4m.setTitleX("vert t (ns)");
H_TOF_vt_S5m = new H1F("H_TOF_vt_S5n","H_TOF_vt_S5n",100,tofvt1,tofvt2);
H_TOF_vt_S5m.setTitle("S5 neg TOF vert t");
H_TOF_vt_S5m.setTitleX("vert t (ns)");
H_TOF_vt_S6m = new H1F("H_TOF_vt_S6n","H_TOF_vt_S6n",100,tofvt1,tofvt2);
H_TOF_vt_S6m.setTitle("S6 neg TOF vert t");
H_TOF_vt_S6m.setTitleX("vert t (ns)");
H_TOF_vt_mom_S1m = new H2F("H_TOF_vt_mom_S1n","H_TOF_vt_mom_S1n",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S1m.setTitle("S1 neg TOF vert t vs mom");
H_TOF_vt_mom_S1m.setTitleX("p (GeV)");
H_TOF_vt_mom_S1m.setTitleY("vert t (ns)");
H_TOF_vt_mom_S2m = new H2F("H_TOF_vt_mom_S2n","H_TOF_vt_mom_S2n",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S2m.setTitle("S2 neg TOF vert t vs mom");
H_TOF_vt_mom_S2m.setTitleX("p (GeV)");
H_TOF_vt_mom_S2m.setTitleY("vert t (ns)");
H_TOF_vt_mom_S3m = new H2F("H_TOF_vt_mom_S3n","H_TOF_vt_mom_S3n",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S3m.setTitle("S3 neg TOF vert t vs mom");
H_TOF_vt_mom_S3m.setTitleX("p (GeV)");
H_TOF_vt_mom_S3m.setTitleY("vert t (ns)");
H_TOF_vt_mom_S4m = new H2F("H_TOF_vt_mom_S4n","H_TOF_vt_mom_S4n",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S4m.setTitle("S4 neg TOF vert t vs mom");
H_TOF_vt_mom_S4m.setTitleX("p (GeV)");
H_TOF_vt_mom_S4m.setTitleY("vert t (ns)");
H_TOF_vt_mom_S5m = new H2F("H_TOF_vt_mom_S5n","H_TOF_vt_mom_S5n",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S5m.setTitle("S5 neg TOF vert t vs mom");
H_TOF_vt_mom_S5m.setTitleX("p (GeV)");
H_TOF_vt_mom_S5m.setTitleY("vert t (ns)");
H_TOF_vt_mom_S6m = new H2F("H_TOF_vt_mom_S6n","H_TOF_vt_mom_S6n",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S6m.setTitle("S6 neg TOF vert t vs mom");
H_TOF_vt_mom_S6m.setTitleX("p (GeV)");
H_TOF_vt_mom_S6m.setTitleY("vert t (ns)");
H_TOF_vt_S1p = new H1F("H_TOF_vt_S1p","H_TOF_vt_S1p",100,tofvt1,tofvt2);
H_TOF_vt_S1p.setTitle("S1 pos TOF vert t");
H_TOF_vt_S1p.setTitleX("vert t (ns)");
H_TOF_vt_S2p = new H1F("H_TOF_vt_S2p","H_TOF_vt_S2p",100,tofvt1,tofvt2);
H_TOF_vt_S2p.setTitle("S2 pos TOF vert t");
H_TOF_vt_S2p.setTitleX("vert t (ns)");
H_TOF_vt_S3p = new H1F("H_TOF_vt_S3p","H_TOF_vt_S3p",100,tofvt1,tofvt2);
H_TOF_vt_S3p.setTitle("S3 pos TOF vert t");
H_TOF_vt_S3p.setTitleX("vert t (ns)");
H_TOF_vt_S4p = new H1F("H_TOF_vt_S4p","H_TOF_vt_S4p",100,tofvt1,tofvt2);
H_TOF_vt_S4p.setTitle("S4 pos TOF vert t");
H_TOF_vt_S4p.setTitleX("vert t (ns)");
H_TOF_vt_S5p = new H1F("H_TOF_vt_S5p","H_TOF_vt_S5p",100,tofvt1,tofvt2);
H_TOF_vt_S5p.setTitle("S5 pos TOF vert t");
H_TOF_vt_S5p.setTitleX("vert t (ns)");
H_TOF_vt_S6p = new H1F("H_TOF_vt_S6p","H_TOF_vt_S6p",100,tofvt1,tofvt2);
H_TOF_vt_S6p.setTitle("S6 pos TOF vert t");
H_TOF_vt_S6p.setTitleX("vert t (ns)");
H_TOF_vt_mom_S1p = new H2F("H_TOF_vt_mom_S1p","H_TOF_vt_mom_S1p",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S1p.setTitle("S1 pos TOF vert t vs mom");
H_TOF_vt_mom_S1p.setTitleX("p (GeV)");
H_TOF_vt_mom_S1p.setTitleY("vert t (ns)");
H_TOF_vt_mom_S2p = new H2F("H_TOF_vt_mom_S2p","H_TOF_vt_mom_S2p",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S2p.setTitle("S2 pos TOF vert t vs mom");
H_TOF_vt_mom_S2p.setTitleX("p (GeV)");
H_TOF_vt_mom_S2p.setTitleY("vert t (ns)");
H_TOF_vt_mom_S3p = new H2F("H_TOF_vt_mom_S3p","H_TOF_vt_mom_S3p",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S3p.setTitle("S3 pos TOF vert t vs mom");
H_TOF_vt_mom_S3p.setTitleX("p (GeV)");
H_TOF_vt_mom_S3p.setTitleY("vert t (ns)");
H_TOF_vt_mom_S4p = new H2F("H_TOF_vt_mom_S4p","H_TOF_vt_mom_S4p",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S4p.setTitle("S4 pos TOF vert t vs mom");
H_TOF_vt_mom_S4p.setTitleX("p (GeV)");
H_TOF_vt_mom_S4p.setTitleY("vert t (ns)");
H_TOF_vt_mom_S5p = new H2F("H_TOF_vt_mom_S5p","H_TOF_vt_mom_S5p",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S5p.setTitle("S5 pos TOF vert t vs mom");
H_TOF_vt_mom_S5p.setTitleX("p (GeV)");
H_TOF_vt_mom_S5p.setTitleY("vert t (ns)");
H_TOF_vt_mom_S6p = new H2F("H_TOF_vt_mom_S6p","H_TOF_vt_mom_S6p",100,0,EB,100,tofvt1,tofvt2);
H_TOF_vt_mom_S6p.setTitle("S6 pos TOF vert t vs mom");
H_TOF_vt_mom_S6p.setTitleX("p (GeV)");
H_TOF_vt_mom_S6p.setTitleY("vert t (ns)");
H_Nclust_ev = new H1F("H_Nclust_ev","H_Nclust_ev",11,-0.5,10.5);
H_Nclust_ev.setTitle("N clust events");
H_Nclust_ev.setTitleX("N clust");
H_clust1_E = new H1F("H_clust1_E","H_clust1_E",100,0,1.5);
H_clust1_E.setTitle("1st cluster energy");
H_clust1_E.setTitleX("E (GeV)");
H_clust2_E = new H1F("H_clust2_E","H_clust2_E",100,0,1.5);
H_clust2_E.setTitle("2nd cluster energy");
H_clust2_E.setTitleX("E (GeV)");
H_trig_sector_count = new H1F("H_trig_sector_count","H_trig_sector_count",6,0.5,6.5);
H_trig_sector_count.setTitle("N trigs per sect");
H_trig_sector_count.setTitleX("Sector number");
H_muon_trig_sector_count = new H1F("H_muon_trig_sector_count","H_muon_trig_sector_count",3,0.5,3.5);
H_muon_trig_sector_count.setTitle("N muon trigs per sect-pair");
H_muon_trig_sector_count.setTitleX("Sector-pair number");
H_rand_trig_sector_count = new H1F("H_rand_trig_sector_count","H_rand_trig_sector_count",7,0.5,7.5);
H_rand_trig_sector_count.setTitle("N rand trigs per sect");
H_rand_trig_sector_count.setTitleX("Sector number");
H_trig_sector_elec = new H1F("H_trig_sector_elec","H_trig_sector_elec",6,0.5,6.5);
H_trig_sector_elec.setTitle("N elec per sect");
H_trig_sector_elec.setTitleX("Sector number");
H_trig_sector_muon = new H1F("H_trig_sector_muon","H_trig_sector_muon",3,0.5,3.5);
H_trig_sector_muon.setTitle("N muon per sect");
H_trig_sector_muon.setTitleX("Sector number");
H_trig_sector_muontrack = new H1F("H_trig_sector_muontrack","H_trig_sector_muontrack",3,0.5,3.5);
H_trig_sector_muontrack.setTitle("N muonpairs trigger per sect");
H_trig_sector_muontrack.setTitleX("Sector number");
H_trig_sector_elec_rat = new H1F("H_trig_sector_elec_rat","H_trig_sector_elec_rat",6,0.5,6.5);
H_trig_sector_elec_rat.setTitle("N elec / trig vs sector");
H_trig_sector_elec_rat.setTitleX("Sector number");
H_trig_sector_muon_rat = new H1F("H_trig_sector_muon_rat","H_trig_sector_muon_rat",3,0.5,3.5);
H_trig_sector_muon_rat.setTitle("N muon / trig vs sector");
H_trig_sector_muon_rat.setTitleX("Sector-pair number");
H_trig_sector_muontrack_rat = new H1F("H_trig_sector_muontrack_rat","H_trig_sector_muontrack_rat",3,0.5,3.5);
H_trig_sector_muontrack_rat.setTitle("N muon trig / N muon vs sector");
H_trig_sector_muontrack_rat.setTitleX("Sector-pair number");
H_trig_sector_prot = new H1F("H_trig_sector_prot","H_trig_sector_prot",6,0.5,6.5);
H_trig_sector_piplus = new H1F("H_trig_sector_piplus","H_trig_sector_piplus",6,0.5,6.5);
H_trig_sector_piminus = new H1F("H_trig_sector_piminus","H_trig_sector_piminus",6,0.5,6.5);
H_trig_sector_kplus = new H1F("H_trig_sector_kplus","H_trig_sector_kplus",6,0.5,6.5);
H_trig_sector_kminus = new H1F("H_trig_sector_kminus","H_trig_sector_kminus",6,0.5,6.5);
H_trig_sector_photon = new H1F("H_trig_sector_photon","H_trig_sector_photon",6,0.5,6.5);
H_trig_sector_neutron = new H1F("H_trig_sector_neutron","H_trig_sector_neutron",6,0.5,6.5);
H_trig_sector_deut = new H1F("H_trig_sector_deuteron","H_trig_sector_deuteron",6,0.5,6.5);
H_trig_sector_prot_rat = new H1F("H_trig_sector_prot_rat","H_trig_sector_prot_rat",6,0.5,6.5);
H_trig_sector_prot_rat.setTitle("FD prot / trig per sect");
H_trig_sector_prot_rat.setTitleX("Sector number");
H_trig_sector_piplus_rat = new H1F("H_trig_sector_piplus_rat","H_trig_sector_piplus_rat",6,0.5,6.5);
H_trig_sector_piplus_rat.setTitle("FD #pi+ / trig per sect");
H_trig_sector_piplus_rat.setTitleX("Sector number");
H_trig_sector_piminus_rat = new H1F("H_trig_sector_piminus_rat","H_trig_sector_piminus_rat",6,0.5,6.5);
H_trig_sector_piminus_rat.setTitle("FD #pi- / trig per sect");
H_trig_sector_piminus_rat.setTitleX("Sector number");
H_trig_sector_kplus_rat = new H1F("H_trig_sector_kplus_rat","H_trig_sector_kplus_rat",6,0.5,6.5);
H_trig_sector_kplus_rat.setTitle("FD K+ / trig per sect");
H_trig_sector_kplus_rat.setTitleX("Sector number");
H_trig_sector_kminus_rat = new H1F("H_trig_sector_kminus_rat","H_trig_sector_kminus_rat",6,0.5,6.5);
H_trig_sector_kminus_rat.setTitle("FD K- / trig per sect");
H_trig_sector_kminus_rat.setTitleX("Sector number");
H_trig_sector_photon_rat = new H1F("H_trig_sector_photon_rat","H_trig_sector_photon_rat",6,0.5,6.5);
H_trig_sector_photon_rat.setTitle("FD #gamma / trig per sect");
H_trig_sector_photon_rat.setTitleX("Sector number");
H_trig_sector_neutron_rat = new H1F("H_trig_sector_neutron_rat","H_trig_sector_neutron_rat",6,0.5,6.5);
H_trig_sector_deut_rat = new H1F("H_trig_sector_deut_rat","H_trig_sector_deut_rat",6,0.5,6.5);
H_trig_sector_deut_rat.setTitle("FD deut / trig per sect");
H_trig_sector_deut_rat.setTitleX("Sector number");
H_trig_sector_positive_rat = new H1F("H_trig_sector_positive_rat","H_trig_sector_positive_rat",6,0.5,6.5);
H_trig_sector_positive_rat.setTitle("FD positive / trig per sect");
H_trig_sector_positive_rat.setTitleX("Sector number");
H_trig_sector_negative_rat = new H1F("H_trig_sector_negative_rat","H_trig_sector_negative_rat",6,0.5,6.5);
H_trig_sector_negative_rat.setTitle("FD negative / trig per sect");
H_trig_sector_negative_rat.setTitleX("Sector number");
H_trig_sector_neutral_rat = new H1F("H_trig_sector_neutral_rat","H_trig_sector_neutral_rat",6,0.5,6.5);
H_trig_sector_neutral_rat.setTitle("FD neutral / trig per sect");
H_trig_sector_neutral_rat.setTitleX("Sector number");
H_trig_central_prot_rat = new H1F("H_trig_central_prot_rat","H_trig_central_prot_rat",1,0.5,1.5);
H_trig_central_prot_rat.setTitle("CD prot/ trig");
H_trig_central_prot_rat.setTitleX("All sectors");
H_trig_central_piplus_rat = new H1F("H_trig_central_piplus_rat","H_trig_central_piplus_rat",1,0.5,1.5);
H_trig_central_piplus_rat.setTitle("CD #pi+ / trig");
H_trig_central_piplus_rat.setTitleX("All sectors");
H_trig_central_piminus_rat = new H1F("H_trig_central_piminus_rat","H_trig_central_piminus_rat",1,0.5,1.5);
H_trig_central_piminus_rat.setTitle("CD #pi- / trig");
H_trig_central_piminus_rat.setTitleX("All sectors");
H_trig_central_kplus_rat = new H1F("H_trig_central_kplus_rat","H_trig_central_kplus_rat",1,0.5,1.5);
H_trig_central_kplus_rat.setTitle("CD K+ / trig");
H_trig_central_kplus_rat.setTitleX("All sectors");
H_trig_central_kminus_rat = new H1F("H_trig_central_kminus_rat","H_trig_central_kminus_rat",1,0.5,1.5);
H_trig_central_kminus_rat.setTitle("CD K- / trig");
H_trig_central_kminus_rat.setTitleX("All sectors");
H_trig_central_deut_rat = new H1F("H_trig_central_deut_rat","H_trig_central_deut_rat",1,0.5,1.5);
H_trig_central_deut_rat.setTitle("CD deut / trig");
H_trig_central_deut_rat.setTitleX("All sectors");
H_CD_vz_mom = new H2F("H_CD_vz_mom","H_CD_vz_mom",100,0,3.5,100,-25.,25.);
H_CD_vz_mom.setTitle("CD z vertex vs mom");
H_CD_vz_mom.setTitleX("p (GeV/c");
H_CD_vz_mom.setTitleY("z (cm)");
H_CD_vz_theta = new H2F("H_CD_vz_theta","H_CD_vz_theta",100,0,180.,100, -25., 25.);
H_CD_vz_theta.setTitle("CD z vertex vs theta");
H_CD_vz_theta.setTitleX("#theta (^o)");
H_CD_vz_theta.setTitleY("z (cm)");
H_CD_vz_phi = new H2F("H_CD_vz_phi", "H_CD_vz_phi", 200, -180., 180., 100, -25., 25.);
H_CD_vz_phi.setTitle("CD z vertex vs phi");
H_CD_vz_phi.setTitleX("#phi (^o)");
H_CD_vz_phi.setTitleY("z (cm)");
H_CD_vx = new H1F("H_CD_vx", 200, -10., 10.);
H_CD_vx.setTitle("CD particle x vertex");
H_CD_vx.setTitleX("x (cm)");
H_CD_vz = new H1F("H_CD_vz", 200, -25., 25.);
H_CD_vz.setTitle("CD particle z vertex");
H_CD_vz.setTitleX("z (cm)");
H_CD_vy = new H1F("H_CD_vy", 200, -10., 10.);
H_CD_vy.setTitle("CD particle y vertex");
H_CD_vy.setTitleX("y (cm)");
H_CD_vx_vy = new H2F("H_CD_vx_vy", "H_CD_vx_vy", 100, -25., 25, 100, -25., 25.);
H_CD_vx_vy.setTitle("CD particle vertex vy vs vx");
H_CD_vx_vy.setTitleX("x (cm)");
H_CD_vx_vy.setTitleY("y (cm)");
H_CD_vx_vz = new H2F("H_CD_vx_vz", "H_CD_vx_vz", 100, -25., 25, 100, -25., 25.);
H_CD_vx_vz.setTitle("CD particle vertex vz vs vx");
H_CD_vx_vz.setTitleX("x (cm)");
H_CD_vx_vz.setTitleY("z (cm)");
H_CD_vz_vy = new H2F("H_CD_vz_vy", "H_CD_vz_vy", 100, -25., 25, 100, -25., 25.);
H_CD_vz_vy.setTitle("CD particle vertex vz vs vy");
H_CD_vz_vy.setTitleX("y (cm)");
H_CD_vz_vy.setTitleY("z (cm)");
H_CVT_vz_mom = new H2F("H_CVT_vz_mom", "H_CVT_vz_mom", 100, 0, 3.5, 100, -25., 25.);
H_CVT_vz_mom.setTitle("CVT z vertex vs mom");
H_CVT_vz_mom.setTitleX("p (GeV/c");
H_CVT_vz_mom.setTitleY("z (cm)");
H_CVT_vz_theta = new H2F("H_CVT_vz_theta", "H_CVT_vz_theta", 100, 0, 180., 100, -25., 25.);
H_CVT_vz_theta.setTitle("CVT z vertex vs theta");
H_CVT_vz_theta.setTitleX("#theta (^o)");
H_CVT_vz_theta.setTitleY("z (cm)");
H_CVT_vz_phi = new H2F("H_CVT_vz_phi", "H_CVT_vz_phi", 200, -180., 180., 100, -25., 25.);
H_CVT_vz_phi.setTitle("CVT z vertex vs phi");
H_CVT_vz_phi.setTitleX("#phi (^o)");
H_CVT_vz_phi.setTitleY("z (cm)");
H_CVT_vx = new H1F("H_CVT_vx", 200, -5., 5.);
H_CVT_vx.setTitle("CVT x vertex");
H_CVT_vx.setTitleX("x (cm)");
H_CVT_vz = new H1F("H_CVT_vz", 200, -25., 25.);
H_CVT_vz.setTitle("CVT z vertex");
H_CVT_vz.setTitleX("z (cm)");
H_CVT_vy = new H1F("H_CVT_vy", 200, -5., 5.);
H_CVT_vy.setTitle("CVT y vertex");
H_CVT_vy.setTitleX("y (cm)");
H_CVT_vx_vy = new H2F("H_CVT_vx_vy", "H_CVT_vx_vy", 100, -25., 25, 100, -25., 25.);
H_CVT_vx_vy.setTitle("CVT vertex y vs x");
H_CVT_vx_vy.setTitleX("x (cm)");
H_CVT_vx_vy.setTitleY("y (cm)");
H_CVT_vx_vz = new H2F("H_CVT_vx_vz", "H_CVT_vx_vz", 100, -25., 25, 100, -25., 25.);
H_CVT_vx_vz.setTitle("CVT vertex z vs x");
H_CVT_vx_vz.setTitleX("x (cm)");
H_CVT_vx_vz.setTitleY("z (cm)");
H_CVT_vz_vy = new H2F("H_CVT_vz_vy", "H_CVT_vz_vy", 100, -25., 25, 100, -25., 25.);
H_CVT_vz_vy.setTitle("CVT vertex z vs y");
H_CVT_vz_vy.setTitleX("y (cm)");
H_CVT_vz_vy.setTitleY("z (cm)");
PCAL_Thresh_S1 = new H1F("PCAL_Thresh_S1","PCAL_Thresh_S1",100,0,0.5);
PCAL_Thresh_S1.setTitle("PCAL E S1");
PCAL_Thresh_S1.setTitleX("E (GeV)");
PCAL_Thresh_S2 = new H1F("PCAL_Thresh_S2","PCAL_Thresh_S2",100,0,0.5);
PCAL_Thresh_S2.setTitle("PCAL E S2");
PCAL_Thresh_S2.setTitleX("E (GeV)");
PCAL_Thresh_S3 = new H1F("PCAL_Thresh_S3","PCAL_Thresh_S3",100,0,0.5);
PCAL_Thresh_S3.setTitle("PCAL E S3");
PCAL_Thresh_S3.setTitleX("E (GeV)");
PCAL_Thresh_S4 = new H1F("PCAL_Thresh_S4","PCAL_Thresh_S4",100,0,0.5);
PCAL_Thresh_S4.setTitle("PCAL E S4");
PCAL_Thresh_S4.setTitleX("E (GeV)");
PCAL_Thresh_S5 = new H1F("PCAL_Thresh_S5","PCAL_Thresh_S5",100,0,0.5);
PCAL_Thresh_S5.setTitle("PCAL E S5");
PCAL_Thresh_S5.setTitleX("E (GeV)");
PCAL_Thresh_S6 = new H1F("PCAL_Thresh_S6","PCAL_Thresh_S6",100,0,0.5);
PCAL_Thresh_S6.setTitle("PCAL E S6");
PCAL_Thresh_S6.setTitleX("E (GeV)");
ETOT_Sampl_S1 = new H2F("ETOT_Sampl_S1","ETOT_Sampl_S1",100,0,EB,100,0,0.5);
ETOT_Sampl_S1.setTitle("ETOT sampling S1");
ETOT_Sampl_S1.setTitleX("p (GeV)");
ETOT_Sampl_S1.setTitleY("ETOT/p");
ETOT_Sampl_S2 = new H2F("ETOT_Sampl_S2","ETOT_Sampl_S2",100,0,EB,100,0,0.5);
ETOT_Sampl_S2.setTitle("ETOT sampling S2");
ETOT_Sampl_S2.setTitleX("p (GeV)");
ETOT_Sampl_S2.setTitleY("ETOT/p");
ETOT_Sampl_S3 = new H2F("ETOT_Sampl_S3","ETOT_Sampl_S3",100,0,EB,100,0,0.5);
ETOT_Sampl_S3.setTitle("ETOT sampling S3");
ETOT_Sampl_S3.setTitleX("p (GeV)");
ETOT_Sampl_S3.setTitleY("ETOT/p");
ETOT_Sampl_S4 = new H2F("ETOT_Sampl_S4","ETOT_Sampl_S4",100,0,EB,100,0,0.5);
ETOT_Sampl_S4.setTitle("ETOT sampling S4");
ETOT_Sampl_S4.setTitleX("p (GeV)");
ETOT_Sampl_S4.setTitleY("ETOT/p");
ETOT_Sampl_S5 = new H2F("ETOT_Sampl_S5","ETOT_Sampl_S5",100,0,EB,100,0,0.5);
ETOT_Sampl_S5.setTitle("ETOT sampling S5");
ETOT_Sampl_S5.setTitleX("p (GeV)");
ETOT_Sampl_S5.setTitleY("ETOT/p");
ETOT_Sampl_S6 = new H2F("ETOT_Sampl_S6","ETOT_Sampl_S6",100,0,EB,100,0,0.5);
ETOT_Sampl_S6.setTitle("ETOT sampling S6");
ETOT_Sampl_S6.setTitleX("p (GeV)");
ETOT_Sampl_S6.setTitleY("ETOT/p");
missTrig_S1_ft = new H2F("missTrig_S1_ft","missTrig_S1_ft",100,-180,180,100,0,40);
missTrig_S1_ft.setTitle("Miss trig S1");
missTrig_S1_ft.setTitleX("#phi");
missTrig_S1_ft.setTitleY("#theta");
missTrig_S2_ft = new H2F("missTrig_S2_ft","missTrig_S2_ft",100,-180,180,100,0,40);
missTrig_S2_ft.setTitle("Miss trig S2");
missTrig_S2_ft.setTitleX("#phi");
missTrig_S2_ft.setTitleY("#theta");
missTrig_S3_ft = new H2F("missTrig_S3_ft","missTrig_S3_ft",100,-180,180,100,0,40);
missTrig_S3_ft.setTitle("Miss trig S3");
missTrig_S3_ft.setTitleX("#phi");
missTrig_S3_ft.setTitleY("#theta");
missTrig_S4_ft = new H2F("missTrig_S4_ft","missTrig_S4_ft",100,-180,180,100,0,40);
missTrig_S4_ft.setTitle("Miss trig S4");
missTrig_S4_ft.setTitleX("#phi");
missTrig_S4_ft.setTitleY("#theta");
missTrig_S5_ft = new H2F("missTrig_S5_ft","missTrig_S5_ft",100,-180,180,100,0,40);
missTrig_S5_ft.setTitle("Miss trig S5");
missTrig_S5_ft.setTitleX("#phi");
missTrig_S5_ft.setTitleY("#theta");
missTrig_S6_ft = new H2F("missTrig_S6_ft","missTrig_S6_ft",100,-180,180,100,0,40);
missTrig_S6_ft.setTitle("Miss trig S6");
missTrig_S6_ft.setTitleX("#phi");
missTrig_S6_ft.setTitleY("#theta");
missTrig_S1_mt = new H2F("missTrig_S1_mt","missTrig_S1_mt",100,0,EB,100,0,40);
missTrig_S1_mt.setTitle("Miss trig S1");
missTrig_S1_mt.setTitleX("p (GeV)");
missTrig_S1_mt.setTitleY("#theta");
missTrig_S2_mt = new H2F("missTrig_S2_mt","missTrig_S2_mt",100,0,EB,100,0,40);
missTrig_S2_mt.setTitle("Miss trig S2");
missTrig_S2_mt.setTitleX("p (GeV)");
missTrig_S2_mt.setTitleY("#theta");
missTrig_S3_mt = new H2F("missTrig_S3_mt","missTrig_S3_mt",100,0,EB,100,0,40);
missTrig_S3_mt.setTitle("Miss trig S3");
missTrig_S3_mt.setTitleX("p (GeV)");
missTrig_S3_mt.setTitleY("#theta");
missTrig_S4_mt = new H2F("missTrig_S4_mt","missTrig_S4_mt",100,0,EB,100,0,40);
missTrig_S4_mt.setTitle("Miss trig S4");
missTrig_S4_mt.setTitleX("p (GeV)");
missTrig_S4_mt.setTitleY("#theta");
missTrig_S5_mt = new H2F("missTrig_S5_mt","missTrig_S5_mt",100,0,EB,100,0,40);
missTrig_S5_mt.setTitle("Miss trig S5");
missTrig_S5_mt.setTitleX("p (GeV)");
missTrig_S5_mt.setTitleY("#theta");
missTrig_S6_mt = new H2F("missTrig_S6_mt","missTrig_S6_mt",100,0,EB,100,0,40);
missTrig_S6_mt.setTitle("Miss trig S6");
missTrig_S6_mt.setTitleX("p (GeV)");
missTrig_S6_mt.setTitleY("#theta");
missTrig_S1_mf = new H2F("missTrig_S1_mf","missTrig_S1_mf",100,0,EB,100,-180,180);
missTrig_S1_mf.setTitle("Miss Trig S1");
missTrig_S1_mf.setTitleX("p (GeV)");
missTrig_S1_mf.setTitleY("#phi");
missTrig_S2_mf = new H2F("missTrig_S2_mf","missTrig_S2_mf",100,0,EB,100,-180,180);
missTrig_S2_mf.setTitle("Miss Trig S2");
missTrig_S2_mf.setTitleX("p (GeV)");
missTrig_S2_mf.setTitleY("#phi");
missTrig_S3_mf = new H2F("missTrig_S3_mf","missTrig_S3_mf",100,0,EB,100,-180,180);
missTrig_S3_mf.setTitle("Miss Trig S3");
missTrig_S3_mf.setTitleX("p (GeV)");
missTrig_S3_mf.setTitleY("#phi");
missTrig_S4_mf = new H2F("missTrig_S4_mf","missTrig_S4_mf",100,0,EB,100,-180,180);
missTrig_S4_mf.setTitle("Miss Trig S4");
missTrig_S4_mf.setTitleX("p (GeV)");
missTrig_S4_mf.setTitleY("#phi");
missTrig_S5_mf = new H2F("missTrig_S5_mf","missTrig_S5_mf",100,0,EB,100,-180,180);
missTrig_S5_mf.setTitle("Miss Trig S5");
missTrig_S5_mf.setTitleX("p (GeV)");
missTrig_S5_mf.setTitleY("#phi");
missTrig_S6_mf = new H2F("missTrig_S6_mf","missTrig_S6_mf",100,0,EB,100,-180,180);
missTrig_S6_mf.setTitle("Miss Trig S6");
missTrig_S6_mf.setTitleX("p (GeV)");
missTrig_S6_mf.setTitleY("#phi");
H_trig_S1_ETOT_E = new H1F("H_trig_S1_ETOT_E","H_trig_S1_ETOT_E",100,0,0.75);
H_trig_S1_ETOT_E.setTitle("ETOT E S1 trig bit");
H_trig_S1_ETOT_E.setTitleX("E_{ETOT} (GeV)");
H_trig_S2_ETOT_E = new H1F("H_trig_S2_ETOT_E","H_trig_S2_ETOT_E",100,0,0.75);
H_trig_S2_ETOT_E.setTitle("ETOT E S2 trig bit");
H_trig_S2_ETOT_E.setTitleX("E_{ETOT} (GeV)");
H_trig_S3_ETOT_E = new H1F("H_trig_S3_ETOT_E","H_trig_S3_ETOT_E",100,0,0.75);
H_trig_S3_ETOT_E.setTitle("ETOT E S3 trig bit");
H_trig_S3_ETOT_E.setTitleX("E_{ETOT} (GeV)");
H_trig_S4_ETOT_E = new H1F("H_trig_S4_ETOT_E","H_trig_S4_ETOT_E",100,0,0.75);
H_trig_S4_ETOT_E.setTitle("ETOT E S4 trig bit");
H_trig_S4_ETOT_E.setTitleX("E_{ETOT} (GeV)");
H_trig_S5_ETOT_E = new H1F("H_trig_S5_ETOT_E","H_trig_S5_ETOT_E",100,0,0.75);
H_trig_S5_ETOT_E.setTitle("ETOT E S5 trig bit");
H_trig_S5_ETOT_E.setTitleX("E_{ETOT} (GeV)");
H_trig_S6_ETOT_E = new H1F("H_trig_S6_ETOT_E","H_trig_S6_ETOT_E",100,0,0.75);
H_trig_S6_ETOT_E.setTitle("ETOT E S6 trig bit");
H_trig_S6_ETOT_E.setTitleX("E_{ETOT} (GeV)");
H_trig_S1_ECAL_E = new H1F("H_trig_S1_ECAL_E","H_trig_S1_ECAL_E",100,0,0.25);
H_trig_S1_ECAL_E.setTitle("ECAL E S1 trig bit");
H_trig_S1_ECAL_E.setTitleX("E_{ECAL} (GeV)");
H_trig_S2_ECAL_E = new H1F("H_trig_S2_ECAL_E","H_trig_S2_ECAL_E",100,0,0.25);
H_trig_S2_ECAL_E.setTitle("ECAL E S2 trig bit");
H_trig_S2_ECAL_E.setTitleX("E_{ECAL} (GeV)");
H_trig_S3_ECAL_E = new H1F("H_trig_S3_ECAL_E","H_trig_S3_ECAL_E",100,0,0.25);
H_trig_S3_ECAL_E.setTitle("ECAL E S3 trig bit");
H_trig_S3_ECAL_E.setTitleX("E_{ECAL} (GeV)");
H_trig_S4_ECAL_E = new H1F("H_trig_S4_ECAL_E","H_trig_S4_ECAL_E",100,0,0.25);
H_trig_S4_ECAL_E.setTitle("ECAL E S4 trig bit");
H_trig_S4_ECAL_E.setTitleX("E_{ECAL} (GeV)");
H_trig_S5_ECAL_E = new H1F("H_trig_S5_ECAL_E","H_trig_S5_ECAL_E",100,0,0.25);
H_trig_S5_ECAL_E.setTitle("ECAL E S5 trig bit");
H_trig_S5_ECAL_E.setTitleX("E_{ECAL} (GeV)");
H_trig_S6_ECAL_E = new H1F("H_trig_S6_ECAL_E","H_trig_S6_ECAL_E",100,0,0.25);
H_trig_S6_ECAL_E.setTitle("ECAL E S6 trig bit");
H_trig_S6_ECAL_E.setTitleX("E_{ECAL} (GeV)");
H_trig_S1_PCAL_E = new H1F("H_trig_S1_PCAL_E","H_trig_S1_PCAL_E",100,0,0.5);
H_trig_S1_PCAL_E.setTitle("PCAL E S1 trig bit");
H_trig_S1_PCAL_E.setTitleX("E_{ECAL} (GeV)");
H_trig_S2_PCAL_E = new H1F("H_trig_S2_PCAL_E","H_trig_S2_PCAL_E",100,0,0.5);
H_trig_S2_PCAL_E.setTitle("PCAL E S2 trig bit");
H_trig_S2_PCAL_E.setTitleX("E_{PCAL} (GeV)");
H_trig_S3_PCAL_E = new H1F("H_trig_S3_PCAL_E","H_trig_S3_PCAL_E",100,0,0.5);
H_trig_S3_PCAL_E.setTitle("PCAL E S3 trig bit");
H_trig_S3_PCAL_E.setTitleX("E_{PCAL} (GeV)");
H_trig_S4_PCAL_E = new H1F("H_trig_S4_PCAL_E","H_trig_S4_PCAL_E",100,0,0.5);
H_trig_S4_PCAL_E.setTitle("PCAL E S4 trig bit");
H_trig_S4_PCAL_E.setTitleX("E_{PCAL} (GeV)");
H_trig_S5_PCAL_E = new H1F("H_trig_S5_PCAL_E","H_trig_S5_PCAL_E",100,0,0.5);
H_trig_S5_PCAL_E.setTitle("PCAL E S5 trig bit");
H_trig_S5_PCAL_E.setTitleX("E_{PCAL} (GeV)");
H_trig_S6_PCAL_E = new H1F("H_trig_S6_PCAL_E","H_trig_S6_PCAL_E",100,0,0.5);
H_trig_S6_PCAL_E.setTitle("PCAL E S6 trig bit");
H_trig_S6_PCAL_E.setTitleX("E_{PCAL} (GeV)");
H_trig_S1_HTCC_n = new H1F("H_trig_S1_HTCC_n","H_trig_S1_HTCC_n",300,0,30);
H_trig_S1_HTCC_n.setTitle("HTCC nphe S1 trig bit");
H_trig_S1_HTCC_n.setTitleX("nphe");
H_trig_S2_HTCC_n = new H1F("H_trig_S2_HTCC_n","H_trig_S2_HTCC_n",300,0,30);
H_trig_S2_HTCC_n.setTitle("HTCC nphe S2 trig bit");
H_trig_S2_HTCC_n.setTitleX("nphe");
H_trig_S3_HTCC_n = new H1F("H_trig_S3_HTCC_n","H_trig_S3_HTCC_n",300,0,30);
H_trig_S3_HTCC_n.setTitle("HTCC nphe S3 trig bit");
H_trig_S3_HTCC_n.setTitleX("nphe");
H_trig_S4_HTCC_n = new H1F("H_trig_S4_HTCC_n","H_trig_S4_HTCC_n",300,0,30);
H_trig_S4_HTCC_n.setTitle("HTCC nphe S4 trig bit");
H_trig_S4_HTCC_n.setTitleX("nphe");
H_trig_S5_HTCC_n = new H1F("H_trig_S5_HTCC_n","H_trig_S5_HTCC_n",300,0,30);
H_trig_S5_HTCC_n.setTitle("HTCC nphe S5 trig bit");
H_trig_S5_HTCC_n.setTitleX("nphe");
H_trig_S6_HTCC_n = new H1F("H_trig_S6_HTCC_n","H_trig_S6_HTCC_n",300,0,30);
H_trig_S6_HTCC_n.setTitle("HTCC nphe S6 trig bit");
H_trig_S6_HTCC_n.setTitleX("nphe");
H_trig_S1_HTCC_N = new H1F("H_trig_S1_HTCC_N","H_trig_S1_HTCC_N",300,0,30);
H_trig_S1_HTCC_N.setTitle("HTCC nphe (hig) S1 trig bit");
H_trig_S1_HTCC_N.setTitleX("nphe");
H_trig_S2_HTCC_N = new H1F("H_trig_S2_HTCC_N","H_trig_S2_HTCC_N",300,0,30);
H_trig_S2_HTCC_N.setTitle("HTCC nphe (hig) S2 trig bit");
H_trig_S2_HTCC_N.setTitleX("nphe");
H_trig_S3_HTCC_N = new H1F("H_trig_S3_HTCC_N","H_trig_S3_HTCC_N",300,0,30);
H_trig_S3_HTCC_N.setTitle("HTCC nphe (hig) S3 trig bit");
H_trig_S3_HTCC_N.setTitleX("nphe");
H_trig_S4_HTCC_N = new H1F("H_trig_S4_HTCC_N","H_trig_S4_HTCC_N",300,0,30);
H_trig_S4_HTCC_N.setTitle("HTCC nphe (hig) S4 trig bit");
H_trig_S4_HTCC_N.setTitleX("nphe");
H_trig_S5_HTCC_N = new H1F("H_trig_S5_HTCC_N","H_trig_S5_HTCC_N",300,0,30);
H_trig_S5_HTCC_N.setTitle("HTCC nphe (hig) S5 trig bit");
H_trig_S5_HTCC_N.setTitleX("nphe");
H_trig_S6_HTCC_N = new H1F("H_trig_S6_HTCC_N","H_trig_S6_HTCC_N",300,0,30);
H_trig_S6_HTCC_N.setTitle("HTCC nphe (hig) S6 trig bit");
H_trig_S6_HTCC_N.setTitleX("nphe");
H_trig_S1_HTCC_N_track = new H1F("H_trig_S1_HTCC_N_track","H_trig_S1_HTCC_N_track",300,0,30);
H_trig_S1_HTCC_N_track.setTitle("HTCC nphe (hig+trk) S1 trig bit");
H_trig_S1_HTCC_N_track.setTitleX("nphe");
H_trig_S2_HTCC_N_track = new H1F("H_trig_S2_HTCC_N_track","H_trig_S2_HTCC_N_track",300,0,30);
H_trig_S2_HTCC_N_track.setTitle("HTCC nphe (hig+trk) S2 trig bit");
H_trig_S2_HTCC_N_track.setTitleX("nphe");
H_trig_S3_HTCC_N_track = new H1F("H_trig_S3_HTCC_N_track","H_trig_S3_HTCC_N_track",300,0,30);
H_trig_S3_HTCC_N_track.setTitle("HTCC nphe (hig+trk) S3 trig bit");
H_trig_S3_HTCC_N_track.setTitleX("nphe");
H_trig_S4_HTCC_N_track = new H1F("H_trig_S4_HTCC_N_track","H_trig_S4_HTCC_N_track",300,0,30);
H_trig_S4_HTCC_N_track.setTitle("HTCC nphe (hig+trk) S4 trig bit");
H_trig_S4_HTCC_N_track.setTitleX("nphe");
H_trig_S5_HTCC_N_track = new H1F("H_trig_S5_HTCC_N_track","H_trig_S5_HTCC_N_track",300,0,30);
H_trig_S5_HTCC_N_track.setTitle("HTCC nphe (hig+trk) S5 trig bit");
H_trig_S5_HTCC_N_track.setTitleX("nphe");
H_trig_S6_HTCC_N_track = new H1F("H_trig_S6_HTCC_N_track","H_trig_S6_HTCC_N_track",300,0,30);
H_trig_S6_HTCC_N_track.setTitle("HTCC nphe (hig+trk) S6 trig bit");
H_trig_S6_HTCC_N_track.setTitleX("nphe");
H_trig_S1_PCAL_XY = new H2F("H_trig_S1_PCAL_XY","H_trig_S1_PCAL_XY",100,-400,400,100,-400,400);
H_trig_S1_PCAL_XY.setTitle("PCAL XY S1 trig bit");
H_trig_S1_PCAL_XY.setTitleX("X (cm)");
H_trig_S1_PCAL_XY.setTitleY("Y (cm)");
H_trig_S2_PCAL_XY = new H2F("H_trig_S2_PCAL_XY","H_trig_S2_PCAL_XY",100,-400,400,100,-400,400);
H_trig_S2_PCAL_XY.setTitle("PCAL XY S2 trig bit");
H_trig_S2_PCAL_XY.setTitleX("X (cm)");
H_trig_S2_PCAL_XY.setTitleY("Y (cm)");
H_trig_S3_PCAL_XY = new H2F("H_trig_S3_PCAL_XY","H_trig_S3_PCAL_XY",100,-400,400,100,-400,400);
H_trig_S3_PCAL_XY.setTitle("PCAL XY S3 trig bit");
H_trig_S3_PCAL_XY.setTitleX("X (cm)");
H_trig_S3_PCAL_XY.setTitleY("Y (cm)");
H_trig_S4_PCAL_XY = new H2F("H_trig_S4_PCAL_XY","H_trig_S4_PCAL_XY",100,-400,400,100,-400,400);
H_trig_S4_PCAL_XY.setTitle("PCAL XY S4 trig bit");
H_trig_S4_PCAL_XY.setTitleX("X (cm)");
H_trig_S4_PCAL_XY.setTitleY("Y (cm)");
H_trig_S5_PCAL_XY = new H2F("H_trig_S5_PCAL_XY","H_trig_S5_PCAL_XY",100,-400,400,100,-400,400);
H_trig_S5_PCAL_XY.setTitle("PCAL XY S5 trig bit");
H_trig_S5_PCAL_XY.setTitleX("X (cm)");
H_trig_S5_PCAL_XY.setTitleY("Y (cm)");
H_trig_S6_PCAL_XY = new H2F("H_trig_S6_PCAL_XY","H_trig_S6_PCAL_XY",100,-400,400,100,-400,400);
H_trig_S6_PCAL_XY.setTitle("PCAL XY S6 trig bit");
H_trig_S6_PCAL_XY.setTitleX("X (cm)");
H_trig_S6_PCAL_XY.setTitleY("Y (cm)");
H_trig_S1_HTCC_XY = new H2F("H_trig_S1_HTCC_XY","H_trig_S1_HTCC_XY",50,-120,120,50,-120,120);
H_trig_S1_HTCC_XY.setTitle("HTCC XY S1 trig bit");
H_trig_S1_HTCC_XY.setTitleX("X (cm)");
H_trig_S1_HTCC_XY.setTitleY("Y (cm)");
H_trig_S2_HTCC_XY = new H2F("H_trig_S2_HTCC_XY","H_trig_S2_HTCC_XY",50,-120,120,50,-120,120);
H_trig_S2_HTCC_XY.setTitle("HTCC XY S2 trig bit");
H_trig_S2_HTCC_XY.setTitleX("X (cm)");
H_trig_S2_HTCC_XY.setTitleY("Y (cm)");
H_trig_S3_HTCC_XY = new H2F("H_trig_S3_HTCC_XY","H_trig_S3_HTCC_XY",50,-120,120,50,-120,120);
H_trig_S3_HTCC_XY.setTitle("HTCC XY S3 trig bit");
H_trig_S3_HTCC_XY.setTitleX("X (cm)");
H_trig_S3_HTCC_XY.setTitleY("Y (cm)");
H_trig_S4_HTCC_XY = new H2F("H_trig_S4_HTCC_XY","H_trig_S4_HTCC_XY",50,-120,120,50,-120,120);
H_trig_S4_HTCC_XY.setTitle("HTCC XY S4 trig bit");
H_trig_S4_HTCC_XY.setTitleX("X (cm)");
H_trig_S4_HTCC_XY.setTitleY("Y (cm)");
H_trig_S5_HTCC_XY = new H2F("H_trig_S5_HTCC_XY","H_trig_S5_HTCC_XY",50,-120,120,50,-120,120);
H_trig_S5_HTCC_XY.setTitle("HTCC XY S5 trig bit");
H_trig_S5_HTCC_XY.setTitleX("X (cm)");
H_trig_S5_HTCC_XY.setTitleY("Y (cm)");
H_trig_S6_HTCC_XY = new H2F("H_trig_S6_HTCC_XY","H_trig_S6_HTCC_XY",50,-120,120,50,-120,120);
H_trig_S6_HTCC_XY.setTitle("HTCC XY S6 trig bit");
H_trig_S6_HTCC_XY.setTitleX("X (cm)");
H_trig_S6_HTCC_XY.setTitleY("Y (cm)");
H_pip_vz_ve = new H2F("H_pip_vz_ve","H_pip_vz_ve",100,-5,15,100,-10,20);
H_pip_vz_ve.setTitle("#pi^+ vz vs e vz");
H_pip_vz_ve.setTitleX("e vz (cm)");
H_pip_vz_ve.setTitleY("#pi^+ vz (cm)");
H_pip_vz_ve_diff = new H1F("H_pip_vz_ve_diff","H_pip_vz_ve_diff",100,-10,20);
H_pip_vz_ve_diff.setTitle("#pi^+ e vz diff");
H_pip_vz_ve_diff.setTitleX("#Delta vz (cm)");
H_pip_vz_ve_diff_mom = new H2F("H_pip_vz_ve_diff_mom","H_pip_vz_ve_diff_mom",100,0,6,100,-10,20);
H_pip_vz_ve_diff_mom.setTitle("#pi^+ e vz diff vs mom");
H_pip_vz_ve_diff_mom.setTitleX("#pi^+ mom (GeV)");
H_pip_vz_ve_diff_mom.setTitleY("#Delta vz (cm)");
H_pip_vz_ve_diff_theta = new H2F("H_pip_vz_ve_diff_theta","H_pip_vz_ve_diff_theta",100,0,40,100,-10,20);
H_pip_vz_ve_diff_theta.setTitle("#pi^+ e vz diff vs #theta");
H_pip_vz_ve_diff_theta.setTitleX("#theta (^o)");
H_pip_vz_ve_diff_theta.setTitleY("#Delta vz (cm)");
H_pip_vz_ve_diff_phi = new H2F("H_pip_vz_ve_diff_phi","H_pip_vz_ve_diff_phi",100,-180,180,100,-10,20);
H_pip_vz_ve_diff_phi.setTitle("#pi^+ e vz diff vs #phi");
H_pip_vz_ve_diff_phi.setTitleX("#phi (^o)");
H_pip_vz_ve_diff_phi.setTitleY("#Delta vz (cm)");
H_pip_vz_ve_diff_Dphi = new H2F("H_pip_vz_ve_diff_Dphi","H_pip_vz_ve_diff_Dphi",100,-180,180,100,-10,20);
H_pip_vz_ve_diff_Dphi.setTitle("#pi^+ e vz diff vs #Delta#phi");
H_pip_vz_ve_diff_Dphi.setTitleX("#Delta#phi (^o)");
H_pip_vz_ve_diff_Dphi.setTitleY("#Delta vz (cm)");
H_pip_Dphi = new H1F("H_pip_Dphi","H_pip_Dphi",100,-180,180);
H_pip_Dphi.setTitle("#pi^+ e #Delta#phi");
H_pip_Dphi.setTitleX("#Delta#phi (^o)");
H_MM_epip_Spip = new H1F[6];
H_MM_epip_Se = new H1F[6];
for(int i=0;i<6;i++){
H_MM_epip_Spip[i] = new H1F(String.format("H_MM_epip_Spip%d",i+1),String.format("H_MM_epip_Spip%d",i+1),100,0,4);
H_MM_epip_Spip[i].setTitle(String.format("pi^+ S%d MM #pi^+ vs #phi",i+1));
H_MM_epip_Spip[i].setTitleX("MM_{e#pi^+} (GeV)");
H_MM_epip_Se[i] = new H1F(String.format("H_MM_epip_Se%d",i+1),String.format("H_MM_epip_Se%d",i+1),100,0,4);
H_MM_epip_Se[i].setTitle(String.format("e S%d MM #pi^+ vs #phi",i+1));
H_MM_epip_Se[i].setTitleX("MM_{e#pi^+} (GeV)");
}
H_pip_vtd = new H1F("H_pip_vtd","H_pip_vtd",100,-5,5);
H_pip_vtd.setTitle("Vertex time difference e #pi^+");
H_pip_vtd.setTitleX("#Delta t_{v} (ns)");
H_pim_vtd = new H1F("H_pim_vtd","H_pim_vtd",100,-5,5);
H_pim_vtd.setTitle("Vertex time difference e #pi^-");
H_pim_vtd.setTitleX("#Delta t_{v} (ns)");
H_MM_epip_phi = new H2F("H_MM_epip_phi","H_MM_epip_phi",100,-180,180,100,-1,5);
H_MM_epip_phi.setTitle("Missing mass #pi^+ vs #phi");
H_MM_epip_phi.setTitleX("#phi (^o)");
H_MM_epip_phi.setTitleY("MM_{e#pi^+} (GeV)");
H_pip_beta_p = new H2F("H_pip_beta_p","H_pip_beta_p",100,0,EB,100,0.9,1.1);
H_pip_beta_p.setTitle("#pi^+ #beta vs momentum");
H_pip_beta_p.setTitleX("p (GeV)");
H_pip_beta_p.setTitleY("#beta");
H_pip_beta2_p = new H2F("H_pip_beta2_p","H_pip_beta2_p",100,0,EB,100,0.9,1.1);
H_pip_beta2_p.setTitle("#pi^+ #beta vs momentum");
H_pip_beta2_p.setTitleX("p (GeV)");
H_pip_beta2_p.setTitleY("#beta");
H_pip_vtd_mom = new H2F("H_pip_vtd_mom","H_pip_vtd_mom",100,0,EB,100,-2,2);
H_pip_vtd_mom.setTitle("#pi^+ time diff e #pi^+ vs mom");
H_pip_vtd_mom.setTitleX("p (GeV)");
H_pip_vtd_mom.setTitleY("#Delta t_{v} (ns)");
H_pip_vtd_theta = new H2F("H_pip_vtd_theta","H_pip_vtd_theta",100,0,40,100,-2,2);
H_pip_vtd_theta.setTitle("#pi^+ time diff e #pi^+ vs #theta");
H_pip_vtd_theta.setTitleX("#theta (^o)");
H_pip_vtd_theta.setTitleY("#Delta t_{v} (ns)");
H_pip_vtd_phi = new H2F("H_pip_vtd_phi","H_pip_vtd_phi",100,-180,180,100,-2,2);
H_pip_vtd_phi.setTitle("#pi^+ time diff e #pi^+ vs #phi");
H_pip_vtd_phi.setTitleX("#phi (^o)");
H_pip_vtd_phi.setTitleY("#Delta t_{v} (ns)");
H_pip_theta_phi = new H2F("H_pip_theta_phi","H_pip_theta_phi",100,-180,180,100,0,40);
H_pip_theta_phi.setTitle("#pi^+ #theta vs #phi");
H_pip_theta_phi.setTitleX("#phi (^o)");
H_pip_theta_phi.setTitleY("#theta (^o)");
H_pip_theta_mom = new H2F("H_pip_theta_mom","H_pip_theta_mom",100,0,EB,100,0,40);
H_pip_theta_mom.setTitle("#pi^+ #theta vs mom");
H_pip_theta_mom.setTitleX("p (GeV)");
H_pip_theta_mom.setTitleY("#theta");
H_pip_phi_mom = new H2F("H_pip_phi_mom","H_pip_phi_mom",100,0,EB,100,-180,180);
H_pip_phi_mom.setTitle("#pi^+ #phi vs mom");
H_pip_phi_mom.setTitleX("p (GeV)");
H_pip_phi_mom.setTitleY("#phi (^o)");
H_pip_vz_phi = new H2F("H_pip_vz_phi","H_pip_vz_phi",100,-180,180,100,-20,20);
H_pip_vz_phi.setTitle("#pi^+ vz vs #phi");
H_pip_vz_phi.setTitleX("#phi (^o)");
H_pip_vz_phi.setTitleY("vz (cm)");
H_pip_vz_theta = new H2F("H_pip_vz_theta","H_pip_vz_theta",100,0,40,100,-20,20);
H_pip_vz_theta.setTitle("#pi^+ vz vs #theta");
H_pip_vz_theta.setTitleX("#theta (^o)");
H_pip_vz_theta.setTitleY("vz (cm)");
H_pip_vz_mom = new H2F("H_pip_vz_mom","H_pip_vz_mom",100,0,EB,100,-20,20);
H_pip_vz_mom.setTitle("#pi^+ vz vs mom");
H_pip_vz_mom.setTitleX("p (GeV)");
H_pip_vz_mom.setTitleY("vz (cm)");
H_pip_e_vt = new H2F("H_pip_e_vt","H_pip_e_vt",100,525,600,100,525,600);
H_pip_e_vt.setTitle("#pi^+ vs e vertex times");
H_pip_e_vt.setTitleX("e t_{v} (ns)");
H_pip_e_vt.setTitleY("#pi^+ t_{v} (ns)");
H_epip_e_theta_phi = new H2F("H_epip_e_theta_phi","H_epip_e_theta_phi",100,-180,180,100,0,40);
H_epip_e_theta_phi.setTitle("e #theta vs #phi");
H_epip_e_theta_phi.setTitleX("#phi (^o)");
H_epip_e_theta_phi.setTitleY("#theta (^o)");
H_epip_e_theta_mom = new H2F("H_epip_e_theta_mom","H_epip_e_theta_mom",100,0,EB,100,0,40);
H_epip_e_theta_mom.setTitle("e #theta vs mom");
H_epip_e_theta_mom.setTitleX("p (GeV)");
H_epip_e_theta_mom.setTitleY("#theta (^o)");
H_epip_e_phi_mom = new H2F("H_epip_e_phi_mom","H_epip_e_phi_mom",100,0,EB,100,-180,180);
H_epip_e_phi_mom.setTitle("e #phi vs mom");
H_epip_e_phi_mom.setTitleX("p (GeV)");
H_epip_e_phi_mom.setTitleY("#phi (^o)");
H_epip_xB_Q2 = new H2F("H_epip_xB_Q2","H_epip_xB_Q2",100,0,1,100,0,EB);
H_epip_xB_Q2.setTitle("Q^2 vs x_B");
H_epip_xB_Q2.setTitleX("x_B");
H_epip_xB_Q2.setTitleY("Q^2");
H_epip_e_W_Q2 = new H2F("H_epip_e_W_Q2","H_epip_e_W_Q2",100,0,5,100,0,EB);
H_epip_e_W_Q2.setTitle("Q^2 vs W");
H_epip_e_W_Q2.setTitleX("W");
H_epip_e_W_Q2.setTitleY("Q^2");
H_epip_e_t_phi = new H2F("H_epip_e_t_phi","H_epip_e_t_phi",100,-180,180,100,0,5);
H_epip_e_t_phi.setTitle("-t vs #phi");
H_epip_e_t_phi.setTitleX("#phi (^o)");
H_epip_e_t_phi.setTitleY("-t (GeV)");
H_MM_epip_zoom = new H1F("H_MM_epip_phi_zoom","H_MM_epip_phi_zoom",100,0,2);
H_MM_epip_zoom.setTitle("Missing mass e#pi^+");
H_MM_epip_zoom.setTitleX("MM_{e#pi^+} (GeV)");
H_MM_epip = new H1F("H_MM_epip","H_MM_epip",100,-1,5);
H_MM_epip.setTitle("Missing Mass e#pi^+");
H_MM_epip.setTitleX("MM_{e#pi^+} (GeV)");
H_rho_prot = new H2F("H_rho_prot","H_rho_prot",100,0,2,100,0,4);
H_rho_prot.setTitle("MM e#pi^+#pi^- vs IM #pi^+#pi^-");
H_rho_prot.setTitleX("IM #pi^+#pi^-");
H_rho_prot.setTitleY("MM e#pi^+#pi^-");
H_rho_pip_beta = new H2F("H_rho_pip_beta","H_rho_pip_beta",100,0,8,100,0.9,1.2);
H_rho_pip_beta.setTitle("#pi^+ #beta vs p");
H_rho_pip_beta.setTitleX("p (GeV)");
H_rho_pip_beta.setTitleY("#beta");
H_rho_pim_beta = new H2F("H_rho_pim_beta","H_rho_pim_beta",100,0,8,100,0.9,1.2);
H_rho_pim_beta.setTitle("#pi^- #beta vs p");
H_rho_pim_beta.setTitleX("p (GeV)");
H_rho_pim_beta.setTitleY("#beta");
H_rho_IM = new H1F("H_rho_IM","H_rho_IM",100,0,2);
H_rho_IM.setTitle("IM #pi^+#pi^-");
H_rho_IM.setTitleX("IM (GeV)");
H_rho_MM = new H1F("H_rho_IM","H_rho_IM",100,0,4);
H_rho_MM.setTitle("MM #pi^+#pi^-");
H_rho_MM.setTitleX("MM (GeV)");
H_rho_Q2_xB = new H2F("H_rho_Q2_xB", "H_rho_Q2_xB", 100, 0, 1, 100, 0, EB);
H_rho_Q2_xB.setTitle("Q^2 vs xB");
H_rho_Q2_xB.setTitleX("Q^2 (GeV^2)");
H_rho_Q2_xB.setTitleY("xB");
H_rho_Q2_W = new H2F("H_rho_Q2_W", "H_rho_Q2_W", 100, 0, 5, 100, 0, EB);
H_rho_Q2_W.setTitle("Q^2 vs W");
H_rho_Q2_W.setTitleX("W (GeV)");