CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TGlobalAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1Trigger/L1TGloba
4 // Class: L1TGlobalAnalyzer
5 //
13 //
14 // Original Author: James Brooke
15 // Created: Tue, 11 Mar 2014 14:55:45 GMT
16 //
17 // Modifying Author: Brian Winer
18 // Created: Tue, 10 Mar 2015 based off L1TCaloAnalyzer
19 //
20 
21 
22 // system include files
23 #include <memory>
24 
25 // user include files
28 
31 
33 
36 
43 
44 #include "TH1F.h"
45 #include "TH2F.h"
46 
47 //
48 // class declaration
49 //
50 
51 namespace l1t {
52 
54 public:
55  explicit L1TGlobalAnalyzer(const edm::ParameterSet&);
57 
58  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
59 
60 
61 private:
62  virtual void beginJob() override;
63  virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
64  virtual void endJob() override;
65 
66  //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override;
67  //virtual void endRun(edm::Run const&, edm::EventSetup const&) override;
68  //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
69  //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
70 
71  // ----------member data ---------------------------
80 
84 
85 
86  bool m_doDmxEGs;
90  bool m_doEGs;
91  bool m_doTaus;
92  bool m_doJets;
93  bool m_doSums;
94 
95  bool m_doGtAlg;
98 
99  bool doText_;
100  bool doHistos_;
102 
104  EG=0x1,
105  Tau=0x2,
106  Jet=0x3,
107  Sum=0x4,
108  DmxEG=0x5,
109  DmxTau=0x6,
110  DmxJet=0x7,
111  DmxSum=0x8,
112  GtAlg=0x9,
113  EmulGtAlg=0x10};
114 
115  std::vector< ObjectType > types_;
116  std::vector< std::string > typeStr_;
117 
118  std::map< ObjectType, TFileDirectory > dirs_;
119  std::map< ObjectType, TH1F* > het_;
120  std::map< ObjectType, TH1F* > heta_;
121  std::map< ObjectType, TH1F* > hphi_;
122  std::map< ObjectType, TH1F* > hbx_;
123  std::map< ObjectType, TH2F* > hetaphi_;
124 
128  TH1F* hAlgoBits_;
136 
137 };
138 
139 //
140 // constants, enums and typedefs
141 //
142 
143 //
144 // static data member definitions
145 //
146 
147 //
148 // constructors and destructor
149 //
151  doText_(iConfig.getUntrackedParameter<bool>("doText", true)),
152  doHistos_(iConfig.getUntrackedParameter<bool>("doHistos", true))
153 {
154  //now do what ever initialization is needed
155 
156  // register what you consume and keep token for later access:
157  edm::InputTag nullTag("None");
158 
159  edm::InputTag dmxEGTag = iConfig.getParameter<edm::InputTag>("dmxEGToken");
160  m_dmxEGToken = consumes<l1t::EGammaBxCollection>(dmxEGTag);
161  m_doDmxEGs = !(dmxEGTag==nullTag);
162 
163  edm::InputTag dmxTauTag = iConfig.getParameter<edm::InputTag>("dmxTauToken");
164  m_dmxTauToken = consumes<l1t::TauBxCollection>(dmxTauTag);
165  m_doDmxTaus = !(dmxTauTag==nullTag);
166 
167  edm::InputTag dmxJetTag = iConfig.getParameter<edm::InputTag>("dmxJetToken");
168  m_dmxJetToken = consumes<l1t::JetBxCollection>(dmxJetTag);
169  m_doDmxJets = !(dmxJetTag==nullTag);
170 
171  edm::InputTag dmxSumTag = iConfig.getParameter<edm::InputTag>("dmxEtSumToken");
172  m_dmxSumToken = consumes<l1t::EtSumBxCollection>(dmxSumTag);
173  m_doDmxSums = !(dmxSumTag==nullTag);
174 
175  edm::InputTag egTag = iConfig.getParameter<edm::InputTag>("egToken");
176  m_egToken = consumes<l1t::EGammaBxCollection>(egTag);
177  m_doEGs = !(egTag==nullTag);
178 
179  edm::InputTag tauTag = iConfig.getParameter<edm::InputTag>("tauToken");
180  m_tauToken = consumes<l1t::TauBxCollection>(tauTag);
181  m_doTaus = !(tauTag==nullTag);
182 
183  edm::InputTag jetTag = iConfig.getParameter<edm::InputTag>("jetToken");
184  m_jetToken = consumes<l1t::JetBxCollection>(jetTag);
185  m_doJets = !(jetTag==nullTag);
186 
187  edm::InputTag sumTag = iConfig.getParameter<edm::InputTag>("etSumToken");
188  m_sumToken = consumes<l1t::EtSumBxCollection>(sumTag);
189  m_doSums = !(sumTag==nullTag);
190 
191  edm::InputTag gtAlgTag = iConfig.getParameter<edm::InputTag>("gtAlgToken");
192  m_gtAlgToken = consumes<GlobalAlgBlkBxCollection>(gtAlgTag);
193  m_doGtAlg = !(gtAlgTag==nullTag);
194 
195  edm::InputTag emulGtAlgTag = iConfig.getParameter<edm::InputTag>("emulGtAlgToken");
196  m_emulGtAlgToken = consumes<GlobalAlgBlkBxCollection>(emulGtAlgTag);
197  m_doEmulGtAlg = !(emulGtAlgTag==nullTag);
198 
199  edm::InputTag emulDxAlgTag = iConfig.getParameter<edm::InputTag>("emulDxAlgToken");
200  m_emulDxAlgToken = consumes<GlobalAlgBlkBxCollection>(emulDxAlgTag);
201  m_doEmulDxAlg = !(emulDxAlgTag==nullTag);
202 
203  types_.push_back( DmxEG );
204  types_.push_back( DmxTau );
205  types_.push_back( DmxJet );
206  types_.push_back( DmxSum );
207  types_.push_back( EG );
208  types_.push_back( Tau );
209  types_.push_back( Jet );
210  types_.push_back( Sum );
211 
212  typeStr_.push_back( "dmxeg" );
213  typeStr_.push_back( "dmxtau" );
214  typeStr_.push_back( "dmxjet" );
215  typeStr_.push_back( "dmxsum" );
216  typeStr_.push_back( "eg" );
217  typeStr_.push_back( "tau" );
218  typeStr_.push_back( "jet" );
219  typeStr_.push_back( "sum" );
220 
221 }
222 
223 
225 {
226 
227  // do anything here that needs to be done at desctruction time
228  // (e.g. close files, deallocate resources etc.)
229 
230 }
231 
232 
233 //
234 // member functions
235 //
236 
237 // ------------ method called for each event ------------
238 void
240 {
241  using namespace edm;
242 
243  std::stringstream text;
244 
245  TH2F* hEvtEG = new TH2F();
246  TH2F* hEvtTau = new TH2F();
247  TH2F* hEvtJet = new TH2F();
248  TH2F* hEvtDmxEG = new TH2F();
249  TH2F* hEvtDmxTau = new TH2F();
250  TH2F* hEvtDmxJet = new TH2F();
251 
252  if (doEvtDisp_) {
253  std::stringstream ss;
254  ss << iEvent.run() << "-" << iEvent.id().event();
255  TFileDirectory dir = evtDispDir_.mkdir(ss.str());
256  hEvtEG = dir.make<TH2F>("EG", "", 83, -41.5, 41.5, 72, .5, 72.5);
257  hEvtTau = dir.make<TH2F>("Tau", "", 83, -41.5, 41.5, 72, .5, 72.5);
258  hEvtJet = dir.make<TH2F>("Jet", "", 83, -41.5, 41.5, 72, .5, 72.5);
259  hEvtDmxEG = dir.make<TH2F>("DmxEG", "", 227, -113.5, 113.5, 144, -0.5, 143.5);
260  hEvtDmxTau = dir.make<TH2F>("DmxTau", "", 227, -113.5, 113.5, 144, -0.5, 143.5);
261  hEvtDmxJet = dir.make<TH2F>("DmxJet", "", 227, -113.5, 113.5, 144, -0.5, 143.5);
262  }
263 
264  // get EG
265  if (m_doDmxEGs) {
267  iEvent.getByToken(m_dmxEGToken,dmxegs);
268 
269  for ( int ibx=dmxegs->getFirstBX(); ibx<=dmxegs->getLastBX(); ++ibx) {
270 
271  for ( auto itr = dmxegs->begin(ibx); itr != dmxegs->end(ibx); ++itr ) {
272  hbx_.at(DmxEG)->Fill( ibx );
273  het_.at(DmxEG)->Fill( itr->hwPt() );
274  heta_.at(DmxEG)->Fill( itr->hwEta() );
275  hphi_.at(DmxEG)->Fill( itr->hwPhi() );
276  hetaphi_.at(DmxEG)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
277 
278  text << "Dmx EG : " << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi() << std::endl;
279 
280  if (doEvtDisp_) hEvtDmxEG->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
281 
282  }
283 
284  }
285 
286  }
287 
288  // get tau
289  if (m_doDmxTaus) {
290  Handle< BXVector<l1t::Tau> > dmxtaus;
291  iEvent.getByToken(m_dmxTauToken,dmxtaus);
292 
293  for ( int ibx=dmxtaus->getFirstBX(); ibx<=dmxtaus->getLastBX(); ++ibx) {
294 
295  for ( auto itr = dmxtaus->begin(ibx); itr != dmxtaus->end(ibx); ++itr ) {
296  hbx_.at(DmxTau)->Fill( ibx );
297  het_.at(DmxTau)->Fill( itr->hwPt() );
298  heta_.at(DmxTau)->Fill( itr->hwEta() );
299  hphi_.at(DmxTau)->Fill( itr->hwPhi() );
300  hetaphi_.at(DmxTau)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
301 
302  text << "Dmx Tau : " << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi() << std::endl;
303 
304  if (doEvtDisp_) hEvtDmxTau->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
305  }
306 
307  }
308 
309  }
310 
311  // get jet
312  if (m_doDmxJets) {
313  Handle< BXVector<l1t::Jet> > dmxjets;
314  iEvent.getByToken(m_dmxJetToken,dmxjets);
315 
316  for ( int ibx=dmxjets->getFirstBX(); ibx<=dmxjets->getLastBX(); ++ibx) {
317 
318  for ( auto itr = dmxjets->begin(ibx); itr != dmxjets->end(ibx); ++itr ) {
319  hbx_.at(DmxJet)->Fill( ibx );
320  het_.at(DmxJet)->Fill( itr->hwPt() );
321  heta_.at(DmxJet)->Fill( itr->hwEta() );
322  hphi_.at(DmxJet)->Fill( itr->hwPhi() );
323  hetaphi_.at(DmxJet)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
324 
325  text << "Dmx Jet : " << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi() << std::endl;
326 
327  if (doEvtDisp_) hEvtDmxJet->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
328  }
329 
330  }
331 
332  }
333 
334  // get sums
335  if (m_doDmxSums) {
337  iEvent.getByToken(m_dmxSumToken,dmxsums);
338 
339  for ( int ibx=dmxsums->getFirstBX(); ibx<=dmxsums->getLastBX(); ++ibx) {
340 
341  for ( auto itr = dmxsums->begin(ibx); itr != dmxsums->end(ibx); ++itr ) {
342  hbx_.at(DmxSum)->Fill( ibx );
343  het_.at(DmxSum)->Fill( itr->hwPt() );
344  heta_.at(DmxSum)->Fill( itr->hwEta() );
345  hphi_.at(DmxSum)->Fill( itr->hwPhi() );
346  hetaphi_.at(DmxSum)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
347 
348  text << "Dmx Sum : " << " type=" << itr->getType() << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi() << std::endl;
349 
350  }
351 
352  }
353 
354  }
355 
356  // get EG
357  if (m_doEGs) {
359  iEvent.getByToken(m_egToken,egs);
360 
361  for ( int ibx=egs->getFirstBX(); ibx<=egs->getLastBX(); ++ibx) {
362 
363  for ( auto itr = egs->begin(ibx); itr != egs->end(ibx); ++itr ) {
364  hbx_.at(EG)->Fill( ibx );
365  het_.at(EG)->Fill( itr->hwPt() );
366  heta_.at(EG)->Fill( itr->hwEta() );
367  hphi_.at(EG)->Fill( itr->hwPhi() );
368  hetaphi_.at(EG)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
369 
370  text << "EG : " << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi() << std::endl;
371 
372  if (doEvtDisp_) hEvtEG->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
373  }
374 
375  }
376 
377  }
378 
379  // get tau
380  if (m_doTaus) {
382  iEvent.getByToken(m_tauToken,taus);
383 
384  for ( int ibx=taus->getFirstBX(); ibx<=taus->getLastBX(); ++ibx) {
385 
386  for ( auto itr = taus->begin(ibx); itr != taus->end(ibx); ++itr ) {
387  hbx_.at(Tau)->Fill( ibx );
388  het_.at(Tau)->Fill( itr->hwPt() );
389  heta_.at(Tau)->Fill( itr->hwEta() );
390  hphi_.at(Tau)->Fill( itr->hwPhi() );
391  hetaphi_.at(Tau)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
392 
393  text << "Tau : " << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi() << std::endl;
394 
395  if (doEvtDisp_) hEvtTau->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
396  }
397 
398  }
399 
400  }
401 
402  // get jet
403  if (m_doJets) {
405  iEvent.getByToken(m_jetToken,jets);
406 
407  for ( int ibx=jets->getFirstBX(); ibx<=jets->getLastBX(); ++ibx) {
408 
409  for ( auto itr = jets->begin(ibx); itr != jets->end(ibx); ++itr ) {
410  hbx_.at(Jet)->Fill( ibx );
411  het_.at(Jet)->Fill( itr->hwPt() );
412  heta_.at(Jet)->Fill( itr->hwEta() );
413  hphi_.at(Jet)->Fill( itr->hwPhi() );
414  hetaphi_.at(Jet)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
415 
416  text << "Jet : " << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi() << std::endl;
417 
418  if (doEvtDisp_) hEvtJet->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
419  }
420 
421  }
422 
423  }
424 
425  // get sums
426  if (m_doSums) {
428  iEvent.getByToken(m_sumToken,sums);
429 
430  for ( int ibx=sums->getFirstBX(); ibx<=sums->getLastBX(); ++ibx) {
431 
432  for ( auto itr = sums->begin(ibx); itr != sums->end(ibx); ++itr ) {
433  hbx_.at(Sum)->Fill( ibx );
434  het_.at(Sum)->Fill( itr->hwPt() );
435  heta_.at(Sum)->Fill( itr->hwEta() );
436  hphi_.at(Sum)->Fill( itr->hwPhi() );
437  hetaphi_.at(Sum)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
438  text << "Sum : " << " type=" << itr->getType() << " BX=" << ibx << " ipt=" << itr->hwPt() << " ieta=" << itr->hwEta() << " iphi=" << itr->hwPhi() << std::endl;
439  }
440 
441  }
442 
443  }
444 
445  //Algorithm Bits
446  if (m_doGtAlg) {
448  iEvent.getByToken(m_gtAlgToken,algs);
449 
450  for ( int ibx=algs->getFirstBX(); ibx<=algs->getLastBX(); ++ibx) {
451 
452  for ( auto itr = algs->begin(ibx); itr != algs->end(ibx); ++itr ) {
453 
454  for(int algBit=0; algBit<128; algBit++) { //Fix Me: Should access size of algo vector...need method in GlobalAlgBlk class
455  if(itr->getAlgoDecisionFinal(algBit)) hAlgoBits_->Fill(algBit);
456  }
457  }
458 
459  }
460 
461  }
462 
463  //Algorithm Bits (Emulation seeded by GT input)
464  if (m_doEmulGtAlg) {
465  Handle< BXVector<GlobalAlgBlk> > emulGtAlgs;
466  iEvent.getByToken(m_emulGtAlgToken,emulGtAlgs);
467 
468  for ( int ibx=emulGtAlgs->getFirstBX(); ibx<=emulGtAlgs->getLastBX(); ++ibx) {
469 
470  for ( auto itr = emulGtAlgs->begin(ibx); itr != emulGtAlgs->end(ibx); ++itr ) {
471 
472  for(int algBit=0; algBit<128; algBit++) { //Fix Me: Should access size of algo vector...need method in GlobalAlgBlk class
473  if(itr->getAlgoDecisionFinal(algBit)) hEmulGtAlgoBits_->Fill(algBit);
474  }
475  }
476 
477  }
478 
479  }
480 
481  //Algorithm Bits (Emulation seeded by Demux Output)
482  if (m_doEmulDxAlg) {
483  Handle< BXVector<GlobalAlgBlk> > emulDxAlgs;
484  iEvent.getByToken(m_emulDxAlgToken,emulDxAlgs);
485 
486  for ( int ibx=emulDxAlgs->getFirstBX(); ibx<=emulDxAlgs->getLastBX(); ++ibx) {
487 
488  for ( auto itr = emulDxAlgs->begin(ibx); itr != emulDxAlgs->end(ibx); ++itr ) {
489 
490  for(int algBit=0; algBit<128; algBit++) { //Fix Me: Should access size of algo vector...need method in GlobalAlgBlk class
491  if(itr->getAlgoDecisionFinal(algBit)) hEmulDxAlgoBits_->Fill(algBit);
492  }
493  }
494 
495  }
496 
497  }
498 
499 
500 
501 
502  // Jets (Dmx vs GT)
503  if (m_doJets & m_doDmxJets) {
505  iEvent.getByToken(m_jetToken,jets);
506 
507  Handle< BXVector<l1t::Jet> > dmxjets;
508  iEvent.getByToken(m_dmxJetToken,dmxjets);
509 
510  for ( int ibx=jets->getFirstBX(); ibx<=jets->getLastBX(); ++ibx) {
511 
512  // Cycle through all GT jets
513  for (unsigned int igtJ=0; igtJ<jets->size(ibx); igtJ++) {
514 
515  double gtJetEt = jets->at(ibx,igtJ).hwPt();
516  double dmxJetEt = 0.0;
517  if(dmxjets->size(ibx)>igtJ) dmxJetEt = dmxjets->at(ibx,igtJ).hwPt();
518  hDmxVsGTJetEt_->Fill(gtJetEt,dmxJetEt);
519 
520  double gtJetEta = jets->at(ibx,igtJ).hwEta();
521  double dmxJetEta = 0.0;
522  if(dmxjets->size(ibx)>igtJ) dmxJetEta = dmxjets->at(ibx,igtJ).hwEta();
523  hDmxVsGTJetEta_->Fill(gtJetEta,dmxJetEta);
524 
525  double gtJetPhi = jets->at(ibx,igtJ).hwPhi();
526  double dmxJetPhi = 0.0;
527  if(dmxjets->size(ibx)>igtJ) dmxJetPhi = dmxjets->at(ibx,igtJ).hwPhi();
528  hDmxVsGTJetPhi_->Fill(gtJetPhi,dmxJetPhi);
529 
530 
531 
532  }
533  // if there are extra jets in the dmx record them
534  for (unsigned int idmJ=jets->size(ibx); idmJ<dmxjets->size(ibx); idmJ++) {
535 
536 
537  double gtJetEt = 0.0; //no GT jet exists
538  double dmxJetEt = dmxjets->at(ibx,idmJ).hwPt();
539  hDmxVsGTJetEt_->Fill(gtJetEt,dmxJetEt);
540 
541  double gtJetEta = 0.0;
542  double dmxJetEta = dmxjets->at(ibx,idmJ).hwEta();
543  hDmxVsGTJetEta_->Fill(gtJetEta,dmxJetEta);
544 
545  double gtJetPhi = 0.0;
546  double dmxJetPhi = dmxjets->at(ibx,idmJ).hwPhi();
547  hDmxVsGTJetPhi_->Fill(gtJetPhi,dmxJetPhi);
548 
549  }
550 
551  }
552 
553  }
554 
555 
556  //Algorithm Bits (Emulation vs HW)
557  if (m_doGtAlg && m_doEmulGtAlg) {
559  iEvent.getByToken(m_gtAlgToken,hwalgs);
560 
562  iEvent.getByToken(m_emulGtAlgToken,emulAlgs);
563 
564 
565  //for ( int ibx=hwalgs->getFirstBX(); ibx<=hwalgs->getLastBX(); ++ibx) {
566  int ibx=0;
567 
568  auto itr = hwalgs->begin(ibx);
569  auto itr_emul = emulAlgs->begin(ibx);
570 
571  for(int algBit=0; algBit<128; algBit++) { //Fix Me: Should access size of algo vector...need method in GlobalAlgBlk class
572  bool hw = itr->getAlgoDecisionFinal(algBit);
573  bool em = itr_emul->getAlgoDecisionFinal(algBit);
574  if(hw & em) {
575  hAlgoBitsEmulGtVsHw_->Fill(algBit,algBit);
576  }else if(hw & !em) {
577  hAlgoBitsEmulGtVsHw_->Fill(algBit,-1.0);
578  }else if(!hw & em) {
579  hAlgoBitsEmulGtVsHw_->Fill(-1.0,algBit);
580  }
581  }
582 
583  // }
584 
585  }
586 
587  //Algorithm Bits (Emulation vs HW)
588  if (m_doGtAlg && m_doEmulDxAlg) {
590  iEvent.getByToken(m_gtAlgToken,hwalgs);
591 
593  iEvent.getByToken(m_emulDxAlgToken,emulAlgs);
594 
595 
596  //for ( int ibx=hwalgs->getFirstBX(); ibx<=hwalgs->getLastBX(); ++ibx) {
597  int ibx=0;
598 
599  auto itr = hwalgs->begin(ibx);
600  auto itr_emul = emulAlgs->begin(ibx);
601 
602  for(int algBit=0; algBit<128; algBit++) { //Fix Me: Should access size of algo vector...need method in GlobalAlgBlk class
603  bool hw = itr->getAlgoDecisionFinal(algBit);
604  bool em = itr_emul->getAlgoDecisionFinal(algBit);
605  if(hw & em) {
606  hAlgoBitsEmulDxVsHw_->Fill(algBit,algBit);
607  }else if(hw & !em) {
608  hAlgoBitsEmulDxVsHw_->Fill(algBit,-1.0);
609  }else if(!hw & em) {
610  hAlgoBitsEmulDxVsHw_->Fill(-1.0,algBit);
611  }
612  }
613 
614  // }
615 
616  }
617 
618 
619 
620 
621  if (doText_) edm::LogInfo("L1TGlobalEvents") << text.str();
622 
623 }
624 
625 
626 
627 // ------------ method called once each job just before starting event loop ------------
628 void
630 {
631 
633 
634  auto itr = types_.cbegin();
635  auto str = typeStr_.cbegin();
636 
637  for (; itr!=types_.end(); ++itr, ++str ) {
638 
639  double etmax=99.5;
640  if (*itr==Jet || *itr==DmxJet || *itr==Sum || *itr==DmxSum) etmax=249.5;
641 
642  dirs_.insert( std::pair< ObjectType, TFileDirectory >(*itr, fs->mkdir(*str) ) );
643 
644  het_.insert( std::pair< ObjectType, TH1F* >(*itr, dirs_.at(*itr).make<TH1F>("et", "", 100, -0.5, etmax) ));
645 
646  hbx_.insert( std::pair< ObjectType, TH1F* >(*itr, dirs_.at(*itr).make<TH1F>("bx", "", 11, -5.5, 5.5) ));
647 
648 
649  heta_.insert( std::pair< ObjectType, TH1F* >(*itr, dirs_.at(*itr).make<TH1F>("eta", "", 227, -113.5, 113.5) ));
650  hphi_.insert( std::pair< ObjectType, TH1F* >(*itr, dirs_.at(*itr).make<TH1F>("phi", "", 144, -0.5, 143.5) ));
651  hetaphi_.insert( std::pair< ObjectType, TH2F* >(*itr, dirs_.at(*itr).make<TH2F>("etaphi", "", 227, -113.5, 113.5, 144, -0.5, 143.5) ));
652 
653  }
654 
655  algDir_ = fs->mkdir("Algorithms");
656  hAlgoBits_ = algDir_.make<TH1F>("hAlgoBits","Algorithm Bits",100, -0.5,99.5);
657  hEmulGtAlgoBits_ = algDir_.make<TH1F>("hEmulGtAlgoBits","GT Emulated Algorithm Bits",100, -0.5,99.5);
658  hAlgoBitsEmulGtVsHw_ = algDir_.make<TH2F>("hAlgoBitsEmulGtVsHw","Algorithm Bits (GT) Emulation vs Hardware",101, -1.5,99.5,101,-1.5,99.5);
659  hEmulDxAlgoBits_ = algDir_.make<TH1F>("hEmulDxAlgoBits","Dx Emulated Algorithm Bits",100, -0.5,99.5);
660  hAlgoBitsEmulDxVsHw_ = algDir_.make<TH2F>("hAlgoBitsEmulDxVsHw","Algorithm Bits (Dx) Emulation vs Hardware",101, -1.5,99.5,101,-1.5,99.5);
661 
662  dmxVGtDir_ = fs->mkdir("DmxVsGT");
663  hDmxVsGTJetEt_ = dmxVGtDir_.make<TH2F>("hDmxVsGTJetEt","Dmx Jet Et versus GT Jet Et",200,-0.5,199.5,200,-0.5,199.5);
664  hDmxVsGTJetEta_ = dmxVGtDir_.make<TH2F>("hDmxVsGTJetEta","Dmx Jet Eta versus GT Jet Eta",227,-113.5,113.5,227,-113.5,113.5);
665  hDmxVsGTJetPhi_ = dmxVGtDir_.make<TH2F>("hDmxVsGTJetPhi","Dmx Jet Phi versus GT Jet Phi",144,-0.5,143.5,144,-0.5,143.5);
666 
667  if (doEvtDisp_) {
668  evtDispDir_ = fs->mkdir("Events");
669  }
670 
671 }
672 
673 // ------------ method called once each job just after ending the event loop ------------
674 void
676 {
677 }
678 
679 // ------------ method called when starting to processes a run ------------
680 /*
681 void
682 L1TGlobalAnalyzer::beginRun(edm::Run const&, edm::EventSetup const&)
683 {
684 }
685 */
686 
687 // ------------ method called when ending the processing of a run ------------
688 /*
689 void
690 L1TGlobalAnalyzer::endRun(edm::Run const&, edm::EventSetup const&)
691 {
692 }
693 */
694 
695 // ------------ method called when starting to processes a luminosity block ------------
696 /*
697 void
698 L1TGlobalAnalyzer::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
699 {
700 }
701 */
702 
703 // ------------ method called when ending the processing of a luminosity block ------------
704 /*
705 void
706 L1TGlobalAnalyzer::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
707 {
708 }
709 */
710 
711 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
712 void
714  //The following says we do not know what parameters are allowed so do no validation
715  // Please change this to state exactly what you do use, even if it is no parameters
717  desc.setUnknown();
718  descriptions.addDefault(desc);
719 }
720 
721 }
722 
723 using namespace l1t;
724 
725 //define this as a plug-in
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
edm::EDGetToken m_emulDxAlgToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetToken m_dmxEGToken
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
Definition: Tau.h:13
std::map< ObjectType, TH2F * > hetaphi_
edm::EDGetToken m_emulGtAlgToken
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: Jet.h:13
int iEvent
Definition: GenABIO.cc:230
void addDefault(ParameterSetDescription const &psetDescription)
std::map< ObjectType, TH1F * > hbx_
std::map< ObjectType, TH1F * > het_
vector< PseudoJet > jets
RunNumber_t run() const
Definition: Event.h:87
edm::EDGetToken m_dmxTauToken
tuple text
Definition: runonSM.py:42
T * make(const Args &...args) const
make new ROOT object
edm::EDGetToken m_gtAlgToken
L1TGlobalAnalyzer(const edm::ParameterSet &)
edm::EDGetToken m_sumToken
std::vector< std::string > typeStr_
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
virtual void beginJob() override
edm::EDGetToken m_dmxSumToken
edm::EDGetToken m_tauToken
std::map< ObjectType, TH1F * > heta_
std::map< ObjectType, TH1F * > hphi_
std::map< ObjectType, TFileDirectory > dirs_
edm::EventID id() const
Definition: EventBase.h:60
edm::EDGetToken m_jetToken
edm::EDGetToken m_dmxJetToken
std::vector< ObjectType > types_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
dbl *** dir
Definition: mlp_gen.cc:35
virtual void endJob() override