CMS 3D CMS Logo

L1TStage2EMTF.cc
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
3 #include <iostream>
4 #include <map>
5 
7 
9  : daqToken(consumes<l1t::EMTFDaqOutCollection>(ps.getParameter<edm::InputTag>("emtfSource"))),
10  hitToken(consumes<l1t::EMTFHitCollection>(ps.getParameter<edm::InputTag>("emtfSource"))),
11  trackToken(consumes<l1t::EMTFTrackCollection>(ps.getParameter<edm::InputTag>("emtfSource"))),
12  muonToken(consumes<l1t::RegionalMuonCandBxCollection>(ps.getParameter<edm::InputTag>("emtfSource"))),
13  monitorDir(ps.getUntrackedParameter<std::string>("monitorDir", "")),
14  verbose(ps.getUntrackedParameter<bool>("verbose", false)) {}
15 
17 
19 
20 
22 
23  // Monitor Dir
25 
26  const std::array<std::string, 6> binNamesErrors{{"Corruptions","Synch. Err.","Synch. Mod.","BX Mismatch","Time Misalign","FMM != Ready"}};
27 
28  // DAQ Output Monitor Elements
29  emtfErrors = ibooker.book1D("emtfErrors", "EMTF Errors", 6, 0, 6);
30  emtfErrors->setAxisTitle("Error Type (Corruptions Not Implemented)", 1);
31  emtfErrors->setAxisTitle("Number of Errors", 2);
32  for (unsigned int bin = 0; bin < binNamesErrors.size(); ++bin) {
33  emtfErrors->setBinLabel(bin+1, binNamesErrors[bin], 1);
34  }
35 
36  // CSC LCT Monitor Elements
37  int nChambs, nWires, nStrips; // Number of chambers, wiregroups, and halfstrips in each station/ring pair
39  const std::array<std::string, 10> suffix_name{{"42", "41", "32", "31", "22", "21", "13", "12", "11b", "11a"}};
40  const std::array<std::string, 10> suffix_label{{"4/2", "4/1", "3/2", "3/1", " 2/2", "2/1", "1/3", "1/2", "1/1b", "1/1a"}};
41  const std::array<std::string, 12> binNames{{"ME-N", "ME-4", "ME-3", "ME-2", "ME-1b", "ME-1a", "ME+1a", "ME+1b", "ME+2", "ME+3", "ME+4", "ME+N"}};
42 
43  cscLCTBX = ibooker.book2D("cscLCTBX", "CSC LCT BX", 7, -3, 4, 20, 0, 20);
44  cscLCTBX->setAxisTitle("BX", 1);
45  for (int xbin = 1, xbin_label = -3; xbin <= 7; ++xbin, ++xbin_label) {
46  cscLCTBX->setBinLabel(xbin, std::to_string(xbin_label), 1);
47  }
48  for (int ybin = 1; ybin <= 10; ++ybin) {
49  cscLCTBX->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
50  cscLCTBX->setBinLabel(21 - ybin, "ME+" + suffix_label[ybin - 1], 2);
51  }
52 
53  cscLCTOccupancy = ibooker.book2D("cscLCTOccupancy", "CSC Chamber Occupancy", 54, 1, 55, 12, -6, 6);
54  cscLCTOccupancy->setAxisTitle("Sector (CSCID 1-9 Unlabelled)", 1);
55  for (int xbin = 1; xbin < 7; ++xbin) {
56  cscLCTOccupancy->setBinLabel(xbin * 9 - 8, std::to_string(xbin), 1);
57  }
58  for (unsigned int ybin = 0; ybin < binNames.size(); ++ybin) {
59  cscLCTOccupancy->setBinLabel(ybin+1, binNames[ybin], 2);
60  }
61 
62  //cscOccupancy designed to match the cscDQM plot
63  cscDQMOccupancy = ibooker.book2D("cscDQMOccupancy", "CSC Chamber Occupancy", 42, 1, 43, 20, 0, 20);
64  cscDQMOccupancy->setAxisTitle("10#circ Chamber (N=neighbor)", 1);
65  int count=0;
66  for (int xbin=1; xbin < 43; ++xbin) {
67  cscDQMOccupancy->setBinLabel(xbin, std::to_string(xbin-count), 1);
68  if (xbin==2 || xbin==9 || xbin==16 || xbin==23 || xbin==30 ||xbin==37 ) {
69  ++xbin;
70  ++count;
71  cscDQMOccupancy->setBinLabel(xbin, "N", 1);
72  }
73  }
74  for (int ybin = 1; ybin <= 10; ++ybin) {
75  cscDQMOccupancy->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
76  cscDQMOccupancy->setBinLabel(21 - ybin, "ME+" + suffix_label[ybin - 1], 2);
77  }
78  cscDQMOccupancy->getTH2F()->GetXaxis()->SetCanExtend(false); // Needed to stop multi-thread summing
79 
80  mpcLinkErrors = ibooker.book2D("mpcLinkErrors", "MPC Link Errors", 54, 1, 55, 12, -6, 6);
81  mpcLinkErrors->setAxisTitle("Sector (CSCID 1-9 Unlabelled)", 1);
82  for (int xbin = 1; xbin < 7; ++xbin) {
83  mpcLinkErrors->setBinLabel(xbin * 9 - 8, std::to_string(xbin), 1);
84  }
85  for (unsigned int ybin = 0; ybin < binNames.size(); ++ybin) {
86  mpcLinkErrors->setBinLabel(ybin+1, binNames[ybin], 2);
87  }
88 
89  mpcLinkGood = ibooker.book2D("mpcLinkGood", "MPC Good Links", 54, 1, 55, 12, -6, 6);
90  mpcLinkGood->setAxisTitle("Sector (CSCID 1-9 Unlabelled)", 1);
91  for (int xbin = 1; xbin < 7; ++xbin) {
92  mpcLinkGood->setBinLabel(xbin * 9 - 8, std::to_string(xbin), 1);
93  }
94  for (unsigned int ybin = 0; ybin < binNames.size(); ++ybin) {
95  mpcLinkGood->setBinLabel(ybin+1, binNames[ybin], 2);
96  }
97 
98  // RPC Monitor Elements
99  const std::array<std::string, 6> rpc_name{{"43", "42", "33", "32", "22", "12"}};
100  const std::array<std::string, 6> rpc_label{{"4/3", "4/2", "3/3", "3/2", "2/2", "1/2"}};
101 
102  rpcHitBX = ibooker.book2D("rpcHitBX", "RPC Hit BX", 7, -3, 4, 12, 0, 12);
103  rpcHitBX->setAxisTitle("BX", 1);
104  for (int xbin = 1, xbin_label = -3; xbin <= 7; ++xbin, ++xbin_label) {
105  rpcHitBX->setBinLabel(xbin, std::to_string(xbin_label), 1);
106  }
107  for (int ybin = 1; ybin <= 6; ++ybin) {
108  rpcHitBX->setBinLabel(ybin, "RE-" + rpc_label[ybin - 1], 2);
109  rpcHitBX->setBinLabel(13 - ybin, "RE+" + rpc_label[ybin - 1], 2);
110  }
111 
112  rpcHitOccupancy = ibooker.book2D("rpcHitOccupancy", "RPC Chamber Occupancy", 42, 1, 43, 12, 0, 12);
113  rpcHitOccupancy->setAxisTitle("Sector (N=neighbor)", 1);
114  for (int bin = 1; bin < 7; ++bin) {
115  rpcHitOccupancy->setBinLabel(bin*7 - 6, std::to_string(bin), 1);
116  rpcHitOccupancy->setBinLabel(bin*7, "N", 1);
117  rpcHitOccupancy->setBinLabel(bin, "RE-" + rpc_label[bin - 1], 2);
118  rpcHitOccupancy->setBinLabel(13 - bin, "RE+" + rpc_label[bin - 1],2);
119  }
120  rpcHitOccupancy->getTH2F()->GetXaxis()->SetCanExtend(false); // Needed to stop multi-thread summing
121 
122  // Track Monitor Elements
123  emtfnTracks = ibooker.book1D("emtfnTracks", "Number of EMTF Tracks per Event", 11, 0, 11);
124  for (int xbin = 1; xbin <= 10; ++xbin) {
125  emtfnTracks->setBinLabel(xbin, std::to_string(xbin - 1), 1);
126  }
127  emtfnTracks->setBinLabel(11, "Overflow", 1);
128 
129  emtfTracknHits = ibooker.book1D("emtfTracknHits", "Number of Hits per EMTF Track", 5, 0, 5);
130  for (int xbin = 1; xbin <= 5; ++xbin) {
131  emtfTracknHits->setBinLabel(xbin, std::to_string(xbin - 1), 1);
132  }
133 
134  emtfTrackBX = ibooker.book2D("emtfTrackBX", "EMTF Track Bunch Crossing", 12, -6, 6, 7, -3, 4);
135  emtfTrackBX->setAxisTitle("Sector (Endcap)", 1);
136  for (int xbin = 0; xbin < 6; ++xbin) {
137  emtfTrackBX->setBinLabel(xbin + 1, std::to_string(6 - xbin) + " (-)", 1);
138  emtfTrackBX->setBinLabel(12 - xbin, std::to_string(6 - xbin) + " (+)", 1);
139  }
140  emtfTrackBX->setAxisTitle("Track BX", 2);
141  for (int ybin = 1, i = -3; ybin <= 7; ++ybin, ++i) {
142  emtfTrackBX->setBinLabel(ybin, std::to_string(i), 2);
143  }
144 
145  emtfTrackPt = ibooker.book1D("emtfTrackPt", "EMTF Track p_{T}", 256, 1, 257);
146  emtfTrackPt->setAxisTitle("Track p_{T} [GeV]", 1);
147 
148  emtfTrackEta = ibooker.book1D("emtfTrackEta", "EMTF Track #eta", 100, -2.5, 2.5);
149  emtfTrackEta->setAxisTitle("Track #eta", 1);
150 
151  emtfTrackPhi = ibooker.book1D("emtfTrackPhi", "EMTF Track #phi", 126, -3.15, 3.15);
152  emtfTrackPhi->setAxisTitle("Track #phi", 1);
153 
154  emtfTrackOccupancy = ibooker.book2D("emtfTrackOccupancy", "EMTF Track Occupancy", 100, -2.5, 2.5, 126, -3.15, 3.15);
155  emtfTrackOccupancy->setAxisTitle("#eta", 1);
156  emtfTrackOccupancy->setAxisTitle("#phi", 2);
157 
158  emtfTrackMode = ibooker.book1D("emtfTrackMode", "EMTF Track Mode", 16, 0, 16);
159  emtfTrackMode->setAxisTitle("Mode", 1);
160 
161  emtfTrackQuality = ibooker.book1D("emtfTrackQuality", "EMTF Track Quality", 16, 0, 16);
162  emtfTrackQuality->setAxisTitle("Quality", 1);
163 
164  emtfTrackQualityVsMode = ibooker.book2D("emtfTrackQualityVsMode", "EMTF Track Quality vs Mode", 16, 0, 16, 16, 0, 16);
166  emtfTrackQualityVsMode->setAxisTitle("Quality", 2);
167 
168  RPCvsEMTFTrackMode = ibooker.book2D("RPCvsEMTFTrackMode", "RPC Mode vs EMTF TrackMode", 16, 0, 16, 16, 0, 16);
169  RPCvsEMTFTrackMode->setAxisTitle("EMTF Mode", 1);
170  RPCvsEMTFTrackMode->setAxisTitle("RPC Mode", 2);
171 
172  for (int bin = 1; bin <= 16; ++bin) {
173  emtfTrackMode->setBinLabel(bin, std::to_string(bin - 1), 1);
174  emtfTrackQuality->setBinLabel(bin, std::to_string(bin - 1), 1);
175  emtfTrackQualityVsMode->setBinLabel(bin, std::to_string(bin - 1), 1);
176  emtfTrackQualityVsMode->setBinLabel(bin, std::to_string(bin - 1), 2);
177  RPCvsEMTFTrackMode->setBinLabel(bin, std::to_string(bin - 1), 1);
178  RPCvsEMTFTrackMode->setBinLabel(bin, std::to_string(bin - 1), 2);
179  }
180 
181  //Chad Freer May 8 2018 (Selected Tracks)
182  ibooker.setCurrentFolder(monitorDir + "/SelectedTracks");
183 
184  //Chad Freer May 8 2018 (High Quality Track Plots)
185  emtfTrackPtHighQuality = ibooker.book1D("emtfTrackPtHighQuality", "EMTF High Quality Track p_{T}", 256, 1, 257);
186  emtfTrackPtHighQuality->setAxisTitle("Track p_{T} [GeV] (Quality #geq 12)", 1);
187 
188  emtfTrackEtaHighQuality = ibooker.book1D("emtfTrackEtaHighQuality", "EMTF High Quality Track #eta", 100, -2.5, 2.5);
189  emtfTrackEtaHighQuality->setAxisTitle("Track #eta (Quality #geq 12)", 1);
190 
191  emtfTrackPhiHighQuality = ibooker.book1D("emtfTrackPhiHighQuality", "EMTF High Quality #phi", 126, -3.15, 3.15);
192  emtfTrackPhiHighQuality->setAxisTitle("Track #phi (Quality #geq 12)", 1);
193 
194  emtfTrackOccupancyHighQuality = ibooker.book2D("emtfTrackOccupancyHighQuality", "EMTF High Quality Track Occupancy", 100, -2.5, 2.5, 126, -3.15, 3.15);
197 
198  //Chad Freer may 8 2018 (High Quality and High PT [22 GeV] Track Plots)
199  emtfTrackPtHighQualityHighPT = ibooker.book1D("emtfTrackPtHighQualityHighPT", "EMTF High Quality High PT Track p_{T}", 256, 1, 257);
200  emtfTrackPtHighQualityHighPT->setAxisTitle("Track p_{T} [GeV] (Quality #geq 12 and pT>22)", 1);
201 
202  emtfTrackEtaHighQualityHighPT = ibooker.book1D("emtfTrackEtaHighQualityHighPT", "EMTF High Quality High PT Track #eta", 100, -2.5, 2.5);
203  emtfTrackEtaHighQualityHighPT->setAxisTitle("Track #eta (Quality #geq 12 and pT>22)", 1);
204 
205  emtfTrackPhiHighQualityHighPT = ibooker.book1D("emtfTrackPhiHighQualityHighPT", "EMTF High Quality High PT #phi", 126, -3.15, 3.15);
206  emtfTrackPhiHighQualityHighPT->setAxisTitle("Track #phi (Quality #geq 12 and pT>22)", 1);
207 
208  emtfTrackOccupancyHighQualityHighPT = ibooker.book2D("emtfTrackOccupancyHighQualityHighPT", "EMTF High Quality High PT Track Occupancy", 100, -2.5, 2.5, 126, -3.15, 3.15);
211  //Chad Freer May 8 2018 (END new plots)
212 
213  // CSC Input
214  ibooker.setCurrentFolder(monitorDir + "/CSCInput");
215 
216  for (int hist = 0, i = 0; hist < 20; ++hist, i = hist % 10) {
217 
218  if (hist < 10) {
219  name = "MENeg" + suffix_name[i];
220  label = "ME-" + suffix_label[i];
221  } else {
222  name = "MEPos" + suffix_name[9 - i];
223  label = "ME+" + suffix_label[9 - i];
224  }
225 
226  if (hist < 6) {
227  nChambs = (i % 2) ? 18 : 36;
228  } else if (hist >13) {
229  nChambs = (i % 2) ? 36 : 18;
230  } else {
231  nChambs = 36;
232  }
233 
234  const std::array<int, 10> wiregroups{{64, 96, 64, 96, 64, 112, 32, 64, 48, 48}};
235  const std::array<int, 10> halfstrips{{160, 160, 160, 160, 160, 160, 128, 160, 128, 96}};
236 
237  if (hist < 10) {
238  nWires = wiregroups[hist];
239  nStrips = halfstrips[hist];
240  } else {
241  nWires = wiregroups[19 - hist];
242  nStrips = halfstrips[19 - hist];
243  }
244 
245  cscLCTStrip[hist] = ibooker.book1D("cscLCTStrip" + name, "CSC Halfstrip " + label, nStrips, 0, nStrips);
246  cscLCTStrip[hist]->setAxisTitle("Cathode Halfstrip, " + label, 1);
247 
248  cscLCTWire[hist] = ibooker.book1D("cscLCTWire" + name, "CSC Wiregroup " + label, nWires, 0, nWires);
249  cscLCTWire[hist]->setAxisTitle("Anode Wiregroup, " + label, 1);
250 
251  cscChamberStrip[hist] = ibooker.book2D("cscChamberStrip" + name, "CSC Halfstrip " + label, nChambs, 1, 1+nChambs, nStrips, 0, nStrips);
252  cscChamberStrip[hist]->setAxisTitle("Chamber, " + label, 1);
253  cscChamberStrip[hist]->setAxisTitle("Cathode Halfstrip", 2);
254 
255  cscChamberWire[hist] = ibooker.book2D("cscChamberWire" + name, "CSC Wiregroup " + label, nChambs, 1, 1+nChambs, nWires, 0, nWires);
256  cscChamberWire[hist]->setAxisTitle("Chamber, " + label, 1);
257  cscChamberWire[hist]->setAxisTitle("Anode Wiregroup", 2);
258 
259  for (int bin = 1; bin <= nChambs; ++bin) {
260  cscChamberStrip[hist]->setBinLabel(bin, std::to_string(bin), 1);
261  cscChamberWire[hist]->setBinLabel(bin, std::to_string(bin), 1);
262  }
263  }
264 
265  // RPC Input
266  ibooker.setCurrentFolder(monitorDir + "/RPCInput");
267 
268  for (int hist = 0, i = 0; hist < 12; ++hist, i = hist % 6) {
269  if (hist < 6) {
270  name = "RENeg" + rpc_name[i];
271  label = "RE-" + rpc_label[i];
272  } else {
273  name = "REPos" + rpc_name[5 - i];
274  label = "RE+" + rpc_label[5 - i];
275  }
276  rpcHitPhi[hist] = ibooker.book1D("rpcHitPhi" + name, "RPC Hit Phi " + label, 1250, 0, 1250);
277  rpcHitPhi[hist]->setAxisTitle("#phi", 1);
278  rpcHitTheta[hist] = ibooker.book1D("rpcHitTheta" + name, "RPC Hit Theta " + label, 32, 0, 32);
279  rpcHitTheta[hist]->setAxisTitle("#theta", 1);
280  rpcChamberPhi[hist] = ibooker.book2D("rpcChamberPhi" + name, "RPC Chamber Phi " + label, 36, 1, 37, 1250, 0, 1250);
281  rpcChamberPhi[hist]->setAxisTitle("Chamber", 1);
282  rpcChamberPhi[hist]->setAxisTitle("#phi", 2);
283  rpcChamberTheta[hist] = ibooker.book2D("rpcChamberTheta" + name, "RPC Chamber Theta " + label, 36, 1, 37, 32, 0, 32);
284  rpcChamberTheta[hist]->setAxisTitle("Chamber", 1);
285  rpcChamberTheta[hist]->setAxisTitle("#theta", 2);
286  for (int xbin = 1; xbin < 37; ++xbin) {
287  rpcChamberPhi[hist]->setBinLabel(xbin, std::to_string(xbin), 1);
288  rpcChamberTheta[hist]->setBinLabel(xbin, std::to_string(xbin), 1);
289  }
290  }
291 
292  // CSC LCT and RPC Hit Timing
293  ibooker.setCurrentFolder(monitorDir + "/Timing");
294 
295  cscTimingTot = ibooker.book2D("cscTimingTotal", "CSC Total BX ", 42, 1, 43, 20, 0, 20);
296  cscTimingTot->setAxisTitle("10#circ Chamber (N=neighbor)", 1);
297 
298  rpcHitTimingTot = ibooker.book2D("rpcHitTimingTot", "RPC Chamber Occupancy ", 42, 1, 43, 12, 0, 12);
299  rpcHitTimingTot->setAxisTitle("Sector (N=neighbor)", 1);
300  const std::array<std::string, 5> nameBX{{"BXNeg1","BXPos1","BXNeg2","BXPos2","BX0"}};
301  const std::array<std::string, 5> labelBX{{"BX -1","BX +1","BX -2","BX +2","BX 0"}};
302 
303  for (int hist = 0; hist < 5; ++hist) {
304 
305  count = 0;
306  cscLCTTiming[hist] = ibooker.book2D("cscLCTTiming" + nameBX[hist], "CSC Chamber Occupancy " + labelBX[hist], 42, 1, 43, 20, 0, 20);
307  cscLCTTiming[hist]->setAxisTitle("10#circ Chamber", 1);
308 
309  for (int xbin=1; xbin < 43; ++xbin) {
310  cscLCTTiming[hist]->setBinLabel(xbin, std::to_string(xbin-count), 1);
311  if (hist==0) cscTimingTot->setBinLabel(xbin, std::to_string(xbin-count), 1);//only fill once in the loop
312  if (xbin==2 || xbin==9 || xbin==16 || xbin==23 || xbin==30 ||xbin==37 ) {
313  ++xbin;
314  ++count;
315  cscLCTTiming[hist]->setBinLabel(xbin, "N", 1);
316  if (hist==0) cscTimingTot->setBinLabel(xbin, "N", 1);
317  }
318  }
319 
320  for (int ybin = 1; ybin <= 10; ++ybin) {
321  cscLCTTiming[hist]->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
322  cscLCTTiming[hist]->setBinLabel(21 - ybin, "ME+" + suffix_label[ybin - 1], 2);
323  if (hist==0) cscTimingTot->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
324  if (hist==0) cscTimingTot->setBinLabel(21 - ybin, "ME+" + suffix_label[ybin - 1], 2);
325  }
326  if (hist==0) cscTimingTot->getTH2F()->GetXaxis()->SetCanExtend(false); // Needed to stop multi-thread summing
327  cscLCTTiming[hist]->getTH2F()->GetXaxis()->SetCanExtend(false); // Needed to stop multi-thread summing
328 
329  rpcHitTiming[hist] = ibooker.book2D("rpcHitTiming" + nameBX[hist], "RPC Chamber Occupancy " + labelBX[hist], 42, 1, 43, 12, 0, 12);
330  rpcHitTiming[hist]->setAxisTitle("Sector (N=neighbor)", 1);
331  for (int bin = 1; bin < 7; ++bin) {
332  rpcHitTiming[hist]->setBinLabel(bin*7 - 6, std::to_string(bin), 1);
333  rpcHitTiming[hist]->setBinLabel(bin*7, "N", 1);
334  rpcHitTiming[hist]->setBinLabel(bin, "RE-" + rpc_label[bin - 1], 2);
335  rpcHitTiming[hist]->setBinLabel(13 - bin, "RE+" + rpc_label[bin - 1],2);
336  }
337  rpcHitTiming[hist]->getTH2F()->GetXaxis()->SetCanExtend(false); // Needed to stop multi-thread summing
338  if (hist==0) {
339  for (int bin = 1; bin < 7; ++bin) {
340  rpcHitTimingTot->setBinLabel(bin*7 - 6, std::to_string(bin), 1);
341  rpcHitTimingTot->setBinLabel(bin*7, "N", 1);
342  rpcHitTimingTot->setBinLabel(bin, "RE-" + rpc_label[bin - 1], 2);
343  rpcHitTimingTot->setBinLabel(13 - bin, "RE+" + rpc_label[bin - 1],2);
344  }
345  rpcHitTimingTot->getTH2F()->GetXaxis()->SetCanExtend(false); // Needed to stop multi-thread summing
346  }
347  //if (hist == 4) continue; // Don't book for BX = 0
348 
349  count = 0;
350  cscLCTTimingFrac[hist] = ibooker.book2D("cscLCTTimingFrac" + nameBX[hist], "CSC Chamber Occupancy " + labelBX[hist], 42, 1, 43, 20, 0, 20);
351  cscLCTTimingFrac[hist]->setAxisTitle("10#circ Chambers", 1);
352  for (int xbin=1; xbin < 43; ++xbin) {
353  cscLCTTimingFrac[hist]->setBinLabel(xbin, std::to_string(xbin-count), 1);
354  if (xbin==2 || xbin==9 || xbin==16 || xbin==23 || xbin==30 || xbin==37 ) {
355  ++xbin;
356  ++count;
357  cscLCTTimingFrac[hist]->setBinLabel(xbin, "N", 1);
358  }
359  }
360  for (int ybin = 1; ybin <= 10; ++ybin) {
361  cscLCTTimingFrac[hist]->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
362  cscLCTTimingFrac[hist]->setBinLabel(21 - ybin, "ME+" + suffix_label[ybin - 1], 2);
363  }
364  cscLCTTimingFrac[hist]->getTH2F()->GetXaxis()->SetCanExtend(false); // Needed to stop multi-thread summing
365 
366  rpcHitTimingFrac[hist] = ibooker.book2D("rpcHitTimingFrac" + nameBX[hist], "RPC Chamber Fraction in " + labelBX[hist], 42, 1, 43, 12, 0, 12);
367  rpcHitTimingFrac[hist]->setAxisTitle("Sector (N=neighbor)", 1);
368  for (int bin = 1; bin < 7; ++bin) {
369  rpcHitTimingFrac[hist]->setBinLabel(bin*7 - 6, std::to_string(bin), 1);
370  rpcHitTimingFrac[hist]->setBinLabel(bin*7, "N", 1);
371  rpcHitTimingFrac[hist]->setBinLabel(bin, "RE-" + rpc_label[bin - 1], 2);
372  rpcHitTimingFrac[hist]->setBinLabel(13 - bin, "RE+" + rpc_label[bin - 1],2);
373  }
374 
375  }
376 
377  rpcHitTimingInTrack = ibooker.book2D("rpcHitTimingInTrack", "RPC Hit Timing (matched to track in BX 0)", 7, -3, 4, 12, 0, 12);
379  for (int xbin = 1, xbin_label = -3; xbin <= 7; ++xbin, ++xbin_label) {
380  rpcHitTimingInTrack->setBinLabel(xbin, std::to_string(xbin_label), 1);
381  }
382  for (int ybin = 1; ybin <= 6; ++ybin) {
383  rpcHitTimingInTrack->setBinLabel(ybin, "RE-" + rpc_label[ybin - 1], 2);
384  rpcHitTimingInTrack->setBinLabel(13 - ybin, "RE+" + rpc_label[ybin - 1], 2);
385  }
386 
387  const std::array<std::string, 3> nameNumStation{{"4Station","3Station","2Station"}};
388  const std::array<std::string, 3> labelNumStation{{"4 Station Track","3 Station Track","2 Station Track"}};
389 
390  for (int hist = 0; hist < 3; ++hist) {
391  emtfTrackBXVsCSCLCT[hist] = ibooker.book2D("emtfTrackBXVsCSCLCT" + nameNumStation[hist],
392  "EMTF " + labelNumStation[hist] + " BX vs CSC LCT BX", 7, -3, 4, 7, -3, 4);
393  emtfTrackBXVsCSCLCT[hist]->setAxisTitle("LCT BX", 1);
394  emtfTrackBXVsCSCLCT[hist]->setAxisTitle("Track BX", 2);
395  for (int bin = 1, bin_label = -3; bin <= 7; ++bin, ++bin_label) {
396  emtfTrackBXVsCSCLCT[hist]->setBinLabel(bin, std::to_string(bin_label), 1);
397  emtfTrackBXVsCSCLCT[hist]->setBinLabel(bin, std::to_string(bin_label), 2);
398  }
399  emtfTrackBXVsRPCHit[hist] = ibooker.book2D("emtfTrackBXVsRPCHit" + nameNumStation[hist],
400  "EMTF " + labelNumStation[hist] + " BX vs RPC Hit BX", 7, -3, 4, 7, -3, 4);
401  emtfTrackBXVsRPCHit[hist]->setAxisTitle("Hit BX", 1);
402  emtfTrackBXVsRPCHit[hist]->setAxisTitle("Track BX", 2);
403  for (int bin = 1, bin_label = -3; bin <= 7; ++bin, ++bin_label) {
404  emtfTrackBXVsRPCHit[hist]->setBinLabel(bin, std::to_string(bin_label), 1);
405  emtfTrackBXVsRPCHit[hist]->setBinLabel(bin, std::to_string(bin_label), 2);
406  }
407  }
408 
409  // Muon Cand
410  ibooker.setCurrentFolder(monitorDir + "/MuonCand");
411 
412  // Regional Muon Candidate Monitor Elements
413  emtfMuonBX = ibooker.book1D("emtfMuonBX", "EMTF Muon Cand BX", 7, -3, 4);
414  emtfMuonBX->setAxisTitle("BX", 1);
415  for (int xbin = 1, bin_label = -3; xbin <= 7; ++xbin, ++bin_label) {
416  emtfMuonBX->setBinLabel(xbin, std::to_string(bin_label), 1);
417  }
418 
419  emtfMuonhwPt = ibooker.book1D("emtfMuonhwPt", "EMTF Muon Cand p_{T}", 512, 0, 512);
420  emtfMuonhwPt->setAxisTitle("Hardware p_{T}", 1);
421 
422  emtfMuonhwEta = ibooker.book1D("emtfMuonhwEta", "EMTF Muon Cand #eta", 460, -230, 230);
423  emtfMuonhwEta->setAxisTitle("Hardware #eta", 1);
424 
425  emtfMuonhwPhi = ibooker.book1D("emtfMuonhwPhi", "EMTF Muon Cand #phi", 145, -40, 105);
426  emtfMuonhwPhi->setAxisTitle("Hardware #phi", 1);
427 
428  emtfMuonhwQual = ibooker.book1D("emtfMuonhwQual", "EMTF Muon Cand Quality", 16, 0, 16);
429  emtfMuonhwQual->setAxisTitle("Quality", 1);
430  for (int xbin = 1; xbin <= 16; ++xbin) {
431  emtfMuonhwQual->setBinLabel(xbin, std::to_string(xbin - 1), 1);
432  }
433 }
434 
435 // CSCOccupancy chamber mapping for neighbor inclusive plots
436 int chamber_bin (int station, int ring, int chamber) {
437  int chamber_bin_index = 0;
438  if (station > 1 && (ring % 2) == 1) {
439  chamber_bin_index = (chamber * 2) + ((chamber + 1) / 3);
440  } else {
441  chamber_bin_index = chamber + ((chamber + 3) / 6);
442  }
443  return chamber_bin_index;
444 };
445 
446 
448 
449  if (verbose) edm::LogInfo("L1TStage2EMTF") << "L1TStage2EMTF: analyze..." << std::endl;
450 
451  // DAQ Output
453  e.getByToken(daqToken, DaqOutCollection);
454 
455  for (auto DaqOut = DaqOutCollection->begin(); DaqOut != DaqOutCollection->end(); ++DaqOut ) {
456  const l1t::emtf::MECollection* MECollection = DaqOut->PtrMECollection();
457  for (auto ME = MECollection->begin(); ME != MECollection->end(); ++ME ) {
458  if (ME->SE()) emtfErrors->Fill(1);
459  if (ME->SM()) emtfErrors->Fill(2);
460  if (ME->BXE()) emtfErrors->Fill(3);
461  if (ME->AF()) emtfErrors->Fill(4);
462  }
463 
464  const l1t::emtf::EventHeader* EventHeader = DaqOut->PtrEventHeader();
465  if (!EventHeader->Rdy()) emtfErrors->Fill(5);
466 
467  // Fill MPC input link errors
468  int offset = (EventHeader->Sector() - 1) * 9;
469  int endcap = EventHeader->Endcap();
470  l1t::emtf::Counters CO = DaqOut->GetCounters();
471  const std::array<std::array<int,9>,5> counters {{
472  {{CO.ME1a_1(), CO.ME1a_2(), CO.ME1a_3(), CO.ME1a_4(), CO.ME1a_5(), CO.ME1a_6(), CO.ME1a_7(), CO.ME1a_8(), CO.ME1a_9()}},
473  {{CO.ME1b_1(), CO.ME1b_2(), CO.ME1b_3(), CO.ME1b_4(), CO.ME1b_5(), CO.ME1b_6(), CO.ME1b_7(), CO.ME1b_8(), CO.ME1b_9()}},
474  {{CO.ME2_1(), CO.ME2_2(), CO.ME2_3(), CO.ME2_4(), CO.ME2_5(), CO.ME2_6(), CO.ME2_7(), CO.ME2_8(), CO.ME2_9()}},
475  {{CO.ME3_1(), CO.ME3_2(), CO.ME3_3(), CO.ME3_4(), CO.ME3_5(), CO.ME3_6(), CO.ME3_7(), CO.ME3_8(), CO.ME3_9()}},
476  {{CO.ME4_1(), CO.ME4_2(), CO.ME4_3(), CO.ME4_4(), CO.ME4_5(), CO.ME4_6(), CO.ME4_7(), CO.ME4_8(), CO.ME4_9()}}
477  }};
478  for (int i = 0; i < 5; i++) {
479  for (int j = 0; j < 9; j++) {
480  if (counters.at(i).at(j) != 0) mpcLinkErrors->Fill(j + 1 + offset, endcap * (i + 0.5), counters.at(i).at(j));
481  else mpcLinkGood->Fill(j + 1 + offset, endcap * (i + 0.5));
482  }
483  }
484  if (CO.ME1n_3() == 1) mpcLinkErrors->Fill(1 + offset, endcap * 5.5);
485  if (CO.ME1n_6() == 1) mpcLinkErrors->Fill(2 + offset, endcap * 5.5);
486  if (CO.ME1n_9() == 1) mpcLinkErrors->Fill(3 + offset, endcap * 5.5);
487  if (CO.ME2n_3() == 1) mpcLinkErrors->Fill(4 + offset, endcap * 5.5);
488  if (CO.ME2n_9() == 1) mpcLinkErrors->Fill(5 + offset, endcap * 5.5);
489  if (CO.ME3n_3() == 1) mpcLinkErrors->Fill(6 + offset, endcap * 5.5);
490  if (CO.ME3n_9() == 1) mpcLinkErrors->Fill(7 + offset, endcap * 5.5);
491  if (CO.ME4n_3() == 1) mpcLinkErrors->Fill(8 + offset, endcap * 5.5);
492  if (CO.ME4n_9() == 1) mpcLinkErrors->Fill(9 + offset, endcap * 5.5);
493  if (CO.ME1n_3() == 0) mpcLinkGood->Fill(1 + offset, endcap * 5.5);
494  if (CO.ME1n_6() == 0) mpcLinkGood->Fill(2 + offset, endcap * 5.5);
495  if (CO.ME1n_9() == 0) mpcLinkGood->Fill(3 + offset, endcap * 5.5);
496  if (CO.ME2n_3() == 0) mpcLinkGood->Fill(4 + offset, endcap * 5.5);
497  if (CO.ME2n_9() == 0) mpcLinkGood->Fill(5 + offset, endcap * 5.5);
498  if (CO.ME3n_3() == 0) mpcLinkGood->Fill(6 + offset, endcap * 5.5);
499  if (CO.ME3n_9() == 0) mpcLinkGood->Fill(7 + offset, endcap * 5.5);
500  if (CO.ME4n_3() == 0) mpcLinkGood->Fill(8 + offset, endcap * 5.5);
501  if (CO.ME4n_9() == 0) mpcLinkGood->Fill(9 + offset, endcap * 5.5);
502  }
503 
504  // Hits (CSC LCTs and RPC hits)
506  e.getByToken(hitToken, HitCollection);
507 
508  // Maps CSC station and ring to the monitor element index and uses symmetry of the endcaps
509  const std::map<std::pair<int,int>,int> histIndexCSC = { {{1,4}, 9}, {{1,1}, 8}, {{1,2}, 7}, {{1,3}, 6},
510  {{2,1}, 5}, {{2,2}, 4},
511  {{3,1}, 3}, {{3,2}, 2},
512  {{4,1}, 1}, {{4,2}, 0} };
513 
514  // Maps RPC staion and ring to the monitor element index and uses symmetry of the endcaps
515  const std::map<std::pair<int, int>, int> histIndexRPC = { {{4,3}, 0}, {{4,2}, 1}, {{3,3}, 2}, {{3,2}, 3}, {{2,2}, 4}, {{1,2}, 5} };
516 
517  for (auto Hit = HitCollection->begin(); Hit != HitCollection->end(); ++Hit) {
518  int endcap = Hit->Endcap();
519  int sector = Hit->Sector();
520  int station = Hit->Station();
521  int ring = Hit->Ring();
522  int cscid = Hit->CSC_ID();
523  int chamber = Hit->Chamber();
524  int strip = Hit->Strip();
525  int wire = Hit->Wire();
526  int cscid_offset = (sector - 1) * 9;
527 
528  int hist_index = 0;
529  if (ring == 4 && strip >= 128) strip -= 128;
530 
531  if (Hit->Is_CSC() == true) {
532  hist_index = histIndexCSC.at( {station, ring} );
533  if (endcap > 0) hist_index = 19 - hist_index;
534  cscLCTBX->Fill(Hit->BX(), hist_index);
535  float evt_wgt = (Hit->Station() > 1 && Hit->Ring() == 1) ? 0.5 : 1.0;
536  if (Hit->Neighbor() == false) {
537  //Map for cscDQMOccupancy plot
538  cscDQMOccupancy->Fill(chamber_bin(station,ring,chamber),hist_index,evt_wgt);
539  if (station>1 && (ring % 2)==1) {
540  cscDQMOccupancy->Fill(chamber_bin(station,ring,chamber)-1,hist_index,evt_wgt);
541  }
542  cscLCTStrip[hist_index]->Fill(strip);
543  cscLCTWire[hist_index]->Fill(wire);
544  cscChamberStrip[hist_index]->Fill(chamber, strip);
545  cscChamberWire[hist_index]->Fill(chamber, wire);
546  if (Hit->Subsector() == 1) {
547  cscLCTOccupancy->Fill(cscid + cscid_offset, endcap * (station - 0.5));
548  } else {
549  cscLCTOccupancy->Fill(cscid + cscid_offset, endcap * (station + 0.5));
550  }
551  } else {
552  // Map neighbor chambers to "fake" CSC IDs: 1/3 --> 1, 1/6 --> 2, 1/9 --> 3, 2/3 --> 4, 2/9 --> 5, etc.
553  int cscid_n = (station == 1 ? (cscid / 3) : (station * 2) + ((cscid - 3) / 6) );
554  cscLCTOccupancy->Fill(cscid_n + cscid_offset, endcap * 5.5);
555  }
556  if (Hit->Neighbor() == true) {
557  cscDQMOccupancy->Fill(sector*7-4,hist_index,evt_wgt);
558  }
559  }
560 
561  if (Hit->Is_RPC() == true) {
562  hist_index = histIndexRPC.at( {station, ring} );
563  if (endcap > 0) hist_index = 11 - hist_index;
564 
565  rpcHitBX->Fill(Hit->BX(), hist_index);
566 
567  if (Hit->Neighbor() == false) {
568  rpcHitPhi[hist_index]->Fill(Hit->Phi_fp() / 4);
569  rpcHitTheta[hist_index]->Fill(Hit->Theta_fp() / 4);
570  rpcChamberPhi[hist_index]->Fill(chamber, Hit->Phi_fp() / 4);
571  rpcChamberTheta[hist_index]->Fill(chamber, Hit->Theta_fp() / 4);
572  rpcHitOccupancy->Fill((Hit->Sector_RPC() - 1) * 7 + Hit->Subsector(), hist_index + 0.5);
573  } else if (Hit->Neighbor() == true) {
574  rpcHitOccupancy->Fill((Hit->Sector_RPC() - 1) * 7 + 7, hist_index + 0.5);
575  }
576  }
577  }
578 
579  // Tracks
581  e.getByToken(trackToken, TrackCollection);
582 
583  int nTracks = TrackCollection->size();
584 
585  emtfnTracks->Fill(std::min(nTracks, emtfnTracks->getTH1F()->GetNbinsX() - 1));
586 
587  for (auto Track = TrackCollection->begin(); Track != TrackCollection->end(); ++Track) {
588  int endcap = Track->Endcap();
589  int sector = Track->Sector();
590  float eta = Track->Eta();
591  float phi_glob_rad = Track->Phi_glob() * M_PI / 180.;
592  int mode = Track->Mode();
593  int quality = Track->GMT_quality();
594  int numHits = Track->NumHits();
595  int modeNeighbor = Track->Mode_neighbor();
596  int modeRPC = Track->Mode_RPC();
597  int singleMuQuality = 12;
598  int singleMuPT = 22;
599 
600  // Only plot if there are <= 1 neighbor hits in the track to avoid spikes at sector boundaries
601  if (modeNeighbor >= 2 && modeNeighbor != 4 && modeNeighbor != 8) continue;
602 
603  emtfTracknHits->Fill(numHits);
604  emtfTrackBX->Fill(endcap * (sector - 0.5), Track->BX());
605  emtfTrackPt->Fill(Track->Pt());
606  emtfTrackEta->Fill(eta);
607 
608  emtfTrackOccupancy->Fill(eta, phi_glob_rad);
609  emtfTrackMode->Fill(mode);
610  emtfTrackQuality->Fill(quality);
611  emtfTrackQualityVsMode->Fill(mode, quality);
612  RPCvsEMTFTrackMode->Fill(mode, modeRPC);
613  emtfTrackPhi->Fill(phi_glob_rad);
614 
615  if (quality >= singleMuQuality) {
616  emtfTrackPtHighQuality->Fill(Track->Pt());
618  emtfTrackPhiHighQuality->Fill(phi_glob_rad);
619  emtfTrackOccupancyHighQuality->Fill(eta, phi_glob_rad);
620  if (Track->Pt()>= singleMuPT) {
621  emtfTrackPtHighQualityHighPT->Fill(Track->Pt());
623  emtfTrackPhiHighQualityHighPT->Fill(phi_glob_rad);
624  emtfTrackOccupancyHighQualityHighPT->Fill(eta, phi_glob_rad);
625  }
626  }
627 
631  {
632  // LCT and RPC Timing
633  if (numHits < 2 || numHits > 4) continue;
634  l1t::EMTFHitCollection tmp_hits = Track->Hits();
635  int numHitsInTrack_BX0 = 0;
636  unsigned int hist_index2 = 4 - numHits;
637 
638  for (const auto & iTrkHit: Track->Hits()) {
639  if (iTrkHit.Is_CSC() == true) {
640  emtfTrackBXVsCSCLCT[hist_index2]->Fill(iTrkHit.BX(), Track->BX());
641  }
642  else if (iTrkHit.Is_RPC() == true) {
643  emtfTrackBXVsRPCHit[hist_index2]->Fill(iTrkHit.BX(), Track->BX());
644  }
645  }
646 
647  // Select well-timed tracks: >= 3 hits, with <= 1 in BX != 0
648  if (numHits < 3) continue;
649  for (const auto & jTrkHit: Track->Hits()) {
650  if (jTrkHit.BX() == 0)
651  numHitsInTrack_BX0++;
652  }
653  if (numHitsInTrack_BX0 < numHits - 1) continue;
654 
655  for (const auto & TrkHit: Track->Hits()) {
656 
657  int trackHitBX = TrkHit.BX();
658  //int cscid = TrkHit.CSC_ID();
659  int ring = TrkHit.Ring();
660  int station = TrkHit.Station();
661  int sector = TrkHit.Sector();
662  int subsector = TrkHit.Subsector();
663  //int cscid_offset = (sector - 1) * 9;//no longer needed after new time plots (maybe useful for future plots)
664  int neighbor = TrkHit.Neighbor();
665  int endcap = TrkHit.Endcap();
666  int chamber = TrkHit.Chamber();
667 
668  int hist_index = 0;
669  float evt_wgt = (TrkHit.Station() > 1 && TrkHit.Ring() == 1) ? 0.5 : 1.0;
670  // Maps CSC BX from -2 to 2 to monitor element cscLCTTIming
671  const std::map<int, int> histIndexBX = {{0, 4}, {-1, 0}, {1, 1}, {-2, 2}, {2, 3}};
672  if (std::abs(trackHitBX) > 2) continue; // Should never happen, but just to be safe ...
673 
674  if (TrkHit.Is_CSC() == true) {
675  hist_index = histIndexCSC.at( {station, ring} );
676  if (endcap > 0) hist_index = 19 - hist_index;
677  if (neighbor == false) {
678  cscLCTTiming[histIndexBX.at(trackHitBX)]->Fill(chamber_bin(station,ring,chamber),hist_index,evt_wgt);
679  cscTimingTot->Fill(chamber_bin(station,ring,chamber),hist_index,evt_wgt);
680  if (station>1 && (ring % 2)==1) {
681  cscLCTTiming[histIndexBX.at(trackHitBX)]->Fill(chamber_bin(station,ring,chamber)-1,hist_index,evt_wgt);
682  cscTimingTot->Fill(chamber_bin(station,ring,chamber)-1,hist_index,evt_wgt);
683  }
684  }
685  else {
686  // Map neighbor chambers to "fake" CSC IDs: 1/3 --> 1, 1/6 --> 2, 1/9 --> 3, 2/3 --> 4, 2/9 --> 5, etc.
687  //int cscid_n = (station == 1 ? (cscid / 3) : (station * 2) + ((cscid - 3) / 6) );
688  cscLCTTiming[histIndexBX.at(trackHitBX)]->Fill(sector*7-4,hist_index,evt_wgt);
689  cscTimingTot->Fill(sector*7-4,hist_index,evt_wgt);
690  }
691 
692  // Fill RPC timing with matched CSC LCTs
693  if (trackHitBX == 0 && ring == 2) {
694  for (auto Hit = HitCollection->begin(); Hit != HitCollection->end(); ++Hit) {
695  if ( Hit->Is_RPC() == false || neighbor == true ) continue;
696  if ( std::abs(Track->Eta() - Hit->Eta()) > 0.1 ) continue;
697  if ( Hit->Endcap() != endcap ||
698  Hit->Station() != station ||
699  Hit->Chamber() != chamber ) continue;
700  if ( std::abs(Hit->BX()) > 2 ) continue;
701 
702  hist_index = histIndexRPC.at( {Hit->Station(), Hit->Ring()} );
703  if (Hit->Endcap() > 0) hist_index = 11 - hist_index;
704  rpcHitTimingInTrack->Fill(Hit->BX(), hist_index + 0.5);
705  rpcHitTiming[histIndexBX.at(Hit->BX())]->Fill((Hit->Sector_RPC() - 1) * 7 + Hit->Subsector(), hist_index + 0.5);
706  rpcHitTimingTot->Fill((Hit->Sector_RPC() - 1) * 7 + Hit->Subsector(), hist_index + 0.5);
707  } // End loop: for (auto Hit = HitCollection->begin(); Hit != HitCollection->end(); ++Hit)
708  } // End conditional: if (trackHitBX == 0 && ring == 2)
709  } // End conditional: if (TrkHit.Is_CSC() == true)
710 
711  // Maps RPC station and ring to monitor element index
712  const std::map<std::pair<int, int>, int> histIndexRPC = { {{4,3}, 0}, {{4,2}, 1}, {{3,3}, 2}, {{3,2}, 3}, {{2,2}, 4}, {{1,2}, 5}};
713 
714  if (TrkHit.Is_RPC() == true && neighbor == false) {
715  hist_index = histIndexRPC.at( {station, ring} );
716  if (endcap > 0) hist_index = 11 - hist_index;
717 
718  rpcHitTimingInTrack->Fill(trackHitBX, hist_index + 0.5);
719  rpcHitTiming[histIndexBX.at(trackHitBX)]->Fill((TrkHit.Sector_RPC() - 1) * 7 + subsector, hist_index + 0.5);
720  rpcHitTimingTot->Fill((TrkHit.Sector_RPC() - 1) * 7 + subsector, hist_index + 0.5);
721  } // End conditional: if (TrkHit.Is_RPC() == true && neighbor == false)
722  if (TrkHit.Is_RPC() == true && neighbor == true) {
723  hist_index = histIndexRPC.at( {station, ring} );
724  if (endcap > 0) hist_index = 11 - hist_index;
725  rpcHitTiming[histIndexBX.at(trackHitBX)]->Fill((TrkHit.Sector_RPC() - 1) * 7, hist_index + 0.5);
726  }
727  } // End loop: for (int iHit = 0; iHit < numHits; ++iHit)
728  }
732 
733  } // End loop: for (auto Track = TrackCollection->begin(); Track != TrackCollection->end(); ++Track)
734 
735  // CSC LCT and RPC Hit Timing Efficieny
736  for (int hist_index = 0; hist_index < 5; ++hist_index) {
737  cscLCTTimingFrac[hist_index]->getTH2F()->Divide(cscLCTTiming[hist_index]->getTH2F(), cscTimingTot->getTH2F());
738  rpcHitTimingFrac[hist_index]->getTH2F()->Divide(rpcHitTiming[hist_index]->getTH2F(), rpcHitTimingTot->getTH2F());
739  }
740 
741  // Regional Muon Candidates
743  e.getByToken(muonToken, MuonBxCollection);
744 
745  for (int itBX = MuonBxCollection->getFirstBX(); itBX <= MuonBxCollection->getLastBX(); ++itBX) {
746  for (l1t::RegionalMuonCandBxCollection::const_iterator Muon = MuonBxCollection->begin(itBX); Muon != MuonBxCollection->end(itBX); ++Muon) {
747  emtfMuonBX->Fill(itBX);
748  emtfMuonhwPt->Fill(Muon->hwPt());
749  emtfMuonhwEta->Fill(Muon->hwEta());
750  emtfMuonhwPhi->Fill(Muon->hwPhi());
751  emtfMuonhwQual->Fill(Muon->hwQual());
752  }
753  }
754 }
int ME1a_3() const
Definition: Counters.h:104
MonitorElement * cscChamberWire[20]
Definition: L1TStage2EMTF.h:47
MonitorElement * rpcHitTheta[12]
Definition: L1TStage2EMTF.h:88
const_iterator end(int bx) const
int ME1a_1() const
Definition: Counters.h:102
int ME3_5() const
Definition: Counters.h:133
int ME4_9() const
Definition: Counters.h:146
const unsigned int nTracks(const reco::Vertex &sv)
int ME1b_8() const
Definition: Counters.h:118
int ME4_5() const
Definition: Counters.h:142
MonitorElement * rpcChamberPhi[12]
Definition: L1TStage2EMTF.h:89
MonitorElement * emtfTrackBXVsCSCLCT[3]
Definition: L1TStage2EMTF.h:57
int ME1b_7() const
Definition: Counters.h:117
MonitorElement * cscTimingTot
Definition: L1TStage2EMTF.h:52
MonitorElement * emtfMuonhwEta
Definition: L1TStage2EMTF.h:78
edm::EDGetTokenT< l1t::EMTFHitCollection > hitToken
Definition: L1TStage2EMTF.h:33
MonitorElement * rpcChamberTheta[12]
Definition: L1TStage2EMTF.h:90
BXVector< RegionalMuonCand > RegionalMuonCandBxCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
TH1F * getTH1F() const
MonitorElement * RPCvsEMTFTrackMode
Definition: L1TStage2EMTF.h:74
MonitorElement * emtfTrackPhiHighQualityHighPT
Definition: L1TStage2EMTF.h:67
MonitorElement * cscLCTBX
Definition: L1TStage2EMTF.h:43
int ME4_6() const
Definition: Counters.h:143
int Endcap() const
Definition: EventHeader.h:53
MonitorElement * mpcLinkGood
Definition: L1TStage2EMTF.h:41
int ME4_2() const
Definition: Counters.h:139
int ME1a_4() const
Definition: Counters.h:105
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:15
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * cscLCTTimingFrac[5]
Definition: L1TStage2EMTF.h:51
MonitorElement * rpcHitTimingFrac[5]
Definition: L1TStage2EMTF.h:85
void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
delete x;
Definition: CaloConfig.h:22
MonitorElement * mpcLinkErrors
Definition: L1TStage2EMTF.h:40
int ME2_4() const
Definition: Counters.h:123
int ME1b_2() const
Definition: Counters.h:112
MonitorElement * emtfMuonhwPhi
Definition: L1TStage2EMTF.h:79
MonitorElement * cscChamberStrip[20]
Definition: L1TStage2EMTF.h:46
int ME2n_3() const
Definition: Counters.h:150
std::string monitorDir
Definition: L1TStage2EMTF.h:36
int ME3_3() const
Definition: Counters.h:131
void Fill(long long x)
int ME4_1() const
Definition: Counters.h:138
l1t::EMTFTrackCollection EMTFTrackCollection
Definition: Common.h:29
int ME3_7() const
Definition: Counters.h:135
int ME1n_3() const
Definition: Counters.h:147
int ME2_6() const
Definition: Counters.h:125
Definition: ME.h:11
int ME1a_8() const
Definition: Counters.h:109
char const * label
int ME4_8() const
Definition: Counters.h:145
int ME2_2() const
Definition: Counters.h:121
int ME1b_5() const
Definition: Counters.h:115
MonitorElement * rpcHitTimingTot
Definition: L1TStage2EMTF.h:86
int ME1a_6() const
Definition: Counters.h:107
MonitorElement * emtfTrackPhi
Definition: L1TStage2EMTF.h:65
MonitorElement * cscLCTTiming[5]
Definition: L1TStage2EMTF.h:50
MonitorElement * emtfMuonBX
Definition: L1TStage2EMTF.h:76
int ME1b_4() const
Definition: Counters.h:114
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
int Sector() const
Definition: EventHeader.h:54
int ME3_1() const
Definition: Counters.h:129
MonitorElement * emtfTrackPtHighQuality
Definition: L1TStage2EMTF.h:60
Definition: Muon.py:1
MonitorElement * emtfTrackQuality
Definition: L1TStage2EMTF.h:72
int ME1n_6() const
Definition: Counters.h:148
MonitorElement * cscDQMOccupancy
Definition: L1TStage2EMTF.h:49
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int ME1a_5() const
Definition: Counters.h:106
std::vector< ME > MECollection
Definition: ME.h:103
MonitorElement * emtfTrackQualityVsMode
Definition: L1TStage2EMTF.h:73
MonitorElement * emtfTrackOccupancyHighQualityHighPT
Definition: L1TStage2EMTF.h:70
MonitorElement * emtfMuonhwPt
Definition: L1TStage2EMTF.h:77
std::vector< EMTFHit > EMTFHitCollection
Definition: EMTFHit.h:276
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
std::vector< EMTFDaqOut > EMTFDaqOutCollection
Definition: EMTFDaqOut.h:130
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int ME4_7() const
Definition: Counters.h:144
MonitorElement * cscLCTWire[20]
Definition: L1TStage2EMTF.h:45
l1t::EMTFHitCollection EMTFHitCollection
Definition: Common.h:25
MonitorElement * cscLCTOccupancy
Definition: L1TStage2EMTF.h:48
T min(T a, T b)
Definition: MathUtil.h:58
int ME4_3() const
Definition: Counters.h:140
edm::EDGetTokenT< l1t::EMTFTrackCollection > trackToken
Definition: L1TStage2EMTF.h:34
MonitorElement * emtfTrackMode
Definition: L1TStage2EMTF.h:71
TH2F * getTH2F() const
SeedingHitSet::ConstRecHitPointer Hit
void analyze(const edm::Event &, const edm::EventSetup &) override
#define M_PI
bin
set the eta bin as selection string.
int ME1b_3() const
Definition: Counters.h:113
BXVector< Muon > MuonBxCollection
Definition: Muon.h:11
MonitorElement * rpcHitTiming[5]
Definition: L1TStage2EMTF.h:84
int ME3_6() const
Definition: Counters.h:134
int getFirstBX() const
MonitorElement * cscLCTStrip[20]
Definition: L1TStage2EMTF.h:44
MonitorElement * emtfTrackEtaHighQualityHighPT
Definition: L1TStage2EMTF.h:64
int ME1n_9() const
Definition: Counters.h:149
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
edm::EDGetTokenT< l1t::EMTFDaqOutCollection > daqToken
Definition: L1TStage2EMTF.h:32
int ME1a_9() const
Definition: Counters.h:110
~L1TStage2EMTF() override
MonitorElement * emtfTrackBX
Definition: L1TStage2EMTF.h:56
MonitorElement * rpcHitOccupancy
Definition: L1TStage2EMTF.h:83
MonitorElement * emtfMuonhwQual
Definition: L1TStage2EMTF.h:80
int ME2n_9() const
Definition: Counters.h:151
MonitorElement * emtfTrackPtHighQualityHighPT
Definition: L1TStage2EMTF.h:61
MonitorElement * emtfErrors
Definition: L1TStage2EMTF.h:39
int ME2_5() const
Definition: Counters.h:124
int ME3n_9() const
Definition: Counters.h:153
int ME1a_2() const
Definition: Counters.h:103
MonitorElement * rpcHitPhi[12]
Definition: L1TStage2EMTF.h:87
int ME1b_1() const
Definition: Counters.h:111
int ME2_9() const
Definition: Counters.h:128
int ME3_4() const
Definition: Counters.h:132
MonitorElement ME
int ME3_2() const
Definition: Counters.h:130
HLT enums.
MonitorElement * emtfnTracks
Definition: L1TStage2EMTF.h:54
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > muonToken
Definition: L1TStage2EMTF.h:35
int ME1b_6() const
Definition: Counters.h:116
int ME3n_3() const
Definition: Counters.h:152
MonitorElement * emtfTrackOccupancy
Definition: L1TStage2EMTF.h:68
int ME3_9() const
Definition: Counters.h:137
MonitorElement * emtfTrackEta
Definition: L1TStage2EMTF.h:62
int ME4_4() const
Definition: Counters.h:141
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
int getLastBX() const
int ME2_8() const
Definition: Counters.h:127
int ME2_1() const
Definition: Counters.h:120
MonitorElement * emtfTrackEtaHighQuality
Definition: L1TStage2EMTF.h:63
int ME4n_9() const
Definition: Counters.h:155
MonitorElement * emtfTrackBXVsRPCHit[3]
Definition: L1TStage2EMTF.h:58
int ME2_7() const
Definition: Counters.h:126
MonitorElement * emtfTracknHits
Definition: L1TStage2EMTF.h:55
L1TStage2EMTF(const edm::ParameterSet &ps)
Definition: L1TStage2EMTF.cc:8
int ME1b_9() const
Definition: Counters.h:119
MonitorElement * emtfTrackPt
Definition: L1TStage2EMTF.h:59
MonitorElement * rpcHitBX
Definition: L1TStage2EMTF.h:82
const_iterator begin(int bx) const
int ME2_3() const
Definition: Counters.h:122
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * emtfTrackPhiHighQuality
Definition: L1TStage2EMTF.h:66
int ME4n_3() const
Definition: Counters.h:154
int ME1a_7() const
Definition: Counters.h:108
Definition: Run.h:45
MonitorElement * rpcHitTimingInTrack
Definition: L1TStage2EMTF.h:92
std::vector< RegionalMuonCand >::const_iterator const_iterator
Definition: BXVector.h:20
int chamber_bin(int station, int ring, int chamber)
int ME3_8() const
Definition: Counters.h:136
MonitorElement * emtfTrackOccupancyHighQuality
Definition: L1TStage2EMTF.h:69