test
CMS 3D CMS Logo

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

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
 L1ExtraTestAnalyzer (const edm::ParameterSet &)
 
 ~L1ExtraTestAnalyzer ()
 
- 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 ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & 
itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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 &)
 
- 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

L1TriggerOffline/L1ExtraTestAnalyzer/src/L1ExtraTestAnalyzer.cc

Author
Werner Sun

Description: simple analyzer to print out L1Extra object information.

Definition at line 53 of file L1ExtraTestAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 90 of file L1ExtraTestAnalyzer.cc.

92  "isolatedEmSource" ) ),
94  "nonIsolatedEmSource" ) ),
96  "centralJetSource" ) ),
98  "forwardJetSource" ) ),
100  "tauJetSource" ) ),
102  "muonSource" ) ),
104  "etMissSource" ) ),
106  "htMissSource" ) ),
108  "hfRingsSource" ) ),
110  "gtReadoutSource" ) ),
112  "particleMapSource" ) ),
113  file_( "l1extra.root", "RECREATE" ),
114  hist_( "triggers", "Triggers",
116  -0.75,
118 {
119  //now do what ever initialization is needed
120 
121 }
T getParameter(std::string const &) const
edm::InputTag nonIsoEmSource_
edm::InputTag particleMapSource_
edm::InputTag gtReadoutSource_
edm::InputTag hfRingsSource_
L1ExtraTestAnalyzer::~L1ExtraTestAnalyzer ( )

Definition at line 124 of file L1ExtraTestAnalyzer.cc.

References file_, and hist_.

125 {
126  // do anything here that needs to be done at desctruction time
127  // (e.g. close files, deallocate resources etc.)
128 
129  file_.cd() ;
130  hist_.Write() ;
131 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 140 of file L1ExtraTestAnalyzer.cc.

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

142 {
143  using namespace edm ;
144  using namespace l1extra ;
145 
146  static int iev = 0 ;
147  cout << "EVENT " << ++iev << endl ;
148 
149  cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl ;
150 
151  // Isolated EM particles
153  iEvent.getByLabel( isoEmSource_, isoEmColl ) ;
154  cout << "Number of isolated EM " << isoEmColl->size() << endl ;
155 
156  for( L1EmParticleCollection::const_iterator emItr = isoEmColl->begin() ;
157  emItr != isoEmColl->end() ;
158  ++emItr )
159  {
160  cout << " p4 (" << emItr->px()
161  << ", " << emItr->py()
162  << ", " << emItr->pz()
163  << ", " << emItr->energy()
164  << ") et " << emItr->et()
165  << " eta " << emItr->eta()
166  << " phi " << emItr->phi()
167  << endl ;
168  }
169 
170  // Non-isolated EM particles
171  Handle< L1EmParticleCollection > nonIsoEmColl ;
172  iEvent.getByLabel( nonIsoEmSource_, nonIsoEmColl ) ;
173  cout << "Number of non-isolated EM " << nonIsoEmColl->size() << endl ;
174 
175  for( L1EmParticleCollection::const_iterator emItr = nonIsoEmColl->begin() ;
176  emItr != nonIsoEmColl->end() ;
177  ++emItr )
178  {
179  cout << " p4 (" << emItr->px()
180  << ", " << emItr->py()
181  << ", " << emItr->pz()
182  << ", " << emItr->energy()
183  << ") et " << emItr->et()
184  << " eta " << emItr->eta()
185  << " phi " << emItr->phi()
186  << endl ;
187  }
188 
189  // Jet particles
191  iEvent.getByLabel( cenJetSource_, cenJetColl ) ;
192  cout << "Number of central jets " << cenJetColl->size() << endl ;
193 
194  for( L1JetParticleCollection::const_iterator jetItr = cenJetColl->begin() ;
195  jetItr != cenJetColl->end() ;
196  ++jetItr )
197  {
198  cout << " p4 (" << jetItr->px()
199  << ", " << jetItr->py()
200  << ", " << jetItr->pz()
201  << ", " << jetItr->energy()
202  << ") et " << jetItr->et()
203  << " eta " << jetItr->eta()
204  << " phi " << jetItr->phi()
205  << endl ;
206  }
207 
209  iEvent.getByLabel( forJetSource_, forJetColl ) ;
210  cout << "Number of forward jets " << forJetColl->size() << endl ;
211 
212  for( L1JetParticleCollection::const_iterator jetItr = forJetColl->begin() ;
213  jetItr != forJetColl->end() ;
214  ++jetItr )
215  {
216  cout << " p4 (" << jetItr->px()
217  << ", " << jetItr->py()
218  << ", " << jetItr->pz()
219  << ", " << jetItr->energy()
220  << ") et " << jetItr->et()
221  << " eta " << jetItr->eta()
222  << " phi " << jetItr->phi()
223  << endl ;
224  }
225 
227  iEvent.getByLabel( tauJetSource_, tauColl ) ;
228  cout << "Number of tau jets " << tauColl->size() << endl ;
229 
230  for( L1JetParticleCollection::const_iterator tauItr = tauColl->begin() ;
231  tauItr != tauColl->end() ;
232  ++tauItr )
233  {
234  cout << " p4 (" << tauItr->px()
235  << ", " << tauItr->py()
236  << ", " << tauItr->pz()
237  << ", " << tauItr->energy()
238  << ") et " << tauItr->et()
239  << " eta " << tauItr->eta()
240  << " phi " << tauItr->phi()
241  << endl ;
242  }
243 
244  // Muon particles
246  iEvent.getByLabel( muonSource_, muColl ) ;
247  cout << "Number of muons " << muColl->size() << endl ;
248 
249  for( L1MuonParticleCollection::const_iterator muItr = muColl->begin() ;
250  muItr != muColl->end() ;
251  ++muItr )
252  {
253  cout << " q " << muItr->charge()
254  << " p4 (" << muItr->px()
255  << ", " << muItr->py()
256  << ", " << muItr->pz()
257  << ", " << muItr->energy()
258  << ") et " << muItr->et()
259  << " eta " << muItr->eta() << endl
260  << " phi " << muItr->phi()
261  << " iso " << muItr->isIsolated()
262  << " mip " << muItr->isMip()
263  << " fwd " << muItr->isForward()
264  << " rpc " << muItr->isRPC()
265  << endl ;
266  }
267 
268  // MET
270  iEvent.getByLabel( etMissSource_, etMissColl ) ;
271  cout << "MET Coll (" << etMissColl->begin()->px()
272  << ", " << etMissColl->begin()->py()
273  << ", " << etMissColl->begin()->pz()
274  << ", " << etMissColl->begin()->energy()
275  << ") phi " << etMissColl->begin()->phi()
276  << " EtTot " << etMissColl->begin()->etTotal()
277  << endl ;
278 
279  // MHT
281  iEvent.getByLabel( htMissSource_, htMissColl ) ;
282  cout << "MHT Coll (" << htMissColl->begin()->px()
283  << ", " << htMissColl->begin()->py()
284  << ", " << htMissColl->begin()->pz()
285  << ", " << htMissColl->begin()->energy()
286  << ") phi " << htMissColl->begin()->phi()
287  << " HtTot " << htMissColl->begin()->etTotal()
288  << endl ;
289 
290  // HF Rings
291  Handle< L1HFRingsCollection > hfRingsColl ;
292  iEvent.getByLabel( hfRingsSource_, hfRingsColl ) ;
293  cout << "HF Rings:" << endl ;
294  for( int i = 0 ; i < L1HFRings::kNumRings ; ++i )
295  {
296  cout << " " << i << ": et sum = "
297  << hfRingsColl->begin()->hfEtSum( (L1HFRings::HFRingLabels) i )
298  << ", bit count = "
299  << hfRingsColl->begin()->hfBitCount( (L1HFRings::HFRingLabels) i )
300  << endl ;
301  }
302  cout << endl ;
303 
304 // // L1GlobalTriggerReadoutRecord
305 // Handle< L1GlobalTriggerReadoutRecord > gtRecord ;
306 // iEvent.getByLabel( gtReadoutSource_, gtRecord ) ;
307 // cout << "Global trigger decision " << gtRecord->decision() << endl ;
308 
309  cout << endl ;
310 }
int i
Definition: DBlmapReader.cc:9
edm::InputTag nonIsoEmSource_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:413
edm::InputTag hfRingsSource_
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

edm::InputTag L1ExtraTestAnalyzer::cenJetSource_
private

Definition at line 65 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::etMissSource_
private

Definition at line 69 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

TFile L1ExtraTestAnalyzer::file_
private

Definition at line 75 of file L1ExtraTestAnalyzer.cc.

Referenced by ~L1ExtraTestAnalyzer().

edm::InputTag L1ExtraTestAnalyzer::forJetSource_
private

Definition at line 66 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::gtReadoutSource_
private

Definition at line 72 of file L1ExtraTestAnalyzer.cc.

edm::InputTag L1ExtraTestAnalyzer::hfRingsSource_
private

Definition at line 71 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

TH1F L1ExtraTestAnalyzer::hist_
private

Definition at line 76 of file L1ExtraTestAnalyzer.cc.

Referenced by ~L1ExtraTestAnalyzer().

edm::InputTag L1ExtraTestAnalyzer::htMissSource_
private

Definition at line 70 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::isoEmSource_
private

Definition at line 63 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::muonSource_
private

Definition at line 68 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::nonIsoEmSource_
private

Definition at line 64 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

edm::InputTag L1ExtraTestAnalyzer::particleMapSource_
private

Definition at line 73 of file L1ExtraTestAnalyzer.cc.

edm::InputTag L1ExtraTestAnalyzer::tauJetSource_
private

Definition at line 67 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().