CMS 3D CMS Logo

L1TObjectsTiming.cc
Go to the documentation of this file.
2 
3 
5  : ugmtMuonToken_(consumes<l1t::MuonBxCollection>(ps.getParameter<edm::InputTag>("muonProducer"))),
6  stage2CaloLayer2JetToken_(consumes<l1t::JetBxCollection>(ps.getParameter<edm::InputTag>("stage2CaloLayer2JetProducer"))),
7  stage2CaloLayer2EGammaToken_(consumes<l1t::EGammaBxCollection>(ps.getParameter<edm::InputTag>("stage2CaloLayer2EGammaProducer"))),
8  stage2CaloLayer2TauToken_(consumes<l1t::TauBxCollection>(ps.getParameter<edm::InputTag>("stage2CaloLayer2TauProducer"))),
9  stage2CaloLayer2EtSumToken_(consumes<l1t::EtSumBxCollection>(ps.getParameter<edm::InputTag>("stage2CaloLayer2EtSumProducer"))),
10  l1tStage2uGtProducer_(consumes<GlobalAlgBlkBxCollection>(ps.getParameter<edm::InputTag>("ugtProducer"))),
11  monitorDir_(ps.getUntrackedParameter<std::string>("monitorDir")),
12  verbose_(ps.getUntrackedParameter<bool>("verbose")),
13  gtUtil_(new l1t::L1TGlobalUtil(ps, consumesCollector(), *this, ps.getParameter<edm::InputTag>("ugtProducer"), ps.getParameter<edm::InputTag>("ugtProducer"))),
14  algoBitFirstBxInTrain_(-1),
15  algoBitLastBxInTrain_(-1),
16  algoNameFirstBxInTrain_(ps.getUntrackedParameter<std::string>("firstBXInTrainAlgo","")),
17  algoNameLastBxInTrain_(ps.getUntrackedParameter<std::string>("lastBXInTrainAlgo","")),
18  bxrange_(5)
19 
20 {
21 
22  muons_eta_phi.reserve(bxrange_);
23  jet_eta_phi.reserve(bxrange_);
24  egamma_eta_phi.reserve(bxrange_);
25  tau_eta_phi.reserve(bxrange_);
26  etsum_eta_phi_MET.reserve(bxrange_);
28  etsum_eta_phi_MHT.reserve(bxrange_);
54 
55 }
56 
58 
61  desc.add<edm::InputTag>("muonProducer")->setComment("L1T muons");;
62  desc.add<edm::InputTag>("stage2CaloLayer2JetProducer")->setComment("L1T jets");
63  desc.add<edm::InputTag>("stage2CaloLayer2EGammaProducer")->setComment("L1T egamma");
64  desc.add<edm::InputTag>("stage2CaloLayer2TauProducer")->setComment("L1T taus");
65  desc.add<edm::InputTag>("stage2CaloLayer2EtSumProducer")->setComment("L1T etsums");
66  desc.add<edm::InputTag>("ugtProducer")->setComment("uGT output");
67  desc.addUntracked<std::string>("monitorDir", "")->setComment("Target directory in the DQM file. Will be created if not existing.");
68  desc.addUntracked<bool>("verbose", false);
69  desc.addUntracked<std::string>("firstBXInTrainAlgo","")->setComment("Pick the right algo name for L1 First Collision In Train");
70  desc.addUntracked<std::string>("lastBXInTrainAlgo","")->setComment("Pick the right algo name for L1 Last Collision In Train");
71  descriptions.add("l1tObjectsTiming", desc);
72 }
73 
75  // Get the trigger menu information
76  gtUtil_->retrieveL1Setup(c);
77  // Get the algo bits needed for the timing histograms
78  if (!gtUtil_->getAlgBitFromName(algoNameFirstBxInTrain_, algoBitFirstBxInTrain_)) {
79  edm::LogWarning("L1TObjectsTiming") << "Algo \"" << algoNameFirstBxInTrain_ << "\" not found in the trigger menu " << gtUtil_->gtTriggerMenuName() << ". Could not retrieve algo bit number.";
80  }
81  if (!gtUtil_->getAlgBitFromName(algoNameLastBxInTrain_, algoBitLastBxInTrain_)) {
82  edm::LogWarning("L1TObjectsTiming") << "Algo \"" << algoNameLastBxInTrain_ << "\" not found in the trigger menu " << gtUtil_->gtTriggerMenuName() << ". Could not retrieve algo bit number.";
83  }
84 
85 
86 }
87 
89 
91 
92 
93  // Subsystem Monitoring and Muon Output
94  std::string bx_obj[5]={"minus2","minus1","0","plus1","plus2"};
95 
96  ibooker.setCurrentFolder(monitorDir_+"/L1TMuon"+"/timing");
97  for(unsigned int i=0; i<bxrange_; ++i) {
98  muons_eta_phi.push_back(ibooker.book2D("muons_eta_phi_bx_"+bx_obj[i],"L1T Muon #eta vs #phi BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
99  muons_eta_phi.at(i)->setAxisTitle("#eta", 1);
100  muons_eta_phi.at(i)->setAxisTitle("#phi", 2);
101  }
102 
103  ibooker.setCurrentFolder(monitorDir_+"/L1TJet"+"/timing");
104  for(unsigned int i=0; i<bxrange_; ++i) {
105  jet_eta_phi.push_back(ibooker.book2D("jet_eta_phi_bx_"+bx_obj[i],"L1T Jet #eta vs #phi BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
106  jet_eta_phi.at(i)->setAxisTitle("#eta", 1);
107  jet_eta_phi.at(i)->setAxisTitle("#phi", 2);
108  }
109 
110  ibooker.setCurrentFolder(monitorDir_+"/L1TEGamma"+"/timing");
111  for(unsigned int i=0; i<bxrange_; ++i) {
112  egamma_eta_phi.push_back(ibooker.book2D("egamma_eta_phi_bx_"+bx_obj[i],"L1T EGamma #eta vs #phi BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
113  egamma_eta_phi.at(i)->setAxisTitle("#eta", 1);
114  egamma_eta_phi.at(i)->setAxisTitle("#phi", 2);
115  }
116 
117  ibooker.setCurrentFolder(monitorDir_+"/L1TTau"+"/timing");
118  for(unsigned int i=0; i<bxrange_; ++i) {
119  tau_eta_phi.push_back(ibooker.book2D("tau_eta_phi_bx_"+bx_obj[i],"L1T Tau #eta vs #phi BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
120  tau_eta_phi.at(i)->setAxisTitle("#eta", 1);
121  tau_eta_phi.at(i)->setAxisTitle("#phi", 2);
122  }
123 
124  ibooker.setCurrentFolder(monitorDir_+"/L1TEtSum"+"/timing");
125  for(unsigned int i=0; i<bxrange_; ++i) {
126  etsum_eta_phi_MET.push_back(ibooker.book1D("etsum_phi_bx_MET_"+bx_obj[i],"L1T MET #phi BX="+bx_obj[i],25, -3.2, 3.2));
127  etsum_eta_phi_MET.at(i)->setAxisTitle("#phi", 1);
128  etsum_eta_phi_METHF.push_back(ibooker.book1D("etsum_phi_bx_METHF_"+bx_obj[i],"L1T METHF #phi BX="+bx_obj[i],25, -3.2, 3.2));
129  etsum_eta_phi_METHF.at(i)->setAxisTitle("#phi", 1);
130  etsum_eta_phi_MHT.push_back(ibooker.book1D("etsum_phi_bx_MHT_"+bx_obj[i],"L1T MHT #phi BX="+bx_obj[i],25, -3.2, 3.2));
131  etsum_eta_phi_MHT.at(i)->setAxisTitle("#phi", 1);
132  etsum_eta_phi_MHTHF.push_back(ibooker.book1D("etsum_phi_bx_MHTHF_"+bx_obj[i],"L1T MHTHF #phi BX="+bx_obj[i],25, -3.2, 3.2));
133  etsum_eta_phi_MHTHF.at(i)->setAxisTitle("#phi", 1);
134  }
135 
137  ibooker.setCurrentFolder(monitorDir_+"/L1TMuon"+"/timing"+"/Isolated_bunch");
138  for(unsigned int i=0; i<bxrange_; ++i) {
139  muons_eta_phi_isolated.push_back(ibooker.book2D("muons_eta_phi_bx_isolated_"+bx_obj[i],"L1T Muon #eta vs #phi for isolated bunch BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
140  muons_eta_phi_isolated.at(i)->setAxisTitle("#eta", 1);
141  muons_eta_phi_isolated.at(i)->setAxisTitle("#phi", 2);
142  }
143 
144  ibooker.setCurrentFolder(monitorDir_+"/L1TJet"+"/timing"+"/Isolated_bunch");
145  for(unsigned int i=0; i<bxrange_; ++i) {
146  jet_eta_phi_isolated.push_back(ibooker.book2D("jet_eta_phi_bx_isolated_"+bx_obj[i],"L1T Jet #eta vs #phi for isolated bunch BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
147  jet_eta_phi_isolated.at(i)->setAxisTitle("#eta", 1);
148  jet_eta_phi_isolated.at(i)->setAxisTitle("#phi", 2);
149  }
150 
151  ibooker.setCurrentFolder(monitorDir_+"/L1TEGamma"+"/timing"+"/Isolated_bunch");
152  for(unsigned int i=0; i<bxrange_; ++i) {
153  egamma_eta_phi_isolated.push_back(ibooker.book2D("egamma_eta_phi_bx_isolated_"+bx_obj[i],"L1T EGamma #eta vs #phi for isolated bunch BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
154  egamma_eta_phi_isolated.at(i)->setAxisTitle("#eta", 1);
155  egamma_eta_phi_isolated.at(i)->setAxisTitle("#phi", 2);
156  }
157 
158  ibooker.setCurrentFolder(monitorDir_+"/L1TTau"+"/timing"+"/Isolated_bunch");
159  for(unsigned int i=0; i<bxrange_; ++i) {
160  tau_eta_phi_isolated.push_back(ibooker.book2D("tau_eta_phi_bx_isolated_"+bx_obj[i],"L1T Tau #eta vs #phi for isolated bunch BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
161  tau_eta_phi_isolated.at(i)->setAxisTitle("#eta", 1);
162  tau_eta_phi_isolated.at(i)->setAxisTitle("#phi", 2);
163  }
164 
165  ibooker.setCurrentFolder(monitorDir_+"/L1TEtSum"+"/timing"+"/Isolated_bunch");
166  for(unsigned int i=0; i<bxrange_; ++i) {
167  etsum_eta_phi_MET_isolated.push_back(ibooker.book1D("etsum_phi_bx_MET_isolated_"+bx_obj[i],"L1T MET #phi for isolated bunch BX="+bx_obj[i],25, -3.2, 3.2));
168  etsum_eta_phi_MET_isolated.at(i)->setAxisTitle("#phi", 1);
169  etsum_eta_phi_METHF_isolated.push_back(ibooker.book1D("etsum_phi_bx_METHF_isolated_"+bx_obj[i],"L1T METHF #phi for isolated bunch BX="+bx_obj[i],25, -3.2, 3.2));
170  etsum_eta_phi_METHF_isolated.at(i)->setAxisTitle("#phi", 1);
171  etsum_eta_phi_MHT_isolated.push_back(ibooker.book1D("etsum_phi_bx_MHT_isolated_"+bx_obj[i],"L1T MHT #phi for isolated bunch BX="+bx_obj[i],25, -3.2, 3.2));
172  etsum_eta_phi_MHT_isolated.at(i)->setAxisTitle("#phi", 1);
173  etsum_eta_phi_MHTHF_isolated.push_back(ibooker.book1D("etsum_phi_bx_MHTHF_isolated_"+bx_obj[i],"L1T MHTHF #phi for isolated bunch BX="+bx_obj[i],25, -3.2, 3.2));
174  etsum_eta_phi_MHTHF_isolated.at(i)->setAxisTitle("#phi", 1);
175  }
176 }
177 
178 if(algoBitFirstBxInTrain_ > -1) {
179  ibooker.setCurrentFolder(monitorDir_+"/L1TMuon"+"/timing"+"/First_bunch");
180  for(unsigned int i=0; i<bxrange_-2; ++i) {
181  muons_eta_phi_firstbunch.push_back(ibooker.book2D("muons_eta_phi_bx_firstbunch_"+bx_obj[i],"L1T Muon #eta vs #phi for first bunch BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
182  muons_eta_phi_firstbunch.at(i)->setAxisTitle("#eta", 1);
183  muons_eta_phi_firstbunch.at(i)->setAxisTitle("#phi", 2);
184  }
185 
186  ibooker.setCurrentFolder(monitorDir_+"/L1TJet"+"/timing"+"/First_bunch");
187  for(unsigned int i=0; i<bxrange_-2; ++i) {
188  jet_eta_phi_firstbunch.push_back(ibooker.book2D("jet_eta_phi_bx_firstbunch_"+bx_obj[i],"L1T Jet #eta vs #phi for first bunch BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
189  jet_eta_phi_firstbunch.at(i)->setAxisTitle("#eta", 1);
190  jet_eta_phi_firstbunch.at(i)->setAxisTitle("#phi", 2);
191  }
192 
193  ibooker.setCurrentFolder(monitorDir_+"/L1TEGamma"+"/timing"+"/First_bunch");
194  for(unsigned int i=0; i<bxrange_-2; ++i) {
195  egamma_eta_phi_firstbunch.push_back(ibooker.book2D("egamma_eta_phi_bx_firstbunch_"+bx_obj[i],"L1T EGamma #eta vs #phi for first bunch BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
196  egamma_eta_phi_firstbunch.at(i)->setAxisTitle("#eta", 1);
197  egamma_eta_phi_firstbunch.at(i)->setAxisTitle("#phi", 2);
198  }
199 
200  ibooker.setCurrentFolder(monitorDir_+"/L1TTau"+"/timing"+"/First_bunch");
201  for(unsigned int i=0; i<bxrange_-2; ++i) {
202  tau_eta_phi_firstbunch.push_back(ibooker.book2D("tau_eta_phi_bx_firstbunch_"+bx_obj[i],"L1T Tau #eta vs #phi for first bunch BX="+bx_obj[i],25, -2.5, 2.5, 25, -3.2, 3.2));
203  tau_eta_phi_firstbunch.at(i)->setAxisTitle("#eta", 1);
204  tau_eta_phi_firstbunch.at(i)->setAxisTitle("#phi", 2);
205  }
206 
207  ibooker.setCurrentFolder(monitorDir_+"/L1TEtSum"+"/timing"+"/First_bunch");
208  for(unsigned int i=0; i<bxrange_-2; ++i) {
209  etsum_eta_phi_MET_firstbunch.push_back(ibooker.book1D("etsum_phi_bx_MET_firstbunch_"+bx_obj[i],"L1T MET #phi for firstbunch bunch BX="+bx_obj[i],25, -3.2, 3.2));
210  etsum_eta_phi_MET_firstbunch.at(i)->setAxisTitle("#phi", 1);
211  etsum_eta_phi_METHF_firstbunch.push_back(ibooker.book1D("etsum_phi_bx_METHF_firstbunch_"+bx_obj[i],"L1T METHF #phi for firstbunch bunch BX="+bx_obj[i],25, -3.2, 3.2));
212  etsum_eta_phi_METHF_firstbunch.at(i)->setAxisTitle("#phi", 1);
213  etsum_eta_phi_MHT_firstbunch.push_back(ibooker.book1D("etsum_phi_bx_MHT_firstbunch_"+bx_obj[i],"L1T MHT #phi for firstbunch bunch BX="+bx_obj[i],25, -3.2, 3.2));
214  etsum_eta_phi_MHT_firstbunch.at(i)->setAxisTitle("#phi", 1);
215  etsum_eta_phi_MHTHF_firstbunch.push_back(ibooker.book1D("etsum_phi_bx_MHTHF_firstbunch_"+bx_obj[i],"L1T MHTHF #phi for firstbunch bunch BX="+bx_obj[i],25, -3.2, 3.2));
216  etsum_eta_phi_MHTHF_firstbunch.at(i)->setAxisTitle("#phi", 1);
217  }
218 }
219 
220 if(algoBitLastBxInTrain_ > -1) {
221  ibooker.setCurrentFolder(monitorDir_+"/L1TMuon"+"/timing"+"/Last_bunch");
222  for(unsigned int i=0; i<bxrange_-2; ++i) {
223  muons_eta_phi_lastbunch.push_back(ibooker.book2D("muons_eta_phi_bx_lastbunch_"+bx_obj[i+2],"L1T Muon #eta vs #phi for last bunch BX="+bx_obj[i+2],25, -2.5, 2.5, 25, -3.2, 3.2));
224  muons_eta_phi_lastbunch.at(i)->setAxisTitle("#eta", 1);
225  muons_eta_phi_lastbunch.at(i)->setAxisTitle("#phi", 2);
226  }
227 
228  ibooker.setCurrentFolder(monitorDir_+"/L1TJet"+"/timing"+"/Last_bunch");
229  for(unsigned int i=0; i<bxrange_-2; ++i) {
230  jet_eta_phi_lastbunch.push_back(ibooker.book2D("jet_eta_phi_bx_lastbunch_"+bx_obj[i+2],"L1T Jet #eta vs #phi for last bunch BX="+bx_obj[i+2],25, -2.5, 2.5, 25, -3.2, 3.2));
231  jet_eta_phi_lastbunch.at(i)->setAxisTitle("#eta", 1);
232  jet_eta_phi_lastbunch.at(i)->setAxisTitle("#phi", 2);
233  }
234 
235  ibooker.setCurrentFolder(monitorDir_+"/L1TEGamma"+"/timing"+"/Last_bunch");
236  for(unsigned int i=0; i<bxrange_-2; ++i) {
237  egamma_eta_phi_lastbunch.push_back(ibooker.book2D("egamma_eta_phi_bx_lastbunch_"+bx_obj[i+2],"L1T EGamma #eta vs #phi for last bunch BX="+bx_obj[i+2],25, -2.5, 2.5, 25, -3.2, 3.2));
238  egamma_eta_phi_lastbunch.at(i)->setAxisTitle("#eta", 1);
239  egamma_eta_phi_lastbunch.at(i)->setAxisTitle("#phi", 2);
240  }
241 
242  ibooker.setCurrentFolder(monitorDir_+"/L1TTau"+"/timing"+"/Last_bunch");
243  for(unsigned int i=0; i<bxrange_-2; ++i) {
244  tau_eta_phi_lastbunch.push_back(ibooker.book2D("tau_eta_phi_bx_lastbunch_"+bx_obj[i+2],"L1T Tau #eta vs #phi for last bunch BX="+bx_obj[i+2],25, -2.5, 2.5, 25, -3.2, 3.2));
245  tau_eta_phi_lastbunch.at(i)->setAxisTitle("#eta", 1);
246  tau_eta_phi_lastbunch.at(i)->setAxisTitle("#phi", 2);
247  }
248 
249  ibooker.setCurrentFolder(monitorDir_+"/L1TEtSum"+"/timing"+"/Last_bunch");
250  for(unsigned int i=0; i<bxrange_-2; ++i) {
251  etsum_eta_phi_MET_lastbunch.push_back(ibooker.book1D("etsum_phi_bx_MET_lastbunch_"+bx_obj[i+2],"L1T MET #phi for lastbunch bunch BX="+bx_obj[i+2],25, -3.2, 3.2));
252  etsum_eta_phi_MET_lastbunch.at(i)->setAxisTitle("#phi", 1);
253  etsum_eta_phi_METHF_lastbunch.push_back(ibooker.book1D("etsum_phi_bx_METHF_lastbunch_"+bx_obj[i+2],"L1T METHF #phi for lastbunch bunch BX="+bx_obj[i+2],25, -3.2, 3.2));
254  etsum_eta_phi_METHF_lastbunch.at(i)->setAxisTitle("#phi", 1);
255  etsum_eta_phi_MHT_lastbunch.push_back(ibooker.book1D("etsum_phi_bx_MHT_lastbunch_"+bx_obj[i+2],"L1T MHT #phi for lastbunch bunch BX="+bx_obj[i+2],25, -3.2, 3.2));
256  etsum_eta_phi_MHT_lastbunch.at(i)->setAxisTitle("#phi", 1);
257  etsum_eta_phi_MHTHF_lastbunch.push_back(ibooker.book1D("etsum_phi_bx_MHTHF_lastbunch_"+bx_obj[i+2],"L1T MHTHF #phi for lastbunch bunch BX="+bx_obj[i+2],25, -3.2, 3.2));
258  etsum_eta_phi_MHTHF_lastbunch.at(i)->setAxisTitle("#phi", 1);
259  }
260 }
261 
262 }
263 
264 
265 
267 
268  if (verbose_) edm::LogInfo("L1TObjectsTiming") << "L1TObjectsTiming: analyze..." << std::endl;
269 
270 
271  // Muon Collection
273  e.getByToken(ugmtMuonToken_, MuonBxCollection);
274  // Jet Collection
276  e.getByToken(stage2CaloLayer2JetToken_, JetBxCollection);
277  // EGamma Collection
279  e.getByToken(stage2CaloLayer2EGammaToken_, EGammaBxCollection);
280  // Tau Collection
282  e.getByToken(stage2CaloLayer2TauToken_, TauBxCollection);
283  // EtSum Collection
285  e.getByToken(stage2CaloLayer2EtSumToken_, EtSumBxCollection);
286 
287  // Open uGT readout record
289  e.getByToken(l1tStage2uGtProducer_, uGtAlgs);
290 
291 
292  // Filling eta-phi map for muons for BX=-2,-1,0,+1,+2
293  for (int itBX = MuonBxCollection->getFirstBX(); itBX <= MuonBxCollection->getLastBX(); ++itBX) {
294  for (l1t::MuonBxCollection::const_iterator Muon = MuonBxCollection->begin(itBX); Muon != MuonBxCollection->end(itBX); ++Muon) {
295  int index = (int)itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
296  muons_eta_phi.at(index)->Fill(Muon->eta(), Muon->phi());
297  }
298  }
299 
300  // Filling eta-phi map for jets for BX=-2,-1,0,+1,+2
301  for (int itBX = JetBxCollection->getFirstBX(); itBX <= JetBxCollection->getLastBX(); ++itBX) {
302  for (l1t::JetBxCollection::const_iterator jet = JetBxCollection->begin(itBX); jet != JetBxCollection->end(itBX); ++jet) {
303  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
304  jet_eta_phi.at(index)->Fill(jet->eta(), jet->phi());
305  }
306  }
307 
308  // Filling eta-phi map for egamma for BX=-2,-1,0,+1,+2
309  for (int itBX = EGammaBxCollection->getFirstBX(); itBX <= EGammaBxCollection->getLastBX(); ++itBX) {
310  for (l1t::EGammaBxCollection::const_iterator egamma = EGammaBxCollection->begin(itBX); egamma != EGammaBxCollection->end(itBX); ++egamma) {
311  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
312  egamma_eta_phi.at(index)->Fill(egamma->eta(), egamma->phi());
313  }
314  }
315 
316  // Filling eta-phi map for tau for BX=-2,-1,0,+1,+2
317  for (int itBX = TauBxCollection->getFirstBX(); itBX <= TauBxCollection->getLastBX(); ++itBX) {
318  for (l1t::TauBxCollection::const_iterator tau = TauBxCollection->begin(itBX); tau != TauBxCollection->end(itBX); ++tau) {
319  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
320  tau_eta_phi.at(index)->Fill(tau->eta(), tau->phi());
321  }
322  }
323 
324  // Filling eta-phi map for etsum for BX=-2,-1,0,+1,+2
325  for (int itBX = EtSumBxCollection->getFirstBX(); itBX <= EtSumBxCollection->getLastBX(); ++itBX) {
326  for (l1t::EtSumBxCollection::const_iterator EtSum = EtSumBxCollection->begin(itBX); EtSum != EtSumBxCollection->end(itBX); ++EtSum) {
327  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
328  if (l1t::EtSum::EtSumType::kMissingEt == EtSum->getType()) {
329  etsum_eta_phi_MET.at(index)->Fill(EtSum->phi());
330  }
331  else if (l1t::EtSum::EtSumType::kMissingEtHF == EtSum->getType()) {
332  etsum_eta_phi_METHF.at(index)->Fill(EtSum->phi());
333  }
334  else if(l1t::EtSum::EtSumType::kMissingHt == EtSum->getType()) {
335  etsum_eta_phi_MHT.at(index)->Fill(EtSum->phi());
336  }
337  else if(l1t::EtSum::EtSumType::kMissingHtHF == EtSum->getType()) {
338  etsum_eta_phi_MHTHF.at(index)->Fill(EtSum->phi());
339  }
340  }
341  }
342 
343  for(GlobalAlgBlkBxCollection::const_iterator itr = uGtAlgs->begin(0); itr != uGtAlgs->end(0); ++itr) {
344  if((algoBitFirstBxInTrain_ != -1 && algoBitLastBxInTrain_ != -1) && (itr->getAlgoDecisionInitial(algoBitFirstBxInTrain_) && itr->getAlgoDecisionInitial(algoBitLastBxInTrain_))) {
345 // for(GlobalAlgBlkBxCollection::const_iterator itr = uGtAlgs->begin(0); itr != uGtAlgs->end(0); ++itr)
346  for (int itBX = MuonBxCollection->getFirstBX(); itBX <= MuonBxCollection->getLastBX(); ++itBX) {
347  for (l1t::MuonBxCollection::const_iterator muon = MuonBxCollection->begin(itBX); muon != MuonBxCollection->end(itBX); ++muon) { // Starting with Muons
348  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
349  muons_eta_phi_isolated.at(index)->Fill(muon->eta(),muon->phi());
350  }
351  }
352  for (int itBX = JetBxCollection->getFirstBX(); itBX <= JetBxCollection->getLastBX(); ++itBX) {
353  for (l1t::JetBxCollection::const_iterator jet = JetBxCollection->begin(itBX); jet != JetBxCollection->end(itBX); ++jet) {
354  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
355  jet_eta_phi_isolated.at(index)->Fill(jet->eta(), jet->phi());
356  }
357  }
358  for (int itBX = EGammaBxCollection->getFirstBX(); itBX <= EGammaBxCollection->getLastBX(); ++itBX) {
359  for (l1t::EGammaBxCollection::const_iterator egamma = EGammaBxCollection->begin(itBX); egamma != EGammaBxCollection->end(itBX); ++egamma) {
360  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
361  egamma_eta_phi_isolated.at(index)->Fill(egamma->eta(), egamma->phi());
362  }
363  }
364  for (int itBX = TauBxCollection->getFirstBX(); itBX <= TauBxCollection->getLastBX(); ++itBX) {
365  for (l1t::TauBxCollection::const_iterator tau = TauBxCollection->begin(itBX); tau != TauBxCollection->end(itBX); ++tau) {
366  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
367  tau_eta_phi_isolated.at(index)->Fill(tau->eta(), tau->phi());
368  }
369  }
370  for (int itBX = EtSumBxCollection->getFirstBX(); itBX <= EtSumBxCollection->getLastBX(); ++itBX) {
371  for (l1t::EtSumBxCollection::const_iterator EtSum = EtSumBxCollection->begin(itBX); EtSum != EtSumBxCollection->end(itBX); ++EtSum) {
372  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
373  if (l1t::EtSum::EtSumType::kMissingEt == EtSum->getType()) {
374  etsum_eta_phi_MET_isolated.at(index)->Fill(EtSum->phi());
375  }
376  else if (l1t::EtSum::EtSumType::kMissingEtHF == EtSum->getType()) {
377  etsum_eta_phi_METHF_isolated.at(index)->Fill(EtSum->phi());
378  }
379  else if(l1t::EtSum::EtSumType::kMissingHt == EtSum->getType()) {
380  etsum_eta_phi_MHT_isolated.at(index)->Fill(EtSum->phi());
381  }
382  else if(l1t::EtSum::EtSumType::kMissingHtHF == EtSum->getType()) {
383  etsum_eta_phi_MHTHF_isolated.at(index)->Fill(EtSum->phi());
384  }
385  }
386  }
387  }
388 
389  //if(itr->getAlgoDecisionInitial(algoBitFirstBxInTrain_))
390  if(algoBitFirstBxInTrain_ != -1 && itr->getAlgoDecisionInitial(algoBitFirstBxInTrain_)) { // Filling eta-phi map for all objects for first bunch each BX
391  for (int itBX = MuonBxCollection->getFirstBX(); itBX <= 0 ; ++itBX) {
392  for (l1t::MuonBxCollection::const_iterator muon = MuonBxCollection->begin(itBX); muon != MuonBxCollection->end(itBX); ++muon) { // Starting with Muons
393  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
394  muons_eta_phi_firstbunch.at(index)->Fill(muon->eta(),muon->phi());
395  }
396  }
397  for (int itBX = JetBxCollection->getFirstBX(); itBX <= 0; ++itBX) {
398  for (l1t::JetBxCollection::const_iterator jet = JetBxCollection->begin(itBX); jet != JetBxCollection->end(itBX); ++jet) {
399  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
400  jet_eta_phi_firstbunch.at(index)->Fill(jet->eta(), jet->phi());
401  }
402  }
403  for (int itBX = EGammaBxCollection->getFirstBX(); itBX <= 0; ++itBX) {
404  for (l1t::EGammaBxCollection::const_iterator egamma = EGammaBxCollection->begin(itBX); egamma != EGammaBxCollection->end(itBX); ++egamma) {
405  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
406  egamma_eta_phi_firstbunch.at(index)->Fill(egamma->eta(), egamma->phi());
407  }
408  }
409  for (int itBX = TauBxCollection->getFirstBX(); itBX <= 0; ++itBX) {
410  for (l1t::TauBxCollection::const_iterator tau = TauBxCollection->begin(itBX); tau != TauBxCollection->end(itBX); ++tau) {
411  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
412  tau_eta_phi_firstbunch.at(index)->Fill(tau->eta(), tau->phi());
413  }
414  }
415  for (int itBX = EtSumBxCollection->getFirstBX(); itBX <= 0; ++itBX) {
416  for (l1t::EtSumBxCollection::const_iterator EtSum = EtSumBxCollection->begin(itBX); EtSum != EtSumBxCollection->end(itBX); ++EtSum) {
417  int index = itBX - std::min(0, 1 - (int)bxrange_%2 - (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
418  if (l1t::EtSum::EtSumType::kMissingEt == EtSum->getType()) {
419  etsum_eta_phi_MET_firstbunch.at(index)->Fill(EtSum->phi());
420  }
421  else if (l1t::EtSum::EtSumType::kMissingEtHF == EtSum->getType()) {
422  etsum_eta_phi_METHF_firstbunch.at(index)->Fill(EtSum->phi());
423  }
424  else if(l1t::EtSum::EtSumType::kMissingHt == EtSum->getType()) {
425  etsum_eta_phi_MHT_firstbunch.at(index)->Fill(EtSum->phi());
426  }
427  else if(l1t::EtSum::EtSumType::kMissingHtHF == EtSum->getType()) {
428  etsum_eta_phi_MHTHF_firstbunch.at(index)->Fill(EtSum->phi());
429  }
430  }
431  }
432  }
433  //if(itr->getAlgoDecisionInitial(algoBitLastBxInTrain_))
434  if(algoBitLastBxInTrain_ != -1 && itr->getAlgoDecisionInitial(algoBitLastBxInTrain_)) { // Filling eta-phi map for all objects for last bunch each BX
435  for (int itBX = 0; itBX <= MuonBxCollection->getLastBX(); ++itBX) {
436  for (l1t::MuonBxCollection::const_iterator muon = MuonBxCollection->begin(itBX); muon != MuonBxCollection->end(itBX); ++muon) { // Starting with Muons
437  int index = itBX - std::min(0, 1 - (int)bxrange_%2 + (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
438  muons_eta_phi_lastbunch.at(index)->Fill(muon->eta(),muon->phi());
439  }
440  }
441 
442  for (int itBX = 0; itBX <= JetBxCollection->getLastBX(); ++itBX) {
443  for (l1t::JetBxCollection::const_iterator jet = JetBxCollection->begin(itBX); jet != JetBxCollection->end(itBX); ++jet) {
444  int index = itBX - std::min(0, 1 - (int)bxrange_%2 + (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
445  jet_eta_phi_lastbunch.at(index)->Fill(jet->eta(), jet->phi());
446  }
447  }
448  for (int itBX = 0; itBX <= EGammaBxCollection->getLastBX(); ++itBX) {
449  for (l1t::EGammaBxCollection::const_iterator egamma = EGammaBxCollection->begin(itBX); egamma != EGammaBxCollection->end(itBX); ++egamma) {
450  int index = itBX - std::min(0, 1 - (int)bxrange_%2 + (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
451  egamma_eta_phi_lastbunch.at(index)->Fill(egamma->eta(), egamma->phi());
452  }
453  }
454  for (int itBX = 0; itBX <= TauBxCollection->getLastBX(); ++itBX) {
455  for (l1t::TauBxCollection::const_iterator tau = TauBxCollection->begin(itBX); tau != TauBxCollection->end(itBX); ++tau) {
456  int index = itBX - std::min(0, 1 - (int)bxrange_%2 + (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
457  tau_eta_phi_lastbunch.at(index)->Fill(tau->eta(), tau->phi());
458  }
459  }
460  for (int itBX = 0; itBX <= EtSumBxCollection->getLastBX(); ++itBX) {
461  for (l1t::EtSumBxCollection::const_iterator EtSum = EtSumBxCollection->begin(itBX); EtSum != EtSumBxCollection->end(itBX); ++EtSum) {
462  int index = itBX - std::min(0, 1 - (int)bxrange_%2 + (int)std::floor(bxrange_/2.)); // the correlation from itBX to respective index of the vector
463  if (l1t::EtSum::EtSumType::kMissingEt == EtSum->getType()) {
464  etsum_eta_phi_MET_lastbunch.at(index)->Fill(EtSum->phi());
465  }
466  else if (l1t::EtSum::EtSumType::kMissingEtHF == EtSum->getType()) {
467  etsum_eta_phi_METHF_lastbunch.at(index)->Fill(EtSum->phi());
468  }
469  else if(l1t::EtSum::EtSumType::kMissingHt == EtSum->getType()) {
470  etsum_eta_phi_MHT_lastbunch.at(index)->Fill(EtSum->phi());
471  }
472  else if(l1t::EtSum::EtSumType::kMissingHtHF == EtSum->getType()) {
473  etsum_eta_phi_MHTHF_lastbunch.at(index)->Fill(EtSum->phi());
474  }
475  }
476  }
477  }
478  }
479 }
480 
std::vector< MonitorElement * > egamma_eta_phi_isolated
BXVector< EGamma > EGammaBxCollection
Definition: EGamma.h:11
const_iterator end(int bx) const
std::vector< MonitorElement * > jet_eta_phi_firstbunch
edm::EDGetTokenT< l1t::EGammaBxCollection > stage2CaloLayer2EGammaToken_
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
edm::EDGetTokenT< GlobalAlgBlkBxCollection > l1tStage2uGtProducer_
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::vector< MonitorElement * > etsum_eta_phi_MET_isolated
std::vector< MonitorElement * > etsum_eta_phi_METHF_isolated
std::vector< MonitorElement * > muons_eta_phi_isolated
std::vector< MonitorElement * > egamma_eta_phi
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
std::vector< MonitorElement * > jet_eta_phi_lastbunch
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
std::vector< MonitorElement * > tau_eta_phi_lastbunch
void analyze(const edm::Event &, const edm::EventSetup &) override
const unsigned int bxrange_
delete x;
Definition: CaloConfig.h:22
BXVector< Tau > TauBxCollection
Definition: Tau.h:11
std::vector< MonitorElement * > etsum_eta_phi_MET_firstbunch
std::vector< MonitorElement * > etsum_eta_phi_MHT_lastbunch
std::vector< MonitorElement * > muons_eta_phi_lastbunch
std::vector< MonitorElement * > etsum_eta_phi_MHT
void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
BXVector< EtSum > EtSumBxCollection
Definition: EtSum.h:11
std::vector< MonitorElement * > etsum_eta_phi_MET_lastbunch
Definition: Muon.py:1
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< MonitorElement * > jet_eta_phi
std::vector< MonitorElement * > etsum_eta_phi_METHF_firstbunch
std::vector< MonitorElement * > etsum_eta_phi_MHTHF_isolated
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
L1TObjectsTiming(const edm::ParameterSet &ps)
edm::EDGetTokenT< l1t::MuonBxCollection > ugmtMuonToken_
std::vector< MonitorElement * > egamma_eta_phi_lastbunch
std::vector< MonitorElement * > muons_eta_phi_firstbunch
T min(T a, T b)
Definition: MathUtil.h:58
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< MonitorElement * > etsum_eta_phi_MHTHF_lastbunch
edm::EDGetTokenT< l1t::EtSumBxCollection > stage2CaloLayer2EtSumToken_
edm::EDGetTokenT< l1t::JetBxCollection > stage2CaloLayer2JetToken_
edm::EDGetTokenT< l1t::TauBxCollection > stage2CaloLayer2TauToken_
std::vector< MonitorElement * > tau_eta_phi_isolated
std::vector< MonitorElement * > etsum_eta_phi_METHF
std::vector< MonitorElement * > etsum_eta_phi_MHTHF
BXVector< Muon > MuonBxCollection
Definition: Muon.h:11
std::vector< MonitorElement * > etsum_eta_phi_MHTHF_firstbunch
std::vector< MonitorElement * > tau_eta_phi
int getFirstBX() const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
BXVector< Jet > JetBxCollection
Definition: Jet.h:11
std::vector< MonitorElement * > egamma_eta_phi_firstbunch
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
std::string monitorDir_
std::vector< MonitorElement * > etsum_eta_phi_MHT_isolated
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< MonitorElement * > etsum_eta_phi_METHF_lastbunch
const std::string algoNameLastBxInTrain_
std::vector< MonitorElement * > etsum_eta_phi_MET
~L1TObjectsTiming() override
std::vector< MonitorElement * > jet_eta_phi_isolated
HLT enums.
int getLastBX() const
std::vector< MonitorElement * > muons_eta_phi
const std::string algoNameFirstBxInTrain_
std::vector< MonitorElement * > etsum_eta_phi_MHT_firstbunch
const_iterator begin(int bx) const
std::shared_ptr< l1t::L1TGlobalUtil > gtUtil_
Definition: Run.h:43
std::vector< Muon >::const_iterator const_iterator
Definition: BXVector.h:20
std::vector< MonitorElement * > tau_eta_phi_firstbunch