CMS 3D CMS Logo

HLTEventAnalyzerRAW Class Reference

This class is an EDAnalyzer analyzing the combined HLT information for RAW. More...

#include <HLTrigger/HLTcore/interface/HLTEventAnalyzerRAW.h>

Inheritance diagram for HLTEventAnalyzerRAW:

edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void analyzeTrigger (const std::string &triggerName)
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 HLTEventAnalyzerRAW (const edm::ParameterSet &)
 ~HLTEventAnalyzerRAW ()

Private Attributes

trigger::Vids basemetIds_
trigger::VRbasemet basemetRefs_
trigger::Vids calometIds_
trigger::VRcalomet calometRefs_
trigger::Vids compositeIds_
trigger::VRcomposite compositeRefs_
trigger::Vids electronIds_
trigger::VRelectron electronRefs_
HLTConfigProvider hltConfig_
trigger::Vids jetIds_
trigger::VRjet jetRefs_
trigger::Vids l1emIds_
trigger::VRl1em l1emRefs_
trigger::Vids l1etmissIds_
trigger::VRl1etmiss l1etmissRefs_
trigger::Vids l1jetIds_
trigger::VRl1jet l1jetRefs_
trigger::Vids l1muonIds_
trigger::VRl1muon l1muonRefs_
trigger::Vids muonIds_
trigger::VRmuon muonRefs_
trigger::Vids photonIds_
 payload extracted from TriggerEventWithRefs
trigger::VRphoton photonRefs_
trigger::Vids pixtrackIds_
trigger::VRpixtrack pixtrackRefs_
std::string processName_
 module config parameters
edm::Handle
< trigger::TriggerEventWithRefs
triggerEventWithRefsHandle_
edm::InputTag triggerEventWithRefsTag_
std::string triggerName_
edm::Handle< edm::TriggerResultstriggerResultsHandle_
 additional class data memebers
edm::InputTag triggerResultsTag_


Detailed Description

This class is an EDAnalyzer analyzing the combined HLT information for RAW.

See header file for documentation.

Date
2008/10/11 13:13:58
Revision
1.3

Author:
Martin Grunewald
Date
2008/10/11 13:13:58
Revision
1.7

Author:
Martin Grunewald

Definition at line 26 of file HLTEventAnalyzerRAW.h.


Constructor & Destructor Documentation

HLTEventAnalyzerRAW::HLTEventAnalyzerRAW ( const edm::ParameterSet ps  )  [explicit]

Definition at line 33 of file HLTEventAnalyzerRAW.cc.

References GenMuonPlsPt100GeV_cfg::cout, edm::InputTag::encode(), lat::endl(), processName_, std, triggerEventWithRefsTag_, triggerName_, and triggerResultsTag_.

00033                                                                   : 
00034   processName_(ps.getParameter<std::string>("processName")),
00035   triggerName_(ps.getParameter<std::string>("triggerName")),
00036   triggerResultsTag_(ps.getParameter<edm::InputTag>("triggerResults")),
00037   triggerEventWithRefsTag_(ps.getParameter<edm::InputTag>("triggerEventWithRefs"))
00038 {
00039   using namespace std;
00040   using namespace edm;
00041 
00042   cout << "HLTEventAnalyzerRAW configuration: " << endl
00043        << "   ProcessName = " << processName_ << endl
00044        << "   TriggerName = " << triggerName_ << endl
00045        << "   TriggerResultsTag = " << triggerResultsTag_.encode() << endl
00046        << "   TriggerEventWithRefsTag = " << triggerEventWithRefsTag_.encode() << endl;
00047 
00048 }

HLTEventAnalyzerRAW::~HLTEventAnalyzerRAW (  ) 

Definition at line 50 of file HLTEventAnalyzerRAW.cc.

00051 {
00052 }


Member Function Documentation

void HLTEventAnalyzerRAW::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 88 of file HLTEventAnalyzerRAW.cc.

References analyzeTrigger(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), edm::Event::getByLabel(), hltConfig_, i, edm::Handle< T >::isValid(), n, HLTConfigProvider::size(), std, triggerEventWithRefsHandle_, triggerEventWithRefsTag_, HLTConfigProvider::triggerName(), triggerName_, triggerResultsHandle_, and triggerResultsTag_.

00089 {
00090   using namespace std;
00091   using namespace edm;
00092   
00093   cout << endl;
00094 
00095   // get event products
00096   iEvent.getByLabel(triggerResultsTag_,triggerResultsHandle_);
00097   if (!triggerResultsHandle_.isValid()) {
00098     cout << "HLTEventAnalyzerRAW::analyze: Error in getting TriggerResults product from Event!" << endl;
00099     return;
00100   }
00101   iEvent.getByLabel(triggerEventWithRefsTag_,triggerEventWithRefsHandle_);
00102   if (!triggerEventWithRefsHandle_.isValid()) {
00103     cout << "HLTEventAnalyzerRAW::analyze: Error in getting TriggerEventWithRefs product from Event!" << endl;
00104     return;
00105   }
00106   // sanity check
00107   assert(triggerResultsHandle_->size()==hltConfig_.size());
00108   
00109   // analyze this event for the triggers requested
00110   if (triggerName_=="@") {
00111     const unsigned int n(hltConfig_.size());
00112     for (unsigned int i=0; i!=n; ++i) {
00113       analyzeTrigger(hltConfig_.triggerName(i));
00114     }
00115   } else {
00116     analyzeTrigger(triggerName_);
00117   }
00118 
00119   cout << endl;
00120   
00121   return;
00122   
00123 }

void HLTEventAnalyzerRAW::analyzeTrigger ( const std::string &  triggerName  )  [virtual]

Definition at line 125 of file HLTEventAnalyzerRAW.cc.

References basemetIds_, basemetRefs_, calometIds_, calometRefs_, compositeIds_, compositeRefs_, GenMuonPlsPt100GeV_cfg::cout, electronIds_, electronRefs_, lat::endl(), hltConfig_, i, j, jetIds_, jetRefs_, l1emIds_, l1emRefs_, l1etmissIds_, l1etmissRefs_, l1jetIds_, l1jetRefs_, l1muonIds_, l1muonRefs_, m, moduleLabel(), HLTConfigProvider::moduleLabels(), HLTConfigProvider::moduleType(), muonIds_, muonRefs_, n, photonIds_, photonRefs_, pixtrackIds_, pixtrackRefs_, processName_, HcalSimpleRecAlgoImpl::reco(), HLTConfigProvider::size(), size, std, triggerEventWithRefsHandle_, HLTConfigProvider::triggerIndex(), and triggerResultsHandle_.

Referenced by analyze().

00125                                                                      {
00126   
00127   using namespace std;
00128   using namespace edm;
00129   using namespace reco;
00130   using namespace trigger;
00131   
00132   const unsigned int n(hltConfig_.size());
00133   const unsigned int triggerIndex(hltConfig_.triggerIndex(triggerName));
00134   
00135   // abort on invalid trigger name
00136   if (triggerIndex>=n) {
00137     cout << "HLTEventAnalyzerRAW::analyzeTrigger: path "
00138          << triggerName << " - not found!" << endl;
00139     return;
00140   }
00141   
00142   cout << "HLTEventAnalyzerRAW::analyzeTrigger: path "
00143        << triggerName << " [" << triggerIndex << "]" << endl;
00144   // modules on this trigger path
00145   const unsigned int m(hltConfig_.size(triggerIndex));
00146   const vector<string>& moduleLabels(hltConfig_.moduleLabels(triggerIndex));
00147 
00148   // Results from TriggerResults product
00149   cout << " Trigger path status:"
00150        << " WasRun=" << triggerResultsHandle_->wasrun(triggerIndex)
00151        << " Accept=" << triggerResultsHandle_->accept(triggerIndex)
00152        << " Error =" << triggerResultsHandle_->error(triggerIndex)
00153        << endl;
00154   const unsigned int moduleIndex(triggerResultsHandle_->index(triggerIndex));
00155   cout << " Last active module - label/type: "
00156        << moduleLabels[moduleIndex] << "/" << hltConfig_.moduleType(moduleLabels[moduleIndex])
00157        << " [" << moduleIndex << " out of 0-" << (m-1) << " on this path]"
00158        << endl;
00159   assert (moduleIndex<m);
00160 
00161   // Results from TriggerEventWithRefs product
00162   photonIds_.clear();
00163   photonRefs_.clear();
00164   electronIds_.clear();
00165   electronRefs_.clear();
00166   muonIds_.clear();
00167   muonRefs_.clear();
00168   jetIds_.clear();
00169   jetRefs_.clear();
00170   compositeIds_.clear();
00171   compositeRefs_.clear();
00172   basemetIds_.clear();
00173   basemetRefs_.clear();
00174   calometIds_.clear();
00175   calometRefs_.clear();
00176   pixtrackIds_.clear();
00177   pixtrackRefs_.clear();
00178   l1emIds_.clear();
00179   l1emRefs_.clear();
00180   l1muonIds_.clear();
00181   l1muonRefs_.clear();
00182   l1jetIds_.clear();
00183   l1jetRefs_.clear();
00184   l1etmissIds_.clear();
00185   l1etmissRefs_.clear();
00186 
00187   // Attention: must look only for modules actually run in this path
00188   // for this event!
00189   for (unsigned int j=0; j<=moduleIndex; ++j) {
00190     const string& moduleLabel(moduleLabels[j]);
00191     const string  moduleType(hltConfig_.moduleType(moduleLabel));
00192     // check whether the module is packed up in TriggerEventWithRef product
00193     const unsigned int filterIndex(triggerEventWithRefsHandle_->filterIndex(InputTag(moduleLabel,"",processName_)));
00194     if (filterIndex<triggerEventWithRefsHandle_->size()) {
00195       cout << " Filter in slot " << j << " - label/type " << moduleLabel << "/" << moduleType << endl;
00196       cout << "  Accepted objects:" << endl;
00197 
00198       triggerEventWithRefsHandle_->getObjects(filterIndex,photonIds_,photonRefs_);
00199       const unsigned int nPhotons(photonIds_.size());
00200       if (nPhotons>0) {
00201         cout << "   Photons: " << nPhotons << "  - the objects: # id pt" << endl;
00202         for (unsigned int i=0; i!=nPhotons; ++i) {
00203           cout << "   " << i << " " << photonIds_[i]
00204                << " " << photonRefs_[i]->pt()
00205                << endl;
00206         }
00207       }
00208 
00209       triggerEventWithRefsHandle_->getObjects(filterIndex,electronIds_,electronRefs_);
00210       const unsigned int nElectrons(electronIds_.size());
00211       if (nElectrons>0) {
00212         cout << "   Electrons: " << nElectrons << "  - the objects: # id pt" << endl;
00213         for (unsigned int i=0; i!=nElectrons; ++i) {
00214           cout << "   " << i << " " << electronIds_[i]
00215                << " " << electronRefs_[i]->pt()
00216                << endl;
00217         }
00218       }
00219 
00220       triggerEventWithRefsHandle_->getObjects(filterIndex,muonIds_,muonRefs_);
00221       const unsigned int nMuons(muonIds_.size());
00222       if (nMuons>0) {
00223         cout << "   Muons: " << nMuons << "  - the objects: # id pt" << endl;
00224         for (unsigned int i=0; i!=nMuons; ++i) {
00225           cout << "   " << i << " " << muonIds_[i]
00226                << " " << muonRefs_[i]->pt()
00227                << endl;
00228         }
00229       }
00230 
00231       triggerEventWithRefsHandle_->getObjects(filterIndex,jetIds_,jetRefs_);
00232       const unsigned int nJets(jetIds_.size());
00233       if (nJets>0) {
00234         cout << "   Jets: " << nJets << "  - the objects: # id pt" << endl;
00235         for (unsigned int i=0; i!=nJets; ++i) {
00236           cout << "   " << i << " " << jetIds_[i]
00237                << " " << jetRefs_[i]->pt()
00238                << endl;
00239         }
00240       }
00241 
00242       triggerEventWithRefsHandle_->getObjects(filterIndex,compositeIds_,compositeRefs_);
00243       const unsigned int nComposites(compositeIds_.size());
00244       if (nComposites>0) {
00245         cout << "   Composites: " << nComposites << "  - the objects: # id pt" << endl;
00246         for (unsigned int i=0; i!=nComposites; ++i) {
00247           cout << "   " << i << " " << compositeIds_[i]
00248                << " " << compositeRefs_[i]->pt()
00249                << endl;
00250         }
00251       }
00252 
00253       triggerEventWithRefsHandle_->getObjects(filterIndex,basemetIds_,basemetRefs_);
00254       const unsigned int nBaseMETs(basemetIds_.size());
00255       if (nBaseMETs>0) {
00256         cout << "   BaseMETs: " << nBaseMETs << "  - the objects: # id pt" << endl;
00257         for (unsigned int i=0; i!=nBaseMETs; ++i) {
00258           cout << "   " << i << " " << basemetIds_[i]
00259                << " " << basemetRefs_[i]->pt()
00260                << endl;
00261         }
00262       }
00263 
00264       triggerEventWithRefsHandle_->getObjects(filterIndex,calometIds_,calometRefs_);
00265       const unsigned int nCaloMETs(calometIds_.size());
00266       if (nCaloMETs>0) {
00267         cout << "   CaloMETs: " << nCaloMETs << "  - the objects: # id pt" << endl;
00268         for (unsigned int i=0; i!=nCaloMETs; ++i) {
00269           cout << "   " << i << " " << calometIds_[i]
00270                << " " << calometRefs_[i]->pt()
00271                << endl;
00272         }
00273       }
00274 
00275       triggerEventWithRefsHandle_->getObjects(filterIndex,pixtrackIds_,pixtrackRefs_);
00276       const unsigned int nPixTracks(pixtrackIds_.size());
00277       if (nPixTracks>0) {
00278         cout << "   PixTracks: " << nPixTracks << "  - the objects: # id pt" << endl;
00279         for (unsigned int i=0; i!=nPixTracks; ++i) {
00280           cout << "   " << i << " " << pixtrackIds_[i]
00281                << " " << pixtrackRefs_[i]->pt()
00282                << endl;
00283         }
00284       }
00285 
00286       triggerEventWithRefsHandle_->getObjects(filterIndex,l1emIds_,l1emRefs_);
00287       const unsigned int nL1EM(l1emIds_.size());
00288       if (nL1EM>0) {
00289         cout << "   L1EM: " << nL1EM << "  - the objects: # id pt" << endl;
00290         for (unsigned int i=0; i!=nL1EM; ++i) {
00291           cout << "   " << i << " " << l1emIds_[i]
00292                << " " << l1emRefs_[i]->pt()
00293                << endl;
00294         }
00295       }
00296 
00297       triggerEventWithRefsHandle_->getObjects(filterIndex,l1muonIds_,l1muonRefs_);
00298       const unsigned int nL1Muon(l1muonIds_.size());
00299       if (nL1Muon>0) {
00300         cout << "   L1Muon: " << nL1Muon << "  - the objects: # id pt" << endl;
00301         for (unsigned int i=0; i!=nL1Muon; ++i) {
00302           cout << "   " << i << " " << l1muonIds_[i]
00303                << " " << l1muonRefs_[i]->pt()
00304                << endl;
00305         }
00306       }
00307 
00308       triggerEventWithRefsHandle_->getObjects(filterIndex,l1jetIds_,l1jetRefs_);
00309       const unsigned int nL1Jet(l1jetIds_.size());
00310       if (nL1Jet>0) {
00311         cout << "   L1Jet: " << nL1Jet << "  - the objects: # id pt" << endl;
00312         for (unsigned int i=0; i!=nL1Jet; ++i) {
00313           cout << "   " << i << " " << l1jetIds_[i]
00314                << " " << l1jetRefs_[i]->pt()
00315                << endl;
00316         }
00317       }
00318 
00319       triggerEventWithRefsHandle_->getObjects(filterIndex,l1etmissIds_,l1etmissRefs_);
00320       const unsigned int nL1EtMiss(l1etmissIds_.size());
00321       if (nL1EtMiss>0) {
00322         cout << "   L1EtMiss: " << nL1EtMiss << "  - the objects: # id pt" << endl;
00323         for (unsigned int i=0; i!=nL1EtMiss; ++i) {
00324           cout << "   " << i << " " << l1etmissIds_[i]
00325                << " " << l1etmissRefs_[i]->pt()
00326                << endl;
00327         }
00328       }
00329     }
00330   }
00331 
00332   return;
00333 }

void HLTEventAnalyzerRAW::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 58 of file HLTEventAnalyzerRAW.cc.

References GenMuonPlsPt100GeV_cfg::cout, HLTConfigProvider::dump(), lat::endl(), hltConfig_, HLTConfigProvider::init(), n, processName_, HLTConfigProvider::size(), std, HLTConfigProvider::triggerIndex(), and triggerName_.

00059 {
00060   using namespace std;
00061   using namespace edm;
00062   
00063   // HLT config does not change within runs!
00064   if (hltConfig_.init(processName_)) {
00065     // check if trigger name in (new) config
00066     if (triggerName_!="@") { // "@" means: analyze all triggers in config
00067       const unsigned int n(hltConfig_.size());
00068       const unsigned int triggerIndex(hltConfig_.triggerIndex(triggerName_));
00069       if (triggerIndex>=n) {
00070         cout << "HLTEventAnalyzerRAW::beginRun:"
00071              << " TriggerName " << triggerName_ 
00072              << " not available in (new) config!" << endl;
00073         cout << "Available TriggerNames are: " << endl;
00074         hltConfig_.dump("Triggers");
00075       }
00076     }
00077   } else {
00078     cout << "HLTEventAnalyzerRAW::beginRun:"
00079          << " config extraction failure with process name "
00080          << processName_ << endl;
00081   }
00082   return;
00083 
00084 }


Member Data Documentation

trigger::Vids HLTEventAnalyzerRAW::basemetIds_ [private]

Definition at line 61 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRbasemet HLTEventAnalyzerRAW::basemetRefs_ [private]

Definition at line 62 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::Vids HLTEventAnalyzerRAW::calometIds_ [private]

Definition at line 63 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRcalomet HLTEventAnalyzerRAW::calometRefs_ [private]

Definition at line 64 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::Vids HLTEventAnalyzerRAW::compositeIds_ [private]

Definition at line 59 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRcomposite HLTEventAnalyzerRAW::compositeRefs_ [private]

Definition at line 60 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::Vids HLTEventAnalyzerRAW::electronIds_ [private]

Definition at line 53 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRelectron HLTEventAnalyzerRAW::electronRefs_ [private]

Definition at line 54 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

HLTConfigProvider HLTEventAnalyzerRAW::hltConfig_ [private]

Definition at line 47 of file HLTEventAnalyzerRAW.h.

Referenced by analyze(), analyzeTrigger(), and beginRun().

trigger::Vids HLTEventAnalyzerRAW::jetIds_ [private]

Definition at line 57 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRjet HLTEventAnalyzerRAW::jetRefs_ [private]

Definition at line 58 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::Vids HLTEventAnalyzerRAW::l1emIds_ [private]

Definition at line 68 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRl1em HLTEventAnalyzerRAW::l1emRefs_ [private]

Definition at line 69 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::Vids HLTEventAnalyzerRAW::l1etmissIds_ [private]

Definition at line 74 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRl1etmiss HLTEventAnalyzerRAW::l1etmissRefs_ [private]

Definition at line 75 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::Vids HLTEventAnalyzerRAW::l1jetIds_ [private]

Definition at line 72 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRl1jet HLTEventAnalyzerRAW::l1jetRefs_ [private]

Definition at line 73 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::Vids HLTEventAnalyzerRAW::l1muonIds_ [private]

Definition at line 70 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRl1muon HLTEventAnalyzerRAW::l1muonRefs_ [private]

Definition at line 71 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::Vids HLTEventAnalyzerRAW::muonIds_ [private]

Definition at line 55 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRmuon HLTEventAnalyzerRAW::muonRefs_ [private]

Definition at line 56 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::Vids HLTEventAnalyzerRAW::photonIds_ [private]

payload extracted from TriggerEventWithRefs

Definition at line 51 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRphoton HLTEventAnalyzerRAW::photonRefs_ [private]

Definition at line 52 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::Vids HLTEventAnalyzerRAW::pixtrackIds_ [private]

Definition at line 65 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

trigger::VRpixtrack HLTEventAnalyzerRAW::pixtrackRefs_ [private]

Definition at line 66 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger().

std::string HLTEventAnalyzerRAW::processName_ [private]

module config parameters

Definition at line 39 of file HLTEventAnalyzerRAW.h.

Referenced by analyzeTrigger(), beginRun(), and HLTEventAnalyzerRAW().

edm::Handle<trigger::TriggerEventWithRefs> HLTEventAnalyzerRAW::triggerEventWithRefsHandle_ [private]

Definition at line 46 of file HLTEventAnalyzerRAW.h.

Referenced by analyze(), and analyzeTrigger().

edm::InputTag HLTEventAnalyzerRAW::triggerEventWithRefsTag_ [private]

Definition at line 42 of file HLTEventAnalyzerRAW.h.

Referenced by analyze(), and HLTEventAnalyzerRAW().

std::string HLTEventAnalyzerRAW::triggerName_ [private]

Definition at line 40 of file HLTEventAnalyzerRAW.h.

Referenced by analyze(), beginRun(), and HLTEventAnalyzerRAW().

edm::Handle<edm::TriggerResults> HLTEventAnalyzerRAW::triggerResultsHandle_ [private]

additional class data memebers

Definition at line 45 of file HLTEventAnalyzerRAW.h.

Referenced by analyze(), and analyzeTrigger().

edm::InputTag HLTEventAnalyzerRAW::triggerResultsTag_ [private]

Definition at line 41 of file HLTEventAnalyzerRAW.h.

Referenced by analyze(), and HLTEventAnalyzerRAW().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:24:29 2009 for CMSSW by  doxygen 1.5.4