CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1TGCT.cc
Go to the documentation of this file.
4 
5 // Trigger Headers
6 
7 // GCT and RCT data formats
11 
12 using namespace edm;
13 
14 // Define statics for bins etc.
15 const unsigned int JETETABINS = 22;
16 const float JETETAMIN = -0.5;
17 const float JETETAMAX = 21.5;
18 
19 const unsigned int EMETABINS = 22;
20 const float EMETAMIN = -0.5;
21 const float EMETAMAX = 21.5;
22 
23 const unsigned int METPHIBINS = 72;
24 const float METPHIMIN = -0.5;
25 const float METPHIMAX = 71.5;
26 
27 const unsigned int MHTPHIBINS = 18;
28 const float MHTPHIMIN = -0.5;
29 const float MHTPHIMAX = 17.5;
30 
31 const unsigned int PHIBINS = 18;
32 const float PHIMIN = -0.5;
33 const float PHIMAX = 17.5;
34 
35 const unsigned int OFBINS = 2;
36 const float OFMIN = -0.5;
37 const float OFMAX = 1.5;
38 
39 const unsigned int BXBINS = 5;
40 const float BXMIN = -2.5;
41 const float BXMAX = 2.5;
42 
43 // Bins for 3, 5, 6, 7, 10 and 12 bits
44 const unsigned int R3BINS = 8;
45 const float R3MIN = -0.5;
46 const float R3MAX = 7.5;
47 const unsigned int R5BINS = 32;
48 const float R5MIN = -0.5;
49 const float R5MAX = 31.5;
50 const unsigned int R6BINS = 64;
51 const float R6MIN = -0.5;
52 const float R6MAX = 63.5;
53 const unsigned int R7BINS = 128;
54 const float R7MIN = -0.5;
55 const float R7MAX = 127.5;
56 const unsigned int R12BINS = 4096;
57 const float R12MIN = -0.5;
58 const float R12MAX = 4095.5;
59 
61  : monitorDir_(ps.getUntrackedParameter<std::string>("monitorDir", "")),
62  gctCenJetsSource_(ps.getParameter<edm::InputTag>("gctCentralJetsSource")),
63  gctForJetsSource_(ps.getParameter<edm::InputTag>("gctForwardJetsSource")),
64  gctTauJetsSource_(ps.getParameter<edm::InputTag>("gctTauJetsSource")),
65  gctIsoTauJetsSource_(ps.getParameter<edm::InputTag>("gctIsoTauJetsSource")),
66  gctEnergySumsSource_(ps.getParameter<edm::InputTag>("gctEnergySumsSource")),
67  gctIsoEmSource_(ps.getParameter<edm::InputTag>("gctIsoEmSource")),
68  gctNonIsoEmSource_(ps.getParameter<edm::InputTag>("gctNonIsoEmSource")),
69  m_stage1_layer2_(ps.getParameter<bool>("stage1_layer2_")),
70  filterTriggerType_(ps.getParameter<int>("filterTriggerType")) {
71  // verbosity switch
72  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
73 
74  if (verbose_)
75  edm::LogInfo("L1TGCT") << "L1TGCT: constructor...." << std::endl;
76 
77  outputFile_ = ps.getUntrackedParameter<std::string>("outputFile", "");
78  if (!outputFile_.empty()) {
79  edm::LogInfo("L1TGCT") << "L1T Monitoring histograms will be saved to " << outputFile_ << std::endl;
80  }
81 
82  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
83  if (disable) {
84  outputFile_ = "";
85  }
86 
87  //set Token(-s)
88  gctIsoEmSourceToken_ = consumes<L1GctEmCandCollection>(ps.getParameter<edm::InputTag>("gctIsoEmSource"));
89  gctNonIsoEmSourceToken_ = consumes<L1GctEmCandCollection>(ps.getParameter<edm::InputTag>("gctNonIsoEmSource"));
90  gctCenJetsSourceToken_ = consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctCentralJetsSource"));
91  gctForJetsSourceToken_ = consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctForwardJetsSource"));
92  gctTauJetsSourceToken_ = consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctTauJetsSource"));
93  if (m_stage1_layer2_ == true) {
94  gctIsoTauJetsSourceToken_ = consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctIsoTauJetsSource"));
95  }
97  consumes<L1GctHFRingEtSumsCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
98  l1HFCountsToken_ = consumes<L1GctHFBitCountsCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
99  l1EtMissToken_ = consumes<L1GctEtMissCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
100  l1HtMissToken_ = consumes<L1GctHtMissCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
101  l1EtHadToken_ = consumes<L1GctEtHadCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
102  l1EtTotalToken_ = consumes<L1GctEtTotalCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
103 }
104 
106 
108  nev_ = 0;
109 
110  ibooker.setCurrentFolder(monitorDir_);
111 
112  triggerType_ = ibooker.book1D("TriggerType", "TriggerType", 17, -0.5, 16.5);
113 
114  l1GctAllJetsEtEtaPhi_ = ibooker.book2D(
115  "AllJetsEtEtaPhi", "CENTRAL AND FORWARD JET E_{T}", JETETABINS, JETETAMIN, JETETAMAX, PHIBINS, PHIMIN, PHIMAX);
117  ibooker.book2D("CenJetsEtEtaPhi", "CENTRAL JET E_{T}", JETETABINS, JETETAMIN, JETETAMAX, PHIBINS, PHIMIN, PHIMAX);
119  ibooker.book2D("ForJetsEtEtaPhi", "FORWARD JET E_{T}", JETETABINS, JETETAMIN, JETETAMAX, PHIBINS, PHIMIN, PHIMAX);
121  ibooker.book2D("TauJetsEtEtaPhi", "TAU JET E_{T}", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
122  if (m_stage1_layer2_ == true) {
124  "IsoTauJetsEtEtaPhi", "ISOTAU JET E_{T}", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
125  }
127  ibooker.book2D("IsoEmRankEtaPhi", "ISO EM E_{T}", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
129  ibooker.book2D("NonIsoEmRankEtaPhi", "NON-ISO EM E_{T}", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
130  l1GctAllJetsOccEtaPhi_ = ibooker.book2D("AllJetsOccEtaPhi",
131  "CENTRAL AND FORWARD JET OCCUPANCY",
132  JETETABINS,
133  JETETAMIN,
134  JETETAMAX,
135  PHIBINS,
136  PHIMIN,
137  PHIMAX);
138  l1GctCenJetsOccEtaPhi_ = ibooker.book2D(
139  "CenJetsOccEtaPhi", "CENTRAL JET OCCUPANCY", JETETABINS, JETETAMIN, JETETAMAX, PHIBINS, PHIMIN, PHIMAX);
140  l1GctForJetsOccEtaPhi_ = ibooker.book2D(
141  "ForJetsOccEtaPhi", "FORWARD JET OCCUPANCY", JETETABINS, JETETAMIN, JETETAMAX, PHIBINS, PHIMIN, PHIMAX);
143  ibooker.book2D("TauJetsOccEtaPhi", "TAU JET OCCUPANCY", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
144  if (m_stage1_layer2_ == true) {
146  "IsoTauJetsOccEtaPhi", "ISOTAU JET OCCUPANCY", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
147  }
149  ibooker.book2D("IsoEmOccEtaPhi", "ISO EM OCCUPANCY", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
151  "NonIsoEmOccEtaPhi", "NON-ISO EM OCCUPANCY", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
152 
153  //HF Ring stuff
154 
156  "HFRing1TowerCountCorr", "HF RING1 TOWER COUNT CORRELATION +/- #eta", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
158  "HFRing2TowerCountCorr", "HF RING2 TOWER COUNT CORRELATION +/- #eta", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
159 
161  ibooker.book1D("HFRing1TowerCountPosEta", "HF RING1 TOWER COUNT #eta +", R3BINS, R3MIN, R3MAX);
163  ibooker.book1D("HFRing1TowerCountNegEta", "HF RING1 TOWER COUNT #eta -", R3BINS, R3MIN, R3MAX);
165  ibooker.book1D("HFRing2TowerCountPosEta", "HF RING2 TOWER COUNT #eta +", R3BINS, R3MIN, R3MAX);
167  ibooker.book1D("HFRing2TowerCountNegEta", "HF RING2 TOWER COUNT #eta -", R3BINS, R3MIN, R3MAX);
168 
170  ibooker.book2D("HFRingTowerCountOccBx", "HF RING TOWER COUNT PER BX", BXBINS, BXMIN, BXMAX, R3BINS, R3MIN, R3MAX);
171 
172  if (m_stage1_layer2_ == false) {
174  "HFRing1Corr", "HF RING1 E_{T} CORRELATION +/- #eta", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
176  "HFRing2Corr", "HF RING2 E_{T} CORRELATION +/- #eta", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
177  l1GctHFRing1ETSumPosEta_ = ibooker.book1D("HFRing1ETSumPosEta", "HF RING1 E_{T} #eta +", R3BINS, R3MIN, R3MAX);
178  l1GctHFRing1ETSumNegEta_ = ibooker.book1D("HFRing1ETSumNegEta", "HF RING1 E_{T} #eta -", R3BINS, R3MIN, R3MAX);
179  l1GctHFRing2ETSumPosEta_ = ibooker.book1D("HFRing2ETSumPosEta", "HF RING2 E_{T} #eta +", R3BINS, R3MIN, R3MAX);
180  l1GctHFRing2ETSumNegEta_ = ibooker.book1D("HFRing2ETSumNegEta", "HF RING2 E_{T} #eta -", R3BINS, R3MIN, R3MAX);
182  ibooker.book2D("HFRingETSumOccBx", "HF RING E_{T} PER BX", BXBINS, BXMIN, BXMAX, R3BINS, R3MIN, R3MAX);
183  l1GctHFRingRatioPosEta_ = ibooker.book1D("HFRingRatioPosEta", "HF RING E_{T} RATIO #eta +", R5BINS, R5MIN, R5MAX);
184  l1GctHFRingRatioNegEta_ = ibooker.book1D("HFRingRatioNegEta", "HF RING E_{T} RATIO #eta -", R5BINS, R5MIN, R5MAX);
185  }
186 
187  if (m_stage1_layer2_ == true) {
189  "IsoTau 1 2 Corr", "IsoTau 1 IsoTau 2 E_{T} CORRELATION", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
191  ibooker.book2D("IsoTau 3 4 Corr", "IsoTau 3 IsoTau 4 CORRELATION", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
192  l1GctHFRing1ETSumPosEta_ = ibooker.book1D("Iso Tau 1 Et", "Isolated Tau1 E_{T}", 9, -0.5, 8.5);
193  l1GctHFRing1ETSumNegEta_ = ibooker.book1D("Iso Tau 2 Et", "Isolated Tau2 E_{T}", 9, -0.5, 8.5);
194  l1GctHFRing2ETSumPosEta_ = ibooker.book1D("Iso Tau 3 Et", "Isolated Tau3 E_{T}", 9, -0.5, 8.5);
195  l1GctHFRing2ETSumNegEta_ = ibooker.book1D("Iso Tau 4 Et", "Isolated Tau4 E_{T}", 9, -0.5, 8.5);
197  ibooker.book2D("IsoTau HFRingSum OccBx", "Iso Tau PER BX", BXBINS, BXMIN, BXMAX, R3BINS, R3MIN, R3MAX);
198  l1GctHFRingRatioPosEta_ = ibooker.book1D("IsoTau Ratio 1 2", "IsoTau E_{T} RATIO", 9, -0.5, 8.5);
199  l1GctHFRingRatioNegEta_ = ibooker.book1D("IsoTau Ratio 1 2", "IsoTau E_{T} RATIO", 9, -0.5, 8.5);
200  }
201 
202  // Rank histograms
203  l1GctCenJetsRank_ = ibooker.book1D("CenJetsRank", "CENTRAL JET E_{T}", R6BINS, R6MIN, R6MAX);
204  l1GctForJetsRank_ = ibooker.book1D("ForJetsRank", "FORWARD JET E_{T}", R6BINS, R6MIN, R6MAX);
205  l1GctTauJetsRank_ = ibooker.book1D("TauJetsRank", "TAU JET E_{T}", R6BINS, R6MIN, R6MAX);
206  if (m_stage1_layer2_ == true) {
207  l1GctIsoTauJetsRank_ = ibooker.book1D("IsoTauJetsRank", "ISOTAU JET E_{T}", R6BINS, R6MIN, R6MAX);
208  }
209  l1GctIsoEmRank_ = ibooker.book1D("IsoEmRank", "ISO EM E_{T}", R6BINS, R6MIN, R6MAX);
210  l1GctNonIsoEmRank_ = ibooker.book1D("NonIsoEmRank", "NON-ISO EM E_{T}", R6BINS, R6MIN, R6MAX);
211 
213  ibooker.book2D("AllJetsOccRankBx", "ALL JETS E_{T} PER BX", BXBINS, BXMIN, BXMAX, R6BINS, R6MIN, R6MAX);
215  ibooker.book2D("AllEmOccRankBx", "ALL EM E_{T} PER BX", BXBINS, BXMIN, BXMAX, R6BINS, R6MIN, R6MAX);
216 
217  // Energy sums
218  l1GctEtMiss_ = ibooker.book1D("EtMiss", "MET", R12BINS, R12MIN, R12MAX);
219  l1GctEtMissPhi_ = ibooker.book1D("EtMissPhi", "MET #phi", METPHIBINS, METPHIMIN, METPHIMAX);
220  l1GctEtMissOf_ = ibooker.book1D("EtMissOf", "MET OVERFLOW", OFBINS, OFMIN, OFMAX);
221  l1GctEtMissOccBx_ = ibooker.book2D("EtMissOccBx", "MET PER BX", BXBINS, BXMIN, BXMAX, R12BINS, R12MIN, R12MAX);
222  if (m_stage1_layer2_ == false) {
223  l1GctHtMiss_ = ibooker.book1D("HtMiss", "MHT", R7BINS, R7MIN, R7MAX);
224  l1GctHtMissPhi_ = ibooker.book1D("HtMissPhi", "MHT #phi", MHTPHIBINS, MHTPHIMIN, MHTPHIMAX);
225  l1GctHtMissOf_ = ibooker.book1D("HtMissOf", "MHT OVERFLOW", OFBINS, OFMIN, OFMAX);
226  l1GctHtMissOccBx_ = ibooker.book2D("HtMissOccBx", "MHT PER BX", BXBINS, BXMIN, BXMAX, R7BINS, R7MIN, R7MAX);
227  }
228  if (m_stage1_layer2_ == true) {
229  l1GctHtMiss_ = ibooker.book1D("HtMissHtTotal", "MHTHT", R7BINS, R7MIN, R7MAX);
230  l1GctHtMissPhi_ = ibooker.book1D("HtMissHtTotal Phi", "MHTHT #phi", MHTPHIBINS, MHTPHIMIN, MHTPHIMAX);
231  l1GctHtMissOf_ = ibooker.book1D("HtMissHtTotal Of", "MHTHT OVERFLOW", OFBINS, OFMIN, OFMAX);
233  ibooker.book2D("HtMissHtTotal OccBx", "MHTHT PER BX", BXBINS, BXMIN, BXMAX, R7BINS, R7MIN, R7MAX);
234  }
236  ibooker.book2D("EtMissHtMissCorr", "MET MHT CORRELATION", R6BINS, R12MIN, R12MAX, R6BINS, R7MIN, R7MAX);
237  l1GctEtMissHtMissCorrPhi_ = ibooker.book2D("EtMissHtMissPhiCorr",
238  "MET MHT #phi CORRELATION",
239  METPHIBINS,
240  METPHIMIN,
241  METPHIMAX,
242  MHTPHIBINS,
243  MHTPHIMIN,
244  MHTPHIMAX);
245  l1GctEtTotal_ = ibooker.book1D("EtTotal", "SUM E_{T}", R12BINS, R12MIN, R12MAX);
246  l1GctEtTotalOf_ = ibooker.book1D("EtTotalOf", "SUM E_{T} OVERFLOW", OFBINS, OFMIN, OFMAX);
248  ibooker.book2D("EtTotalOccBx", "SUM E_{T} PER BX", BXBINS, BXMIN, BXMAX, R12BINS, R12MIN, R12MAX);
249  l1GctEtHad_ = ibooker.book1D("EtHad", "H_{T}", R12BINS, R12MIN, R12MAX);
250  l1GctEtHadOf_ = ibooker.book1D("EtHadOf", "H_{T} OVERFLOW", OFBINS, OFMIN, OFMAX);
251  l1GctEtHadOccBx_ = ibooker.book2D("EtHadOccBx", "H_{T} PER BX", BXBINS, BXMIN, BXMAX, R12BINS, R12MIN, R12MAX);
253  ibooker.book2D("EtTotalEtHadCorr", "Sum E_{T} H_{T} CORRELATION", R6BINS, R12MIN, R12MAX, R6BINS, R12MIN, R12MAX);
254  //}
255 }
256 
258  nev_++;
259  if (verbose_) {
260  edm::LogInfo("L1TGCT") << "L1TGCT: analyze...." << std::endl;
261  }
262 
263  // filter according trigger type
264  // enum ExperimentType {
265  // Undefined = 0,
266  // PhysicsTrigger = 1,
267  // CalibrationTrigger = 2,
268  // RandomTrigger = 3,
269  // Reserved = 4,
270  // TracedEvent = 5,
271  // TestTrigger = 6,
272  // ErrorTrigger = 15
273 
274  // fill a histogram with the trigger type, for normalization fill also last bin
275  // ErrorTrigger + 1
276  double triggerType = static_cast<double>(e.experimentType()) + 0.001;
277  double triggerTypeLast = static_cast<double>(edm::EventAuxiliary::ExperimentType::ErrorTrigger) + 0.001;
278  triggerType_->Fill(triggerType);
279  triggerType_->Fill(triggerTypeLast + 1);
280 
281  // filter only if trigger type is greater than 0, negative values disable filtering
282  if (filterTriggerType_ >= 0) {
283  // now filter, for real data only
284  if (e.isRealData()) {
285  if (!(e.experimentType() == filterTriggerType_)) {
286  edm::LogInfo("L1TGCT") << "\n Event of TriggerType " << e.experimentType() << " rejected" << std::endl;
287  return;
288  }
289  }
290  }
291 
292  // Get all the collections
298  if (m_stage1_layer2_ == true) {
300  e.getByToken(gctIsoTauJetsSourceToken_, l1IsoTauJets);
301  }
308 
309  e.getByToken(gctIsoEmSourceToken_, l1IsoEm);
310  e.getByToken(gctNonIsoEmSourceToken_, l1NonIsoEm);
311  e.getByToken(gctCenJetsSourceToken_, l1CenJets);
312  e.getByToken(gctForJetsSourceToken_, l1ForJets);
313  e.getByToken(gctTauJetsSourceToken_, l1TauJets);
315  e.getByToken(l1HFCountsToken_, l1HFCounts);
316  e.getByToken(l1EtMissToken_, l1EtMiss);
317  e.getByToken(l1HtMissToken_, l1HtMiss);
318  e.getByToken(l1EtHadToken_, l1EtHad);
319  e.getByToken(l1EtTotalToken_, l1EtTotal);
320 
321  // Fill histograms
322 
323  // Central jets
324  if (l1CenJets.isValid()) {
325  for (L1GctJetCandCollection::const_iterator cj = l1CenJets->begin(); cj != l1CenJets->end(); cj++) {
326  // only plot central BX
327  if (cj->bx() == 0) {
328  l1GctCenJetsRank_->Fill(cj->rank());
329  // only plot eta and phi maps for non-zero candidates
330  if (cj->rank()) {
331  l1GctAllJetsEtEtaPhi_->Fill(cj->regionId().ieta(), cj->regionId().iphi(), cj->rank());
332  l1GctAllJetsOccEtaPhi_->Fill(cj->regionId().ieta(), cj->regionId().iphi());
333  l1GctCenJetsEtEtaPhi_->Fill(cj->regionId().ieta(), cj->regionId().iphi(), cj->rank());
334  l1GctCenJetsOccEtaPhi_->Fill(cj->regionId().ieta(), cj->regionId().iphi());
335  }
336  }
337  if (cj->rank())
338  l1GctAllJetsOccRankBx_->Fill(cj->bx(), cj->rank()); // for all BX
339  }
340  } else {
341  edm::LogWarning("DataNotFound") << " Could not find l1CenJets label was " << gctCenJetsSource_;
342  }
343 
344  // Forward jets
345  if (l1ForJets.isValid()) {
346  for (L1GctJetCandCollection::const_iterator fj = l1ForJets->begin(); fj != l1ForJets->end(); fj++) {
347  // only plot central BX
348  if (fj->bx() == 0) {
349  l1GctForJetsRank_->Fill(fj->rank());
350  // only plot eta and phi maps for non-zero candidates
351  if (fj->rank()) {
352  l1GctAllJetsEtEtaPhi_->Fill(fj->regionId().ieta(), fj->regionId().iphi(), fj->rank());
353  l1GctAllJetsOccEtaPhi_->Fill(fj->regionId().ieta(), fj->regionId().iphi());
354  l1GctForJetsEtEtaPhi_->Fill(fj->regionId().ieta(), fj->regionId().iphi(), fj->rank());
355  l1GctForJetsOccEtaPhi_->Fill(fj->regionId().ieta(), fj->regionId().iphi());
356  }
357  }
358  if (fj->rank())
359  l1GctAllJetsOccRankBx_->Fill(fj->bx(), fj->rank()); // for all BX
360  }
361  } else {
362  edm::LogWarning("DataNotFound") << " Could not find l1ForJets label was " << gctForJetsSource_;
363  }
364 
365  // Tau jets
366  if (l1TauJets.isValid()) {
367  for (L1GctJetCandCollection::const_iterator tj = l1TauJets->begin(); tj != l1TauJets->end(); tj++) {
368  // only plot central BX
369  if (tj->bx() == 0) {
370  l1GctTauJetsRank_->Fill(tj->rank());
371  // only plot eta and phi maps for non-zero candidates
372  if (tj->rank()) {
373  l1GctTauJetsEtEtaPhi_->Fill(tj->regionId().ieta(), tj->regionId().iphi(), tj->rank());
374  l1GctTauJetsOccEtaPhi_->Fill(tj->regionId().ieta(), tj->regionId().iphi());
375  }
376  }
377  if (tj->rank())
378  l1GctAllJetsOccRankBx_->Fill(tj->bx(), tj->rank()); // for all BX
379  }
380  } else {
381  edm::LogWarning("DataNotFound") << " Could not find l1TauJets label was " << gctTauJetsSource_;
382  }
383 
384  // IsoTau jets
385  if (m_stage1_layer2_ == true) {
387  e.getByToken(gctIsoTauJetsSourceToken_, l1IsoTauJets);
388  if (l1IsoTauJets.isValid()) {
389  for (L1GctJetCandCollection::const_iterator itj = l1IsoTauJets->begin(); itj != l1IsoTauJets->end(); itj++) {
390  // only plot central BX
391  if (itj->bx() == 0) {
392  l1GctIsoTauJetsRank_->Fill(itj->rank());
393  // only plot eta and phi maps for non-zero candidates
394  if (itj->rank()) {
395  l1GctIsoTauJetsEtEtaPhi_->Fill(itj->regionId().ieta(), itj->regionId().iphi(), itj->rank());
396  l1GctIsoTauJetsOccEtaPhi_->Fill(itj->regionId().ieta(), itj->regionId().iphi());
397  }
398  }
399  if (itj->rank())
400  l1GctAllJetsOccRankBx_->Fill(itj->bx(), itj->rank()); // for all BX
401  }
402  } else {
403  edm::LogWarning("DataNotFound") << " Could not find l1IsoTauJets label was " << gctIsoTauJetsSource_;
404  }
405  }
406 
407  // Missing ET
408  if (l1EtMiss.isValid()) {
409  for (L1GctEtMissCollection::const_iterator met = l1EtMiss->begin(); met != l1EtMiss->end(); met++) {
410  // only plot central BX
411  if (met->bx() == 0) {
412  if (met->overFlow() == 0 && met->et() > 0) {
413  //Avoid problems with met=0 candidates affecting MET_PHI plots
414  l1GctEtMiss_->Fill(met->et());
415  l1GctEtMissPhi_->Fill(met->phi());
416  }
417  l1GctEtMissOf_->Fill(met->overFlow());
418  }
419  if (met->overFlow() == 0 && met->et() > 0)
420  l1GctEtMissOccBx_->Fill(met->bx(), met->et()); // for all BX
421  }
422  } else {
423  edm::LogWarning("DataNotFound") << " Could not find l1EtMiss label was " << gctEnergySumsSource_;
424  }
425 
426  // Missing HT
427  if (l1HtMiss.isValid()) {
428  for (L1GctHtMissCollection::const_iterator mht = l1HtMiss->begin(); mht != l1HtMiss->end(); mht++) {
429  // only plot central BX
430  if (mht->bx() == 0) {
431  if (mht->overFlow() == 0 && mht->et() > 0) {
432  //Avoid problems with mht=0 candidates affecting MHT_PHI plots
433  l1GctHtMiss_->Fill(mht->et());
434  l1GctHtMissPhi_->Fill(mht->phi());
435  }
436  l1GctHtMissOf_->Fill(mht->overFlow());
437  }
438  if (mht->overFlow() == 0 && mht->et() > 0)
439  l1GctHtMissOccBx_->Fill(mht->bx(), mht->et()); // for all BX
440  }
441  } else {
442  edm::LogWarning("DataNotFound") << " Could not find l1HtMiss label was " << gctEnergySumsSource_;
443  }
444 
445  // Missing ET HT correlations
446  if (l1HtMiss.isValid() && l1EtMiss.isValid()) {
447  if (l1HtMiss->size() == l1EtMiss->size()) {
448  for (unsigned i = 0; i < l1HtMiss->size(); i++) {
449  if (l1HtMiss->at(i).overFlow() == 0 && l1EtMiss->at(i).overFlow() == 0 && l1HtMiss->at(i).bx() == 0 &&
450  l1EtMiss->at(i).bx() == 0) {
451  // Avoid problems overflows and only plot central BX
452  l1GctEtMissHtMissCorr_->Fill(l1EtMiss->at(i).et(), l1HtMiss->at(i).et());
453  if (l1HtMiss->at(i).et() && l1EtMiss->at(i).et()) { // Don't plot phi if one or other is zero
454  l1GctEtMissHtMissCorrPhi_->Fill(l1EtMiss->at(i).phi(), l1HtMiss->at(i).phi());
455  }
456  }
457  }
458  }
459  } else {
460  edm::LogWarning("DataNotFound") << " Could not find l1EtMiss or l1HtMiss label was " << gctEnergySumsSource_;
461  }
462 
463  // HT
464  if (l1EtHad.isValid()) {
465  for (L1GctEtHadCollection::const_iterator ht = l1EtHad->begin(); ht != l1EtHad->end(); ht++) {
466  // only plot central BX
467  if (ht->bx() == 0) {
468  l1GctEtHad_->Fill(ht->et());
469  l1GctEtHadOf_->Fill(ht->overFlow());
470  }
471  l1GctEtHadOccBx_->Fill(ht->bx(), ht->et()); // for all BX
472  }
473  } else {
474  edm::LogWarning("DataNotFound") << " Could not find l1EtHad label was " << gctEnergySumsSource_;
475  }
476 
477  // Total ET
478  if (l1EtTotal.isValid()) {
479  for (L1GctEtTotalCollection::const_iterator et = l1EtTotal->begin(); et != l1EtTotal->end(); et++) {
480  // only plot central BX
481  if (et->bx() == 0) {
482  l1GctEtTotal_->Fill(et->et());
483  l1GctEtTotalOf_->Fill(et->overFlow());
484  }
485  l1GctEtTotalOccBx_->Fill(et->bx(), et->et()); // for all BX
486  }
487  } else {
488  edm::LogWarning("DataNotFound") << " Could not find l1EtTotal label was " << gctEnergySumsSource_;
489  }
490 
491  // Total ET HT correlations
492  if (l1EtTotal.isValid() && l1EtHad.isValid()) {
493  if (l1EtTotal->size() == l1EtHad->size()) {
494  for (unsigned i = 0; i < l1EtHad->size(); i++) {
495  if (l1EtHad->at(i).overFlow() == 0 && l1EtTotal->at(i).overFlow() == 0 && l1EtHad->at(i).bx() == 0 &&
496  l1EtTotal->at(i).bx() == 0) {
497  // Avoid problems overflows and only plot central BX
498  l1GctEtTotalEtHadCorr_->Fill(l1EtTotal->at(i).et(), l1EtHad->at(i).et());
499  }
500  }
501  }
502  } else {
503  edm::LogWarning("DataNotFound") << " Could not find l1EtTotal or l1EtHad label was " << gctEnergySumsSource_;
504  }
505 
506  //HF Ring Et Sums
507  if (l1HFSums.isValid()) {
508  for (L1GctHFRingEtSumsCollection::const_iterator hfs = l1HFSums->begin(); hfs != l1HFSums->end(); hfs++) {
509  // only plot central BX
510  if (hfs->bx() == 0) {
511  // Individual ring Et sums
512  l1GctHFRing1ETSumPosEta_->Fill(hfs->etSum(0));
513  l1GctHFRing1ETSumNegEta_->Fill(hfs->etSum(1));
514  l1GctHFRing2ETSumPosEta_->Fill(hfs->etSum(2));
515  l1GctHFRing2ETSumNegEta_->Fill(hfs->etSum(3));
516  // Ratio of ring Et sums
517  if (hfs->etSum(2) != 0)
518  l1GctHFRingRatioPosEta_->Fill((hfs->etSum(0)) / (hfs->etSum(2)));
519  if (hfs->etSum(3) != 0)
520  l1GctHFRingRatioNegEta_->Fill((hfs->etSum(1)) / (hfs->etSum(3)));
521  // Correlate positive and neagative eta
522  l1GctHFRing1PosEtaNegEta_->Fill(hfs->etSum(0), hfs->etSum(1));
523  l1GctHFRing2PosEtaNegEta_->Fill(hfs->etSum(2), hfs->etSum(3));
524  }
525  // Occupancy vs BX
526  for (unsigned i = 0; i < 4; i++) {
527  l1GctHFRingETSumOccBx_->Fill(hfs->bx(), hfs->etSum(i));
528  }
529  }
530  } else {
531  edm::LogWarning("DataNotFound") << " Could not find l1HFSums label was " << gctEnergySumsSource_;
532  }
533 
534  // HF Ring Counts
535  if (l1HFCounts.isValid()) {
536  for (L1GctHFBitCountsCollection::const_iterator hfc = l1HFCounts->begin(); hfc != l1HFCounts->end(); hfc++) {
537  // only plot central BX
538  if (hfc->bx() == 0) {
539  // Individual ring counts
540  l1GctHFRing1TowerCountPosEta_->Fill(hfc->bitCount(0));
541  l1GctHFRing1TowerCountNegEta_->Fill(hfc->bitCount(1));
542  l1GctHFRing2TowerCountPosEta_->Fill(hfc->bitCount(2));
543  l1GctHFRing2TowerCountNegEta_->Fill(hfc->bitCount(3));
544  // Correlate positive and negative eta
545  l1GctHFRing1TowerCountPosEtaNegEta_->Fill(hfc->bitCount(0), hfc->bitCount(1));
546  l1GctHFRing2TowerCountPosEtaNegEta_->Fill(hfc->bitCount(2), hfc->bitCount(3));
547  }
548  // Occupancy vs BX
549  for (unsigned i = 0; i < 4; i++) {
550  l1GctHFRingTowerCountOccBx_->Fill(hfc->bx(), hfc->bitCount(i));
551  }
552  }
553  } else {
554  edm::LogWarning("DataNotFound") << " Could not find l1HFCounts label was " << gctEnergySumsSource_;
555  }
556 
557  // Isolated EM
558  if (l1IsoEm.isValid()) {
559  for (L1GctEmCandCollection::const_iterator ie = l1IsoEm->begin(); ie != l1IsoEm->end(); ie++) {
560  // only plot central BX
561  if (ie->bx() == 0) {
562  l1GctIsoEmRank_->Fill(ie->rank());
563  // only plot eta and phi maps for non-zero candidates
564  if (ie->rank()) {
565  l1GctIsoEmRankEtaPhi_->Fill(ie->regionId().ieta(), ie->regionId().iphi(), ie->rank());
566  l1GctIsoEmOccEtaPhi_->Fill(ie->regionId().ieta(), ie->regionId().iphi());
567  }
568  }
569  if (ie->rank())
570  l1GctAllEmOccRankBx_->Fill(ie->bx(), ie->rank()); // for all BX
571  }
572  } else {
573  edm::LogWarning("DataNotFound") << " Could not find l1IsoEm label was " << gctIsoEmSource_;
574  }
575 
576  // Non-isolated EM
577  if (l1NonIsoEm.isValid()) {
578  for (L1GctEmCandCollection::const_iterator ne = l1NonIsoEm->begin(); ne != l1NonIsoEm->end(); ne++) {
579  // only plot central BX
580  if (ne->bx() == 0) {
581  l1GctNonIsoEmRank_->Fill(ne->rank());
582  // only plot eta and phi maps for non-zero candidates
583  if (ne->rank()) {
584  l1GctNonIsoEmRankEtaPhi_->Fill(ne->regionId().ieta(), ne->regionId().iphi(), ne->rank());
585  l1GctNonIsoEmOccEtaPhi_->Fill(ne->regionId().ieta(), ne->regionId().iphi());
586  }
587  }
588  if (ne->rank())
589  l1GctAllEmOccRankBx_->Fill(ne->bx(), ne->rank()); // for all BX
590  }
591  } else {
592  edm::LogWarning("DataNotFound") << " Could not find l1NonIsoEm label was " << gctNonIsoEmSource_;
593  }
594  edm::LogInfo("L1TGCT") << "L1TGCT: end job...." << std::endl;
595  edm::LogInfo("EndJob") << "analyzed " << nev_ << " events";
596 }
const float METPHIMAX
Definition: L1TGCT.cc:25
const unsigned int R6BINS
Definition: L1TCompare.cc:71
const unsigned int BXBINS
Definition: L1TGCT.cc:39
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * l1GctHtMiss_
Definition: L1TGCT.h:173
MonitorElement * l1GctEtHad_
Definition: L1TGCT.h:182
MonitorElement * l1GctHtMissPhi_
Definition: L1TGCT.h:174
const unsigned int OFBINS
Definition: L1TGCT.cc:35
edm::InputTag gctEnergySumsSource_
Definition: L1TGCT.h:215
MonitorElement * l1GctHFRing2TowerCountNegEta_
Definition: L1TGCT.h:195
const edm::EventSetup & c
MonitorElement * l1GctEtMissOccBx_
Definition: L1TGCT.h:172
MonitorElement * l1GctCenJetsRank_
Definition: L1TGCT.h:158
MonitorElement * l1GctHFRing1ETSumNegEta_
Definition: L1TGCT.h:197
MonitorElement * l1GctEtTotalEtHadCorr_
Definition: L1TGCT.h:185
MonitorElement * l1GctHFRing1TowerCountPosEta_
Definition: L1TGCT.h:192
const unsigned int EMETABINS
Definition: L1TGCT.cc:19
MonitorElement * l1GctTauJetsEtEtaPhi_
Definition: L1TGCT.h:145
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * l1GctHFRingETSumOccBx_
Definition: L1TGCT.h:202
~L1TGCT() override
Definition: L1TGCT.cc:105
MonitorElement * l1GctNonIsoEmRank_
Definition: L1TGCT.h:163
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
const unsigned int MHTPHIBINS
Definition: L1TGCT.cc:27
const float OFMAX
Definition: L1TGCT.cc:37
MonitorElement * l1GctEtMiss_
Definition: L1TGCT.h:169
std::string monitorDir_
Definition: L1TGCT.h:136
MonitorElement * l1GctHFRing2ETSumNegEta_
Definition: L1TGCT.h:199
MonitorElement * l1GctAllEmOccRankBx_
Definition: L1TGCT.h:166
edm::EDGetTokenT< L1GctJetCandCollection > gctCenJetsSourceToken_
Definition: L1TGCT.h:226
MonitorElement * l1GctEtTotal_
Definition: L1TGCT.h:179
const float PHIMAX
Definition: L1TCompare.cc:68
MonitorElement * l1GctHtMissOf_
Definition: L1TGCT.h:175
edm::EDGetTokenT< L1GctHtMissCollection > l1HtMissToken_
Definition: L1TGCT.h:233
MonitorElement * l1GctIsoTauJetsEtEtaPhi_
Definition: L1TGCT.h:146
MonitorElement * l1GctEtHadOccBx_
Definition: L1TGCT.h:184
MonitorElement * l1GctEtTotalOccBx_
Definition: L1TGCT.h:181
edm::InputTag gctIsoTauJetsSource_
Definition: L1TGCT.h:214
bool isRealData() const
Definition: EventBase.h:62
edm::EDGetTokenT< L1GctEtTotalCollection > l1EtTotalToken_
Definition: L1TGCT.h:235
MonitorElement * l1GctHFRingTowerCountOccBx_
Definition: L1TGCT.h:203
MonitorElement * l1GctForJetsRank_
Definition: L1TGCT.h:159
const unsigned int PHIBINS
Definition: L1TCompare.cc:66
MonitorElement * l1GctTauJetsRank_
Definition: L1TGCT.h:160
MonitorElement * l1GctHFRing2ETSumPosEta_
Definition: L1TGCT.h:198
edm::InputTag gctCenJetsSource_
Definition: L1TGCT.h:211
L1TGCT(const edm::ParameterSet &ps)
Definition: L1TGCT.cc:60
void Fill(long long x)
MonitorElement * l1GctEtMissPhi_
Definition: L1TGCT.h:170
MonitorElement * l1GctCenJetsEtEtaPhi_
Definition: L1TGCT.h:143
edm::InputTag gctTauJetsSource_
Definition: L1TGCT.h:213
edm::EDGetTokenT< L1GctEmCandCollection > gctIsoEmSourceToken_
Definition: L1TGCT.h:224
MonitorElement * l1GctAllJetsEtEtaPhi_
Definition: L1TGCT.h:142
const float JETETAMAX
Definition: L1TGCT.cc:17
MonitorElement * l1GctHFRing1ETSumPosEta_
Definition: L1TGCT.h:196
const float R6MAX
Definition: L1TCompare.cc:73
edm::EDGetTokenT< L1GctJetCandCollection > gctTauJetsSourceToken_
Definition: L1TGCT.h:228
const unsigned int R3BINS
Definition: L1TGCT.cc:44
edm::EDGetTokenT< L1GctHFBitCountsCollection > l1HFCountsToken_
Definition: L1TGCT.h:231
MonitorElement * l1GctHFRingRatioNegEta_
Definition: L1TGCT.h:201
const float EMETAMIN
Definition: L1TGCT.cc:20
MonitorElement * l1GctCenJetsOccEtaPhi_
Definition: L1TGCT.h:151
MonitorElement * l1GctIsoTauJetsRank_
Definition: L1TGCT.h:161
MonitorElement * l1GctEtMissOf_
Definition: L1TGCT.h:171
MonitorElement * l1GctForJetsEtEtaPhi_
Definition: L1TGCT.h:144
const unsigned int JETETABINS
Definition: L1TGCT.cc:15
MonitorElement * l1GctIsoEmRank_
Definition: L1TGCT.h:162
const float R12MAX
Definition: L1TGCT.cc:58
const float PHIMIN
Definition: L1TCompare.cc:67
MonitorElement * l1GctHtMissOccBx_
Definition: L1TGCT.h:176
const float R7MAX
Definition: L1TGCT.cc:55
edm::EDGetTokenT< L1GctEmCandCollection > gctNonIsoEmSourceToken_
Definition: L1TGCT.h:225
const float R5MAX
Definition: L1TGCT.cc:49
MonitorElement * l1GctHFRing2TowerCountPosEta_
Definition: L1TGCT.h:194
edm::EDGetTokenT< L1GctEtHadCollection > l1EtHadToken_
Definition: L1TGCT.h:234
const float R12MIN
Definition: L1TGCT.cc:57
MonitorElement * l1GctHFRing2TowerCountPosEtaNegEta_
Definition: L1TGCT.h:191
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag gctIsoEmSource_
Definition: L1TGCT.h:216
MonitorElement * triggerType_
Definition: L1TGCT.h:139
const float OFMIN
Definition: L1TGCT.cc:36
MonitorElement * l1GctEtMissHtMissCorrPhi_
Definition: L1TGCT.h:178
const float MHTPHIMAX
Definition: L1TGCT.cc:29
const float R5MIN
Definition: L1TGCT.cc:48
MonitorElement * l1GctNonIsoEmOccEtaPhi_
Definition: L1TGCT.h:156
const float MHTPHIMIN
Definition: L1TGCT.cc:28
Log< level::Info, false > LogInfo
int filterTriggerType_
Definition: L1TGCT.h:221
const unsigned int R7BINS
Definition: L1TGCT.cc:53
const float R6MIN
Definition: L1TCompare.cc:72
edm::InputTag gctForJetsSource_
Definition: L1TGCT.h:212
MonitorElement * l1GctNonIsoEmRankEtaPhi_
Definition: L1TGCT.h:148
int nev_
Definition: L1TGCT.h:205
MonitorElement * l1GctIsoTauJetsOccEtaPhi_
Definition: L1TGCT.h:154
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
bool m_stage1_layer2_
filter TriggerType
Definition: L1TGCT.h:220
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * l1GctHFRing1PosEtaNegEta_
Definition: L1TGCT.h:188
const unsigned int R12BINS
Definition: L1TGCT.cc:56
const unsigned int R5BINS
Definition: L1TGCT.cc:47
edm::EDGetTokenT< L1GctHFRingEtSumsCollection > gctEnergySumsSourceToken_
Definition: L1TGCT.h:230
MonitorElement * l1GctAllJetsOccEtaPhi_
Definition: L1TGCT.h:150
edm::EDGetTokenT< L1GctJetCandCollection > gctIsoTauJetsSourceToken_
Definition: L1TGCT.h:229
static const int BXMAX
MonitorElement * l1GctHFRingRatioPosEta_
Definition: L1TGCT.h:200
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
Definition: L1TGCT.cc:107
MonitorElement * l1GctIsoEmRankEtaPhi_
Definition: L1TGCT.h:147
MonitorElement * l1GctHFRing1TowerCountPosEtaNegEta_
Definition: L1TGCT.h:190
const float METPHIMIN
Definition: L1TGCT.cc:24
edm::EventAuxiliary::ExperimentType experimentType() const
Definition: EventBase.h:63
edm::EDGetTokenT< L1GctJetCandCollection > gctForJetsSourceToken_
Definition: L1TGCT.h:227
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TGCT.cc:257
MonitorElement * l1GctEtHadOf_
Definition: L1TGCT.h:183
std::string outputFile_
Definition: L1TGCT.h:206
MonitorElement * l1GctForJetsOccEtaPhi_
Definition: L1TGCT.h:152
const float EMETAMAX
Definition: L1TGCT.cc:21
Log< level::Warning, false > LogWarning
MonitorElement * l1GctHFRing1TowerCountNegEta_
Definition: L1TGCT.h:193
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
edm::EDGetTokenT< L1GctEtMissCollection > l1EtMissToken_
Definition: L1TGCT.h:232
static const int BXMIN
bool verbose_
Definition: L1TGCT.h:207
MonitorElement * l1GctEtTotalOf_
Definition: L1TGCT.h:180
const float R3MAX
Definition: L1TGCT.cc:46
MonitorElement * l1GctAllJetsOccRankBx_
Definition: L1TGCT.h:165
MonitorElement * l1GctEtMissHtMissCorr_
Definition: L1TGCT.h:177
MonitorElement * l1GctHFRing2PosEtaNegEta_
Definition: L1TGCT.h:189
const unsigned int METPHIBINS
Definition: L1TGCT.cc:23
edm::InputTag gctNonIsoEmSource_
Definition: L1TGCT.h:217
MonitorElement * l1GctTauJetsOccEtaPhi_
Definition: L1TGCT.h:153
Definition: Run.h:45
MonitorElement * l1GctIsoEmOccEtaPhi_
Definition: L1TGCT.h:155
const float R3MIN
Definition: L1TGCT.cc:45
const float R7MIN
Definition: L1TGCT.cc:54
const float JETETAMIN
Definition: L1TGCT.cc:16