CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1ExtraTestAnalyzer Class Reference
Inheritance diagram for L1ExtraTestAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 L1ExtraTestAnalyzer (const edm::ParameterSet &)
 
 ~L1ExtraTestAnalyzer () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::InputTag cenJetSource_
 
edm::InputTag etMissSource_
 
TFile file_
 
edm::InputTag forJetSource_
 
edm::InputTag gtReadoutSource_
 
edm::InputTag hfRingsSource_
 
TH1F hist_
 
edm::InputTag htMissSource_
 
edm::InputTag isoEmSource_
 
edm::InputTag muonSource_
 
edm::InputTag nonIsoEmSource_
 
edm::InputTag particleMapSource_
 
edm::InputTag tauJetSource_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

L1TriggerOffline/L1ExtraTestAnalyzer/src/L1ExtraTestAnalyzer.cc

Author
Werner Sun

Description: simple analyzer to print out L1Extra object information.

Definition at line 54 of file L1ExtraTestAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 91 of file L1ExtraTestAnalyzer.cc.

92  : isoEmSource_(iConfig.getParameter<edm::InputTag>("isolatedEmSource")),
93  nonIsoEmSource_(iConfig.getParameter<edm::InputTag>("nonIsolatedEmSource")),
94  cenJetSource_(iConfig.getParameter<edm::InputTag>("centralJetSource")),
95  forJetSource_(iConfig.getParameter<edm::InputTag>("forwardJetSource")),
96  tauJetSource_(iConfig.getParameter<edm::InputTag>("tauJetSource")),
97  muonSource_(iConfig.getParameter<edm::InputTag>("muonSource")),
98  etMissSource_(iConfig.getParameter<edm::InputTag>("etMissSource")),
99  htMissSource_(iConfig.getParameter<edm::InputTag>("htMissSource")),
100  hfRingsSource_(iConfig.getParameter<edm::InputTag>("hfRingsSource")),
101  gtReadoutSource_(iConfig.getParameter<edm::InputTag>("gtReadoutSource")),
102  particleMapSource_(iConfig.getParameter<edm::InputTag>("particleMapSource")),
103  file_("l1extra.root", "RECREATE"),
104  hist_("triggers",
105  "Triggers",
107  -0.75,
109  // now do what ever initialization is needed
110 }
T getParameter(std::string const &) const
edm::InputTag nonIsoEmSource_
edm::InputTag particleMapSource_
edm::InputTag gtReadoutSource_
edm::InputTag hfRingsSource_
L1ExtraTestAnalyzer::~L1ExtraTestAnalyzer ( )
override

Definition at line 112 of file L1ExtraTestAnalyzer.cc.

References file_, and hist_.

112  {
113  // do anything here that needs to be done at desctruction time
114  // (e.g. close files, deallocate resources etc.)
115 
116  file_.cd();
117  hist_.Write();
118 }

Member Function Documentation

void L1ExtraTestAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 125 of file L1ExtraTestAnalyzer.cc.

References cenJetSource_, gather_cfg::cout, DEFINE_FWK_MODULE, etMissSource_, forJetSource_, edm::Event::getByLabel(), hfRingsSource_, htMissSource_, mps_fire::i, isoEmSource_, muonSource_, nonIsoEmSource_, and tauJetSource_.

125  {
126  using namespace edm;
127  using namespace l1extra;
128 
129  static int iev = 0;
130  cout << "EVENT " << ++iev << endl;
131 
132  cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl;
133 
134  // Isolated EM particles
136  iEvent.getByLabel(isoEmSource_, isoEmColl);
137  cout << "Number of isolated EM " << isoEmColl->size() << endl;
138 
139  for (L1EmParticleCollection::const_iterator emItr = isoEmColl->begin(); emItr != isoEmColl->end(); ++emItr) {
140  cout << " p4 (" << emItr->px() << ", " << emItr->py() << ", " << emItr->pz() << ", " << emItr->energy() << ") et "
141  << emItr->et() << " eta " << emItr->eta() << " phi " << emItr->phi() << endl;
142  }
143 
144  // Non-isolated EM particles
145  Handle<L1EmParticleCollection> nonIsoEmColl;
146  iEvent.getByLabel(nonIsoEmSource_, nonIsoEmColl);
147  cout << "Number of non-isolated EM " << nonIsoEmColl->size() << endl;
148 
149  for (L1EmParticleCollection::const_iterator emItr = nonIsoEmColl->begin(); emItr != nonIsoEmColl->end(); ++emItr) {
150  cout << " p4 (" << emItr->px() << ", " << emItr->py() << ", " << emItr->pz() << ", " << emItr->energy() << ") et "
151  << emItr->et() << " eta " << emItr->eta() << " phi " << emItr->phi() << endl;
152  }
153 
154  // Jet particles
156  iEvent.getByLabel(cenJetSource_, cenJetColl);
157  cout << "Number of central jets " << cenJetColl->size() << endl;
158 
159  for (L1JetParticleCollection::const_iterator jetItr = cenJetColl->begin(); jetItr != cenJetColl->end(); ++jetItr) {
160  cout << " p4 (" << jetItr->px() << ", " << jetItr->py() << ", " << jetItr->pz() << ", " << jetItr->energy()
161  << ") et " << jetItr->et() << " eta " << jetItr->eta() << " phi " << jetItr->phi() << endl;
162  }
163 
165  iEvent.getByLabel(forJetSource_, forJetColl);
166  cout << "Number of forward jets " << forJetColl->size() << endl;
167 
168  for (L1JetParticleCollection::const_iterator jetItr = forJetColl->begin(); jetItr != forJetColl->end(); ++jetItr) {
169  cout << " p4 (" << jetItr->px() << ", " << jetItr->py() << ", " << jetItr->pz() << ", " << jetItr->energy()
170  << ") et " << jetItr->et() << " eta " << jetItr->eta() << " phi " << jetItr->phi() << endl;
171  }
172 
174  iEvent.getByLabel(tauJetSource_, tauColl);
175  cout << "Number of tau jets " << tauColl->size() << endl;
176 
177  for (L1JetParticleCollection::const_iterator tauItr = tauColl->begin(); tauItr != tauColl->end(); ++tauItr) {
178  cout << " p4 (" << tauItr->px() << ", " << tauItr->py() << ", " << tauItr->pz() << ", " << tauItr->energy()
179  << ") et " << tauItr->et() << " eta " << tauItr->eta() << " phi " << tauItr->phi() << endl;
180  }
181 
182  // Muon particles
184  iEvent.getByLabel(muonSource_, muColl);
185  cout << "Number of muons " << muColl->size() << endl;
186 
187  for (L1MuonParticleCollection::const_iterator muItr = muColl->begin(); muItr != muColl->end(); ++muItr) {
188  cout << " q " << muItr->charge() << " p4 (" << muItr->px() << ", " << muItr->py() << ", " << muItr->pz() << ", "
189  << muItr->energy() << ") et " << muItr->et() << " eta " << muItr->eta() << endl
190  << " phi " << muItr->phi() << " iso " << muItr->isIsolated() << " mip " << muItr->isMip() << " fwd "
191  << muItr->isForward() << " rpc " << muItr->isRPC() << endl;
192  }
193 
194  // MET
196  iEvent.getByLabel(etMissSource_, etMissColl);
197  cout << "MET Coll (" << etMissColl->begin()->px() << ", " << etMissColl->begin()->py() << ", "
198  << etMissColl->begin()->pz() << ", " << etMissColl->begin()->energy() << ") phi " << etMissColl->begin()->phi()
199  << " EtTot " << etMissColl->begin()->etTotal() << endl;
200 
201  // MHT
203  iEvent.getByLabel(htMissSource_, htMissColl);
204  cout << "MHT Coll (" << htMissColl->begin()->px() << ", " << htMissColl->begin()->py() << ", "
205  << htMissColl->begin()->pz() << ", " << htMissColl->begin()->energy() << ") phi " << htMissColl->begin()->phi()
206  << " HtTot " << htMissColl->begin()->etTotal() << endl;
207 
208  // HF Rings
209  Handle<L1HFRingsCollection> hfRingsColl;
210  iEvent.getByLabel(hfRingsSource_, hfRingsColl);
211  cout << "HF Rings:" << endl;
212  for (int i = 0; i < L1HFRings::kNumRings; ++i) {
213  cout << " " << i << ": et sum = " << hfRingsColl->begin()->hfEtSum((L1HFRings::HFRingLabels)i)
214  << ", bit count = " << hfRingsColl->begin()->hfBitCount((L1HFRings::HFRingLabels)i) << endl;
215  }
216  cout << endl;
217 
218  // // L1GlobalTriggerReadoutRecord
219  // Handle< L1GlobalTriggerReadoutRecord > gtRecord ;
220  // iEvent.getByLabel( gtReadoutSource_, gtRecord ) ;
221  // cout << "Global trigger decision " << gtRecord->decision() << endl ;
222 
223  cout << endl;
224 }
edm::InputTag nonIsoEmSource_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
edm::InputTag hfRingsSource_
HLT enums.

Member Data Documentation

edm::InputTag L1ExtraTestAnalyzer::cenJetSource_
private

Definition at line 66 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::etMissSource_
private

Definition at line 70 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

TFile L1ExtraTestAnalyzer::file_
private

Definition at line 76 of file L1ExtraTestAnalyzer.cc.

Referenced by ~L1ExtraTestAnalyzer().

edm::InputTag L1ExtraTestAnalyzer::forJetSource_
private

Definition at line 67 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::gtReadoutSource_
private

Definition at line 73 of file L1ExtraTestAnalyzer.cc.

edm::InputTag L1ExtraTestAnalyzer::hfRingsSource_
private

Definition at line 72 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

TH1F L1ExtraTestAnalyzer::hist_
private

Definition at line 77 of file L1ExtraTestAnalyzer.cc.

Referenced by ~L1ExtraTestAnalyzer().

edm::InputTag L1ExtraTestAnalyzer::htMissSource_
private

Definition at line 71 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::isoEmSource_
private

Definition at line 64 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::muonSource_
private

Definition at line 69 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::nonIsoEmSource_
private

Definition at line 65 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::particleMapSource_
private

Definition at line 74 of file L1ExtraTestAnalyzer.cc.

edm::InputTag L1ExtraTestAnalyzer::tauJetSource_
private

Definition at line 68 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().