CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
l1t::L1TGlobalAnalyzer Class Reference
Inheritance diagram for l1t::L1TGlobalAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1TGlobalAnalyzer (const edm::ParameterSet &)
 
 ~L1TGlobalAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Types

enum  ObjectType {
  EG =0x1, Tau =0x2, Jet =0x3, Sum =0x4,
  DmxEG =0x5, DmxTau =0x6, DmxJet =0x7, DmxSum =0x8,
  GtAlg =0x9, EmulGtAlg =0x10
}
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
virtual void endJob () override
 

Private Attributes

TFileDirectory algDir_
 
std::map< ObjectType,
TFileDirectory
dirs_
 
TFileDirectory dmxVGtDir_
 
bool doEvtDisp_
 
bool doHistos_
 
bool doText_
 
TFileDirectory evtDispDir_
 
TH1F * hAlgoBits_
 
TH2F * hAlgoBitsEmulDxVsHw_
 
TH2F * hAlgoBitsEmulGtVsHw_
 
std::map< ObjectType, TH1F * > hbx_
 
TH2F * hDmxVsGTJetEt_
 
TH2F * hDmxVsGTJetEta_
 
TH2F * hDmxVsGTJetPhi_
 
TH1F * hEmulDxAlgoBits_
 
TH1F * hEmulGtAlgoBits_
 
std::map< ObjectType, TH1F * > het_
 
std::map< ObjectType, TH1F * > heta_
 
std::map< ObjectType, TH2F * > hetaphi_
 
std::map< ObjectType, TH1F * > hphi_
 
edm::EDGetToken m_dmxEGToken
 
edm::EDGetToken m_dmxJetToken
 
edm::EDGetToken m_dmxSumToken
 
edm::EDGetToken m_dmxTauToken
 
bool m_doDmxEGs
 
bool m_doDmxJets
 
bool m_doDmxSums
 
bool m_doDmxTaus
 
bool m_doEGs
 
bool m_doEmulDxAlg
 
bool m_doEmulGtAlg
 
bool m_doGtAlg
 
bool m_doJets
 
bool m_doSums
 
bool m_doTaus
 
edm::EDGetToken m_egToken
 
edm::EDGetToken m_emulDxAlgToken
 
edm::EDGetToken m_emulGtAlgToken
 
edm::EDGetToken m_gtAlgToken
 
edm::EDGetToken m_jetToken
 
edm::EDGetToken m_sumToken
 
edm::EDGetToken m_tauToken
 
std::vector< ObjectTypetypes_
 
std::vector< std::string > typeStr_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 53 of file L1TGlobalAnalyzer.cc.

Member Enumeration Documentation

Enumerator
EG 
Tau 
Jet 
Sum 
DmxEG 
DmxTau 
DmxJet 
DmxSum 
GtAlg 
EmulGtAlg 

Definition at line 103 of file L1TGlobalAnalyzer.cc.

Constructor & Destructor Documentation

L1TGlobalAnalyzer::L1TGlobalAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 150 of file L1TGlobalAnalyzer.cc.

References DmxEG, DmxJet, DmxSum, DmxTau, EG, edm::ParameterSet::getParameter(), m_dmxEGToken, m_dmxJetToken, m_dmxSumToken, m_dmxTauToken, m_doDmxEGs, m_doDmxJets, m_doDmxSums, m_doDmxTaus, m_doEGs, m_doEmulDxAlg, m_doEmulGtAlg, m_doGtAlg, m_doJets, m_doSums, m_doTaus, m_egToken, m_emulDxAlgToken, m_emulGtAlgToken, m_gtAlgToken, m_jetToken, m_sumToken, m_tauToken, Sum, types_, and typeStr_.

150  :
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 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetToken m_emulDxAlgToken
edm::EDGetToken m_dmxEGToken
Definition: Tau.h:13
edm::EDGetToken m_emulGtAlgToken
Definition: Jet.h:13
edm::EDGetToken m_dmxTauToken
edm::EDGetToken m_gtAlgToken
edm::EDGetToken m_sumToken
std::vector< std::string > typeStr_
edm::EDGetToken m_dmxSumToken
edm::EDGetToken m_tauToken
edm::EDGetToken m_jetToken
edm::EDGetToken m_dmxJetToken
std::vector< ObjectType > types_
L1TGlobalAnalyzer::~L1TGlobalAnalyzer ( )

Definition at line 224 of file L1TGlobalAnalyzer.cc.

225 {
226 
227  // do anything here that needs to be done at desctruction time
228  // (e.g. close files, deallocate resources etc.)
229 
230 }

Member Function Documentation

void L1TGlobalAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 239 of file L1TGlobalAnalyzer.cc.

References dir, DmxEG, DmxJet, DmxSum, DmxTau, doEvtDisp_, doText_, EG, edm::EventID::event(), evtDispDir_, edm::Event::getByToken(), hAlgoBits_, hAlgoBitsEmulDxVsHw_, hAlgoBitsEmulGtVsHw_, hbx_, hDmxVsGTJetEt_, hDmxVsGTJetEta_, hDmxVsGTJetPhi_, hEmulDxAlgoBits_, hEmulGtAlgoBits_, het_, heta_, hetaphi_, hphi_, edm::EventBase::id(), fwrapper::jets, m_dmxEGToken, m_dmxJetToken, m_dmxSumToken, m_dmxTauToken, m_doDmxEGs, m_doDmxJets, m_doDmxSums, m_doDmxTaus, m_doEGs, m_doEmulDxAlg, m_doEmulGtAlg, m_doGtAlg, m_doJets, m_doSums, m_doTaus, m_egToken, m_emulDxAlgToken, m_emulGtAlgToken, m_gtAlgToken, m_jetToken, m_sumToken, m_tauToken, TFileDirectory::make(), TFileDirectory::mkdir(), edm::Event::run(), contentValuesCheck::ss, Sum, and runonSM::text.

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 }
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
Definition: Tau.h:13
std::map< ObjectType, TH2F * > hetaphi_
edm::EDGetToken m_emulGtAlgToken
Definition: Jet.h:13
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
edm::EDGetToken m_sumToken
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
edm::EDGetToken m_dmxSumToken
edm::EDGetToken m_tauToken
std::map< ObjectType, TH1F * > heta_
std::map< ObjectType, TH1F * > hphi_
edm::EventID id() const
Definition: EventBase.h:60
edm::EDGetToken m_jetToken
edm::EDGetToken m_dmxJetToken
dbl *** dir
Definition: mlp_gen.cc:35
void L1TGlobalAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 629 of file L1TGlobalAnalyzer.cc.

References algDir_, dirs_, DmxJet, DmxSum, dmxVGtDir_, doEvtDisp_, evtDispDir_, hAlgoBits_, hAlgoBitsEmulDxVsHw_, hAlgoBitsEmulGtVsHw_, hbx_, hDmxVsGTJetEt_, hDmxVsGTJetEta_, hDmxVsGTJetPhi_, hEmulDxAlgoBits_, hEmulGtAlgoBits_, het_, heta_, hetaphi_, hphi_, TFileDirectory::make(), TFileService::mkdir(), Sum, types_, and typeStr_.

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 }
std::map< ObjectType, TH2F * > hetaphi_
Definition: Jet.h:13
std::map< ObjectType, TH1F * > hbx_
std::map< ObjectType, TH1F * > het_
T * make(const Args &...args) const
make new ROOT object
std::vector< std::string > typeStr_
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
std::map< ObjectType, TH1F * > heta_
std::map< ObjectType, TH1F * > hphi_
std::map< ObjectType, TFileDirectory > dirs_
std::vector< ObjectType > types_
void L1TGlobalAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 675 of file L1TGlobalAnalyzer.cc.

676 {
677 }
void L1TGlobalAnalyzer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 713 of file L1TGlobalAnalyzer.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

713  {
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 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

TFileDirectory l1t::L1TGlobalAnalyzer::algDir_
private

Definition at line 126 of file L1TGlobalAnalyzer.cc.

Referenced by beginJob().

std::map< ObjectType, TFileDirectory > l1t::L1TGlobalAnalyzer::dirs_
private

Definition at line 118 of file L1TGlobalAnalyzer.cc.

Referenced by beginJob().

TFileDirectory l1t::L1TGlobalAnalyzer::dmxVGtDir_
private

Definition at line 127 of file L1TGlobalAnalyzer.cc.

Referenced by beginJob().

bool l1t::L1TGlobalAnalyzer::doEvtDisp_
private

Definition at line 101 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

bool l1t::L1TGlobalAnalyzer::doHistos_
private

Definition at line 100 of file L1TGlobalAnalyzer.cc.

bool l1t::L1TGlobalAnalyzer::doText_
private

Definition at line 99 of file L1TGlobalAnalyzer.cc.

Referenced by analyze().

TFileDirectory l1t::L1TGlobalAnalyzer::evtDispDir_
private

Definition at line 125 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

TH1F* l1t::L1TGlobalAnalyzer::hAlgoBits_
private

Definition at line 128 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

TH2F* l1t::L1TGlobalAnalyzer::hAlgoBitsEmulDxVsHw_
private

Definition at line 132 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

TH2F* l1t::L1TGlobalAnalyzer::hAlgoBitsEmulGtVsHw_
private

Definition at line 131 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

std::map< ObjectType, TH1F* > l1t::L1TGlobalAnalyzer::hbx_
private

Definition at line 122 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

TH2F* l1t::L1TGlobalAnalyzer::hDmxVsGTJetEt_
private

Definition at line 133 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

TH2F* l1t::L1TGlobalAnalyzer::hDmxVsGTJetEta_
private

Definition at line 134 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

TH2F* l1t::L1TGlobalAnalyzer::hDmxVsGTJetPhi_
private

Definition at line 135 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

TH1F* l1t::L1TGlobalAnalyzer::hEmulDxAlgoBits_
private

Definition at line 130 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

TH1F* l1t::L1TGlobalAnalyzer::hEmulGtAlgoBits_
private

Definition at line 129 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

std::map< ObjectType, TH1F* > l1t::L1TGlobalAnalyzer::het_
private

Definition at line 119 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

std::map< ObjectType, TH1F* > l1t::L1TGlobalAnalyzer::heta_
private

Definition at line 120 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

std::map< ObjectType, TH2F* > l1t::L1TGlobalAnalyzer::hetaphi_
private

Definition at line 123 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

std::map< ObjectType, TH1F* > l1t::L1TGlobalAnalyzer::hphi_
private

Definition at line 121 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and beginJob().

edm::EDGetToken l1t::L1TGlobalAnalyzer::m_dmxEGToken
private

Definition at line 72 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

edm::EDGetToken l1t::L1TGlobalAnalyzer::m_dmxJetToken
private

Definition at line 74 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

edm::EDGetToken l1t::L1TGlobalAnalyzer::m_dmxSumToken
private

Definition at line 75 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

edm::EDGetToken l1t::L1TGlobalAnalyzer::m_dmxTauToken
private

Definition at line 73 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

bool l1t::L1TGlobalAnalyzer::m_doDmxEGs
private

Definition at line 86 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

bool l1t::L1TGlobalAnalyzer::m_doDmxJets
private

Definition at line 88 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

bool l1t::L1TGlobalAnalyzer::m_doDmxSums
private

Definition at line 89 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

bool l1t::L1TGlobalAnalyzer::m_doDmxTaus
private

Definition at line 87 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

bool l1t::L1TGlobalAnalyzer::m_doEGs
private

Definition at line 90 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

bool l1t::L1TGlobalAnalyzer::m_doEmulDxAlg
private

Definition at line 97 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

bool l1t::L1TGlobalAnalyzer::m_doEmulGtAlg
private

Definition at line 96 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

bool l1t::L1TGlobalAnalyzer::m_doGtAlg
private

Definition at line 95 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

bool l1t::L1TGlobalAnalyzer::m_doJets
private

Definition at line 92 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

bool l1t::L1TGlobalAnalyzer::m_doSums
private

Definition at line 93 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

bool l1t::L1TGlobalAnalyzer::m_doTaus
private

Definition at line 91 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

edm::EDGetToken l1t::L1TGlobalAnalyzer::m_egToken
private

Definition at line 76 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

edm::EDGetToken l1t::L1TGlobalAnalyzer::m_emulDxAlgToken
private

Definition at line 83 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

edm::EDGetToken l1t::L1TGlobalAnalyzer::m_emulGtAlgToken
private

Definition at line 82 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

edm::EDGetToken l1t::L1TGlobalAnalyzer::m_gtAlgToken
private

Definition at line 81 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

edm::EDGetToken l1t::L1TGlobalAnalyzer::m_jetToken
private

Definition at line 78 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

edm::EDGetToken l1t::L1TGlobalAnalyzer::m_sumToken
private

Definition at line 79 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

edm::EDGetToken l1t::L1TGlobalAnalyzer::m_tauToken
private

Definition at line 77 of file L1TGlobalAnalyzer.cc.

Referenced by analyze(), and L1TGlobalAnalyzer().

std::vector< ObjectType > l1t::L1TGlobalAnalyzer::types_
private

Definition at line 115 of file L1TGlobalAnalyzer.cc.

Referenced by beginJob(), and L1TGlobalAnalyzer().

std::vector< std::string > l1t::L1TGlobalAnalyzer::typeStr_
private

Definition at line 116 of file L1TGlobalAnalyzer.cc.

Referenced by beginJob(), and L1TGlobalAnalyzer().