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

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
 L1ExtraTestAnalyzer (const edm::ParameterSet &)
 
 ~L1ExtraTestAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

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.

93  "isolatedEmSource" ) ),
95  "nonIsolatedEmSource" ) ),
97  "centralJetSource" ) ),
99  "forwardJetSource" ) ),
101  "tauJetSource" ) ),
103  "muonSource" ) ),
105  "etMissSource" ) ),
107  "htMissSource" ) ),
109  "hfRingsSource" ) ),
111  "gtReadoutSource" ) ),
113  "particleMapSource" ) ),
114  file_( "l1extra.root", "RECREATE" ),
115  hist_( "triggers", "Triggers",
117  -0.75,
119 {
120  //now do what ever initialization is needed
121 
122 }
T getParameter(std::string const &) const
edm::InputTag nonIsoEmSource_
edm::InputTag particleMapSource_
edm::InputTag gtReadoutSource_
edm::InputTag hfRingsSource_
L1ExtraTestAnalyzer::~L1ExtraTestAnalyzer ( )

Definition at line 125 of file L1ExtraTestAnalyzer.cc.

References file_, and hist_.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 141 of file L1ExtraTestAnalyzer.cc.

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

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

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().