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")),
94  iConfig.getParameter<edm::InputTag>("nonIsolatedEmSource")),
95  cenJetSource_(iConfig.getParameter<edm::InputTag>("centralJetSource")),
96  forJetSource_(iConfig.getParameter<edm::InputTag>("forwardJetSource")),
97  tauJetSource_(iConfig.getParameter<edm::InputTag>("tauJetSource")),
98  muonSource_(iConfig.getParameter<edm::InputTag>("muonSource")),
99  etMissSource_(iConfig.getParameter<edm::InputTag>("etMissSource")),
100  htMissSource_(iConfig.getParameter<edm::InputTag>("htMissSource")),
101  hfRingsSource_(iConfig.getParameter<edm::InputTag>("hfRingsSource")),
102  gtReadoutSource_(iConfig.getParameter<edm::InputTag>("gtReadoutSource")),
104  iConfig.getParameter<edm::InputTag>("particleMapSource")),
105  file_("l1extra.root", "RECREATE"),
106  hist_("triggers", "Triggers",
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_.

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