45 #include "TPaveLabel.h"
46 #include "TPostScript.h"
63 "ME1/1",
"ME1/2",
"ME1/3",
"ME1/A",
"ME2/1",
"ME2/2",
"ME3/1",
"ME3/2",
"ME4/1",
"ME4/2"};
65 "ME+1/1",
"ME+1/2",
"ME+1/3",
"ME+1/A",
"ME+2/1",
"ME+2/2",
"ME+3/1",
"ME+3/2",
"ME+4/1",
"ME+4/2"};
67 "ME-1/1",
"ME-1/2",
"ME-1/3",
"ME-1/A",
"ME-2/1",
"ME-2/2",
"ME-3/1",
"ME-3/2",
"ME-4/1",
"ME-4/2"};
70 48, 64, 32, 48, 112, 64, 96, 64, 96, 64};
72 128, 160, 128, 96, 160, 160, 160, 160, 160, 160};
74 -999, -5, 4, -4, 3, -3, 2, -2, 1, -1, 0};
99 {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95},
100 {0, 95}, {0, 95}, {0, 77}, {0, 61}, {0, 39}, {0, 22}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
101 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
102 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
103 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}};
106 {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31},
107 {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 22}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
108 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
109 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
110 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}};
116 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
117 {100, 127}, {73, 127}, {47, 127}, {22, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127},
118 {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127},
119 {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127},
120 {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 105}, {0, 93}, {0, 78}, {0, 63}};
124 t_EventNumberAnalyzed = -1;
128 t_nStubs_readout = 0;
141 t->Branch(
"t_EventNumberAnalyzed", &t_EventNumberAnalyzed,
"t_EventNumberAnalyzed/I");
142 t->Branch(
"t_RUN", &t_RUN,
"t_RUN/I");
143 t->Branch(
"t_Event", &t_Event,
"t_Event/I");
144 t->Branch(
"t_nStubs", &t_nStubs,
"t_nStubs/I");
145 t->Branch(
"t_nStubs_readout", &t_nStubs_readout,
"t_nStubs_readout/I");
146 t->Branch(
"t_nStubs_ME119", &t_nStubs_ME119,
"t_nStubs_ME119/I");
147 t->Branch(
"t_nStubs_ME11no911", &t_nStubs_ME11no911,
"t_nStubs_ME11no911/I");
148 t->Branch(
"t_nStubs_noMEpm11", &t_nStubs_noMEpm11,
"t_nStubs_noMEpm11/I");
150 t->Branch(
"t_chamber", &t_chamber,
"t_chamber/I");
151 t->Branch(
"t_ring", &t_ring,
"t_ring/I");
152 t->Branch(
"t_endcap", &t_endcap,
"t_endcap/I");
153 t->Branch(
"t_station", &t_station,
"t_station/I");
154 t->Branch(
"t_chambertype", &t_chambertype,
"t_chambertype/I");
167 totStubs_emul_readout = -1;
179 quality_pretrig = -1;
180 maxquality_pretrig = -1;
184 pattern_pretrig = -1;
185 maxpattern_pretrig = -1;
199 WGcrossHS_data =
false;
200 WGcrossHS_emul =
false;
216 t->Branch(
"nRUN", &nRUN);
218 t->Branch(
"firstfill", &firstfill);
219 t->Branch(
"totStubs_data", &totStubs_data);
220 t->Branch(
"totStubs_emul", &totStubs_emul);
221 t->Branch(
"totStubs_emul_readout", &totStubs_emul_readout);
222 t->Branch(
"nStub_data", &nStub_data);
223 t->Branch(
"nStub_emul", &nStub_emul);
226 t->Branch(
"ring", &
ring);
229 t->Branch(
"chambertype", &chambertype);
230 t->Branch(
"has_data", &has_data);
231 t->Branch(
"has_emul", &has_emul);
232 t->Branch(
"quality_data", &quality_data);
233 t->Branch(
"quality_emul", &quality_emul);
234 t->Branch(
"npretrig", &npretrig);
235 t->Branch(
"quality_pretrig", &quality_pretrig);
236 t->Branch(
"maxquality_pretrig", &maxquality_pretrig);
237 t->Branch(
"pattern_data", &pattern_data);
238 t->Branch(
"pattern_emul", &pattern_emul);
239 t->Branch(
"pattern_pretrig", &pattern_pretrig);
240 t->Branch(
"maxpattern_pretrig", &maxpattern_pretrig);
241 t->Branch(
"bend_data", &bend_data);
242 t->Branch(
"bx_data", &bx_data);
243 t->Branch(
"fullbx_data", &fullbx_data);
244 t->Branch(
"bend_emul", &bend_emul);
245 t->Branch(
"bx_emul", &bx_emul);
246 t->Branch(
"fullbx_emul", &fullbx_emul);
247 t->Branch(
"bend_pretrig", &bend_pretrig);
248 t->Branch(
"bx_pretrig", &bx_pretrig);
249 t->Branch(
"bx_corr_emul", &bx_corr_emul);
250 t->Branch(
"WGcrossHS_data", &WGcrossHS_data);
251 t->Branch(
"WGcrossHS_emul", &WGcrossHS_emul);
252 t->Branch(
"key_WG_data", &key_WG_data);
253 t->Branch(
"key_WG_emul", &key_WG_emul);
254 t->Branch(
"key_hs_data", &key_hs_data);
255 t->Branch(
"key_hs_emul", &key_hs_emul);
256 t->Branch(
"key_hs_pretrig", &key_hs_pretrig);
257 t->Branch(
"trknmb_data", &trknmb_data);
258 t->Branch(
"trknmb_emul", &trknmb_emul);
259 t->Branch(
"dphi_data", &dphi_data);
260 t->Branch(
"dphi_emul", &dphi_emul);
261 t->Branch(
"eta_data", &eta_data);
262 t->Branch(
"eta_emul", &eta_emul);
263 t->Branch(
"phi_data", &phi_data);
264 t->Branch(
"phi_emul", &phi_emul);
287 gangedME1a = commonParams.getParameter<
bool>(
"gangedME1a");
315 cscGeomToken_ = esConsumes<CSCGeometry, MuonGeometryRecord>();
316 pBadToken_ = esConsumes<CSCBadChambers, CSCBadChambersRcd>();
318 consumesMany<edm::HepMCProduct>();
366 LogTrace(
"CSCTriggerPrimitivesReader") <<
"\n** CSCTriggerPrimitivesReader: processing run #" <<
ev.id().run()
408 <<
"+++ Warning: Collection of ALCTs with label MuonCSCALCTDigi"
409 <<
" requested, but not found in the event... Skipping the rest +++\n";
414 <<
"+++ Warning: Collection of CLCTs with label MuonCSCCLCTDigi"
415 <<
" requested, but not found in the event... Skipping the rest +++\n";
418 if (!lcts_tmb_data.
isValid()) {
419 edm::LogWarning(
"L1CSCTPEmulatorWrongInput") <<
"+++ Warning: Collection of correlated LCTs with label"
420 <<
" MuonCSCCorrelatedLCTDigi requested, but not found in the"
421 <<
" event... Skipping the rest +++\n";
448 <<
"+++ Warning: Collection of emulated ALCTs"
449 <<
" requested, but not found in the event... Skipping the rest +++\n";
454 <<
"+++ Warning: Collection of emulated CLCTs"
455 <<
" requested, but not found in the event... Skipping the rest +++\n";
458 if (!lcts_tmb_emul.
isValid()) {
460 <<
"+++ Warning: Collection of emulated correlated LCTs"
461 <<
" requested, but not found in the event... Skipping the rest +++\n";
541 edm::LogInfo(
"CSCTriggerPrimitivesReader") <<
"\n ALCT efficiencies:";
542 double tot_simh = 0.0, tot_alct = 0.0;
543 for (
int idh = 0; idh <
CSC_TYPES; idh++) {
550 <<
" " <<
csc_type[idh] <<
": alct = " << alct <<
", simh = " << simh <<
" eff = " << eff;
555 <<
" overall: alct = " << tot_alct <<
", simh = " << tot_simh <<
" eff = " << tot_alct / tot_simh;
559 edm::LogInfo(
"CSCTriggerPrimitivesReader") <<
"\n CLCT efficiencies:";
560 double tot_simh = 0.0, tot_clct = 0.0;
561 for (
int idh = 0; idh <
CSC_TYPES; idh++) {
568 <<
" " <<
csc_type[idh] <<
": clct = " << clct <<
", simh = " << simh <<
" eff = " << eff;
573 <<
" overall: clct = " << tot_clct <<
", simh = " << tot_simh <<
" eff = " << tot_clct / tot_simh;
578 double cor = 0.0, tot = 0.0;
582 <<
"\n Correct half-strip assigned in " << cor <<
"/" << tot <<
" = " << cor / tot <<
" of half-strip CLCTs";
591 <<
" Correct wire group assigned in " << cor <<
"/" << tot <<
" = " << cor / tot <<
" of ALCTs";
599 TH1::AddDirectory(
false);
601 gROOT->SetStyle(
"Plain");
602 gStyle->SetFillColor(0);
603 gStyle->SetOptDate();
604 gStyle->SetOptStat(111110);
605 gStyle->SetOptFit(1111);
606 gStyle->SetPadTickX(1);
607 gStyle->SetPadTickY(1);
608 gStyle->SetMarkerSize(0.5);
609 gStyle->SetMarkerStyle(8);
610 gStyle->SetGridStyle(3);
611 gStyle->SetPaperSize(TStyle::kA4);
612 gStyle->SetStatW(0.25);
613 gStyle->SetStatH(0.10);
614 gStyle->SetStatFormat(
"6.4g");
615 gStyle->SetTitleSize(0.055,
"");
618 gStyle->SetLabelSize(0.05,
"XYZ");
619 gStyle->SetStatFontSize(0.06);
620 gStyle->SetTitleFont(32,
"XYZ");
621 gStyle->SetTitleFont(32,
"");
622 gStyle->SetLabelFont(32,
"XYZ");
623 gStyle->SetStatFont(32);
624 gStyle->SetLabelOffset(0.006,
"Y");
632 hHotWire1 = fs->
make<TH1F>(
"hHotWire1",
"hHotWire1", 570 * 6 * 112, 0, 570 * 6 * 112);
633 hHotCham1 = fs->
make<TH1F>(
"hHotCham1",
"hHotCham1", 570, 0, 570);
641 hAlctPerEvent = fs->
make<TH1F>(
"ALCTs_per_event",
"ALCTs per event", 31, -0.5, 30.5);
643 hAlctPerCSC = fs->
make<TH1F>(
"ALCTs_per_CSCtype",
"ALCTs per CSC type", 10, -0.5, 9.5);
657 hAlctValid = fs->
make<TH1F>(
"ALCT_validity",
"ALCT validity", 3, -0.5, 2.5);
658 hAlctQuality = fs->
make<TH1F>(
"ALCT_quality",
"ALCT quality", 5, -0.5, 4.5);
659 hAlctAccel = fs->
make<TH1F>(
"ALCT_accel_flag",
"ALCT accel. flag", 3, -0.5, 2.5);
660 hAlctCollis = fs->
make<TH1F>(
"ALCT_collision_flag",
"ALCT collision. flag", 3, -0.5, 2.5);
661 hAlctKeyGroup = fs->
make<TH1F>(
"ALCT_key_wiregroup",
"ALCT key wiregroup", 120, -0.5, 119.5);
662 hAlctBXN = fs->
make<TH1F>(
"ALCT_bx",
"ALCT bx", 20, -0.5, 19.5);
667 std::cout <<
" bookedALCTHistos " << std::endl;
674 hClctPerEvent = fs->
make<TH1F>(
"CLCTs_per_event",
"CLCTs per event", 31, -0.5, 30.5);
676 hClctPerCSC = fs->
make<TH1F>(
"CLCTs_per_CSCtype",
"CLCTs per CSC type", 10, -0.5, 9.5);
690 hClctValid = fs->
make<TH1F>(
"CLCT_validity",
"CLCT validity", 3, -0.5, 2.5);
691 hClctQuality = fs->
make<TH1F>(
"CLCT_layers_hit",
"CLCT layers hit", 9, -0.5, 8.5);
693 hClctSign = fs->
make<TH1F>(
"CLCT_sing_(L/R)",
"CLCT sign (L/R)", 3, -0.5, 2.5);
694 hClctCFEB = fs->
make<TH1F>(
"CLCT_cfeb_#",
"CLCT cfeb #", 6, -0.5, 5.5);
695 hClctBXN = fs->
make<TH1F>(
"CLCT_bx",
"CLCT bx", 20, -0.5, 19.5);
697 hClctKeyStrip[0] = fs->
make<TH1F>(
"CLCT_keystrip_distrips",
"CLCT keystrip, distrips", 40, -0.5, 39.5);
699 hClctKeyStrip[1] = fs->
make<TH1F>(
"CLCT_keystrip_halfstrips",
"CLCT keystrip, halfstrips", 160, -0.5, 159.5);
700 hClctPattern[0] = fs->
make<TH1F>(
"CLCT_pattern_distrips",
"CLCT pattern, distrips", 13, -0.5, 12.5);
701 hClctPattern[1] = fs->
make<TH1F>(
"CLCT_pattern_halfstrips",
"CLCT pattern, halfstrips", 13, -0.5, 12.5);
706 sprintf(asdf,
"CLCT_bend0_%i",
i + 1);
708 sprintf(asdf,
"CLCT_bend1_%i",
i + 1);
711 sprintf(asdf,
"CLCT_keystrip_%i",
i + 1);
717 hClctKeyStripME11 = fs->
make<TH1F>(
"hClctKeyStripME11",
"CLCT keystrip, halfstrips ME1/1", 161, -0.5, 160.5);
720 std::cout <<
" bookedCLCTHistos " << std::endl;
729 hLctTMBPerCSC = fs->
make<TH1F>(
"LCTs_per_CSCtype",
"LCTs per CSC type", 10, -0.5, 9.5);
730 hCorrLctTMBPerCSC = fs->
make<TH1F>(
"CorrLCTs_per_CSCtype",
"Corr. LCTs per CSC type", 10, -0.5, 9.5);
748 hLctTMBValid = fs->
make<TH1F>(
"LCT_validity",
"LCT validity", 3, -0.5, 2.5);
750 hLctTMBKeyGroup = fs->
make<TH1F>(
"LCT_key_wiregroup",
"LCT key wiregroup", 120, -0.5, 119.5);
754 hLctTMBBend = fs->
make<TH1F>(
"LCT_bend",
"LCT L/R bend", 3, -0.5, 2.5);
760 sprintf(histname,
"LCT_CSCId, station %d", istat + 1);
768 std::cout <<
" bookedLCTTMBHistos " << std::endl;
776 ix = (
id.station() - 2) * 2 + 3;
788 ix = (
id.station() - 2) * 2 + 3 + 1;
798 int st =
id.station();
800 int ch =
id.chamber();
801 int ec =
id.endcap();
803 if (st == 1 && ri == 1)
805 if (st == 1 && ri == 2)
807 if (st == 1 && ri == 3)
809 if (st == 1 && ri == 4)
811 if (st == 2 && ri == 1)
813 if (st == 2 && ri == 2)
815 if (st == 3 && ri == 1)
817 if (st == 3 && ri == 2)
819 if (st == 4 && ri == 1)
821 if (st == 4 && ri == 2)
824 kSerial = kSerial + 300;
831 hLctMPCPerCSC = fs->
make<TH1F>(
"MPC_per_CSCtype",
"LCTs per CSC type", 10, -0.5, 9.5);
838 hLctMPCValid = fs->
make<TH1F>(
"MPC_validity",
"LCT validity", 3, -0.5, 2.5);
840 hLctMPCKeyGroup = fs->
make<TH1F>(
"MPC_key_wiregroup",
"LCT key wiregroup", 120, -0.5, 119.5);
844 hLctMPCBend = fs->
make<TH1F>(
"MPC_bend",
"LCT L/R bend", 3, -0.5, 2.5);
850 sprintf(histname,
"MPC_CSCId, station %d", istat + 1);
859 LogTrace(
"CSCTriggerPrimitivesReader") <<
"bookedLCTMPCHistos ";
860 std::cout <<
" bookedLCTMPCHistos " << std::endl;
870 hAlctCompFound2 = fs->
make<TH2F>(
"h_ALCT_found2",
"h_ALCT_found2", 19, -9.5, 9.5, 36, 0.5, 36.5);
871 hAlctCompFound2x = fs->
make<TH2F>(
"h_ALCT_found2x",
"h_ALCT_found2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
874 hAlctCompSameN2 = fs->
make<TH2F>(
"h_ALCT_SameN2",
"h_ALCT_SameN2", 19, -9.5, 9.5, 36, 0.5, 36.5);
875 hAlctCompSameN2x = fs->
make<TH2F>(
"h_ALCT_SameN2x",
"h_ALCT_SameN2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
878 hAlctCompMatch2 = fs->
make<TH2F>(
"h_ALCT_match2",
"h_ALCT_match2", 19, -9.5, 9.5, 36, 0.5, 36.5);
879 hAlctCompMatch2x = fs->
make<TH2F>(
"h_ALCT_match2x",
"h_ALCT_match2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
882 hAlctCompTotal2 = fs->
make<TH2F>(
"h_ALCT_total2",
"h_ALCT_total2", 19, -9.5, 9.5, 36, 0.5, 36.5);
883 hAlctCompTotal2x = fs->
make<TH2F>(
"h_ALCT_total2x",
"h_ALCT_total2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
886 hClctCompFound2 = fs->
make<TH2F>(
"h_CLCT_found2",
"h_CLCT_found2", 19, -9.5, 9.5, 36, 0.5, 36.5);
887 hClctCompFound2x = fs->
make<TH2F>(
"h_CLCT_found2x",
"h_CLCT_found2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
890 hClctCompSameN2 = fs->
make<TH2F>(
"h_CLCT_SameN2",
"h_CLCT_SameN2", 19, -9.5, 9.5, 36, 0.5, 36.5);
891 hClctCompSameN2x = fs->
make<TH2F>(
"h_CLCT_SameN2x",
"h_CLCT_SameN2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
894 hClctCompMatch2 = fs->
make<TH2F>(
"h_CLCT_match2",
"h_CLCT_match2", 19, -9.5, 9.5, 36, 0.5, 36.5);
895 hClctCompMatch2x = fs->
make<TH2F>(
"h_CLCT_match2x",
"h_CLCT_match2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
898 hClctCompTotal2 = fs->
make<TH2F>(
"h_CLCT_total2",
"h_CLCT_total2", 19, -9.5, 9.5, 36, 0.5, 36.5);
899 hClctCompTotal2x = fs->
make<TH2F>(
"h_CLCT_total2x",
"h_CLCT_total2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
902 hLCTCompFound2 = fs->
make<TH2F>(
"h_LCT_found2",
"h_LCT_found2", 19, -9.5, 9.5, 36, 0.5, 36.5);
903 hLCTCompFound2x = fs->
make<TH2F>(
"h_LCT_found2x",
"h_LCT_found2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
906 hLCTCompSameN2 = fs->
make<TH2F>(
"h_LCT_SameN2",
"h_LCT_SameN2", 19, -9.5, 9.5, 36, 0.5, 36.5);
907 hLCTCompSameN2x = fs->
make<TH2F>(
"h_LCT_SameN2x",
"h_LCT_SameN2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
910 hLCTCompMatch2 = fs->
make<TH2F>(
"h_LCT_match2",
"h_LCT_match2", 19, -9.5, 9.5, 36, 0.5, 36.5);
911 hLCTCompMatch2x = fs->
make<TH2F>(
"h_LCT_match2x",
"h_LCT_match2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
914 hLCTCompTotal2 = fs->
make<TH2F>(
"h_LCT_total2",
"h_LCT_total2", 19, -9.5, 9.5, 36, 0.5, 36.5);
915 hLCTCompTotal2x = fs->
make<TH2F>(
"h_LCT_total2x",
"h_LCT_total2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
918 hAlctCompFound2i = fs->
make<TH2F>(
"h_ALCT_found2i",
"h_ALCT_found2i", 18, 0, 18, 36, 0.5, 36.5);
919 hAlctCompSameN2i = fs->
make<TH2F>(
"h_ALCT_SameN2i",
"h_ALCT_SameN2i", 18, 0, 18, 36, 0.5, 36.5);
920 hAlctCompMatch2i = fs->
make<TH2F>(
"h_ALCT_match2i",
"h_ALCT_match2i", 18, 0, 18, 36, 0.5, 36.5);
921 hAlctCompTotal2i = fs->
make<TH2F>(
"h_ALCT_total2i",
"h_ALCT_total2i", 18, 0, 18, 36, 0.5, 36.5);
922 hClctCompFound2i = fs->
make<TH2F>(
"h_CLCT_found2i",
"h_CLCT_found2i", 18, 0, 18, 36, 0.5, 36.5);
923 hClctCompSameN2i = fs->
make<TH2F>(
"h_CLCT_SameN2i",
"h_CLCT_SameN2i", 18, 0, 18, 36, 0.5, 36.5);
924 hClctCompMatch2i = fs->
make<TH2F>(
"h_CLCT_match2i",
"h_CLCT_match2i", 18, 0, 18, 36, 0.5, 36.5);
925 hClctCompTotal2i = fs->
make<TH2F>(
"h_CLCT_total2i",
"h_CLCT_total2i", 18, 0, 18, 36, 0.5, 36.5);
926 hLCTCompFound2i = fs->
make<TH2F>(
"h_LCT_found2i",
"h_LCT_found2i", 18, 0, 18, 36, 0.5, 36.5);
927 hLCTCompSameN2i = fs->
make<TH2F>(
"h_LCT_SameN2i",
"h_LCT_SameN2i", 18, 0, 18, 36, 0.5, 36.5);
928 hLCTCompMatch2i = fs->
make<TH2F>(
"h_LCT_match2i",
"h_LCT_match2i", 18, 0, 18, 36, 0.5, 36.5);
929 hLCTCompTotal2i = fs->
make<TH2F>(
"h_LCT_total2i",
"h_LCT_total2i", 18, 0, 18, 36, 0.5, 36.5);
943 sprintf(asdf,
"Comp_ALCTsFound_%i",
i *
CSC_TYPES +
j);
945 sprintf(asdf,
"Comp_ALCTsSame_%i",
i *
CSC_TYPES +
j);
947 sprintf(asdf,
"Comp_ALCTsTotal_%i",
i *
CSC_TYPES +
j);
949 sprintf(asdf,
"Comp_ALCTsMatch_%i",
i *
CSC_TYPES +
j);
967 sprintf(asdf,
"Comp_CLCTsFound_%i",
i *
CSC_TYPES +
j);
969 sprintf(asdf,
"Comp_CLCTsSame_%i",
i *
CSC_TYPES +
j);
971 sprintf(asdf,
"Comp_CLCTsTotal_%i",
i *
CSC_TYPES +
j);
973 sprintf(asdf,
"Comp_CLCTsMatch_%i",
i *
CSC_TYPES +
j);
991 sprintf(asdf,
"LCTs_CompFound_%i",
i *
CSC_TYPES +
j);
993 sprintf(asdf,
"LCTs_CompSame_%i",
i *
CSC_TYPES +
j);
995 sprintf(asdf,
"LCTs_CompTotal_%i",
i *
CSC_TYPES +
j);
997 sprintf(asdf,
"LCTs_CompMatch_%i",
i *
CSC_TYPES +
j);
1008 LogTrace(
"CSCTriggerPrimitivesReader") <<
"bookedCompHistos ";
1009 std::cout <<
"bookCompHistos " << std::endl;
1016 const double EDMIN = -0.05;
1017 const double EDMAX = 0.05;
1018 const double PDMIN = -5.0;
1019 const double PDMAX = 5.0;
1031 hEtaRecVsSim = fs->
make<TH2F>(
"",
"#eta_rec vs #eta_sim", 64, 0.9, 2.5, 64, 0.9, 2.5);
1037 sprintf(histname,
"ALCTs vs eta, station %d",
i + 1);
1040 sprintf(histname,
"CLCTs vs phi, station %d",
i + 1);
1043 sprintf(histname,
"#LT#eta_rec-#eta_sim#GT, station %d",
i + 1);
1046 sprintf(histname,
"#LT#phi_rec-#phi_sim#GT, station %d",
i + 1);
1053 string t1 =
t0 +
", endcap1";
1055 string t2 =
t0 +
", endcap2";
1058 string t4 =
"#eta_rec-#eta_sim vs wiregroup, " +
csc_type[
i];
1061 string u0 =
"#phi_rec-#phi_sim, " +
csc_type[
i];
1063 string u1 = u0 +
", endcap1";
1065 string u2 = u0 +
", endcap2";
1071 string u5 =
"#phi_rec-#phi_sim (mrad) vs distrip, " +
csc_type[
i];
1073 string u6 =
"#phi_rec-#phi_sim (mrad) vs halfstrip, " +
csc_type[
i];
1076 string u7 =
"#phi(layer 1)-#phi(layer 6), mrad, " +
csc_type[
i];
1080 int max_patterns, phibend;
1082 for (
int i = 0;
i < max_patterns;
i++) {
1084 sprintf(histname,
"#phi_rec-#phi_sim, bend = %d", phibend);
1090 LogTrace(
"CSCTriggerPrimitivesReader") <<
"bookedResolHistos ";
1099 sprintf(histname,
"SimHits vs eta, station %d",
i + 1);
1102 sprintf(histname,
"ALCTs vs eta, station %d",
i + 1);
1105 sprintf(histname,
"CLCTs vs eta, station %d",
i + 1);
1121 LogTrace(
"CSCTriggerPrimitivesReader") <<
"bookedEfficHistos ";
1122 std::cout <<
" bookedEfficHistos " << std::endl;
1130 int nValidALCTs = 0;
1131 for (
auto detUnitIt = alcts->begin(); detUnitIt != alcts->end(); detUnitIt++) {
1132 int nValidALCTsPerCSC = 0;
1133 const CSCDetId&
id = (*detUnitIt).first;
1136 const auto&
range = (*detUnitIt).second;
1137 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
1138 bool alct_valid = (*digiIt).isValid();
1142 hAlctAccel->Fill((*digiIt).getAccelerator());
1155 nValidALCTsPerCSC++;
1158 LogTrace(
"CSCTriggerPrimitivesReader")
1159 << (*digiIt) <<
" found in ME" << ((
id.endcap() == 1) ?
"+" :
"-") <<
id.station() <<
"/" <<
id.ring()
1160 <<
"/" <<
id.chamber() <<
" (sector " <<
id.triggerSector() <<
" trig id. " <<
id.triggerCscId() <<
")";
1168 LogTrace(
"CSCTriggerPrimitivesReader") << nValidALCTs <<
" valid ALCTs found in this event";
1177 int nValidCLCTs = 0;
1178 for (
auto detUnitIt = clcts->begin(); detUnitIt != clcts->end(); detUnitIt++) {
1179 int nValidCLCTsPerCSC = 0;
1180 const CSCDetId&
id = (*detUnitIt).first;
1183 const auto&
range = (*detUnitIt).second;
1184 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
1185 bool clct_valid = (*digiIt).isValid();
1188 int striptype = (*digiIt).getStripType();
1189 int keystrip = (*digiIt).getKeyStrip();
1204 if (striptype == 1 && csctype == 0)
1208 int pattern = (*digiIt).getPattern();
1216 nValidCLCTsPerCSC++;
1219 LogTrace(
"CSCTriggerPrimitivesReader")
1220 << (*digiIt) <<
" found in ME" << ((
id.endcap() == 1) ?
"+" :
"-") <<
id.station() <<
"/" <<
id.ring()
1221 <<
"/" <<
id.chamber() <<
" (sector " <<
id.triggerSector() <<
" trig id. " <<
id.triggerCscId() <<
")";
1228 LogTrace(
"CSCTriggerPrimitivesReader") << nValidCLCTs <<
" valid CLCTs found in this event";
1238 bool alct_valid, clct_valid;
1240 for (
auto detUnitIt = lcts->begin(); detUnitIt != lcts->end(); detUnitIt++) {
1241 int nValidLCTsPerCSC = 0;
1242 const CSCDetId&
id = (*detUnitIt).first;
1245 const auto&
range = (*detUnitIt).second;
1246 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
1247 bool lct_valid = (*digiIt).isValid();
1256 int quality = (*digiIt).getQuality();
1277 if (alct_valid && clct_valid)
1280 if (alct_valid && csctype == 0) {
1283 if (clct_valid && csctype == 0) {
1291 LogTrace(
"CSCTriggerPrimitivesReader")
1292 << (*digiIt) <<
" found in ME" << ((
id.endcap() == 1) ?
"+" :
"-") <<
id.station() <<
"/" <<
id.ring()
1293 <<
"/" <<
id.chamber() <<
" (sector " <<
id.triggerSector() <<
" trig id. " <<
id.triggerCscId() <<
")";
1300 LogTrace(
"CSCTriggerPrimitivesReader") << nValidLCTs <<
" valid LCTs found in this event";
1310 bool alct_valid, clct_valid;
1312 for (
auto detUnitIt = lcts->begin(); detUnitIt != lcts->end(); detUnitIt++) {
1313 const CSCDetId&
id = (*detUnitIt).first;
1316 const auto&
range = (*detUnitIt).second;
1317 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
1318 bool lct_valid = (*digiIt).isValid();
1327 int quality = (*digiIt).getQuality();
1347 if (alct_valid && clct_valid)
1350 if (alct_valid && csctype == 0) {
1353 if (clct_valid && csctype == 0) {
1360 LogTrace(
"CSCTriggerPrimitivesReader")
1361 <<
"MPC " << (*digiIt) <<
" found in ME" << ((
id.endcap() == 1) ?
"+" :
"-") <<
id.station() <<
"/"
1362 <<
id.ring() <<
"/" <<
id.chamber() <<
" (sector " <<
id.triggerSector() <<
" trig id. "
1363 <<
id.triggerCscId() <<
")";
1369 LogTrace(
"CSCTriggerPrimitivesReader") << nValidLCTs <<
" MPC LCTs found in this event";
1387 compareLCTs(lcts_data, lcts_emul, alcts_data, clcts_data);
1396 int fifo_pretrig = 10;
1397 int fpga_latency = 6;
1398 int l1a_window_width = 7;
1400 int rawhit_tbin_offset = (fifo_pretrig - fpga_latency) + (l1a_window_width - 1) / 2;
1403 int register_delay = 2;
1405 std::vector<CSCALCTDigi>::const_iterator pd, pe;
1406 for (
int endc = 1; endc <= 2; endc++) {
1416 std::vector<CSCALCTDigi> alctV_data, alctV_emul;
1417 const auto& drange = alcts_data->get(detid);
1418 for (
auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
1419 if ((*digiIt).isValid()) {
1420 alctV_data.push_back(*digiIt);
1424 const auto& erange = alcts_emul->get(detid);
1425 std::vector<bool> bookedalctV_emul;
1426 for (
auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
1427 if ((*digiIt).isValid()) {
1428 alctV_emul.push_back(*digiIt);
1429 bookedalctV_emul.push_back(
false);
1433 int ndata = alctV_data.size();
1434 int nemul = alctV_emul.size();
1436 if (ndata == 0 && nemul == 0)
1438 bool firstfill =
true;
1441 ostringstream strstrm;
1442 strstrm <<
"\n--- ME" << ((detid.
endcap() == 1) ?
"+" :
"-") << detid.
station() <<
"/" << detid.
ring()
1445 strstrm <<
" **** " << ndata <<
" valid data ALCTs found:\n";
1446 for (pd = alctV_data.begin(); pd != alctV_data.end(); pd++) {
1447 strstrm <<
" " << (*pd) <<
" Full BX = " << (*pd).getFullBX() <<
"\n";
1449 strstrm <<
" **** " << nemul <<
" valid emul ALCTs found:\n";
1450 for (pe = alctV_emul.begin(); pe != alctV_emul.end(); pe++) {
1451 strstrm <<
" " << (*pe);
1452 for (pd = alctV_data.begin(); pd != alctV_data.end(); pd++) {
1453 if ((*pd).getTrknmb() == (*pe).getTrknmb()) {
1454 int emul_bx = (*pe).getBX();
1455 emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay;
1456 strstrm <<
" Corr BX = " << emul_corr_bx;
1462 LogTrace(
"CSCTriggerPrimitivesReader") << strstrm.str();
1468 int perEv_nStub_data = 0;
1469 int perEv_nStub_emul = 0;
1472 for (pd = alctV_data.begin(); pd != alctV_data.end(); pd++) {
1484 for (pe = alctV_emul.begin(); pe != alctV_emul.end(); pe++) {
1511 if (ndata != nemul) {
1512 LogTrace(
"CSCTriggerPrimitivesReader")
1513 <<
" +++ Different numbers of ALCTs found in ME" << ((endc == 1) ?
"+" :
"-") <<
stat <<
"/" <<
ring
1514 <<
"/" <<
cham <<
": data = " << ndata <<
" emulator = " << nemul <<
" +++\n";
1525 for (
int i = 0;
i < ndata;
i++) {
1526 if (alctV_data[
i].isValid() == 0)
1528 int data_trknmb = alctV_data[
i].getTrknmb();
1532 int data_wiregroup = alctV_data[
i].getKeyWG();
1533 int data_bx = alctV_data[
i].getBX();
1557 for (
int j = 0;
j < nemul;
j++) {
1558 if (alctV_emul[
j].isValid() == 0)
1560 if (bookedalctV_emul[
j])
1563 int emul_trknmb = alctV_emul[
j].getTrknmb();
1567 int emul_wiregroup = alctV_emul[
j].getKeyWG();
1568 int emul_bx = alctV_emul[
j].getBX();
1570 emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay;
1572 emul_corr_bx = emul_bx;
1574 if (ndata == nemul) {
1584 if (data_trknmb == emul_trknmb) {
1585 if (
abs(data_wiregroup - emul_wiregroup) <= 2) {
1596 LogTrace(
"CSCTriggerPrimitivesReader") <<
" Identical ALCTs #" << data_trknmb;
1606 bookedalctV_emul[
j] =
true;
1609 LogTrace(
"CSCTriggerPrimitivesReader")
1610 <<
" Different ALCTs #" << data_trknmb <<
" in ME" << ((endc == 1) ?
"+" :
"-") <<
stat <<
"/"
1616 LogTrace(
"CSCTriggerPrimitivesReader")
1617 <<
" not matched ALCT from data " << alctV_data[
i] <<
" stubs_comparison 0 key_WG_data "
1623 for (
int i = 0;
i < nemul;
i++) {
1624 if (alctV_emul[
i].isValid() == 0
or bookedalctV_emul[
i])
1626 int emul_bx = alctV_emul[
i].getBX();
1652 emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay;
1654 emul_corr_bx = emul_bx;
1658 LogTrace(
"CSCTriggerPrimitivesReader") <<
"not matched ALCT from emulation " << alctV_emul[
i];
1671 const int tbin_cathode_offset = 7;
1673 const int pretrig_trig_zone = 5;
1676 std::vector<CSCCLCTDigi>::const_iterator pd, pe;
1677 std::vector<CSCCLCTPreTriggerDigi>::const_iterator pretrig;
1680 for (
int endc = 1; endc <= 2; endc++) {
1691 std::vector<CSCCLCTDigi> clctV_data, clctV_emul;
1692 const auto& drange = clcts_data->get(detid);
1693 for (
auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
1694 if ((*digiIt).isValid()) {
1695 clctV_data.push_back(*digiIt);
1699 const auto& erange = clcts_emul->get(detid);
1700 std::vector<bool> bookedclctV_emul;
1701 for (
auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
1702 if ((*digiIt).isValid()) {
1703 for (
const auto& pclct : clctV_emul) {
1704 if (digiIt->getBX() != pclct.getBX() and
abs(digiIt->getBX() - pclct.getBX()) < 5)
1705 LogTrace(
"CSCTriggerPrimitivesReader")
1706 <<
"Two CLCTs very close in timing!!! Special event: first clct " << pclct <<
" second clct "
1707 << *digiIt << std::endl;
1709 clctV_emul.push_back(*digiIt);
1710 bookedclctV_emul.push_back(
false);
1714 std::vector<CSCCLCTPreTriggerDigi> pretrigV_emul;
1715 const auto& pretrigrange = pretrigs_emul->
get(detid);
1716 for (
auto pretrigIt = pretrigrange.first; pretrigIt != pretrigrange.second; pretrigIt++) {
1717 if ((*pretrigIt).isValid()) {
1718 pretrigV_emul.push_back(*pretrigIt);
1722 int ndata = clctV_data.size();
1723 int nemul = clctV_emul.size();
1724 if (ndata == 0 && nemul == 0)
1726 bool firstfill =
true;
1727 int nemul_readout = 0;
1728 for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1729 for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1730 int emul_bx = (*pe).getBX();
1731 int corr_bx = ((*pd).getFullBX() + emul_bx - tbin_cathode_offset) & 0x03;
1732 int bx_data = pd->getBX();
1734 if (corr_bx == bx_data) {
1741 if (
debug or nemul > ndata
or (ndata != nemul)
or ndata != nemul_readout) {
1742 LogTrace(
"CSCTriggerPrimitivesReader")
1743 <<
" CLCTs from data " << ndata <<
" CLCTs from emul " << nemul <<
" readout " << nemul_readout;
1744 ostringstream strstrm;
1745 strstrm <<
"\n--- ME" << ((detid.
endcap() == 1) ?
"+" :
"-") << detid.
station() <<
"/" << detid.
ring()
1748 strstrm <<
" **** " << ndata <<
" valid data CLCTs found:\n";
1749 for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1750 strstrm <<
" " << (*pd) <<
" Full BX = " << (*pd).getFullBX() <<
"\n";
1752 strstrm <<
" **** " << nemul <<
" valid emul CLCTs found:\n";
1753 for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1754 strstrm <<
" " << (*pe);
1755 for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1756 if ((*pd).getTrknmb() == (*pe).getTrknmb()
or abs((*pe).getKeyStrip() - (*pd).getKeyStrip()) < 5) {
1757 int emul_bx = (*pe).getBX();
1758 int corr_bx = ((*pd).getFullBX() + emul_bx - tbin_cathode_offset) & 0x03;
1759 strstrm <<
" Corr BX = " << corr_bx;
1765 LogTrace(
"CSCTriggerPrimitivesReader") << strstrm.str();
1767 if (nemul_readout > 2) {
1774 int perEv_nStub_data = 0;
1775 int perEv_nStub_emul = 0;
1778 for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1790 for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1812 if (ndata != nemul) {
1813 LogTrace(
"CSCTriggerPrimitivesReader")
1815 <<
" +++ Different numbers of CLCTs found in ME" << ((endc == 1) ?
"+" :
"-") <<
stat <<
"/" <<
ring
1816 <<
"/" <<
cham <<
": data = " << ndata <<
" emulator = " << nemul <<
" +++\n";
1828 for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1830 if ((*pd).isValid() == 0)
1832 int data_trknmb = (*pd).getTrknmb();
1833 int data_quality = (*pd).getQuality();
1834 int data_pattern = (*pd).getPattern();
1835 int data_striptype = (*pd).getStripType();
1836 int data_bend = (*pd).getBend();
1837 int data_keystrip = (*pd).getKeyStrip();
1838 int data_cfeb = (*pd).getCFEB();
1839 int data_bx = (*pd).getBX();
1840 int fullBX = (*pd).getFullBX();
1842 if (data_keystrip >= 128 and
stat == 1 and
ring == 1)
1873 for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1875 if ((*pe).isValid() == 0)
1877 if (bookedclctV_emul[
j])
1879 int emul_trknmb = (*pe).getTrknmb();
1880 int emul_quality = (*pe).getQuality();
1881 int emul_pattern = (*pe).getPattern();
1882 int emul_striptype = (*pe).getStripType();
1883 int emul_bend = (*pe).getBend();
1884 int emul_keystrip = (*pe).getKeyStrip();
1885 int emul_cfeb = (*pe).getCFEB();
1886 int emul_bx = (*pe).getBX();
1888 if (
abs(data_keystrip - emul_keystrip) <= 2) {
1891 int emul_corr_bx = (fullBX + emul_bx - tbin_cathode_offset) & 0x03;
1894 emul_corr_bx = (emul_bx & 0x03);
1895 if (ndata == nemul) {
1904 if (data_quality == emul_quality && data_pattern == emul_pattern && data_striptype == emul_striptype &&
1905 data_bend == emul_bend && data_keystrip == emul_keystrip && data_cfeb == emul_cfeb) {
1906 if (ndata == nemul) {
1916 LogTrace(
"CSCTriggerPrimitivesReader") <<
" Identical CLCTs #" << data_trknmb;
1918 LogTrace(
"CSCTriggerPrimitivesReader")
1919 <<
" Different CLCTs #" << data_trknmb <<
" in ME" << ((endc == 1) ?
"+" :
"-") <<
stat
1920 <<
"/" <<
ring <<
"/" <<
cham <<
" data_bx " << data_bx <<
" emul_corr_bx " << emul_corr_bx;
1933 bookedclctV_emul[
j] =
true;
1936 int num_pretrig = 0;
1937 for (pretrig = pretrigV_emul.begin(); pretrig != pretrigV_emul.end(); pretrig++) {
1938 if ((*pretrig).getBX() != (*pe).getBX())
1940 int hsgap =
std::abs((*pretrig).getKeyStrip() - (*pe).getKeyStrip());
1941 bool samechamber =
true;
1943 samechamber = (((*pretrig).getKeyStrip() < 128 and (*pe).getKeyStrip() < 128) ||
1944 ((*pretrig).getKeyStrip() >= 128 and (*pe).getKeyStrip() >= 128));
1945 if (not samechamber)
1948 if (hsgap <= pretrig_trig_zone)
1967 LogTrace(
"CSCTriggerPrimitivesReader")
1968 <<
"CSCDetid " << detid <<
" not matched CLCT from data " << (*pd)
1974 for (
int k = 0;
k < nemul;
k++) {
1975 if (clctV_emul[
i].isValid() == 0)
1977 if (bookedclctV_emul[
k])
2003 if (clctV_emul[
k].getKeyStrip() >= 128 and
stat == 1 and
ring == 1)
2010 bookedclctV_emul[
k] =
true;
2026 std::vector<CSCCorrelatedLCTDigi>::const_iterator pd, pe;
2027 for (
int endc = 1; endc <= 2; endc++) {
2038 std::vector<CSCCorrelatedLCTDigi> lctV_data, lctV_emul;
2039 std::vector<bool> bookedlctV_emul;
2040 const auto& drange = lcts_data->get(detid);
2041 for (
auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
2042 if ((*digiIt).isValid()) {
2043 lctV_data.push_back(*digiIt);
2047 const auto& erange = lcts_emul->get(detid);
2048 for (
auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
2049 if ((*digiIt).isValid()) {
2050 lctV_emul.push_back(*digiIt);
2051 bookedlctV_emul.push_back(
false);
2055 int ndata = lctV_data.size();
2056 int nemul = lctV_emul.size();
2057 if (ndata == 0 && nemul == 0)
2059 bool firstfill =
true;
2060 int nemul_readout = 0;
2061 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2062 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2063 int bx_data = pd->getBX();
2064 int bx_corr =
convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data);
2065 if ((bx_data == bx_corr)
or (
abs(pe->getKeyWG() - pd->getKeyWG()) <= 2)) {
2072 if (
debug or nemul > ndata
or (nemul_readout != ndata)
or nemul != ndata) {
2073 LogTrace(
"CSCTriggerPrimitivesReader")
2074 <<
" LCTs from data " << ndata <<
" LCTs from emul " << nemul <<
" readout " << nemul_readout;
2075 ostringstream strstrm;
2076 strstrm <<
"\n--- ME" << ((detid.
endcap() == 1) ?
"+" :
"-") << detid.
station() <<
"/" << detid.
ring()
2079 strstrm <<
" **** " << ndata <<
" valid data LCTs found:\n";
2080 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2081 strstrm <<
" " << (*pd);
2083 strstrm <<
"\n **** " << nemul <<
" valid emul LCTs found:\n";
2084 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2085 strstrm <<
" " << (*pe);
2086 strstrm <<
" corr BX = " <<
convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data);
2087 strstrm <<
" LCT pattern = " << (*pe).getPattern();
2090 LogTrace(
"CSCTriggerPrimitivesReader") << strstrm.str();
2093 if (nemul_readout > 2) {
2100 int perEv_nStub_data = 0;
2101 int perEv_nStub_emul = 0;
2104 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2116 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2138 if (ndata != nemul) {
2139 LogTrace(
"CSCTriggerPrimitivesReader")
2141 <<
" +++ Different numbers of LCTs found in ME" << ((endc == 1) ?
"+" :
"-") <<
stat <<
"/" <<
ring
2142 <<
"/" <<
cham <<
": data = " << ndata <<
" emulator = " << nemul <<
" +++\n";
2153 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2155 if ((*pd).isValid() == 0)
2157 int data_trknmb = (*pd).getTrknmb();
2158 int data_quality = (*pd).getQuality();
2159 int data_wiregroup = (*pd).getKeyWG();
2160 int data_keystrip = (*pd).getStrip();
2161 int data_pattern = (*pd).getCLCTPattern();
2162 int data_striptype = (*pd).getStripType();
2163 int data_bend = (*pd).getBend();
2164 int data_bx = (*pd).getBX();
2194 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2196 if ((*pe).isValid() == 0)
2198 if (bookedlctV_emul[
j])
2200 int emul_trknmb = (*pe).getTrknmb();
2201 int emul_quality = (*pe).getQuality();
2202 int emul_wiregroup = (*pe).getKeyWG();
2203 int emul_keystrip = (*pe).getStrip();
2204 int emul_pattern = (*pe).getCLCTPattern();
2205 int emul_striptype = (*pe).getStripType();
2206 int emul_bend = (*pe).getBend();
2207 int emul_bx = (*pe).getBX();
2208 if (
abs(data_keystrip - emul_keystrip) <= 2 ||
abs(data_wiregroup - emul_wiregroup) <= 2) {
2211 int emul_corr_bx =
convertBXofLCT(emul_bx, detid, alcts_data, clcts_data);
2214 emul_corr_bx = (emul_bx & 0x01);
2216 if (ndata == nemul) {
2225 if (data_quality == emul_quality && data_wiregroup == emul_wiregroup &&
2226 data_keystrip == emul_keystrip && data_pattern == emul_pattern &&
2227 data_striptype == emul_striptype && data_bend == emul_bend) {
2228 if (ndata == nemul) {
2238 LogTrace(
"CSCTriggerPrimitivesReader") <<
" Identical LCTs #" << data_trknmb;
2240 LogTrace(
"CSCTriggerPrimitivesReader")
2241 <<
" Different LCTs #" << data_trknmb <<
" in ME" << ((endc == 1) ?
"+" :
"-") <<
stat
2242 <<
"/" <<
ring <<
"/" <<
cham <<
" data_lct bx " << data_bx <<
" emul bx " << emul_corr_bx;
2259 bookedlctV_emul[
j] =
true;
2264 LogTrace(
"CSCTriggerPrimitivesReader")
2265 <<
"CSCDetid " << detid <<
" not matched LCT from Data " << (*pd)
2270 for (
int k = 0;
k < nemul;
k++) {
2271 if (bookedlctV_emul[
k])
2273 if (lctV_emul[
i].isValid() == 0)
2303 bookedlctV_emul[
k] =
true;
2319 std::vector<CSCCorrelatedLCTDigi>::const_iterator pd, pe;
2320 for (
int endc = 1; endc <= 2; endc++) {
2331 std::vector<CSCCorrelatedLCTDigi> lctV_data, lctV_emul;
2332 std::vector<bool> bookedlctV_emul;
2333 const auto& drange = lcts_data->get(detid);
2334 for (
auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
2335 if ((*digiIt).isValid()) {
2336 lctV_data.push_back(*digiIt);
2340 const auto& erange = lcts_emul->get(detid);
2341 for (
auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
2342 if ((*digiIt).isValid()) {
2343 lctV_emul.push_back(*digiIt);
2344 bookedlctV_emul.push_back(
false);
2348 int ndata = lctV_data.size();
2349 int nemul = lctV_emul.size();
2350 if (ndata == 0 && nemul == 0)
2352 bool firstfill =
true;
2355 ostringstream strstrm;
2356 strstrm <<
"\n--- ME" << ((detid.
endcap() == 1) ?
"+" :
"-") << detid.
station() <<
"/" << detid.
ring()
2359 strstrm <<
" **** " << ndata <<
" valid data LCTs found:\n";
2360 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2361 strstrm <<
" " << (*pd);
2363 strstrm <<
"\n **** " << nemul <<
" valid emul LCTs found:\n";
2364 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2365 strstrm <<
" " << (*pe);
2366 strstrm <<
" corr BX = " <<
convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data);
2367 strstrm <<
" LCT pattern = " << (*pe).getPattern();
2370 LogTrace(
"CSCTriggerPrimitivesReader") << strstrm.str();
2376 if (ndata != nemul) {
2377 LogTrace(
"CSCTriggerPrimitivesReader")
2378 <<
" +++ Different numbers of MPC LCTs found in ME" << ((endc == 1) ?
"+" :
"-") <<
stat <<
"/"
2379 <<
ring <<
"/" <<
cham <<
": data = " << ndata <<
" emulator = " << nemul <<
" +++\n";
2392 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2394 if ((*pd).isValid() == 0)
2396 int data_trknmb = (*pd).getTrknmb();
2397 int data_quality = (*pd).getQuality();
2398 int data_wiregroup = (*pd).getKeyWG();
2399 int data_keystrip = (*pd).getStrip();
2400 int data_pattern = (*pd).getCLCTPattern();
2401 int data_striptype = (*pd).getStripType();
2402 int data_bend = (*pd).getBend();
2403 int data_bx = (*pd).getBX();
2431 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2433 if ((*pe).isValid() == 0)
2435 int emul_trknmb = (*pe).getTrknmb();
2436 int emul_quality = (*pe).getQuality();
2437 int emul_wiregroup = (*pe).getKeyWG();
2438 int emul_keystrip = (*pe).getStrip();
2439 int emul_pattern = (*pe).getCLCTPattern();
2440 int emul_striptype = (*pe).getStripType();
2441 int emul_bend = (*pe).getBend();
2442 int emul_bx = (*pe).getBX();
2443 if (data_trknmb == emul_trknmb) {
2446 int emul_corr_bx =
convertBXofLCT(emul_bx, detid, alcts_data, clcts_data);
2449 emul_corr_bx = (emul_bx & 0x01);
2461 if (data_quality == emul_quality && data_wiregroup == emul_wiregroup &&
2462 data_keystrip == emul_keystrip && data_pattern == emul_pattern &&
2463 data_striptype == emul_striptype && data_bend == emul_bend) {
2476 LogTrace(
"CSCTriggerPrimitivesReader") <<
" Identical LCTs #" << data_trknmb;
2491 bookedlctV_emul[
j] =
true;
2494 LogTrace(
"CSCTriggerPrimitivesReader")
2496 <<
" Different LCTs #" << data_trknmb <<
" in ME" << ((endc == 1) ?
"+" :
"-") <<
stat
2497 <<
"/" <<
ring <<
"/" <<
cham <<
" data_lct bx " << data_bx <<
" emul bx " << emul_corr_bx;
2502 LogTrace(
"CSCTriggerPrimitivesReader")
2508 for (
int k = 0;
k < nemul;
k++) {
2509 if (bookedlctV_emul[
k])
2541 bookedlctV_emul[
k] =
true;
2554 int full_anode_bx = -999;
2557 int tbin_anode_offset = 5;
2560 const auto& arange = alcts_data->get(detid);
2561 for (
auto digiIt = arange.first; digiIt != arange.second; digiIt++) {
2562 if ((*digiIt).isValid()) {
2563 full_anode_bx = (*digiIt).getFullBX();
2569 const auto& crange = clcts_data->get(detid);
2570 for (
auto digiIt = crange.first; digiIt != crange.second; digiIt++) {
2571 if ((*digiIt).isValid()) {
2578 if (full_anode_bx == -999) {
2580 edm::LogWarning(
"L1CSCTPEmulatorWrongInput") <<
"+++ Warning in convertBXofLCT(): full anode BX is not available!"
2586 lct_bx = (full_anode_bx + emul_bx - tbin_anode_offset) & 0x01;
2602 int serial_old = -1;
2603 for (
auto dWDiter =
wires->begin(); dWDiter !=
wires->end(); dWDiter++) {
2607 std::vector<CSCWireDigi>::const_iterator wireIter = (*dWDiter).second.first;
2608 std::vector<CSCWireDigi>::const_iterator lWire = (*dWDiter).second.second;
2609 bool has_layer =
false;
2610 for (; wireIter != lWire; ++wireIter) {
2612 int i_layer =
id.layer() - 1;
2613 int i_wire = wireIter->getWireGroup() - 1;
2614 int nbins = wireIter->getTimeBinsOn().size();
2615 int serial2 = serial * (6 * 112) + i_layer * 112 + i_wire;
2627 if (serial_old != serial && has_layer) {
2631 serial_old = serial;
2643 vector<edm::Handle<edm::HepMCProduct> > allhepmcp;
2645 ev.getManyByType(allhepmcp);
2648 if (!allhepmcp.empty()) {
2651 for (HepMC::GenEvent::particle_const_iterator
p =
mc.particles_begin();
p !=
mc.particles_end(); ++
p) {
2652 int id = (*p)->pdg_id();
2653 double phitmp = (*p)->momentum().phi();
2655 phitmp += 2. *
M_PI;
2657 LogDebug(
"CSCTriggerPrimitivesReader")
2658 <<
"MC part #" << ++
i <<
": id = " <<
id <<
", status = " << (*p)->status()
2659 <<
"\n pX = " << (*p)->momentum().x() <<
", pY = " << (*p)->momentum().y()
2660 <<
", pT = " << (*p)->momentum().perp() <<
" GeV"
2661 <<
", p = " << (*p)->momentum().rho() <<
" GeV"
2662 <<
"\n eta = " << (*p)->momentum().pseudoRapidity() <<
", phi = " << phitmp <<
" ("
2663 << phitmp * 180. /
M_PI <<
" deg)";
2685 <<
" requested, but not found in the event... Skipping the rest +++\n";
2691 <<
" requested, but not found in the event... Skipping the rest +++\n";
2697 <<
" requested, but not found in the event... Skipping the rest +++\n";
2702 LogTrace(
"CSCTriggerPrimitivesReader") <<
" #CSC SimHits: " <<
simHits.size();
2725 for (
auto adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) {
2726 const CSCDetId&
id = (*adetUnitIt).first;
2729 const auto&
range = (*adetUnitIt).second;
2730 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
2731 bool alct_valid = (*digiIt).isValid();
2733 vector<CSCAnodeLayerInfo> alctInfo = alct_analyzer.
getSimInfo(*digiIt,
id, wiredc, &allSimHits);
2735 double hitPhi = -999.0, hitEta = -999.0;
2736 int hitWG = alct_analyzer.
nearestWG(alctInfo, hitPhi, hitEta);
2739 int wiregroup = (*digiIt).getKeyWG();
2742 int endc =
id.endcap();
2743 int stat =
id.station();
2746 double alctEta = alct_analyzer.
getWGEta(layerId, wiregroup);
2747 double deltaEta = alctEta - hitEta;
2750 double deltaWG = wiregroup - hitWG;
2752 LogTrace(
"CSCTriggerPrimitivesReader")
2753 <<
"WG: MC = " << hitWG <<
" rec = " << wiregroup <<
" delta = " << deltaWG;
2778 for (
auto cdetUnitIt = clcts->begin(); cdetUnitIt != clcts->end(); cdetUnitIt++) {
2779 const CSCDetId&
id = (*cdetUnitIt).first;
2782 const auto&
range = (*cdetUnitIt).second;
2783 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
2784 bool clct_valid = (*digiIt).isValid();
2786 vector<CSCCathodeLayerInfo> clctInfo = clct_analyzer.
getSimInfo(*digiIt,
id, compdc, &allSimHits);
2788 double hitPhi = -999.0, hitEta = -999.0, deltaStrip = -999.0;
2789 int hitHS = clct_analyzer.
nearestHS(clctInfo, hitPhi, hitEta);
2792 int halfstrip = (*digiIt).getKeyStrip();
2793 int strip = halfstrip / 2;
2794 int distrip = halfstrip / 4;
2795 int stripType = (*digiIt).getStripType();
2798 int endc =
id.endcap();
2799 int stat =
id.station();
2805 float fstrip = -999.;
2806 if (stripType == 0) {
2807 fstrip =
strip + 1.;
2809 fstrip =
strip + 0.5 * (halfstrip % 2) + 0.25;
2811 double clctPhi = clct_analyzer.
getStripPhi(layerId, fstrip);
2812 double deltaPhi = clctPhi - hitPhi;
2819 hitPhi += 2. *
M_PI;
2821 clctPhi += 2. *
M_PI;
2823 LogTrace(
"CSCTriggerPrimitivesReader")
2824 <<
" clctPhi = " << clctPhi <<
" hitPhi = " << hitPhi <<
" deltaPhi = " <<
deltaPhi;
2827 if (stripType == 0) {
2828 deltaStrip = distrip - hitHS / 4;
2833 deltaStrip = halfstrip - hitHS;
2839 LogTrace(
"CSCTriggerPrimitivesReader") <<
"Half-strip: MC = " << hitHS <<
" rec = " << halfstrip
2840 <<
" pattern type = " << stripType <<
" delta = " << deltaStrip;
2850 if (stripType == 1) {
2852 if ((endc == 1 && (
stat == 1 ||
stat == 2)) || (endc == 2 && (
stat == 3 ||
stat == 4))) {
2866 double phi1 = -999.0, phi6 = -999.0;
2867 vector<CSCCathodeLayerInfo>::const_iterator pli;
2868 for (pli = clctInfo.begin(); pli != clctInfo.end(); pli++) {
2870 int layer = layerId.
layer();
2871 if (layer == 1 || layer == 6) {
2873 for (
const auto& psh : allSimHits) {
2876 if (hitId == layerId &&
abs(psh.particleType()) == 13) {
2878 const auto& thisPoint = csclayer->
toGlobal(psh.localPosition());
2879 double phi = thisPoint.phi();
2882 else if (layer == 6)
2889 if (phi1 > -99. && phi6 > -99.) {
2911 vector<CSCDetId> chamberIds;
2912 vector<CSCDetId>::const_iterator chamberIdIt;
2913 for (
const auto& simHitIt : allSimHits) {
2915 bool sameId =
false;
2923 for (
const auto& chamberId : chamberIds) {
2924 if (chamberId.endcap() == hitId.
endcap() && chamberId.station() == hitId.
station() &&
2925 chamberId.ring() == hitId.
ring() && chamberId.chamber() == hitId.
chamber()) {
2932 chamberIds.push_back(newChamberId);
2935 LogTrace(
"CSCTriggerPrimitivesReader") <<
"Found SimHits in " << chamberIds.size() <<
" CSCs";
2939 for (
const auto& chamberId : chamberIds) {
2943 used[ilayer] =
false;
2944 simHitsV[ilayer].clear();
2947 int endcap = chamberId.endcap();
2948 int station = chamberId.station();
2949 int ring = chamberId.ring();
2950 int chamber = chamberId.chamber();
2951 for (
const auto& simHitIt : allSimHits) {
2955 int layer = hitId.
layer() - 1;
2956 if (!used[layer] &&
abs(simHitIt.particleType()) == 13) {
2959 simHitsV[layer].push_back(simHitIt);
2964 <<
"/" <<
chamber <<
" has muon hits in " <<
nLayers <<
" layers";
2971 double hitEta = -999.;
2973 vector<PSimHit> layerSimHitsV = simHitsV[ilayer];
2974 if (!layerSimHitsV.empty()) {
2975 LocalPoint hitLP = layerSimHitsV[0].localPosition();
2979 hitEta = hitGP.
eta();
2984 edm::LogWarning(
"L1CSCTPEmulatorWrongValues") <<
"+++ Warning in calcEfficiency(): no SimHit found"
2985 <<
" where there must be at least " <<
nLayers <<
"! +++\n";
2992 bool isALCT =
false;
2993 for (
auto adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) {
2994 const CSCDetId&
id = (*adetUnitIt).first;
2995 if (
id == (*chamberIdIt)) {
2996 const auto&
range = (*adetUnitIt).second;
2997 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
2998 if (digiIt->isValid()) {
3000 LogTrace(
"CSCTriggerPrimitivesReader") <<
"ALCT was found";
3013 LogTrace(
"CSCTriggerPrimitivesReader") <<
"ALCT was not found";
3016 bool isCLCT =
false;
3017 for (
auto cdetUnitIt = clcts->begin(); cdetUnitIt != clcts->end(); cdetUnitIt++) {
3018 const CSCDetId&
id = (*cdetUnitIt).first;
3019 if (
id == (*chamberIdIt)) {
3020 const auto&
range = (*cdetUnitIt).second;
3021 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
3022 if (digiIt->isValid()) {
3024 LogTrace(
"CSCTriggerPrimitivesReader") <<
"CLCT was found";
3037 LogTrace(
"CSCTriggerPrimitivesReader") <<
"CLCT was not found";
3044 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3046 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3049 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3050 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3056 t.SetTextSize(0.025);
3057 char pagenum[7], titl[50];
3065 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"Number of ALCTs");
3066 title->SetFillColor(10);
3068 sprintf(pagenum,
"- %d -",
page);
3069 t.DrawText(0.9, 0.02, pagenum);
3070 gStyle->SetOptStat(111110);
3072 pad[
page]->Divide(1, 3);
3090 sprintf(titl,
"ALCTs per chamber, endcap %d", endc + 1);
3091 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3092 title->SetFillColor(10);
3094 sprintf(pagenum,
"- %d -",
page);
3095 t.DrawText(0.9, 0.02, pagenum);
3096 gStyle->SetOptStat(10);
3098 pad[
page]->Divide(2, 5);
3099 for (
int idh = 0; idh < max_idh; idh++) {
3102 hAlctCsc[endc][idh]->SetMinimum(0.0);
3103 pad[
page]->cd(idh + 1);
3113 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"ALCT quantities");
3114 title->SetFillColor(10);
3116 sprintf(pagenum,
"- %d -",
page);
3117 t.DrawText(0.9, 0.02, pagenum);
3118 gStyle->SetOptStat(111110);
3120 pad[
page]->Divide(2, 3);
3141 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3143 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3146 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3147 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3153 t.SetTextSize(0.025);
3154 char pagenum[7], titl[50];
3160 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"Number of CLCTs");
3161 title->SetFillColor(10);
3163 sprintf(pagenum,
"- %d -",
page);
3164 t.DrawText(0.9, 0.02, pagenum);
3165 gStyle->SetOptStat(111110);
3167 pad[
page]->Divide(1, 3);
3175 for (
int ibin = 1; ibin <=
nbins; ibin++) {
3177 edm::LogInfo(
"CSCTriggerPrimitivesReader") <<
" # CLCTs/chamber: " << ibin - 1 <<
"; events: " << f_bin << endl;
3195 sprintf(titl,
"CLCTs per chamber, endcap %d", endc + 1);
3196 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3197 title->SetFillColor(10);
3199 sprintf(pagenum,
"- %d -",
page);
3200 t.DrawText(0.9, 0.02, pagenum);
3201 gStyle->SetOptStat(10);
3203 pad[
page]->Divide(2, 5);
3204 for (
int idh = 0; idh < max_idh; idh++) {
3207 hClctCsc[endc][idh]->SetMinimum(0.0);
3208 pad[
page]->cd(idh + 1);
3218 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT quantities");
3219 title->SetFillColor(10);
3221 sprintf(pagenum,
"- %d -",
page);
3222 t.DrawText(0.9, 0.02, pagenum);
3223 gStyle->SetOptStat(111110);
3225 pad[
page]->Divide(2, 4);
3247 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT bend for various chamber types, halfstrips");
3248 title->SetFillColor(10);
3250 sprintf(pagenum,
"- %d -",
page);
3251 t.DrawText(0.9, 0.02, pagenum);
3252 gStyle->SetOptStat(110);
3254 pad[
page]->Divide(2, 5);
3255 for (
int idh = 0; idh < max_idh; idh++) {
3258 pad[
page]->cd(idh + 1);
3259 hClctBendCsc[idh][1]->GetXaxis()->SetTitle(
"Pattern bend");
3260 hClctBendCsc[idh][1]->GetYaxis()->SetTitle(
"Number of LCTs");
3271 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3273 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3276 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3277 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3283 t.SetTextSize(0.025);
3284 char pagenum[7], titl[50];
3292 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"Number of LCTs");
3293 title->SetFillColor(10);
3295 sprintf(pagenum,
"- %d -",
page);
3296 t.DrawText(0.9, 0.02, pagenum);
3297 gStyle->SetOptStat(111110);
3299 pad[
page]->Divide(2, 2);
3314 gStyle->SetOptStat(1110);
3321 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"LCT geometry");
3322 title->SetFillColor(10);
3324 sprintf(pagenum,
"- %d -",
page);
3325 t.DrawText(0.9, 0.02, pagenum);
3326 gStyle->SetOptStat(110110);
3328 pad[
page]->Divide(2, 4);
3338 pad[
page]->cd(istat + 5);
3348 sprintf(titl,
"LCTs per chamber, endcap %d", endc + 1);
3349 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3350 title->SetFillColor(10);
3352 sprintf(pagenum,
"- %d -",
page);
3353 t.DrawText(0.9, 0.02, pagenum);
3354 gStyle->SetOptStat(10);
3356 pad[
page]->Divide(2, 5);
3357 for (
int idh = 0; idh < max_idh; idh++) {
3361 pad[
page]->cd(idh + 1);
3371 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"LCT quantities");
3372 title->SetFillColor(10);
3374 sprintf(pagenum,
"- %d -",
page);
3375 t.DrawText(0.9, 0.02, pagenum);
3376 gStyle->SetOptStat(110110);
3378 pad[
page]->Divide(2, 4);
3403 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3405 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3408 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3409 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3415 t.SetTextSize(0.025);
3422 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"Number of LCTs");
3423 title->SetFillColor(10);
3425 sprintf(pagenum,
"- %d -",
page);
3426 t.DrawText(0.9, 0.02, pagenum);
3427 gStyle->SetOptStat(111110);
3429 pad[
page]->Divide(1, 3);
3447 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"LCT geometry");
3448 title->SetFillColor(10);
3450 sprintf(pagenum,
"- %d -",
page);
3451 t.DrawText(0.9, 0.02, pagenum);
3452 gStyle->SetOptStat(110110);
3454 pad[
page]->Divide(2, 4);
3464 pad[
page]->cd(istat + 5);
3473 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"LCT quantities");
3474 title->SetFillColor(10);
3476 sprintf(pagenum,
"- %d -",
page);
3477 t.DrawText(0.9, 0.02, pagenum);
3479 pad[
page]->Divide(2, 4);
3504 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3506 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3509 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3510 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3516 t.SetTextSize(0.025);
3522 teff.SetTextFont(32);
3523 teff.SetTextSize(0.08);
3524 char eff[25], titl[60];
3532 sprintf(titl,
"ALCT firmware-emulator: match in number found, endcap %d", endc + 1);
3533 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3534 title->SetFillColor(10);
3536 sprintf(pagenum,
"- %d -",
page);
3537 t.DrawText(0.9, 0.02, pagenum);
3539 gStyle->SetOptStat(0);
3541 pad[
page]->Divide(2, 5);
3543 for (
int idh = 0; idh < max_idh; idh++) {
3549 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3551 hAlctFoundEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3552 hAlctFoundEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3556 gStyle->SetStatX(0.65);
3557 hAlctFoundEffVsCsc[endc][idh]->SetMinimum(-0.05);
3558 hAlctFoundEffVsCsc[endc][idh]->SetMaximum(1.05);
3559 hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3560 hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3561 hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3562 hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3563 hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3564 hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3565 hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3566 hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of same number found");
3567 pad[
page]->cd(idh + 1);
3568 hAlctFoundEffVsCsc[endc][idh]->Draw(
"e");
3576 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3577 teff.DrawTextNDC(0.3, 0.5, eff);
3587 sprintf(titl,
"ALCT firmware-emulator: exact match, endcap %d", endc + 1);
3588 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3589 title->SetFillColor(10);
3591 sprintf(pagenum,
"- %d -",
page);
3592 t.DrawText(0.9, 0.02, pagenum);
3594 gStyle->SetOptStat(0);
3596 pad[
page]->Divide(2, 5);
3598 for (
int idh = 0; idh < max_idh; idh++) {
3604 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3606 hAlctMatchEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3607 hAlctMatchEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3611 gStyle->SetStatX(0.65);
3612 hAlctMatchEffVsCsc[endc][idh]->SetMinimum(-0.05);
3613 hAlctMatchEffVsCsc[endc][idh]->SetMaximum(1.05);
3614 hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3615 hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3616 hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3617 hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3618 hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3619 hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3620 hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3621 hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of exact match");
3622 pad[
page]->cd(idh + 1);
3623 hAlctMatchEffVsCsc[endc][idh]->Draw(
"e");
3631 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3632 teff.DrawTextNDC(0.3, 0.5, eff);
3642 sprintf(titl,
"CLCT firmware-emulator: match in number found, endcap %d", endc + 1);
3643 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3644 title->SetFillColor(10);
3646 sprintf(pagenum,
"- %d -",
page);
3647 t.DrawText(0.9, 0.02, pagenum);
3649 gStyle->SetOptStat(0);
3651 pad[
page]->Divide(2, 5);
3653 for (
int idh = 0; idh < max_idh; idh++) {
3659 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3661 hClctFoundEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3662 hClctFoundEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3666 gStyle->SetStatX(0.65);
3667 hClctFoundEffVsCsc[endc][idh]->SetMinimum(-0.05);
3668 hClctFoundEffVsCsc[endc][idh]->SetMaximum(1.05);
3669 hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3670 hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3671 hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3672 hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3673 hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3674 hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3675 hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3676 hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of same number found");
3677 pad[
page]->cd(idh + 1);
3678 hClctFoundEffVsCsc[endc][idh]->Draw(
"e");
3686 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3687 teff.DrawTextNDC(0.3, 0.5, eff);
3697 sprintf(titl,
"CLCT firmware-emulator: exact match, endcap %d", endc + 1);
3698 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3699 title->SetFillColor(10);
3701 sprintf(pagenum,
"- %d -",
page);
3702 t.DrawText(0.9, 0.02, pagenum);
3704 gStyle->SetOptStat(0);
3706 pad[
page]->Divide(2, 5);
3708 for (
int idh = 0; idh < max_idh; idh++) {
3714 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3716 hClctMatchEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3717 hClctMatchEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3721 gStyle->SetStatX(0.65);
3722 hClctMatchEffVsCsc[endc][idh]->SetMinimum(-0.05);
3723 hClctMatchEffVsCsc[endc][idh]->SetMaximum(1.05);
3724 hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3725 hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3726 hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3727 hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3728 hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3729 hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3730 hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3731 hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of exact match");
3732 pad[
page]->cd(idh + 1);
3733 hClctMatchEffVsCsc[endc][idh]->Draw(
"e");
3741 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3742 teff.DrawTextNDC(0.3, 0.5, eff);
3752 sprintf(titl,
"LCT firmware-emulator: match in number found, endcap %d", endc + 1);
3753 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3754 title->SetFillColor(10);
3756 sprintf(pagenum,
"- %d -",
page);
3757 t.DrawText(0.9, 0.02, pagenum);
3759 gStyle->SetOptStat(0);
3761 pad[
page]->Divide(2, 5);
3763 for (
int idh = 0; idh < max_idh; idh++) {
3766 hLctFoundEffVsCsc[endc][idh] = (TH1F*)
hLctCompFoundCsc[endc][idh]->Clone();
3769 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3771 hLctFoundEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3772 hLctFoundEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3776 gStyle->SetStatX(0.65);
3777 hLctFoundEffVsCsc[endc][idh]->SetMinimum(-0.05);
3778 hLctFoundEffVsCsc[endc][idh]->SetMaximum(1.05);
3779 hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3780 hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3781 hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3782 hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3783 hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3784 hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3785 hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3786 hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of same number found");
3787 pad[
page]->cd(idh + 1);
3788 hLctFoundEffVsCsc[endc][idh]->Draw(
"e");
3796 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3797 teff.DrawTextNDC(0.3, 0.5, eff);
3807 sprintf(titl,
"LCT firmware-emulator: exact match, endcap %d", endc + 1);
3808 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3809 title->SetFillColor(10);
3811 sprintf(pagenum,
"- %d -",
page);
3812 t.DrawText(0.9, 0.02, pagenum);
3814 gStyle->SetOptStat(0);
3816 pad[
page]->Divide(2, 5);
3818 for (
int idh = 0; idh < max_idh; idh++) {
3821 hLctMatchEffVsCsc[endc][idh] = (TH1F*)
hLctCompTotalCsc[endc][idh]->Clone();
3824 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3826 hLctMatchEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3827 hLctMatchEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3831 gStyle->SetStatX(0.65);
3832 hLctMatchEffVsCsc[endc][idh]->SetMinimum(-0.05);
3833 hLctMatchEffVsCsc[endc][idh]->SetMaximum(1.05);
3834 hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3835 hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3836 hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3837 hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3838 hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3839 hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3840 hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3841 hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of exact match");
3842 pad[
page]->cd(idh + 1);
3843 hLctMatchEffVsCsc[endc][idh]->Draw(
"e");
3851 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3852 teff.DrawTextNDC(0.3, 0.5, eff);
3863 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3865 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3868 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3869 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3875 t.SetTextSize(0.025);
3884 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"ALCT resolution");
3885 title->SetFillColor(10);
3887 sprintf(pagenum,
"- %d -",
page);
3888 t.DrawText(0.9, 0.02, pagenum);
3889 gStyle->SetOptStat(111110);
3891 pad[
page]->Divide(2, 2);
3892 gStyle->SetStatX(1.00);
3893 gStyle->SetStatY(0.65);
3898 gStyle->SetStatX(1.00);
3899 gStyle->SetStatY(0.995);
3920 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#eta_rec-#eta_sim");
3921 title->SetFillColor(10);
3923 sprintf(pagenum,
"- %d -",
page);
3924 t.DrawText(0.9, 0.02, pagenum);
3926 pad[
page]->Divide(2, 5);
3927 for (
int idh = 0; idh < max_idh; idh++) {
3930 hEtaDiffCsc[idh][0]->GetXaxis()->SetLabelSize(0.07);
3931 hEtaDiffCsc[idh][0]->GetYaxis()->SetLabelSize(0.07);
3932 pad[
page]->cd(idh + 1);
3943 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#eta_rec-#eta_sim, endcap1");
3944 title->SetFillColor(10);
3946 sprintf(pagenum,
"- %d -",
page);
3947 t.DrawText(0.9, 0.02, pagenum);
3949 pad[
page]->Divide(2, 5);
3950 for (
int idh = 0; idh < max_idh; idh++) {
3953 hEtaDiffCsc[idh][1]->GetXaxis()->SetLabelSize(0.07);
3954 hEtaDiffCsc[idh][1]->GetYaxis()->SetLabelSize(0.07);
3955 pad[
page]->cd(idh + 1);
3966 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#eta_rec-#eta_sim, endcap2");
3967 title->SetFillColor(10);
3969 sprintf(pagenum,
"- %d -",
page);
3970 t.DrawText(0.9, 0.02, pagenum);
3972 pad[
page]->Divide(2, 5);
3973 for (
int idh = 0; idh < max_idh; idh++) {
3976 hEtaDiffCsc[idh][2]->GetXaxis()->SetLabelSize(0.07);
3977 hEtaDiffCsc[idh][2]->GetYaxis()->SetLabelSize(0.07);
3978 pad[
page]->cd(idh + 1);
3989 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#LT#eta_rec-#eta_sim#GT vs #eta_rec");
3990 title->SetFillColor(10);
3992 sprintf(pagenum,
"- %d -",
page);
3993 t.DrawText(0.9, 0.02, pagenum);
3996 pad[
page]->Divide(2, 2);
3998 for (
int istation = 0; istation <
MAX_STATIONS; istation++) {
3999 hMeanEtaDiffVsEta[istation] = (TH1F*)
hEtaDiffVsEta[istation]->Clone();
4001 hMeanEtaDiffVsEta[istation]->GetXaxis()->SetTitleOffset(1.2);
4002 hMeanEtaDiffVsEta[istation]->GetXaxis()->SetTitle(
"#eta");
4003 hMeanEtaDiffVsEta[istation]->SetMaximum(0.05);
4004 pad[
page]->cd(istation + 1);
4005 hMeanEtaDiffVsEta[istation]->Draw();
4012 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#eta_rec-#eta_sim vs wiregroup");
4013 title->SetFillColor(10);
4015 sprintf(pagenum,
"- %d -",
page);
4016 t.DrawText(0.9, 0.02, pagenum);
4018 pad[
page]->Divide(2, 5);
4019 for (
int idh = 0; idh < max_idh; idh++) {
4022 pad[
page]->cd(idh + 1);
4039 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi resolution");
4040 title->SetFillColor(10);
4042 sprintf(pagenum,
"- %d -",
page);
4043 t.DrawText(0.9, 0.02, pagenum);
4044 gStyle->SetOptStat(111110);
4046 pad[
page]->Divide(2, 2);
4047 gStyle->SetStatX(1.00);
4048 gStyle->SetStatY(0.65);
4053 gStyle->SetStatX(1.00);
4054 gStyle->SetStatY(0.995);
4082 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim (mrad)");
4083 title->SetFillColor(10);
4085 sprintf(pagenum,
"- %d -",
page);
4086 t.DrawText(0.9, 0.02, pagenum);
4088 pad[
page]->Divide(2, 5);
4089 for (
int idh = 0; idh < max_idh; idh++) {
4092 hPhiDiffCsc[idh][0]->GetXaxis()->SetLabelSize(0.07);
4093 hPhiDiffCsc[idh][0]->GetYaxis()->SetLabelSize(0.07);
4094 pad[
page]->cd(idh + 1);
4105 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim (mrad), endcap1");
4106 title->SetFillColor(10);
4108 sprintf(pagenum,
"- %d -",
page);
4109 t.DrawText(0.9, 0.02, pagenum);
4111 pad[
page]->Divide(2, 5);
4112 for (
int idh = 0; idh < max_idh; idh++) {
4115 hPhiDiffCsc[idh][1]->GetXaxis()->SetLabelSize(0.07);
4116 hPhiDiffCsc[idh][1]->GetYaxis()->SetLabelSize(0.07);
4117 pad[
page]->cd(idh + 1);
4128 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim (mrad), endcap2");
4129 title->SetFillColor(10);
4131 sprintf(pagenum,
"- %d -",
page);
4132 t.DrawText(0.9, 0.02, pagenum);
4134 pad[
page]->Divide(2, 5);
4135 for (
int idh = 0; idh < max_idh; idh++) {
4138 hPhiDiffCsc[idh][2]->GetXaxis()->SetLabelSize(0.07);
4139 hPhiDiffCsc[idh][2]->GetYaxis()->SetLabelSize(0.07);
4140 pad[
page]->cd(idh + 1);
4151 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#LT#phi_rec-#phi_sim#GT (mrad) vs #phi_rec");
4152 title->SetFillColor(10);
4154 sprintf(pagenum,
"- %d -",
page);
4155 t.DrawText(0.9, 0.02, pagenum);
4156 gStyle->SetOptStat(0);
4158 pad[
page]->Divide(2, 2);
4160 for (
int istation = 0; istation <
MAX_STATIONS; istation++) {
4161 hMeanPhiDiffVsPhi[istation] = (TH1F*)
hPhiDiffVsPhi[istation]->Clone();
4163 hMeanPhiDiffVsPhi[istation]->GetXaxis()->SetTitleOffset(1.2);
4164 hMeanPhiDiffVsPhi[istation]->GetYaxis()->SetTitleOffset(1.7);
4165 hMeanPhiDiffVsPhi[istation]->GetXaxis()->SetTitle(
"#phi");
4166 hMeanPhiDiffVsPhi[istation]->GetYaxis()->SetTitle(
"#LT#phi_rec-#phi_sim#GT (mrad)");
4167 hMeanPhiDiffVsPhi[istation]->SetMaximum(5.);
4168 pad[
page]->cd(istation + 1);
4169 hMeanPhiDiffVsPhi[istation]->Draw();
4176 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim (mrad) vs halfstrip #");
4177 title->SetFillColor(10);
4179 sprintf(pagenum,
"- %d -",
page);
4180 t.DrawText(0.9, 0.02, pagenum);
4181 gStyle->SetOptStat(0);
4183 pad[
page]->Divide(2, 5);
4184 for (
int idh = 0; idh < max_idh; idh++) {
4187 pad[
page]->cd(idh + 1);
4201 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim, halfstrips only, different patterns");
4202 title->SetFillColor(10);
4204 sprintf(pagenum,
"- %d -",
page);
4205 t.DrawText(0.9, 0.02, pagenum);
4206 gStyle->SetOptStat(111110);
4208 pad[
page]->Divide(3, 3);
4209 int min_pattern, max_pattern;
4212 for (
int idh = min_pattern; idh < max_pattern; idh++) {
4215 pad[
page]->cd(idh - min_pattern + 1);
4226 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_1-#phi_6 (mrad), muon SimHits");
4227 title->SetFillColor(10);
4229 sprintf(pagenum,
"- %d -",
page);
4230 t.DrawText(0.9, 0.02, pagenum);
4232 pad[
page]->Divide(2, 5);
4233 for (
int idh = 0; idh < max_idh; idh++) {
4240 pad[
page]->cd(idh + 1);
4251 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 700);
4253 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
4256 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
4257 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
4263 t.SetTextSize(0.025);
4268 gStyle->SetOptDate(0);
4269 gStyle->SetTitleSize(0.1,
"");
4276 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"ALCT efficiency vs #eta");
4277 title->SetFillColor(10);
4279 sprintf(pagenum,
"- %d -",
page);
4280 t.DrawText(0.9, 0.02, pagenum);
4281 gStyle->SetOptStat(0);
4283 pad[
page]->Divide(2, 2);
4285 for (
int istation = 0; istation <
MAX_STATIONS; istation++) {
4286 hALCTEffVsEta[istation] = (TH1F*)
hEfficHitsEta[istation]->Clone();
4288 hALCTEffVsEta[istation]->GetXaxis()->SetTitleOffset(1.2);
4289 hALCTEffVsEta[istation]->GetXaxis()->SetTitle(
"#eta");
4290 hALCTEffVsEta[istation]->SetMaximum(1.05);
4291 sprintf(histtitle,
"ALCT efficiency vs #eta, station %d", istation + 1);
4292 hALCTEffVsEta[istation]->SetTitle(histtitle);
4293 pad[
page]->cd(istation + 1);
4294 hALCTEffVsEta[istation]->Draw();
4301 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"ALCT efficiency vs #eta");
4302 title->SetFillColor(10);
4304 sprintf(pagenum,
"- %d -",
page);
4305 t.DrawText(0.9, 0.02, pagenum);
4306 gStyle->SetOptStat(11111);
4308 pad[
page]->Divide(2, 5);
4310 for (
int idh = 0; idh < max_idh; idh++) {
4315 if (idh == 3 || idh == 4 || idh == 6 || idh == 8) {
4317 gStyle->SetStatX(0.43);
4320 gStyle->SetStatX(1.00);
4322 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle(
"#eta");
4323 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4324 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07);
4325 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10);
4326 hALCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4327 hALCTEffVsEtaCsc[idh]->SetLabelOffset(0.012,
"XY");
4328 hALCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4329 hALCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4330 hALCTEffVsEtaCsc[idh]->SetTitle(
csc_type[idh].c_str());
4331 hALCTEffVsEtaCsc[idh]->SetTitleSize(0.1,
"");
4332 hALCTEffVsEtaCsc[idh]->SetLineWidth(2);
4333 hALCTEffVsEtaCsc[idh]->SetLineColor(4);
4334 pad[
page]->cd(idh + 1);
4336 hALCTEffVsEtaCsc[idh]->Draw();
4344 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT efficiency vs #eta");
4345 title->SetFillColor(10);
4347 sprintf(pagenum,
"- %d -",
page);
4348 t.DrawText(0.9, 0.02, pagenum);
4349 gStyle->SetOptStat(0);
4351 pad[
page]->Divide(2, 2);
4353 for (
int istation = 0; istation <
MAX_STATIONS; istation++) {
4354 hCLCTEffVsEta[istation] = (TH1F*)
hEfficHitsEta[istation]->Clone();
4356 hCLCTEffVsEta[istation]->GetXaxis()->SetTitleOffset(1.2);
4357 hCLCTEffVsEta[istation]->GetXaxis()->SetTitle(
"#eta");
4358 hCLCTEffVsEta[istation]->SetMaximum(1.05);
4359 sprintf(histtitle,
"CLCT efficiency vs #eta, station %d", istation + 1);
4360 hCLCTEffVsEta[istation]->SetTitle(histtitle);
4361 pad[
page]->cd(istation + 1);
4362 hCLCTEffVsEta[istation]->Draw();
4369 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT efficiency vs #eta");
4370 title->SetFillColor(10);
4372 sprintf(pagenum,
"- %d -",
page);
4373 t.DrawText(0.9, 0.02, pagenum);
4374 gStyle->SetOptStat(111110);
4376 pad[
page]->Divide(2, 5);
4378 for (
int idh = 0; idh < max_idh; idh++) {
4383 if (idh == 3 || idh == 4 || idh == 6 || idh == 8) {
4385 gStyle->SetStatX(0.43);
4388 gStyle->SetStatX(1.00);
4390 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle(
"#eta");
4391 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4392 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07);
4393 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10);
4394 hCLCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4395 hCLCTEffVsEtaCsc[idh]->SetLabelOffset(0.012,
"XY");
4396 hCLCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4397 hCLCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4398 hCLCTEffVsEtaCsc[idh]->SetTitle(
csc_type[idh].c_str());
4399 hCLCTEffVsEtaCsc[idh]->SetLineWidth(2);
4400 hCLCTEffVsEtaCsc[idh]->SetLineColor(4);
4401 pad[
page]->cd(idh + 1);
4403 hCLCTEffVsEtaCsc[idh]->Draw();
4413 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
4414 TCanvas* c2 =
new TCanvas(
"c2",
"", 0, 0, 540, 540);
4417 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
4418 pad[i_page] =
new TPad(
"",
"", .07, .07, .93, .93);
4423 gStyle->SetOptDate(0);
4427 TPostScript* eps1 =
new TPostScript(
"clcts.eps", 113);
4431 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT quantities");
4432 title->SetFillColor(10);
4435 pad[
page]->Divide(2, 3);
4440 TH1F* hClctPatternTot = (TH1F*)
hClctPattern[0]->Clone();
4441 hClctPatternTot->SetTitle(
"CLCT pattern #");
4444 hClctPatternTot->Draw();
4454 hClctKeyStripTot->SetTitle(
"CLCT key strip #");
4457 hClctKeyStripTot->Draw();
4460 c1->Print(
"asdf.png");
4465 gStyle->SetTitleSize(0.055,
"");
4467 TPostScript* eps2 =
new TPostScript(
"alct_deltaWG.eps", 113);
4471 gStyle->SetOptStat(0);
4473 pad[
page]->Divide(1, 1);
4486 TPostScript* eps3 =
new TPostScript(
"clct_deltaHS.eps", 113);
4491 pad[
page]->Divide(1, 1);
4504 TPostScript* eps4 =
new TPostScript(
"clct_deltaDS.eps", 113);
4508 gStyle->SetOptStat(0);
4510 pad[
page]->Divide(1, 1);
4523 TPostScript* eps5 =
new TPostScript(
"clct_deltaPhi_hs.eps", 113);
4527 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim (mrad), halfstrips only");
4528 title->SetFillColor(10);
4530 gStyle->SetTitleSize(0.1,
"");
4531 gStyle->SetOptStat(111110);
4533 pad[
page]->Divide(2, 5);
4534 for (
int idh = 0; idh < max_idh; idh++) {
4537 pad[
page]->cd(idh + 1);
4544 hPhiDiffCsc[idh][4]->GetYaxis()->SetTitle(
"Entries ");
4545 hPhiDiffCsc[idh][4]->GetYaxis()->SetTitleSize(0.07);
4546 hPhiDiffCsc[idh][4]->GetYaxis()->SetTitleOffset(1.0);
4547 hPhiDiffCsc[idh][4]->GetXaxis()->SetLabelSize(0.10);
4548 hPhiDiffCsc[idh][4]->GetYaxis()->SetLabelSize(0.10);
4558 TPostScript* eps6 =
new TPostScript(
"alct_effic.eps", 113);
4562 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"ALCT efficiency vs #eta");
4563 title->SetFillColor(10);
4565 gStyle->SetOptStat(0);
4567 pad[
page]->Divide(2, 5);
4569 for (
int idh = 0; idh < max_idh; idh++) {
4574 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle(
"#eta");
4575 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4576 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07);
4577 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10);
4578 hALCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4579 hALCTEffVsEtaCsc[idh]->SetLabelOffset(0.012,
"XY");
4580 hALCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4581 hALCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4582 hALCTEffVsEtaCsc[idh]->SetTitle(
csc_type[idh].c_str());
4583 hALCTEffVsEtaCsc[idh]->SetTitleSize(0.1,
"");
4584 hALCTEffVsEtaCsc[idh]->SetLineWidth(2);
4585 hALCTEffVsEtaCsc[idh]->SetLineColor(4);
4586 hALCTEffVsEtaCsc[idh]->SetLineColor(4);
4587 pad[
page]->cd(idh + 1);
4589 hALCTEffVsEtaCsc[idh]->Draw();
4595 TPostScript* eps7 =
new TPostScript(
"clct_effic.eps", 113);
4599 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT efficiency vs #eta");
4600 title->SetFillColor(10);
4602 gStyle->SetOptStat(0);
4604 pad[
page]->Divide(2, 5);
4606 for (
int idh = 0; idh < max_idh; idh++) {
4611 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle(
"#eta");
4612 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4613 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07);
4614 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10);
4615 hCLCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4616 hCLCTEffVsEtaCsc[idh]->SetLabelOffset(0.012,
"XY");
4617 hCLCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4618 hCLCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4619 hCLCTEffVsEtaCsc[idh]->SetTitle(
csc_type[idh].c_str());
4620 hCLCTEffVsEtaCsc[idh]->SetLineWidth(2);
4621 hCLCTEffVsEtaCsc[idh]->SetLineColor(4);
4622 pad[
page]->cd(idh + 1);
4624 hCLCTEffVsEtaCsc[idh]->Draw();
4641 keyHS = keyHS - 128;
4646 float fractional_strip = 0.5 * (keyHS + 1) - 0.25;
4650 LocalPoint csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire);
4656 bool isME11 = (
id.station() == 1 and (
id.
ring() == 1
or id.
ring() == 4));
4660 int theEndcap = (
id.endcap() == 1) ? 1 : 2;
4693 type = (
id.triggerCscId() - 1) / 3;
4694 if (
id.
ring() == 4) {
4698 type = 3 +
id.ring() + 2 * (
id.station() - 2);