CMS 3D CMS Logo

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