48 #include "TPaveLabel.h"
49 #include "TPostScript.h"
66 "ME1/1",
"ME1/2",
"ME1/3",
"ME1/A",
"ME2/1",
"ME2/2",
"ME3/1",
"ME3/2",
"ME4/1",
"ME4/2"};
68 "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 "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"};
73 48, 64, 32, 48, 112, 64, 96, 64, 96, 64};
75 128, 160, 128, 96, 160, 160, 160, 160, 160, 160};
77 -999, -5, 4, -4, 3, -3, 2, -2, 1, -1, 0};
102 {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95}, {0, 95},
103 {0, 95}, {0, 95}, {0, 77}, {0, 61}, {0, 39}, {0, 22}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
104 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
105 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
106 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}};
109 {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31},
110 {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 31}, {0, 22}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
111 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
112 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
113 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}};
119 {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},
120 {100, 127}, {73, 127}, {47, 127}, {22, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127},
121 {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127},
122 {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 127},
123 {0, 127}, {0, 127}, {0, 127}, {0, 127}, {0, 105}, {0, 93}, {0, 78}, {0, 63}};
127 t_EventNumberAnalyzed = -1;
131 t_nStubs_readout = 0;
144 t->Branch(
"t_EventNumberAnalyzed", &t_EventNumberAnalyzed,
"t_EventNumberAnalyzed/I");
145 t->Branch(
"t_RUN", &t_RUN,
"t_RUN/I");
146 t->Branch(
"t_Event", &t_Event,
"t_Event/I");
147 t->Branch(
"t_nStubs", &t_nStubs,
"t_nStubs/I");
148 t->Branch(
"t_nStubs_readout", &t_nStubs_readout,
"t_nStubs_readout/I");
149 t->Branch(
"t_nStubs_ME119", &t_nStubs_ME119,
"t_nStubs_ME119/I");
150 t->Branch(
"t_nStubs_ME11no911", &t_nStubs_ME11no911,
"t_nStubs_ME11no911/I");
151 t->Branch(
"t_nStubs_noMEpm11", &t_nStubs_noMEpm11,
"t_nStubs_noMEpm11/I");
153 t->Branch(
"t_chamber", &t_chamber,
"t_chamber/I");
154 t->Branch(
"t_ring", &t_ring,
"t_ring/I");
155 t->Branch(
"t_endcap", &t_endcap,
"t_endcap/I");
156 t->Branch(
"t_station", &t_station,
"t_station/I");
157 t->Branch(
"t_chambertype", &t_chambertype,
"t_chambertype/I");
170 totStubs_emul_readout = -1;
182 quality_pretrig = -1;
183 maxquality_pretrig = -1;
187 pattern_pretrig = -1;
188 maxpattern_pretrig = -1;
202 WGcrossHS_data =
false;
203 WGcrossHS_emul =
false;
219 t->Branch(
"nRUN", &nRUN);
221 t->Branch(
"firstfill", &firstfill);
222 t->Branch(
"totStubs_data", &totStubs_data);
223 t->Branch(
"totStubs_emul", &totStubs_emul);
224 t->Branch(
"totStubs_emul_readout", &totStubs_emul_readout);
225 t->Branch(
"nStub_data", &nStub_data);
226 t->Branch(
"nStub_emul", &nStub_emul);
229 t->Branch(
"ring", &
ring);
232 t->Branch(
"chambertype", &chambertype);
233 t->Branch(
"has_data", &has_data);
234 t->Branch(
"has_emul", &has_emul);
235 t->Branch(
"quality_data", &quality_data);
236 t->Branch(
"quality_emul", &quality_emul);
237 t->Branch(
"npretrig", &npretrig);
238 t->Branch(
"quality_pretrig", &quality_pretrig);
239 t->Branch(
"maxquality_pretrig", &maxquality_pretrig);
240 t->Branch(
"pattern_data", &pattern_data);
241 t->Branch(
"pattern_emul", &pattern_emul);
242 t->Branch(
"pattern_pretrig", &pattern_pretrig);
243 t->Branch(
"maxpattern_pretrig", &maxpattern_pretrig);
244 t->Branch(
"bend_data", &bend_data);
245 t->Branch(
"bx_data", &bx_data);
246 t->Branch(
"fullbx_data", &fullbx_data);
247 t->Branch(
"bend_emul", &bend_emul);
248 t->Branch(
"bx_emul", &bx_emul);
249 t->Branch(
"fullbx_emul", &fullbx_emul);
250 t->Branch(
"bend_pretrig", &bend_pretrig);
251 t->Branch(
"bx_pretrig", &bx_pretrig);
252 t->Branch(
"bx_corr_emul", &bx_corr_emul);
253 t->Branch(
"WGcrossHS_data", &WGcrossHS_data);
254 t->Branch(
"WGcrossHS_emul", &WGcrossHS_emul);
255 t->Branch(
"key_WG_data", &key_WG_data);
256 t->Branch(
"key_WG_emul", &key_WG_emul);
257 t->Branch(
"key_hs_data", &key_hs_data);
258 t->Branch(
"key_hs_emul", &key_hs_emul);
259 t->Branch(
"key_hs_pretrig", &key_hs_pretrig);
260 t->Branch(
"trknmb_data", &trknmb_data);
261 t->Branch(
"trknmb_emul", &trknmb_emul);
262 t->Branch(
"dphi_data", &dphi_data);
263 t->Branch(
"dphi_emul", &dphi_emul);
264 t->Branch(
"eta_data", &eta_data);
265 t->Branch(
"eta_emul", &eta_emul);
266 t->Branch(
"phi_data", &phi_data);
267 t->Branch(
"phi_emul", &phi_emul);
290 gangedME1a = commonParams.getParameter<
bool>(
"gangedME1a");
319 consumesMany<edm::HepMCProduct>();
367 LogTrace(
"CSCTriggerPrimitivesReader") <<
"\n** CSCTriggerPrimitivesReader: processing run #" <<
ev.id().run()
411 <<
"+++ Warning: Collection of ALCTs with label MuonCSCALCTDigi"
412 <<
" requested, but not found in the event... Skipping the rest +++\n";
417 <<
"+++ Warning: Collection of CLCTs with label MuonCSCCLCTDigi"
418 <<
" requested, but not found in the event... Skipping the rest +++\n";
421 if (!lcts_tmb_data.
isValid()) {
422 edm::LogWarning(
"L1CSCTPEmulatorWrongInput") <<
"+++ Warning: Collection of correlated LCTs with label"
423 <<
" MuonCSCCorrelatedLCTDigi requested, but not found in the"
424 <<
" event... Skipping the rest +++\n";
451 <<
"+++ Warning: Collection of emulated ALCTs"
452 <<
" requested, but not found in the event... Skipping the rest +++\n";
457 <<
"+++ Warning: Collection of emulated CLCTs"
458 <<
" requested, but not found in the event... Skipping the rest +++\n";
461 if (!lcts_tmb_emul.
isValid()) {
463 <<
"+++ Warning: Collection of emulated correlated LCTs"
464 <<
" requested, but not found in the event... Skipping the rest +++\n";
544 edm::LogInfo(
"CSCTriggerPrimitivesReader") <<
"\n ALCT efficiencies:";
545 double tot_simh = 0.0, tot_alct = 0.0;
546 for (
int idh = 0; idh <
CSC_TYPES; idh++) {
553 <<
" " <<
csc_type[idh] <<
": alct = " << alct <<
", simh = " << simh <<
" eff = " << eff;
558 <<
" overall: alct = " << tot_alct <<
", simh = " << tot_simh <<
" eff = " << tot_alct / tot_simh;
562 edm::LogInfo(
"CSCTriggerPrimitivesReader") <<
"\n CLCT efficiencies:";
563 double tot_simh = 0.0, tot_clct = 0.0;
564 for (
int idh = 0; idh <
CSC_TYPES; idh++) {
571 <<
" " <<
csc_type[idh] <<
": clct = " << clct <<
", simh = " << simh <<
" eff = " << eff;
576 <<
" overall: clct = " << tot_clct <<
", simh = " << tot_simh <<
" eff = " << tot_clct / tot_simh;
581 double cor = 0.0, tot = 0.0;
585 <<
"\n Correct half-strip assigned in " << cor <<
"/" << tot <<
" = " << cor / tot <<
" of half-strip CLCTs";
594 <<
" Correct wire group assigned in " << cor <<
"/" << tot <<
" = " << cor / tot <<
" of ALCTs";
602 TH1::AddDirectory(
false);
604 gROOT->SetStyle(
"Plain");
605 gStyle->SetFillColor(0);
606 gStyle->SetOptDate();
607 gStyle->SetOptStat(111110);
608 gStyle->SetOptFit(1111);
609 gStyle->SetPadTickX(1);
610 gStyle->SetPadTickY(1);
611 gStyle->SetMarkerSize(0.5);
612 gStyle->SetMarkerStyle(8);
613 gStyle->SetGridStyle(3);
614 gStyle->SetPaperSize(TStyle::kA4);
615 gStyle->SetStatW(0.25);
616 gStyle->SetStatH(0.10);
617 gStyle->SetStatFormat(
"6.4g");
618 gStyle->SetTitleSize(0.055,
"");
621 gStyle->SetLabelSize(0.05,
"XYZ");
622 gStyle->SetStatFontSize(0.06);
623 gStyle->SetTitleFont(32,
"XYZ");
624 gStyle->SetTitleFont(32,
"");
625 gStyle->SetLabelFont(32,
"XYZ");
626 gStyle->SetStatFont(32);
627 gStyle->SetLabelOffset(0.006,
"Y");
635 hHotWire1 = fs->
make<TH1F>(
"hHotWire1",
"hHotWire1", 570 * 6 * 112, 0, 570 * 6 * 112);
636 hHotCham1 = fs->
make<TH1F>(
"hHotCham1",
"hHotCham1", 570, 0, 570);
644 hAlctPerEvent = fs->
make<TH1F>(
"ALCTs_per_event",
"ALCTs per event", 31, -0.5, 30.5);
646 hAlctPerCSC = fs->
make<TH1F>(
"ALCTs_per_CSCtype",
"ALCTs per CSC type", 10, -0.5, 9.5);
660 hAlctValid = fs->
make<TH1F>(
"ALCT_validity",
"ALCT validity", 3, -0.5, 2.5);
661 hAlctQuality = fs->
make<TH1F>(
"ALCT_quality",
"ALCT quality", 5, -0.5, 4.5);
662 hAlctAccel = fs->
make<TH1F>(
"ALCT_accel_flag",
"ALCT accel. flag", 3, -0.5, 2.5);
663 hAlctCollis = fs->
make<TH1F>(
"ALCT_collision_flag",
"ALCT collision. flag", 3, -0.5, 2.5);
664 hAlctKeyGroup = fs->
make<TH1F>(
"ALCT_key_wiregroup",
"ALCT key wiregroup", 120, -0.5, 119.5);
665 hAlctBXN = fs->
make<TH1F>(
"ALCT_bx",
"ALCT bx", 20, -0.5, 19.5);
670 std::cout <<
" bookedALCTHistos " << std::endl;
677 hClctPerEvent = fs->
make<TH1F>(
"CLCTs_per_event",
"CLCTs per event", 31, -0.5, 30.5);
679 hClctPerCSC = fs->
make<TH1F>(
"CLCTs_per_CSCtype",
"CLCTs per CSC type", 10, -0.5, 9.5);
693 hClctValid = fs->
make<TH1F>(
"CLCT_validity",
"CLCT validity", 3, -0.5, 2.5);
694 hClctQuality = fs->
make<TH1F>(
"CLCT_layers_hit",
"CLCT layers hit", 9, -0.5, 8.5);
696 hClctSign = fs->
make<TH1F>(
"CLCT_sing_(L/R)",
"CLCT sign (L/R)", 3, -0.5, 2.5);
697 hClctCFEB = fs->
make<TH1F>(
"CLCT_cfeb_#",
"CLCT cfeb #", 6, -0.5, 5.5);
698 hClctBXN = fs->
make<TH1F>(
"CLCT_bx",
"CLCT bx", 20, -0.5, 19.5);
700 hClctKeyStrip[0] = fs->
make<TH1F>(
"CLCT_keystrip_distrips",
"CLCT keystrip, distrips", 40, -0.5, 39.5);
702 hClctKeyStrip[1] = fs->
make<TH1F>(
"CLCT_keystrip_halfstrips",
"CLCT keystrip, halfstrips", 160, -0.5, 159.5);
703 hClctPattern[0] = fs->
make<TH1F>(
"CLCT_pattern_distrips",
"CLCT pattern, distrips", 13, -0.5, 12.5);
704 hClctPattern[1] = fs->
make<TH1F>(
"CLCT_pattern_halfstrips",
"CLCT pattern, halfstrips", 13, -0.5, 12.5);
709 sprintf(asdf,
"CLCT_bend0_%i",
i + 1);
711 sprintf(asdf,
"CLCT_bend1_%i",
i + 1);
714 sprintf(asdf,
"CLCT_keystrip_%i",
i + 1);
720 hClctKeyStripME11 = fs->
make<TH1F>(
"hClctKeyStripME11",
"CLCT keystrip, halfstrips ME1/1", 161, -0.5, 160.5);
723 std::cout <<
" bookedCLCTHistos " << std::endl;
732 hLctTMBPerCSC = fs->
make<TH1F>(
"LCTs_per_CSCtype",
"LCTs per CSC type", 10, -0.5, 9.5);
733 hCorrLctTMBPerCSC = fs->
make<TH1F>(
"CorrLCTs_per_CSCtype",
"Corr. LCTs per CSC type", 10, -0.5, 9.5);
751 hLctTMBValid = fs->
make<TH1F>(
"LCT_validity",
"LCT validity", 3, -0.5, 2.5);
753 hLctTMBKeyGroup = fs->
make<TH1F>(
"LCT_key_wiregroup",
"LCT key wiregroup", 120, -0.5, 119.5);
757 hLctTMBBend = fs->
make<TH1F>(
"LCT_bend",
"LCT L/R bend", 3, -0.5, 2.5);
763 sprintf(histname,
"LCT_CSCId, station %d", istat + 1);
771 std::cout <<
" bookedLCTTMBHistos " << std::endl;
779 ix = (
id.station() - 2) * 2 + 3;
791 ix = (
id.station() - 2) * 2 + 3 + 1;
801 int st =
id.station();
803 int ch =
id.chamber();
804 int ec =
id.endcap();
806 if (st == 1 && ri == 1)
808 if (st == 1 && ri == 2)
810 if (st == 1 && ri == 3)
812 if (st == 1 && ri == 4)
814 if (st == 2 && ri == 1)
816 if (st == 2 && ri == 2)
818 if (st == 3 && ri == 1)
820 if (st == 3 && ri == 2)
822 if (st == 4 && ri == 1)
824 if (st == 4 && ri == 2)
827 kSerial = kSerial + 300;
834 hLctMPCPerCSC = fs->
make<TH1F>(
"MPC_per_CSCtype",
"LCTs per CSC type", 10, -0.5, 9.5);
841 hLctMPCValid = fs->
make<TH1F>(
"MPC_validity",
"LCT validity", 3, -0.5, 2.5);
843 hLctMPCKeyGroup = fs->
make<TH1F>(
"MPC_key_wiregroup",
"LCT key wiregroup", 120, -0.5, 119.5);
847 hLctMPCBend = fs->
make<TH1F>(
"MPC_bend",
"LCT L/R bend", 3, -0.5, 2.5);
853 sprintf(histname,
"MPC_CSCId, station %d", istat + 1);
862 LogTrace(
"CSCTriggerPrimitivesReader") <<
"bookedLCTMPCHistos ";
863 std::cout <<
" bookedLCTMPCHistos " << std::endl;
873 hAlctCompFound2 = fs->
make<TH2F>(
"h_ALCT_found2",
"h_ALCT_found2", 19, -9.5, 9.5, 36, 0.5, 36.5);
874 hAlctCompFound2x = fs->
make<TH2F>(
"h_ALCT_found2x",
"h_ALCT_found2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
877 hAlctCompSameN2 = fs->
make<TH2F>(
"h_ALCT_SameN2",
"h_ALCT_SameN2", 19, -9.5, 9.5, 36, 0.5, 36.5);
878 hAlctCompSameN2x = fs->
make<TH2F>(
"h_ALCT_SameN2x",
"h_ALCT_SameN2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
881 hAlctCompMatch2 = fs->
make<TH2F>(
"h_ALCT_match2",
"h_ALCT_match2", 19, -9.5, 9.5, 36, 0.5, 36.5);
882 hAlctCompMatch2x = fs->
make<TH2F>(
"h_ALCT_match2x",
"h_ALCT_match2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
885 hAlctCompTotal2 = fs->
make<TH2F>(
"h_ALCT_total2",
"h_ALCT_total2", 19, -9.5, 9.5, 36, 0.5, 36.5);
886 hAlctCompTotal2x = fs->
make<TH2F>(
"h_ALCT_total2x",
"h_ALCT_total2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
889 hClctCompFound2 = fs->
make<TH2F>(
"h_CLCT_found2",
"h_CLCT_found2", 19, -9.5, 9.5, 36, 0.5, 36.5);
890 hClctCompFound2x = fs->
make<TH2F>(
"h_CLCT_found2x",
"h_CLCT_found2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
893 hClctCompSameN2 = fs->
make<TH2F>(
"h_CLCT_SameN2",
"h_CLCT_SameN2", 19, -9.5, 9.5, 36, 0.5, 36.5);
894 hClctCompSameN2x = fs->
make<TH2F>(
"h_CLCT_SameN2x",
"h_CLCT_SameN2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
897 hClctCompMatch2 = fs->
make<TH2F>(
"h_CLCT_match2",
"h_CLCT_match2", 19, -9.5, 9.5, 36, 0.5, 36.5);
898 hClctCompMatch2x = fs->
make<TH2F>(
"h_CLCT_match2x",
"h_CLCT_match2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
901 hClctCompTotal2 = fs->
make<TH2F>(
"h_CLCT_total2",
"h_CLCT_total2", 19, -9.5, 9.5, 36, 0.5, 36.5);
902 hClctCompTotal2x = fs->
make<TH2F>(
"h_CLCT_total2x",
"h_CLCT_total2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
905 hLCTCompFound2 = fs->
make<TH2F>(
"h_LCT_found2",
"h_LCT_found2", 19, -9.5, 9.5, 36, 0.5, 36.5);
906 hLCTCompFound2x = fs->
make<TH2F>(
"h_LCT_found2x",
"h_LCT_found2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
909 hLCTCompSameN2 = fs->
make<TH2F>(
"h_LCT_SameN2",
"h_LCT_SameN2", 19, -9.5, 9.5, 36, 0.5, 36.5);
910 hLCTCompSameN2x = fs->
make<TH2F>(
"h_LCT_SameN2x",
"h_LCT_SameN2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
913 hLCTCompMatch2 = fs->
make<TH2F>(
"h_LCT_match2",
"h_LCT_match2", 19, -9.5, 9.5, 36, 0.5, 36.5);
914 hLCTCompMatch2x = fs->
make<TH2F>(
"h_LCT_match2x",
"h_LCT_match2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
917 hLCTCompTotal2 = fs->
make<TH2F>(
"h_LCT_total2",
"h_LCT_total2", 19, -9.5, 9.5, 36, 0.5, 36.5);
918 hLCTCompTotal2x = fs->
make<TH2F>(
"h_LCT_total2x",
"h_LCT_total2x", 19, -9.5, 9.5, 18, 0.5, 36.5);
921 hAlctCompFound2i = fs->
make<TH2F>(
"h_ALCT_found2i",
"h_ALCT_found2i", 18, 0, 18, 36, 0.5, 36.5);
922 hAlctCompSameN2i = fs->
make<TH2F>(
"h_ALCT_SameN2i",
"h_ALCT_SameN2i", 18, 0, 18, 36, 0.5, 36.5);
923 hAlctCompMatch2i = fs->
make<TH2F>(
"h_ALCT_match2i",
"h_ALCT_match2i", 18, 0, 18, 36, 0.5, 36.5);
924 hAlctCompTotal2i = fs->
make<TH2F>(
"h_ALCT_total2i",
"h_ALCT_total2i", 18, 0, 18, 36, 0.5, 36.5);
925 hClctCompFound2i = fs->
make<TH2F>(
"h_CLCT_found2i",
"h_CLCT_found2i", 18, 0, 18, 36, 0.5, 36.5);
926 hClctCompSameN2i = fs->
make<TH2F>(
"h_CLCT_SameN2i",
"h_CLCT_SameN2i", 18, 0, 18, 36, 0.5, 36.5);
927 hClctCompMatch2i = fs->
make<TH2F>(
"h_CLCT_match2i",
"h_CLCT_match2i", 18, 0, 18, 36, 0.5, 36.5);
928 hClctCompTotal2i = fs->
make<TH2F>(
"h_CLCT_total2i",
"h_CLCT_total2i", 18, 0, 18, 36, 0.5, 36.5);
929 hLCTCompFound2i = fs->
make<TH2F>(
"h_LCT_found2i",
"h_LCT_found2i", 18, 0, 18, 36, 0.5, 36.5);
930 hLCTCompSameN2i = fs->
make<TH2F>(
"h_LCT_SameN2i",
"h_LCT_SameN2i", 18, 0, 18, 36, 0.5, 36.5);
931 hLCTCompMatch2i = fs->
make<TH2F>(
"h_LCT_match2i",
"h_LCT_match2i", 18, 0, 18, 36, 0.5, 36.5);
932 hLCTCompTotal2i = fs->
make<TH2F>(
"h_LCT_total2i",
"h_LCT_total2i", 18, 0, 18, 36, 0.5, 36.5);
946 sprintf(asdf,
"Comp_ALCTsFound_%i",
i *
CSC_TYPES +
j);
948 sprintf(asdf,
"Comp_ALCTsSame_%i",
i *
CSC_TYPES +
j);
950 sprintf(asdf,
"Comp_ALCTsTotal_%i",
i *
CSC_TYPES +
j);
952 sprintf(asdf,
"Comp_ALCTsMatch_%i",
i *
CSC_TYPES +
j);
970 sprintf(asdf,
"Comp_CLCTsFound_%i",
i *
CSC_TYPES +
j);
972 sprintf(asdf,
"Comp_CLCTsSame_%i",
i *
CSC_TYPES +
j);
974 sprintf(asdf,
"Comp_CLCTsTotal_%i",
i *
CSC_TYPES +
j);
976 sprintf(asdf,
"Comp_CLCTsMatch_%i",
i *
CSC_TYPES +
j);
994 sprintf(asdf,
"LCTs_CompFound_%i",
i *
CSC_TYPES +
j);
996 sprintf(asdf,
"LCTs_CompSame_%i",
i *
CSC_TYPES +
j);
998 sprintf(asdf,
"LCTs_CompTotal_%i",
i *
CSC_TYPES +
j);
1000 sprintf(asdf,
"LCTs_CompMatch_%i",
i *
CSC_TYPES +
j);
1011 LogTrace(
"CSCTriggerPrimitivesReader") <<
"bookedCompHistos ";
1012 std::cout <<
"bookCompHistos " << std::endl;
1019 const double EDMIN = -0.05;
1020 const double EDMAX = 0.05;
1021 const double PDMIN = -5.0;
1022 const double PDMAX = 5.0;
1034 hEtaRecVsSim = fs->
make<TH2F>(
"",
"#eta_rec vs #eta_sim", 64, 0.9, 2.5, 64, 0.9, 2.5);
1040 sprintf(histname,
"ALCTs vs eta, station %d",
i + 1);
1043 sprintf(histname,
"CLCTs vs phi, station %d",
i + 1);
1046 sprintf(histname,
"#LT#eta_rec-#eta_sim#GT, station %d",
i + 1);
1049 sprintf(histname,
"#LT#phi_rec-#phi_sim#GT, station %d",
i + 1);
1056 string t1 =
t0 +
", endcap1";
1058 string t2 =
t0 +
", endcap2";
1061 string t4 =
"#eta_rec-#eta_sim vs wiregroup, " +
csc_type[
i];
1064 string u0 =
"#phi_rec-#phi_sim, " +
csc_type[
i];
1066 string u1 = u0 +
", endcap1";
1068 string u2 = u0 +
", endcap2";
1074 string u5 =
"#phi_rec-#phi_sim (mrad) vs distrip, " +
csc_type[
i];
1076 string u6 =
"#phi_rec-#phi_sim (mrad) vs halfstrip, " +
csc_type[
i];
1079 string u7 =
"#phi(layer 1)-#phi(layer 6), mrad, " +
csc_type[
i];
1083 int max_patterns, phibend;
1085 for (
int i = 0;
i < max_patterns;
i++) {
1087 sprintf(histname,
"#phi_rec-#phi_sim, bend = %d", phibend);
1093 LogTrace(
"CSCTriggerPrimitivesReader") <<
"bookedResolHistos ";
1102 sprintf(histname,
"SimHits vs eta, station %d",
i + 1);
1105 sprintf(histname,
"ALCTs vs eta, station %d",
i + 1);
1108 sprintf(histname,
"CLCTs vs eta, station %d",
i + 1);
1124 LogTrace(
"CSCTriggerPrimitivesReader") <<
"bookedEfficHistos ";
1125 std::cout <<
" bookedEfficHistos " << std::endl;
1133 int nValidALCTs = 0;
1134 for (
auto detUnitIt = alcts->begin(); detUnitIt != alcts->end(); detUnitIt++) {
1135 int nValidALCTsPerCSC = 0;
1136 const CSCDetId&
id = (*detUnitIt).first;
1139 const auto&
range = (*detUnitIt).second;
1140 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
1141 bool alct_valid = (*digiIt).isValid();
1145 hAlctAccel->Fill((*digiIt).getAccelerator());
1158 nValidALCTsPerCSC++;
1161 LogTrace(
"CSCTriggerPrimitivesReader")
1162 << (*digiIt) <<
" found in ME" << ((
id.endcap() == 1) ?
"+" :
"-") <<
id.station() <<
"/" <<
id.ring()
1163 <<
"/" <<
id.chamber() <<
" (sector " <<
id.triggerSector() <<
" trig id. " <<
id.triggerCscId() <<
")";
1171 LogTrace(
"CSCTriggerPrimitivesReader") << nValidALCTs <<
" valid ALCTs found in this event";
1180 int nValidCLCTs = 0;
1181 for (
auto detUnitIt = clcts->begin(); detUnitIt != clcts->end(); detUnitIt++) {
1182 int nValidCLCTsPerCSC = 0;
1183 const CSCDetId&
id = (*detUnitIt).first;
1186 const auto&
range = (*detUnitIt).second;
1187 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
1188 bool clct_valid = (*digiIt).isValid();
1191 int striptype = (*digiIt).getStripType();
1192 int keystrip = (*digiIt).getKeyStrip();
1207 if (striptype == 1 && csctype == 0)
1211 int pattern = (*digiIt).getPattern();
1219 nValidCLCTsPerCSC++;
1222 LogTrace(
"CSCTriggerPrimitivesReader")
1223 << (*digiIt) <<
" found in ME" << ((
id.endcap() == 1) ?
"+" :
"-") <<
id.station() <<
"/" <<
id.ring()
1224 <<
"/" <<
id.chamber() <<
" (sector " <<
id.triggerSector() <<
" trig id. " <<
id.triggerCscId() <<
")";
1231 LogTrace(
"CSCTriggerPrimitivesReader") << nValidCLCTs <<
" valid CLCTs found in this event";
1241 bool alct_valid, clct_valid;
1243 for (
auto detUnitIt = lcts->begin(); detUnitIt != lcts->end(); detUnitIt++) {
1244 int nValidLCTsPerCSC = 0;
1245 const CSCDetId&
id = (*detUnitIt).first;
1248 const auto&
range = (*detUnitIt).second;
1249 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
1250 bool lct_valid = (*digiIt).isValid();
1259 int quality = (*digiIt).getQuality();
1280 if (alct_valid && clct_valid)
1283 if (alct_valid && csctype == 0) {
1286 if (clct_valid && csctype == 0) {
1294 LogTrace(
"CSCTriggerPrimitivesReader")
1295 << (*digiIt) <<
" found in ME" << ((
id.endcap() == 1) ?
"+" :
"-") <<
id.station() <<
"/" <<
id.ring()
1296 <<
"/" <<
id.chamber() <<
" (sector " <<
id.triggerSector() <<
" trig id. " <<
id.triggerCscId() <<
")";
1303 LogTrace(
"CSCTriggerPrimitivesReader") << nValidLCTs <<
" valid LCTs found in this event";
1313 bool alct_valid, clct_valid;
1315 for (
auto detUnitIt = lcts->begin(); detUnitIt != lcts->end(); detUnitIt++) {
1316 const CSCDetId&
id = (*detUnitIt).first;
1319 const auto&
range = (*detUnitIt).second;
1320 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
1321 bool lct_valid = (*digiIt).isValid();
1330 int quality = (*digiIt).getQuality();
1350 if (alct_valid && clct_valid)
1353 if (alct_valid && csctype == 0) {
1356 if (clct_valid && csctype == 0) {
1363 LogTrace(
"CSCTriggerPrimitivesReader")
1364 <<
"MPC " << (*digiIt) <<
" found in ME" << ((
id.endcap() == 1) ?
"+" :
"-") <<
id.station() <<
"/"
1365 <<
id.ring() <<
"/" <<
id.chamber() <<
" (sector " <<
id.triggerSector() <<
" trig id. "
1366 <<
id.triggerCscId() <<
")";
1372 LogTrace(
"CSCTriggerPrimitivesReader") << nValidLCTs <<
" MPC LCTs found in this event";
1390 compareLCTs(lcts_data, lcts_emul, alcts_data, clcts_data);
1399 int fifo_pretrig = 10;
1400 int fpga_latency = 6;
1401 int l1a_window_width = 7;
1403 int rawhit_tbin_offset = (fifo_pretrig - fpga_latency) + (l1a_window_width - 1) / 2;
1406 int register_delay = 2;
1408 std::vector<CSCALCTDigi>::const_iterator pd, pe;
1409 for (
int endc = 1; endc <= 2; endc++) {
1419 std::vector<CSCALCTDigi> alctV_data, alctV_emul;
1420 const auto& drange = alcts_data->get(detid);
1421 for (
auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
1422 if ((*digiIt).isValid()) {
1423 alctV_data.push_back(*digiIt);
1427 const auto& erange = alcts_emul->get(detid);
1428 std::vector<bool> bookedalctV_emul;
1429 for (
auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
1430 if ((*digiIt).isValid()) {
1431 alctV_emul.push_back(*digiIt);
1432 bookedalctV_emul.push_back(
false);
1436 int ndata = alctV_data.size();
1437 int nemul = alctV_emul.size();
1439 if (ndata == 0 && nemul == 0)
1441 bool firstfill =
true;
1444 ostringstream strstrm;
1445 strstrm <<
"\n--- ME" << ((detid.
endcap() == 1) ?
"+" :
"-") << detid.
station() <<
"/" << detid.
ring()
1448 strstrm <<
" **** " << ndata <<
" valid data ALCTs found:\n";
1449 for (pd = alctV_data.begin(); pd != alctV_data.end(); pd++) {
1450 strstrm <<
" " << (*pd) <<
" Full BX = " << (*pd).getFullBX() <<
"\n";
1452 strstrm <<
" **** " << nemul <<
" valid emul ALCTs found:\n";
1453 for (pe = alctV_emul.begin(); pe != alctV_emul.end(); pe++) {
1454 strstrm <<
" " << (*pe);
1455 for (pd = alctV_data.begin(); pd != alctV_data.end(); pd++) {
1456 if ((*pd).getTrknmb() == (*pe).getTrknmb()) {
1457 int emul_bx = (*pe).getBX();
1458 emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay;
1459 strstrm <<
" Corr BX = " << emul_corr_bx;
1465 LogTrace(
"CSCTriggerPrimitivesReader") << strstrm.str();
1471 int perEv_nStub_data = 0;
1472 int perEv_nStub_emul = 0;
1475 for (pd = alctV_data.begin(); pd != alctV_data.end(); pd++) {
1487 for (pe = alctV_emul.begin(); pe != alctV_emul.end(); pe++) {
1514 if (ndata != nemul) {
1515 LogTrace(
"CSCTriggerPrimitivesReader")
1516 <<
" +++ Different numbers of ALCTs found in ME" << ((endc == 1) ?
"+" :
"-") <<
stat <<
"/" <<
ring
1517 <<
"/" <<
cham <<
": data = " << ndata <<
" emulator = " << nemul <<
" +++\n";
1528 for (
int i = 0;
i < ndata;
i++) {
1529 if (alctV_data[
i].isValid() == 0)
1531 int data_trknmb = alctV_data[
i].getTrknmb();
1535 int data_wiregroup = alctV_data[
i].getKeyWG();
1536 int data_bx = alctV_data[
i].getBX();
1560 for (
int j = 0;
j < nemul;
j++) {
1561 if (alctV_emul[
j].isValid() == 0)
1563 if (bookedalctV_emul[
j])
1566 int emul_trknmb = alctV_emul[
j].getTrknmb();
1570 int emul_wiregroup = alctV_emul[
j].getKeyWG();
1571 int emul_bx = alctV_emul[
j].getBX();
1573 emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay;
1575 emul_corr_bx = emul_bx;
1577 if (ndata == nemul) {
1587 if (data_trknmb == emul_trknmb) {
1588 if (
abs(data_wiregroup - emul_wiregroup) <= 2) {
1599 LogTrace(
"CSCTriggerPrimitivesReader") <<
" Identical ALCTs #" << data_trknmb;
1609 bookedalctV_emul[
j] =
true;
1612 LogTrace(
"CSCTriggerPrimitivesReader")
1613 <<
" Different ALCTs #" << data_trknmb <<
" in ME" << ((endc == 1) ?
"+" :
"-") <<
stat <<
"/"
1619 LogTrace(
"CSCTriggerPrimitivesReader")
1620 <<
" not matched ALCT from data " << alctV_data[
i] <<
" stubs_comparison 0 key_WG_data "
1626 for (
int i = 0;
i < nemul;
i++) {
1627 if (alctV_emul[
i].isValid() == 0
or bookedalctV_emul[
i])
1629 int emul_bx = alctV_emul[
i].getBX();
1655 emul_corr_bx = emul_bx - rawhit_tbin_offset + register_delay;
1657 emul_corr_bx = emul_bx;
1661 LogTrace(
"CSCTriggerPrimitivesReader") <<
"not matched ALCT from emulation " << alctV_emul[
i];
1674 const int tbin_cathode_offset = 7;
1676 const int pretrig_trig_zone = 5;
1679 std::vector<CSCCLCTDigi>::const_iterator pd, pe;
1680 std::vector<CSCCLCTPreTriggerDigi>::const_iterator pretrig;
1683 for (
int endc = 1; endc <= 2; endc++) {
1694 std::vector<CSCCLCTDigi> clctV_data, clctV_emul;
1695 const auto& drange = clcts_data->get(detid);
1696 for (
auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
1697 if ((*digiIt).isValid()) {
1698 clctV_data.push_back(*digiIt);
1702 const auto& erange = clcts_emul->get(detid);
1703 std::vector<bool> bookedclctV_emul;
1704 for (
auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
1705 if ((*digiIt).isValid()) {
1706 for (
auto pclct : clctV_emul) {
1707 if (digiIt->getBX() != pclct.getBX() and
abs(digiIt->getBX() - pclct.getBX()) < 5)
1708 LogTrace(
"CSCTriggerPrimitivesReader")
1709 <<
"Two CLCTs very close in timing!!! Special event: first clct " << pclct <<
" second clct "
1710 << *digiIt << std::endl;
1712 clctV_emul.push_back(*digiIt);
1713 bookedclctV_emul.push_back(
false);
1717 std::vector<CSCCLCTPreTriggerDigi> pretrigV_emul;
1718 const auto& pretrigrange = pretrigs_emul->
get(detid);
1719 for (
auto pretrigIt = pretrigrange.first; pretrigIt != pretrigrange.second; pretrigIt++) {
1720 if ((*pretrigIt).isValid()) {
1721 pretrigV_emul.push_back(*pretrigIt);
1725 int ndata = clctV_data.size();
1726 int nemul = clctV_emul.size();
1727 if (ndata == 0 && nemul == 0)
1729 bool firstfill =
true;
1730 int nemul_readout = 0;
1731 for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1732 for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1733 int emul_bx = (*pe).getBX();
1734 int corr_bx = ((*pd).getFullBX() + emul_bx - tbin_cathode_offset) & 0x03;
1735 int bx_data = pd->getBX();
1737 if (corr_bx == bx_data) {
1744 if (
debug or nemul > ndata
or (ndata != nemul)
or ndata != nemul_readout) {
1745 LogTrace(
"CSCTriggerPrimitivesReader")
1746 <<
" CLCTs from data " << ndata <<
" CLCTs from emul " << nemul <<
" readout " << nemul_readout;
1747 ostringstream strstrm;
1748 strstrm <<
"\n--- ME" << ((detid.
endcap() == 1) ?
"+" :
"-") << detid.
station() <<
"/" << detid.
ring()
1751 strstrm <<
" **** " << ndata <<
" valid data CLCTs found:\n";
1752 for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1753 strstrm <<
" " << (*pd) <<
" Full BX = " << (*pd).getFullBX() <<
"\n";
1755 strstrm <<
" **** " << nemul <<
" valid emul CLCTs found:\n";
1756 for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1757 strstrm <<
" " << (*pe);
1758 for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1759 if ((*pd).getTrknmb() == (*pe).getTrknmb()
or abs((*pe).getKeyStrip() - (*pd).getKeyStrip()) < 5) {
1760 int emul_bx = (*pe).getBX();
1761 int corr_bx = ((*pd).getFullBX() + emul_bx - tbin_cathode_offset) & 0x03;
1762 strstrm <<
" Corr BX = " << corr_bx;
1768 LogTrace(
"CSCTriggerPrimitivesReader") << strstrm.str();
1770 if (nemul_readout > 2) {
1777 int perEv_nStub_data = 0;
1778 int perEv_nStub_emul = 0;
1781 for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1793 for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1815 if (ndata != nemul) {
1816 LogTrace(
"CSCTriggerPrimitivesReader")
1818 <<
" +++ Different numbers of CLCTs found in ME" << ((endc == 1) ?
"+" :
"-") <<
stat <<
"/" <<
ring
1819 <<
"/" <<
cham <<
": data = " << ndata <<
" emulator = " << nemul <<
" +++\n";
1831 for (pd = clctV_data.begin(); pd != clctV_data.end(); pd++) {
1833 if ((*pd).isValid() == 0)
1835 int data_trknmb = (*pd).getTrknmb();
1836 int data_quality = (*pd).getQuality();
1837 int data_pattern = (*pd).getPattern();
1838 int data_striptype = (*pd).getStripType();
1839 int data_bend = (*pd).getBend();
1840 int data_keystrip = (*pd).getKeyStrip();
1841 int data_cfeb = (*pd).getCFEB();
1842 int data_bx = (*pd).getBX();
1843 int fullBX = (*pd).getFullBX();
1845 if (data_keystrip >= 128 and
stat == 1 and
ring == 1)
1876 for (pe = clctV_emul.begin(); pe != clctV_emul.end(); pe++) {
1878 if ((*pe).isValid() == 0)
1880 if (bookedclctV_emul[
j])
1882 int emul_trknmb = (*pe).getTrknmb();
1883 int emul_quality = (*pe).getQuality();
1884 int emul_pattern = (*pe).getPattern();
1885 int emul_striptype = (*pe).getStripType();
1886 int emul_bend = (*pe).getBend();
1887 int emul_keystrip = (*pe).getKeyStrip();
1888 int emul_cfeb = (*pe).getCFEB();
1889 int emul_bx = (*pe).getBX();
1891 if (
abs(data_keystrip - emul_keystrip) <= 2) {
1894 int emul_corr_bx = (fullBX + emul_bx - tbin_cathode_offset) & 0x03;
1897 emul_corr_bx = (emul_bx & 0x03);
1898 if (ndata == nemul) {
1907 if (data_quality == emul_quality && data_pattern == emul_pattern && data_striptype == emul_striptype &&
1908 data_bend == emul_bend && data_keystrip == emul_keystrip && data_cfeb == emul_cfeb) {
1909 if (ndata == nemul) {
1919 LogTrace(
"CSCTriggerPrimitivesReader") <<
" Identical CLCTs #" << data_trknmb;
1921 LogTrace(
"CSCTriggerPrimitivesReader")
1922 <<
" Different CLCTs #" << data_trknmb <<
" in ME" << ((endc == 1) ?
"+" :
"-") <<
stat
1923 <<
"/" <<
ring <<
"/" <<
cham <<
" data_bx " << data_bx <<
" emul_corr_bx " << emul_corr_bx;
1936 bookedclctV_emul[
j] =
true;
1939 int num_pretrig = 0;
1940 for (pretrig = pretrigV_emul.begin(); pretrig != pretrigV_emul.end(); pretrig++) {
1941 if ((*pretrig).getBX() != (*pe).getBX())
1943 int hsgap =
std::abs((*pretrig).getKeyStrip() - (*pe).getKeyStrip());
1944 bool samechamber =
true;
1946 samechamber = (((*pretrig).getKeyStrip() < 128 and (*pe).getKeyStrip() < 128) ||
1947 ((*pretrig).getKeyStrip() >= 128 and (*pe).getKeyStrip() >= 128));
1948 if (not samechamber)
1951 if (hsgap <= pretrig_trig_zone)
1970 LogTrace(
"CSCTriggerPrimitivesReader")
1971 <<
"CSCDetid " << detid <<
" not matched CLCT from data " << (*pd)
1977 for (
int k = 0;
k < nemul;
k++) {
1978 if (clctV_emul[
i].isValid() == 0)
1980 if (bookedclctV_emul[
k])
2006 if (clctV_emul[
k].getKeyStrip() >= 128 and
stat == 1 and
ring == 1)
2013 bookedclctV_emul[
k] =
true;
2029 std::vector<CSCCorrelatedLCTDigi>::const_iterator pd, pe;
2030 for (
int endc = 1; endc <= 2; endc++) {
2041 std::vector<CSCCorrelatedLCTDigi> lctV_data, lctV_emul;
2042 std::vector<bool> bookedlctV_emul;
2043 const auto& drange = lcts_data->get(detid);
2044 for (
auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
2045 if ((*digiIt).isValid()) {
2046 lctV_data.push_back(*digiIt);
2050 const auto& erange = lcts_emul->get(detid);
2051 for (
auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
2052 if ((*digiIt).isValid()) {
2053 lctV_emul.push_back(*digiIt);
2054 bookedlctV_emul.push_back(
false);
2058 int ndata = lctV_data.size();
2059 int nemul = lctV_emul.size();
2060 if (ndata == 0 && nemul == 0)
2062 bool firstfill =
true;
2063 int nemul_readout = 0;
2064 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2065 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2066 int bx_data = pd->getBX();
2067 int bx_corr =
convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data);
2068 if ((bx_data == bx_corr)
or (
abs(pe->getKeyWG() - pd->getKeyWG()) <= 2)) {
2075 if (
debug or nemul > ndata
or (nemul_readout != ndata)
or nemul != ndata) {
2076 LogTrace(
"CSCTriggerPrimitivesReader")
2077 <<
" LCTs from data " << ndata <<
" LCTs from emul " << nemul <<
" readout " << nemul_readout;
2078 ostringstream strstrm;
2079 strstrm <<
"\n--- ME" << ((detid.
endcap() == 1) ?
"+" :
"-") << detid.
station() <<
"/" << detid.
ring()
2082 strstrm <<
" **** " << ndata <<
" valid data LCTs found:\n";
2083 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2084 strstrm <<
" " << (*pd);
2086 strstrm <<
"\n **** " << nemul <<
" valid emul LCTs found:\n";
2087 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2088 strstrm <<
" " << (*pe);
2089 strstrm <<
" corr BX = " <<
convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data);
2090 strstrm <<
" LCT pattern = " << (*pe).getPattern();
2093 LogTrace(
"CSCTriggerPrimitivesReader") << strstrm.str();
2096 if (nemul_readout > 2) {
2103 int perEv_nStub_data = 0;
2104 int perEv_nStub_emul = 0;
2107 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2119 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2141 if (ndata != nemul) {
2142 LogTrace(
"CSCTriggerPrimitivesReader")
2144 <<
" +++ Different numbers of LCTs found in ME" << ((endc == 1) ?
"+" :
"-") <<
stat <<
"/" <<
ring
2145 <<
"/" <<
cham <<
": data = " << ndata <<
" emulator = " << nemul <<
" +++\n";
2156 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2158 if ((*pd).isValid() == 0)
2160 int data_trknmb = (*pd).getTrknmb();
2161 int data_quality = (*pd).getQuality();
2162 int data_wiregroup = (*pd).getKeyWG();
2163 int data_keystrip = (*pd).getStrip();
2164 int data_pattern = (*pd).getCLCTPattern();
2165 int data_striptype = (*pd).getStripType();
2166 int data_bend = (*pd).getBend();
2167 int data_bx = (*pd).getBX();
2197 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2199 if ((*pe).isValid() == 0)
2201 if (bookedlctV_emul[
j])
2203 int emul_trknmb = (*pe).getTrknmb();
2204 int emul_quality = (*pe).getQuality();
2205 int emul_wiregroup = (*pe).getKeyWG();
2206 int emul_keystrip = (*pe).getStrip();
2207 int emul_pattern = (*pe).getCLCTPattern();
2208 int emul_striptype = (*pe).getStripType();
2209 int emul_bend = (*pe).getBend();
2210 int emul_bx = (*pe).getBX();
2211 if (
abs(data_keystrip - emul_keystrip) <= 2 ||
abs(data_wiregroup - emul_wiregroup) <= 2) {
2214 int emul_corr_bx =
convertBXofLCT(emul_bx, detid, alcts_data, clcts_data);
2217 emul_corr_bx = (emul_bx & 0x01);
2219 if (ndata == nemul) {
2228 if (data_quality == emul_quality && data_wiregroup == emul_wiregroup &&
2229 data_keystrip == emul_keystrip && data_pattern == emul_pattern &&
2230 data_striptype == emul_striptype && data_bend == emul_bend) {
2231 if (ndata == nemul) {
2241 LogTrace(
"CSCTriggerPrimitivesReader") <<
" Identical LCTs #" << data_trknmb;
2243 LogTrace(
"CSCTriggerPrimitivesReader")
2244 <<
" Different LCTs #" << data_trknmb <<
" in ME" << ((endc == 1) ?
"+" :
"-") <<
stat
2245 <<
"/" <<
ring <<
"/" <<
cham <<
" data_lct bx " << data_bx <<
" emul bx " << emul_corr_bx;
2262 bookedlctV_emul[
j] =
true;
2267 LogTrace(
"CSCTriggerPrimitivesReader")
2268 <<
"CSCDetid " << detid <<
" not matched LCT from Data " << (*pd)
2273 for (
int k = 0;
k < nemul;
k++) {
2274 if (bookedlctV_emul[
k])
2276 if (lctV_emul[
i].isValid() == 0)
2306 bookedlctV_emul[
k] =
true;
2322 std::vector<CSCCorrelatedLCTDigi>::const_iterator pd, pe;
2323 for (
int endc = 1; endc <= 2; endc++) {
2334 std::vector<CSCCorrelatedLCTDigi> lctV_data, lctV_emul;
2335 std::vector<bool> bookedlctV_emul;
2336 const auto& drange = lcts_data->get(detid);
2337 for (
auto digiIt = drange.first; digiIt != drange.second; digiIt++) {
2338 if ((*digiIt).isValid()) {
2339 lctV_data.push_back(*digiIt);
2343 const auto& erange = lcts_emul->get(detid);
2344 for (
auto digiIt = erange.first; digiIt != erange.second; digiIt++) {
2345 if ((*digiIt).isValid()) {
2346 lctV_emul.push_back(*digiIt);
2347 bookedlctV_emul.push_back(
false);
2351 int ndata = lctV_data.size();
2352 int nemul = lctV_emul.size();
2353 if (ndata == 0 && nemul == 0)
2355 bool firstfill =
true;
2358 ostringstream strstrm;
2359 strstrm <<
"\n--- ME" << ((detid.
endcap() == 1) ?
"+" :
"-") << detid.
station() <<
"/" << detid.
ring()
2362 strstrm <<
" **** " << ndata <<
" valid data LCTs found:\n";
2363 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2364 strstrm <<
" " << (*pd);
2366 strstrm <<
"\n **** " << nemul <<
" valid emul LCTs found:\n";
2367 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2368 strstrm <<
" " << (*pe);
2369 strstrm <<
" corr BX = " <<
convertBXofLCT((*pe).getBX(), detid, alcts_data, clcts_data);
2370 strstrm <<
" LCT pattern = " << (*pe).getPattern();
2373 LogTrace(
"CSCTriggerPrimitivesReader") << strstrm.str();
2379 if (ndata != nemul) {
2380 LogTrace(
"CSCTriggerPrimitivesReader")
2381 <<
" +++ Different numbers of MPC LCTs found in ME" << ((endc == 1) ?
"+" :
"-") <<
stat <<
"/"
2382 <<
ring <<
"/" <<
cham <<
": data = " << ndata <<
" emulator = " << nemul <<
" +++\n";
2395 for (pd = lctV_data.begin(); pd != lctV_data.end(); pd++) {
2397 if ((*pd).isValid() == 0)
2399 int data_trknmb = (*pd).getTrknmb();
2400 int data_quality = (*pd).getQuality();
2401 int data_wiregroup = (*pd).getKeyWG();
2402 int data_keystrip = (*pd).getStrip();
2403 int data_pattern = (*pd).getCLCTPattern();
2404 int data_striptype = (*pd).getStripType();
2405 int data_bend = (*pd).getBend();
2406 int data_bx = (*pd).getBX();
2434 for (pe = lctV_emul.begin(); pe != lctV_emul.end(); pe++) {
2436 if ((*pe).isValid() == 0)
2438 int emul_trknmb = (*pe).getTrknmb();
2439 int emul_quality = (*pe).getQuality();
2440 int emul_wiregroup = (*pe).getKeyWG();
2441 int emul_keystrip = (*pe).getStrip();
2442 int emul_pattern = (*pe).getCLCTPattern();
2443 int emul_striptype = (*pe).getStripType();
2444 int emul_bend = (*pe).getBend();
2445 int emul_bx = (*pe).getBX();
2446 if (data_trknmb == emul_trknmb) {
2449 int emul_corr_bx =
convertBXofLCT(emul_bx, detid, alcts_data, clcts_data);
2452 emul_corr_bx = (emul_bx & 0x01);
2464 if (data_quality == emul_quality && data_wiregroup == emul_wiregroup &&
2465 data_keystrip == emul_keystrip && data_pattern == emul_pattern &&
2466 data_striptype == emul_striptype && data_bend == emul_bend) {
2479 LogTrace(
"CSCTriggerPrimitivesReader") <<
" Identical LCTs #" << data_trknmb;
2494 bookedlctV_emul[
j] =
true;
2497 LogTrace(
"CSCTriggerPrimitivesReader")
2499 <<
" Different LCTs #" << data_trknmb <<
" in ME" << ((endc == 1) ?
"+" :
"-") <<
stat
2500 <<
"/" <<
ring <<
"/" <<
cham <<
" data_lct bx " << data_bx <<
" emul bx " << emul_corr_bx;
2505 LogTrace(
"CSCTriggerPrimitivesReader")
2511 for (
int k = 0;
k < nemul;
k++) {
2512 if (bookedlctV_emul[
k])
2544 bookedlctV_emul[
k] =
true;
2557 int full_anode_bx = -999;
2560 int tbin_anode_offset = 5;
2563 const auto& arange = alcts_data->get(detid);
2564 for (
auto digiIt = arange.first; digiIt != arange.second; digiIt++) {
2565 if ((*digiIt).isValid()) {
2566 full_anode_bx = (*digiIt).getFullBX();
2572 const auto& crange = clcts_data->get(detid);
2573 for (
auto digiIt = crange.first; digiIt != crange.second; digiIt++) {
2574 if ((*digiIt).isValid()) {
2581 if (full_anode_bx == -999) {
2583 edm::LogWarning(
"L1CSCTPEmulatorWrongInput") <<
"+++ Warning in convertBXofLCT(): full anode BX is not available!"
2589 lct_bx = (full_anode_bx + emul_bx - tbin_anode_offset) & 0x01;
2605 int serial_old = -1;
2606 for (
auto dWDiter =
wires->begin(); dWDiter !=
wires->end(); dWDiter++) {
2610 std::vector<CSCWireDigi>::const_iterator wireIter = (*dWDiter).second.first;
2611 std::vector<CSCWireDigi>::const_iterator lWire = (*dWDiter).second.second;
2612 bool has_layer =
false;
2613 for (; wireIter != lWire; ++wireIter) {
2615 int i_layer =
id.layer() - 1;
2616 int i_wire = wireIter->getWireGroup() - 1;
2617 int nbins = wireIter->getTimeBinsOn().size();
2618 int serial2 = serial * (6 * 112) + i_layer * 112 + i_wire;
2630 if (serial_old != serial && has_layer) {
2634 serial_old = serial;
2646 vector<edm::Handle<edm::HepMCProduct> > allhepmcp;
2648 ev.getManyByType(allhepmcp);
2651 if (!allhepmcp.empty()) {
2654 for (HepMC::GenEvent::particle_const_iterator
p =
mc.particles_begin();
p !=
mc.particles_end(); ++
p) {
2655 int id = (*p)->pdg_id();
2656 double phitmp = (*p)->momentum().phi();
2658 phitmp += 2. *
M_PI;
2660 LogDebug(
"CSCTriggerPrimitivesReader")
2661 <<
"MC part #" << ++
i <<
": id = " <<
id <<
", status = " << (*p)->status()
2662 <<
"\n pX = " << (*p)->momentum().x() <<
", pY = " << (*p)->momentum().y()
2663 <<
", pT = " << (*p)->momentum().perp() <<
" GeV"
2664 <<
", p = " << (*p)->momentum().rho() <<
" GeV"
2665 <<
"\n eta = " << (*p)->momentum().pseudoRapidity() <<
", phi = " << phitmp <<
" ("
2666 << phitmp * 180. /
M_PI <<
" deg)";
2688 <<
" requested, but not found in the event... Skipping the rest +++\n";
2694 <<
" requested, but not found in the event... Skipping the rest +++\n";
2700 <<
" requested, but not found in the event... Skipping the rest +++\n";
2705 LogTrace(
"CSCTriggerPrimitivesReader") <<
" #CSC SimHits: " <<
simHits.size();
2728 for (
auto adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) {
2729 const CSCDetId&
id = (*adetUnitIt).first;
2732 const auto&
range = (*adetUnitIt).second;
2733 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
2734 bool alct_valid = (*digiIt).isValid();
2736 vector<CSCAnodeLayerInfo> alctInfo = alct_analyzer.
getSimInfo(*digiIt,
id, wiredc, &allSimHits);
2738 double hitPhi = -999.0, hitEta = -999.0;
2739 int hitWG = alct_analyzer.
nearestWG(alctInfo, hitPhi, hitEta);
2742 int wiregroup = (*digiIt).getKeyWG();
2745 int endc =
id.endcap();
2746 int stat =
id.station();
2749 double alctEta = alct_analyzer.
getWGEta(layerId, wiregroup);
2750 double deltaEta = alctEta - hitEta;
2753 double deltaWG = wiregroup - hitWG;
2755 LogTrace(
"CSCTriggerPrimitivesReader")
2756 <<
"WG: MC = " << hitWG <<
" rec = " << wiregroup <<
" delta = " << deltaWG;
2781 for (
auto cdetUnitIt = clcts->begin(); cdetUnitIt != clcts->end(); cdetUnitIt++) {
2782 const CSCDetId&
id = (*cdetUnitIt).first;
2785 const auto&
range = (*cdetUnitIt).second;
2786 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
2787 bool clct_valid = (*digiIt).isValid();
2789 vector<CSCCathodeLayerInfo> clctInfo = clct_analyzer.
getSimInfo(*digiIt,
id, compdc, &allSimHits);
2791 double hitPhi = -999.0, hitEta = -999.0, deltaStrip = -999.0;
2792 int hitHS = clct_analyzer.
nearestHS(clctInfo, hitPhi, hitEta);
2795 int halfstrip = (*digiIt).getKeyStrip();
2796 int strip = halfstrip / 2;
2797 int distrip = halfstrip / 4;
2798 int stripType = (*digiIt).getStripType();
2801 int endc =
id.endcap();
2802 int stat =
id.station();
2808 float fstrip = -999.;
2809 if (stripType == 0) {
2810 fstrip =
strip + 1.;
2812 fstrip =
strip + 0.5 * (halfstrip % 2) + 0.25;
2814 double clctPhi = clct_analyzer.
getStripPhi(layerId, fstrip);
2815 double deltaPhi = clctPhi - hitPhi;
2822 hitPhi += 2. *
M_PI;
2824 clctPhi += 2. *
M_PI;
2826 LogTrace(
"CSCTriggerPrimitivesReader")
2827 <<
" clctPhi = " << clctPhi <<
" hitPhi = " << hitPhi <<
" deltaPhi = " <<
deltaPhi;
2830 if (stripType == 0) {
2831 deltaStrip = distrip - hitHS / 4;
2836 deltaStrip = halfstrip - hitHS;
2842 LogTrace(
"CSCTriggerPrimitivesReader") <<
"Half-strip: MC = " << hitHS <<
" rec = " << halfstrip
2843 <<
" pattern type = " << stripType <<
" delta = " << deltaStrip;
2853 if (stripType == 1) {
2855 if ((endc == 1 && (
stat == 1 ||
stat == 2)) || (endc == 2 && (
stat == 3 ||
stat == 4))) {
2869 double phi1 = -999.0, phi6 = -999.0;
2870 vector<CSCCathodeLayerInfo>::const_iterator pli;
2871 for (pli = clctInfo.begin(); pli != clctInfo.end(); pli++) {
2873 int layer = layerId.
layer();
2874 if (layer == 1 || layer == 6) {
2876 for (
const auto& psh : allSimHits) {
2879 if (hitId == layerId &&
abs(psh.particleType()) == 13) {
2881 const auto& thisPoint = csclayer->
toGlobal(psh.localPosition());
2882 double phi = thisPoint.phi();
2885 else if (layer == 6)
2892 if (phi1 > -99. && phi6 > -99.) {
2914 vector<CSCDetId> chamberIds;
2915 vector<CSCDetId>::const_iterator chamberIdIt;
2916 for (
const auto& simHitIt : allSimHits) {
2918 bool sameId =
false;
2926 for (
const auto& chamberId : chamberIds) {
2927 if (chamberId.endcap() == hitId.
endcap() && chamberId.station() == hitId.
station() &&
2928 chamberId.ring() == hitId.
ring() && chamberId.chamber() == hitId.
chamber()) {
2935 chamberIds.push_back(newChamberId);
2938 LogTrace(
"CSCTriggerPrimitivesReader") <<
"Found SimHits in " << chamberIds.size() <<
" CSCs";
2942 for (
const auto& chamberId : chamberIds) {
2946 used[ilayer] =
false;
2947 simHitsV[ilayer].clear();
2950 int endcap = chamberId.endcap();
2951 int station = chamberId.station();
2952 int ring = chamberId.ring();
2953 int chamber = chamberId.chamber();
2954 for (
const auto& simHitIt : allSimHits) {
2958 int layer = hitId.
layer() - 1;
2959 if (!used[layer] &&
abs(simHitIt.particleType()) == 13) {
2962 simHitsV[layer].push_back(simHitIt);
2967 <<
"/" <<
chamber <<
" has muon hits in " <<
nLayers <<
" layers";
2974 double hitEta = -999.;
2976 vector<PSimHit> layerSimHitsV = simHitsV[ilayer];
2977 if (!layerSimHitsV.empty()) {
2978 LocalPoint hitLP = layerSimHitsV[0].localPosition();
2982 hitEta = hitGP.
eta();
2987 edm::LogWarning(
"L1CSCTPEmulatorWrongValues") <<
"+++ Warning in calcEfficiency(): no SimHit found"
2988 <<
" where there must be at least " <<
nLayers <<
"! +++\n";
2995 bool isALCT =
false;
2996 for (
auto adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) {
2997 const CSCDetId&
id = (*adetUnitIt).first;
2998 if (
id == (*chamberIdIt)) {
2999 const auto&
range = (*adetUnitIt).second;
3000 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
3001 if (digiIt->isValid()) {
3003 LogTrace(
"CSCTriggerPrimitivesReader") <<
"ALCT was found";
3016 LogTrace(
"CSCTriggerPrimitivesReader") <<
"ALCT was not found";
3019 bool isCLCT =
false;
3020 for (
auto cdetUnitIt = clcts->begin(); cdetUnitIt != clcts->end(); cdetUnitIt++) {
3021 const CSCDetId&
id = (*cdetUnitIt).first;
3022 if (
id == (*chamberIdIt)) {
3023 const auto&
range = (*cdetUnitIt).second;
3024 for (
auto digiIt =
range.first; digiIt !=
range.second; digiIt++) {
3025 if (digiIt->isValid()) {
3027 LogTrace(
"CSCTriggerPrimitivesReader") <<
"CLCT was found";
3040 LogTrace(
"CSCTriggerPrimitivesReader") <<
"CLCT was not found";
3047 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3049 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3052 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3053 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3059 t.SetTextSize(0.025);
3060 char pagenum[7], titl[50];
3068 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"Number of ALCTs");
3069 title->SetFillColor(10);
3071 sprintf(pagenum,
"- %d -",
page);
3072 t.DrawText(0.9, 0.02, pagenum);
3073 gStyle->SetOptStat(111110);
3075 pad[
page]->Divide(1, 3);
3093 sprintf(titl,
"ALCTs per chamber, endcap %d", endc + 1);
3094 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3095 title->SetFillColor(10);
3097 sprintf(pagenum,
"- %d -",
page);
3098 t.DrawText(0.9, 0.02, pagenum);
3099 gStyle->SetOptStat(10);
3101 pad[
page]->Divide(2, 5);
3102 for (
int idh = 0; idh < max_idh; idh++) {
3105 hAlctCsc[endc][idh]->SetMinimum(0.0);
3106 pad[
page]->cd(idh + 1);
3116 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"ALCT quantities");
3117 title->SetFillColor(10);
3119 sprintf(pagenum,
"- %d -",
page);
3120 t.DrawText(0.9, 0.02, pagenum);
3121 gStyle->SetOptStat(111110);
3123 pad[
page]->Divide(2, 3);
3144 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3146 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3149 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3150 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3156 t.SetTextSize(0.025);
3157 char pagenum[7], titl[50];
3163 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"Number of CLCTs");
3164 title->SetFillColor(10);
3166 sprintf(pagenum,
"- %d -",
page);
3167 t.DrawText(0.9, 0.02, pagenum);
3168 gStyle->SetOptStat(111110);
3170 pad[
page]->Divide(1, 3);
3178 for (
int ibin = 1; ibin <=
nbins; ibin++) {
3180 edm::LogInfo(
"CSCTriggerPrimitivesReader") <<
" # CLCTs/chamber: " << ibin - 1 <<
"; events: " << f_bin << endl;
3198 sprintf(titl,
"CLCTs per chamber, endcap %d", endc + 1);
3199 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3200 title->SetFillColor(10);
3202 sprintf(pagenum,
"- %d -",
page);
3203 t.DrawText(0.9, 0.02, pagenum);
3204 gStyle->SetOptStat(10);
3206 pad[
page]->Divide(2, 5);
3207 for (
int idh = 0; idh < max_idh; idh++) {
3210 hClctCsc[endc][idh]->SetMinimum(0.0);
3211 pad[
page]->cd(idh + 1);
3221 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT quantities");
3222 title->SetFillColor(10);
3224 sprintf(pagenum,
"- %d -",
page);
3225 t.DrawText(0.9, 0.02, pagenum);
3226 gStyle->SetOptStat(111110);
3228 pad[
page]->Divide(2, 4);
3250 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT bend for various chamber types, halfstrips");
3251 title->SetFillColor(10);
3253 sprintf(pagenum,
"- %d -",
page);
3254 t.DrawText(0.9, 0.02, pagenum);
3255 gStyle->SetOptStat(110);
3257 pad[
page]->Divide(2, 5);
3258 for (
int idh = 0; idh < max_idh; idh++) {
3261 pad[
page]->cd(idh + 1);
3262 hClctBendCsc[idh][1]->GetXaxis()->SetTitle(
"Pattern bend");
3263 hClctBendCsc[idh][1]->GetYaxis()->SetTitle(
"Number of LCTs");
3274 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3276 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3279 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3280 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3286 t.SetTextSize(0.025);
3287 char pagenum[7], titl[50];
3295 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"Number of LCTs");
3296 title->SetFillColor(10);
3298 sprintf(pagenum,
"- %d -",
page);
3299 t.DrawText(0.9, 0.02, pagenum);
3300 gStyle->SetOptStat(111110);
3302 pad[
page]->Divide(2, 2);
3317 gStyle->SetOptStat(1110);
3324 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"LCT geometry");
3325 title->SetFillColor(10);
3327 sprintf(pagenum,
"- %d -",
page);
3328 t.DrawText(0.9, 0.02, pagenum);
3329 gStyle->SetOptStat(110110);
3331 pad[
page]->Divide(2, 4);
3341 pad[
page]->cd(istat + 5);
3351 sprintf(titl,
"LCTs per chamber, endcap %d", endc + 1);
3352 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3353 title->SetFillColor(10);
3355 sprintf(pagenum,
"- %d -",
page);
3356 t.DrawText(0.9, 0.02, pagenum);
3357 gStyle->SetOptStat(10);
3359 pad[
page]->Divide(2, 5);
3360 for (
int idh = 0; idh < max_idh; idh++) {
3364 pad[
page]->cd(idh + 1);
3374 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"LCT quantities");
3375 title->SetFillColor(10);
3377 sprintf(pagenum,
"- %d -",
page);
3378 t.DrawText(0.9, 0.02, pagenum);
3379 gStyle->SetOptStat(110110);
3381 pad[
page]->Divide(2, 4);
3406 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3408 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3411 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3412 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3418 t.SetTextSize(0.025);
3425 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"Number of LCTs");
3426 title->SetFillColor(10);
3428 sprintf(pagenum,
"- %d -",
page);
3429 t.DrawText(0.9, 0.02, pagenum);
3430 gStyle->SetOptStat(111110);
3432 pad[
page]->Divide(1, 3);
3450 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"LCT geometry");
3451 title->SetFillColor(10);
3453 sprintf(pagenum,
"- %d -",
page);
3454 t.DrawText(0.9, 0.02, pagenum);
3455 gStyle->SetOptStat(110110);
3457 pad[
page]->Divide(2, 4);
3467 pad[
page]->cd(istat + 5);
3476 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"LCT quantities");
3477 title->SetFillColor(10);
3479 sprintf(pagenum,
"- %d -",
page);
3480 t.DrawText(0.9, 0.02, pagenum);
3482 pad[
page]->Divide(2, 4);
3507 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3509 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3512 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3513 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3519 t.SetTextSize(0.025);
3525 teff.SetTextFont(32);
3526 teff.SetTextSize(0.08);
3527 char eff[25], titl[60];
3535 sprintf(titl,
"ALCT firmware-emulator: match in number found, endcap %d", endc + 1);
3536 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3537 title->SetFillColor(10);
3539 sprintf(pagenum,
"- %d -",
page);
3540 t.DrawText(0.9, 0.02, pagenum);
3542 gStyle->SetOptStat(0);
3544 pad[
page]->Divide(2, 5);
3546 for (
int idh = 0; idh < max_idh; idh++) {
3552 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3554 hAlctFoundEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3555 hAlctFoundEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3559 gStyle->SetStatX(0.65);
3560 hAlctFoundEffVsCsc[endc][idh]->SetMinimum(-0.05);
3561 hAlctFoundEffVsCsc[endc][idh]->SetMaximum(1.05);
3562 hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3563 hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3564 hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3565 hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3566 hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3567 hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3568 hAlctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3569 hAlctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of same number found");
3570 pad[
page]->cd(idh + 1);
3571 hAlctFoundEffVsCsc[endc][idh]->Draw(
"e");
3579 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3580 teff.DrawTextNDC(0.3, 0.5, eff);
3590 sprintf(titl,
"ALCT firmware-emulator: exact match, endcap %d", endc + 1);
3591 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3592 title->SetFillColor(10);
3594 sprintf(pagenum,
"- %d -",
page);
3595 t.DrawText(0.9, 0.02, pagenum);
3597 gStyle->SetOptStat(0);
3599 pad[
page]->Divide(2, 5);
3601 for (
int idh = 0; idh < max_idh; idh++) {
3607 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3609 hAlctMatchEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3610 hAlctMatchEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3614 gStyle->SetStatX(0.65);
3615 hAlctMatchEffVsCsc[endc][idh]->SetMinimum(-0.05);
3616 hAlctMatchEffVsCsc[endc][idh]->SetMaximum(1.05);
3617 hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3618 hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3619 hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3620 hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3621 hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3622 hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3623 hAlctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3624 hAlctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of exact match");
3625 pad[
page]->cd(idh + 1);
3626 hAlctMatchEffVsCsc[endc][idh]->Draw(
"e");
3634 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3635 teff.DrawTextNDC(0.3, 0.5, eff);
3645 sprintf(titl,
"CLCT firmware-emulator: match in number found, endcap %d", endc + 1);
3646 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3647 title->SetFillColor(10);
3649 sprintf(pagenum,
"- %d -",
page);
3650 t.DrawText(0.9, 0.02, pagenum);
3652 gStyle->SetOptStat(0);
3654 pad[
page]->Divide(2, 5);
3656 for (
int idh = 0; idh < max_idh; idh++) {
3662 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3664 hClctFoundEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3665 hClctFoundEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3669 gStyle->SetStatX(0.65);
3670 hClctFoundEffVsCsc[endc][idh]->SetMinimum(-0.05);
3671 hClctFoundEffVsCsc[endc][idh]->SetMaximum(1.05);
3672 hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3673 hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3674 hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3675 hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3676 hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3677 hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3678 hClctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3679 hClctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of same number found");
3680 pad[
page]->cd(idh + 1);
3681 hClctFoundEffVsCsc[endc][idh]->Draw(
"e");
3689 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3690 teff.DrawTextNDC(0.3, 0.5, eff);
3700 sprintf(titl,
"CLCT firmware-emulator: exact match, endcap %d", endc + 1);
3701 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3702 title->SetFillColor(10);
3704 sprintf(pagenum,
"- %d -",
page);
3705 t.DrawText(0.9, 0.02, pagenum);
3707 gStyle->SetOptStat(0);
3709 pad[
page]->Divide(2, 5);
3711 for (
int idh = 0; idh < max_idh; idh++) {
3717 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3719 hClctMatchEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3720 hClctMatchEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3724 gStyle->SetStatX(0.65);
3725 hClctMatchEffVsCsc[endc][idh]->SetMinimum(-0.05);
3726 hClctMatchEffVsCsc[endc][idh]->SetMaximum(1.05);
3727 hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3728 hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3729 hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3730 hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3731 hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3732 hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3733 hClctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3734 hClctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of exact match");
3735 pad[
page]->cd(idh + 1);
3736 hClctMatchEffVsCsc[endc][idh]->Draw(
"e");
3744 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3745 teff.DrawTextNDC(0.3, 0.5, eff);
3755 sprintf(titl,
"LCT firmware-emulator: match in number found, endcap %d", endc + 1);
3756 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3757 title->SetFillColor(10);
3759 sprintf(pagenum,
"- %d -",
page);
3760 t.DrawText(0.9, 0.02, pagenum);
3762 gStyle->SetOptStat(0);
3764 pad[
page]->Divide(2, 5);
3766 for (
int idh = 0; idh < max_idh; idh++) {
3769 hLctFoundEffVsCsc[endc][idh] = (TH1F*)
hLctCompFoundCsc[endc][idh]->Clone();
3772 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3774 hLctFoundEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3775 hLctFoundEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3779 gStyle->SetStatX(0.65);
3780 hLctFoundEffVsCsc[endc][idh]->SetMinimum(-0.05);
3781 hLctFoundEffVsCsc[endc][idh]->SetMaximum(1.05);
3782 hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3783 hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3784 hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3785 hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3786 hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3787 hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3788 hLctFoundEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3789 hLctFoundEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of same number found");
3790 pad[
page]->cd(idh + 1);
3791 hLctFoundEffVsCsc[endc][idh]->Draw(
"e");
3799 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3800 teff.DrawTextNDC(0.3, 0.5, eff);
3810 sprintf(titl,
"LCT firmware-emulator: exact match, endcap %d", endc + 1);
3811 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98, titl);
3812 title->SetFillColor(10);
3814 sprintf(pagenum,
"- %d -",
page);
3815 t.DrawText(0.9, 0.02, pagenum);
3817 gStyle->SetOptStat(0);
3819 pad[
page]->Divide(2, 5);
3821 for (
int idh = 0; idh < max_idh; idh++) {
3824 hLctMatchEffVsCsc[endc][idh] = (TH1F*)
hLctCompTotalCsc[endc][idh]->Clone();
3827 for (Int_t ibin = 1; ibin <=
nbins; ibin++) {
3829 hLctMatchEffVsCsc[endc][idh]->SetBinContent(ibin, -1.);
3830 hLctMatchEffVsCsc[endc][idh]->SetBinError(ibin, 0.);
3834 gStyle->SetStatX(0.65);
3835 hLctMatchEffVsCsc[endc][idh]->SetMinimum(-0.05);
3836 hLctMatchEffVsCsc[endc][idh]->SetMaximum(1.05);
3837 hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleOffset(0.7);
3838 hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleOffset(0.8);
3839 hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetLabelSize(0.06);
3840 hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetLabelSize(0.06);
3841 hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitleSize(0.07);
3842 hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitleSize(0.07);
3843 hLctMatchEffVsCsc[endc][idh]->GetXaxis()->SetTitle(
"CSC id");
3844 hLctMatchEffVsCsc[endc][idh]->GetYaxis()->SetTitle(
"% of exact match");
3845 pad[
page]->cd(idh + 1);
3846 hLctMatchEffVsCsc[endc][idh]->Draw(
"e");
3854 sprintf(eff,
"eff = (%4.1f +/- %4.1f)%%",
ratio * 100.,
error * 100.);
3855 teff.DrawTextNDC(0.3, 0.5, eff);
3866 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
3868 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
3871 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
3872 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
3878 t.SetTextSize(0.025);
3887 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"ALCT resolution");
3888 title->SetFillColor(10);
3890 sprintf(pagenum,
"- %d -",
page);
3891 t.DrawText(0.9, 0.02, pagenum);
3892 gStyle->SetOptStat(111110);
3894 pad[
page]->Divide(2, 2);
3895 gStyle->SetStatX(1.00);
3896 gStyle->SetStatY(0.65);
3901 gStyle->SetStatX(1.00);
3902 gStyle->SetStatY(0.995);
3923 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#eta_rec-#eta_sim");
3924 title->SetFillColor(10);
3926 sprintf(pagenum,
"- %d -",
page);
3927 t.DrawText(0.9, 0.02, pagenum);
3929 pad[
page]->Divide(2, 5);
3930 for (
int idh = 0; idh < max_idh; idh++) {
3933 hEtaDiffCsc[idh][0]->GetXaxis()->SetLabelSize(0.07);
3934 hEtaDiffCsc[idh][0]->GetYaxis()->SetLabelSize(0.07);
3935 pad[
page]->cd(idh + 1);
3946 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#eta_rec-#eta_sim, endcap1");
3947 title->SetFillColor(10);
3949 sprintf(pagenum,
"- %d -",
page);
3950 t.DrawText(0.9, 0.02, pagenum);
3952 pad[
page]->Divide(2, 5);
3953 for (
int idh = 0; idh < max_idh; idh++) {
3956 hEtaDiffCsc[idh][1]->GetXaxis()->SetLabelSize(0.07);
3957 hEtaDiffCsc[idh][1]->GetYaxis()->SetLabelSize(0.07);
3958 pad[
page]->cd(idh + 1);
3969 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#eta_rec-#eta_sim, endcap2");
3970 title->SetFillColor(10);
3972 sprintf(pagenum,
"- %d -",
page);
3973 t.DrawText(0.9, 0.02, pagenum);
3975 pad[
page]->Divide(2, 5);
3976 for (
int idh = 0; idh < max_idh; idh++) {
3979 hEtaDiffCsc[idh][2]->GetXaxis()->SetLabelSize(0.07);
3980 hEtaDiffCsc[idh][2]->GetYaxis()->SetLabelSize(0.07);
3981 pad[
page]->cd(idh + 1);
3992 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#LT#eta_rec-#eta_sim#GT vs #eta_rec");
3993 title->SetFillColor(10);
3995 sprintf(pagenum,
"- %d -",
page);
3996 t.DrawText(0.9, 0.02, pagenum);
3999 pad[
page]->Divide(2, 2);
4001 for (
int istation = 0; istation <
MAX_STATIONS; istation++) {
4002 hMeanEtaDiffVsEta[istation] = (TH1F*)
hEtaDiffVsEta[istation]->Clone();
4004 hMeanEtaDiffVsEta[istation]->GetXaxis()->SetTitleOffset(1.2);
4005 hMeanEtaDiffVsEta[istation]->GetXaxis()->SetTitle(
"#eta");
4006 hMeanEtaDiffVsEta[istation]->SetMaximum(0.05);
4007 pad[
page]->cd(istation + 1);
4008 hMeanEtaDiffVsEta[istation]->Draw();
4015 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#eta_rec-#eta_sim vs wiregroup");
4016 title->SetFillColor(10);
4018 sprintf(pagenum,
"- %d -",
page);
4019 t.DrawText(0.9, 0.02, pagenum);
4021 pad[
page]->Divide(2, 5);
4022 for (
int idh = 0; idh < max_idh; idh++) {
4025 pad[
page]->cd(idh + 1);
4042 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi resolution");
4043 title->SetFillColor(10);
4045 sprintf(pagenum,
"- %d -",
page);
4046 t.DrawText(0.9, 0.02, pagenum);
4047 gStyle->SetOptStat(111110);
4049 pad[
page]->Divide(2, 2);
4050 gStyle->SetStatX(1.00);
4051 gStyle->SetStatY(0.65);
4056 gStyle->SetStatX(1.00);
4057 gStyle->SetStatY(0.995);
4085 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim (mrad)");
4086 title->SetFillColor(10);
4088 sprintf(pagenum,
"- %d -",
page);
4089 t.DrawText(0.9, 0.02, pagenum);
4091 pad[
page]->Divide(2, 5);
4092 for (
int idh = 0; idh < max_idh; idh++) {
4095 hPhiDiffCsc[idh][0]->GetXaxis()->SetLabelSize(0.07);
4096 hPhiDiffCsc[idh][0]->GetYaxis()->SetLabelSize(0.07);
4097 pad[
page]->cd(idh + 1);
4108 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim (mrad), endcap1");
4109 title->SetFillColor(10);
4111 sprintf(pagenum,
"- %d -",
page);
4112 t.DrawText(0.9, 0.02, pagenum);
4114 pad[
page]->Divide(2, 5);
4115 for (
int idh = 0; idh < max_idh; idh++) {
4118 hPhiDiffCsc[idh][1]->GetXaxis()->SetLabelSize(0.07);
4119 hPhiDiffCsc[idh][1]->GetYaxis()->SetLabelSize(0.07);
4120 pad[
page]->cd(idh + 1);
4131 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim (mrad), endcap2");
4132 title->SetFillColor(10);
4134 sprintf(pagenum,
"- %d -",
page);
4135 t.DrawText(0.9, 0.02, pagenum);
4137 pad[
page]->Divide(2, 5);
4138 for (
int idh = 0; idh < max_idh; idh++) {
4141 hPhiDiffCsc[idh][2]->GetXaxis()->SetLabelSize(0.07);
4142 hPhiDiffCsc[idh][2]->GetYaxis()->SetLabelSize(0.07);
4143 pad[
page]->cd(idh + 1);
4154 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#LT#phi_rec-#phi_sim#GT (mrad) vs #phi_rec");
4155 title->SetFillColor(10);
4157 sprintf(pagenum,
"- %d -",
page);
4158 t.DrawText(0.9, 0.02, pagenum);
4159 gStyle->SetOptStat(0);
4161 pad[
page]->Divide(2, 2);
4163 for (
int istation = 0; istation <
MAX_STATIONS; istation++) {
4164 hMeanPhiDiffVsPhi[istation] = (TH1F*)
hPhiDiffVsPhi[istation]->Clone();
4166 hMeanPhiDiffVsPhi[istation]->GetXaxis()->SetTitleOffset(1.2);
4167 hMeanPhiDiffVsPhi[istation]->GetYaxis()->SetTitleOffset(1.7);
4168 hMeanPhiDiffVsPhi[istation]->GetXaxis()->SetTitle(
"#phi");
4169 hMeanPhiDiffVsPhi[istation]->GetYaxis()->SetTitle(
"#LT#phi_rec-#phi_sim#GT (mrad)");
4170 hMeanPhiDiffVsPhi[istation]->SetMaximum(5.);
4171 pad[
page]->cd(istation + 1);
4172 hMeanPhiDiffVsPhi[istation]->Draw();
4179 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim (mrad) vs halfstrip #");
4180 title->SetFillColor(10);
4182 sprintf(pagenum,
"- %d -",
page);
4183 t.DrawText(0.9, 0.02, pagenum);
4184 gStyle->SetOptStat(0);
4186 pad[
page]->Divide(2, 5);
4187 for (
int idh = 0; idh < max_idh; idh++) {
4190 pad[
page]->cd(idh + 1);
4204 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim, halfstrips only, different patterns");
4205 title->SetFillColor(10);
4207 sprintf(pagenum,
"- %d -",
page);
4208 t.DrawText(0.9, 0.02, pagenum);
4209 gStyle->SetOptStat(111110);
4211 pad[
page]->Divide(3, 3);
4212 int min_pattern, max_pattern;
4215 for (
int idh = min_pattern; idh < max_pattern; idh++) {
4218 pad[
page]->cd(idh - min_pattern + 1);
4229 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_1-#phi_6 (mrad), muon SimHits");
4230 title->SetFillColor(10);
4232 sprintf(pagenum,
"- %d -",
page);
4233 t.DrawText(0.9, 0.02, pagenum);
4235 pad[
page]->Divide(2, 5);
4236 for (
int idh = 0; idh < max_idh; idh++) {
4243 pad[
page]->cd(idh + 1);
4254 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 700);
4256 TPostScript* ps =
new TPostScript(
fname.c_str(), 111);
4259 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
4260 pad[i_page] =
new TPad(
"",
"", .05, .05, .93, .93);
4266 t.SetTextSize(0.025);
4271 gStyle->SetOptDate(0);
4272 gStyle->SetTitleSize(0.1,
"");
4279 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"ALCT efficiency vs #eta");
4280 title->SetFillColor(10);
4282 sprintf(pagenum,
"- %d -",
page);
4283 t.DrawText(0.9, 0.02, pagenum);
4284 gStyle->SetOptStat(0);
4286 pad[
page]->Divide(2, 2);
4288 for (
int istation = 0; istation <
MAX_STATIONS; istation++) {
4289 hALCTEffVsEta[istation] = (TH1F*)
hEfficHitsEta[istation]->Clone();
4291 hALCTEffVsEta[istation]->GetXaxis()->SetTitleOffset(1.2);
4292 hALCTEffVsEta[istation]->GetXaxis()->SetTitle(
"#eta");
4293 hALCTEffVsEta[istation]->SetMaximum(1.05);
4294 sprintf(histtitle,
"ALCT efficiency vs #eta, station %d", istation + 1);
4295 hALCTEffVsEta[istation]->SetTitle(histtitle);
4296 pad[
page]->cd(istation + 1);
4297 hALCTEffVsEta[istation]->Draw();
4304 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"ALCT efficiency vs #eta");
4305 title->SetFillColor(10);
4307 sprintf(pagenum,
"- %d -",
page);
4308 t.DrawText(0.9, 0.02, pagenum);
4309 gStyle->SetOptStat(11111);
4311 pad[
page]->Divide(2, 5);
4313 for (
int idh = 0; idh < max_idh; idh++) {
4318 if (idh == 3 || idh == 4 || idh == 6 || idh == 8) {
4320 gStyle->SetStatX(0.43);
4323 gStyle->SetStatX(1.00);
4325 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle(
"#eta");
4326 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4327 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07);
4328 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10);
4329 hALCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4330 hALCTEffVsEtaCsc[idh]->SetLabelOffset(0.012,
"XY");
4331 hALCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4332 hALCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4333 hALCTEffVsEtaCsc[idh]->SetTitle(
csc_type[idh].c_str());
4334 hALCTEffVsEtaCsc[idh]->SetTitleSize(0.1,
"");
4335 hALCTEffVsEtaCsc[idh]->SetLineWidth(2);
4336 hALCTEffVsEtaCsc[idh]->SetLineColor(4);
4337 pad[
page]->cd(idh + 1);
4339 hALCTEffVsEtaCsc[idh]->Draw();
4347 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT efficiency vs #eta");
4348 title->SetFillColor(10);
4350 sprintf(pagenum,
"- %d -",
page);
4351 t.DrawText(0.9, 0.02, pagenum);
4352 gStyle->SetOptStat(0);
4354 pad[
page]->Divide(2, 2);
4356 for (
int istation = 0; istation <
MAX_STATIONS; istation++) {
4357 hCLCTEffVsEta[istation] = (TH1F*)
hEfficHitsEta[istation]->Clone();
4359 hCLCTEffVsEta[istation]->GetXaxis()->SetTitleOffset(1.2);
4360 hCLCTEffVsEta[istation]->GetXaxis()->SetTitle(
"#eta");
4361 hCLCTEffVsEta[istation]->SetMaximum(1.05);
4362 sprintf(histtitle,
"CLCT efficiency vs #eta, station %d", istation + 1);
4363 hCLCTEffVsEta[istation]->SetTitle(histtitle);
4364 pad[
page]->cd(istation + 1);
4365 hCLCTEffVsEta[istation]->Draw();
4372 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT efficiency vs #eta");
4373 title->SetFillColor(10);
4375 sprintf(pagenum,
"- %d -",
page);
4376 t.DrawText(0.9, 0.02, pagenum);
4377 gStyle->SetOptStat(111110);
4379 pad[
page]->Divide(2, 5);
4381 for (
int idh = 0; idh < max_idh; idh++) {
4386 if (idh == 3 || idh == 4 || idh == 6 || idh == 8) {
4388 gStyle->SetStatX(0.43);
4391 gStyle->SetStatX(1.00);
4393 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle(
"#eta");
4394 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4395 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07);
4396 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10);
4397 hCLCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4398 hCLCTEffVsEtaCsc[idh]->SetLabelOffset(0.012,
"XY");
4399 hCLCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4400 hCLCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4401 hCLCTEffVsEtaCsc[idh]->SetTitle(
csc_type[idh].c_str());
4402 hCLCTEffVsEtaCsc[idh]->SetLineWidth(2);
4403 hCLCTEffVsEtaCsc[idh]->SetLineColor(4);
4404 pad[
page]->cd(idh + 1);
4406 hCLCTEffVsEtaCsc[idh]->Draw();
4416 TCanvas*
c1 =
new TCanvas(
"c1",
"", 0, 0, 500, 640);
4417 TCanvas* c2 =
new TCanvas(
"c2",
"", 0, 0, 540, 540);
4420 for (
int i_page = 0; i_page <
MAXPAGES; i_page++) {
4421 pad[i_page] =
new TPad(
"",
"", .07, .07, .93, .93);
4426 gStyle->SetOptDate(0);
4430 TPostScript* eps1 =
new TPostScript(
"clcts.eps", 113);
4434 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT quantities");
4435 title->SetFillColor(10);
4438 pad[
page]->Divide(2, 3);
4443 TH1F* hClctPatternTot = (TH1F*)
hClctPattern[0]->Clone();
4444 hClctPatternTot->SetTitle(
"CLCT pattern #");
4447 hClctPatternTot->Draw();
4457 hClctKeyStripTot->SetTitle(
"CLCT key strip #");
4460 hClctKeyStripTot->Draw();
4463 c1->Print(
"asdf.png");
4468 gStyle->SetTitleSize(0.055,
"");
4470 TPostScript* eps2 =
new TPostScript(
"alct_deltaWG.eps", 113);
4474 gStyle->SetOptStat(0);
4476 pad[
page]->Divide(1, 1);
4489 TPostScript* eps3 =
new TPostScript(
"clct_deltaHS.eps", 113);
4494 pad[
page]->Divide(1, 1);
4507 TPostScript* eps4 =
new TPostScript(
"clct_deltaDS.eps", 113);
4511 gStyle->SetOptStat(0);
4513 pad[
page]->Divide(1, 1);
4526 TPostScript* eps5 =
new TPostScript(
"clct_deltaPhi_hs.eps", 113);
4530 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"#phi_rec-#phi_sim (mrad), halfstrips only");
4531 title->SetFillColor(10);
4533 gStyle->SetTitleSize(0.1,
"");
4534 gStyle->SetOptStat(111110);
4536 pad[
page]->Divide(2, 5);
4537 for (
int idh = 0; idh < max_idh; idh++) {
4540 pad[
page]->cd(idh + 1);
4547 hPhiDiffCsc[idh][4]->GetYaxis()->SetTitle(
"Entries ");
4548 hPhiDiffCsc[idh][4]->GetYaxis()->SetTitleSize(0.07);
4549 hPhiDiffCsc[idh][4]->GetYaxis()->SetTitleOffset(1.0);
4550 hPhiDiffCsc[idh][4]->GetXaxis()->SetLabelSize(0.10);
4551 hPhiDiffCsc[idh][4]->GetYaxis()->SetLabelSize(0.10);
4561 TPostScript* eps6 =
new TPostScript(
"alct_effic.eps", 113);
4565 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"ALCT efficiency vs #eta");
4566 title->SetFillColor(10);
4568 gStyle->SetOptStat(0);
4570 pad[
page]->Divide(2, 5);
4572 for (
int idh = 0; idh < max_idh; idh++) {
4577 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle(
"#eta");
4578 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4579 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07);
4580 hALCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10);
4581 hALCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4582 hALCTEffVsEtaCsc[idh]->SetLabelOffset(0.012,
"XY");
4583 hALCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4584 hALCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4585 hALCTEffVsEtaCsc[idh]->SetTitle(
csc_type[idh].c_str());
4586 hALCTEffVsEtaCsc[idh]->SetTitleSize(0.1,
"");
4587 hALCTEffVsEtaCsc[idh]->SetLineWidth(2);
4588 hALCTEffVsEtaCsc[idh]->SetLineColor(4);
4589 hALCTEffVsEtaCsc[idh]->SetLineColor(4);
4590 pad[
page]->cd(idh + 1);
4592 hALCTEffVsEtaCsc[idh]->Draw();
4598 TPostScript* eps7 =
new TPostScript(
"clct_effic.eps", 113);
4602 title =
new TPaveLabel(0.1, 0.94, 0.9, 0.98,
"CLCT efficiency vs #eta");
4603 title->SetFillColor(10);
4605 gStyle->SetOptStat(0);
4607 pad[
page]->Divide(2, 5);
4609 for (
int idh = 0; idh < max_idh; idh++) {
4614 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitle(
"#eta");
4615 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleOffset(0.8);
4616 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetTitleSize(0.07);
4617 hCLCTEffVsEtaCsc[idh]->GetXaxis()->SetLabelSize(0.10);
4618 hCLCTEffVsEtaCsc[idh]->GetYaxis()->SetLabelSize(0.10);
4619 hCLCTEffVsEtaCsc[idh]->SetLabelOffset(0.012,
"XY");
4620 hCLCTEffVsEtaCsc[idh]->SetMinimum(0.50);
4621 hCLCTEffVsEtaCsc[idh]->SetMaximum(1.05);
4622 hCLCTEffVsEtaCsc[idh]->SetTitle(
csc_type[idh].c_str());
4623 hCLCTEffVsEtaCsc[idh]->SetLineWidth(2);
4624 hCLCTEffVsEtaCsc[idh]->SetLineColor(4);
4625 pad[
page]->cd(idh + 1);
4627 hCLCTEffVsEtaCsc[idh]->Draw();
4644 keyHS = keyHS - 128;
4649 float fractional_strip = 0.5 * (keyHS + 1) - 0.25;
4653 LocalPoint csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire);
4659 bool isME11 = (
id.station() == 1 and (
id.
ring() == 1
or id.
ring() == 4));
4663 int theEndcap = (
id.endcap() == 1) ? 1 : 2;
4696 type = (
id.triggerCscId() - 1) / 3;
4697 if (
id.
ring() == 4) {
4701 type = 3 +
id.ring() + 2 * (
id.station() - 2);