CMS 3D CMS Logo

HLTEventAnalyzerAOD Class Reference

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

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

Inheritance diagram for HLTEventAnalyzerAOD:

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 &)
 HLTEventAnalyzerAOD (const edm::ParameterSet &)
 ~HLTEventAnalyzerAOD ()

Private Attributes

HLTConfigProvider hltConfig_
std::string processName_
 module config parameters
edm::Handle
< trigger::TriggerEvent
triggerEventHandle_
edm::InputTag triggerEventTag_
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 AOD.

See header file for documentation.

Date
2008/09/06 12:01:51
Revision
1.2

Author:
Martin Grunewald
Date
2008/09/19 11:33:10
Revision
1.5

Author:
Martin Grunewald

Definition at line 26 of file HLTEventAnalyzerAOD.h.


Constructor & Destructor Documentation

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

Definition at line 18 of file HLTEventAnalyzerAOD.cc.

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

00018                                                                   : 
00019   processName_(ps.getParameter<std::string>("processName")),
00020   triggerName_(ps.getParameter<std::string>("triggerName")),
00021   triggerResultsTag_(ps.getParameter<edm::InputTag>("triggerResults")),
00022   triggerEventTag_(ps.getParameter<edm::InputTag>("triggerEvent"))
00023 {
00024   using namespace std;
00025   using namespace edm;
00026 
00027   cout << "HLTEventAnalyzerAOD configuration: " << endl
00028        << "   ProcessName = " << processName_ << endl
00029        << "   TriggerName = " << triggerName_ << endl
00030        << "   TriggerResultsTag = " << triggerResultsTag_.encode() << endl
00031        << "   TriggerEventTag = " << triggerEventTag_.encode() << endl;
00032 
00033 }

HLTEventAnalyzerAOD::~HLTEventAnalyzerAOD (  ) 

Definition at line 35 of file HLTEventAnalyzerAOD.cc.

00036 {
00037 }


Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 73 of file HLTEventAnalyzerAOD.cc.

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

00074 {
00075   using namespace std;
00076   using namespace edm;
00077   
00078   cout << endl;
00079 
00080   // get event products
00081   iEvent.getByLabel(triggerResultsTag_,triggerResultsHandle_);
00082   if (!triggerResultsHandle_.isValid()) {
00083     cout << "HLTEventAnalyzerAOD::analyze: Error in getting TriggerResults product from Event!" << endl;
00084     return;
00085   }
00086   iEvent.getByLabel(triggerEventTag_,triggerEventHandle_);
00087   if (!triggerEventHandle_.isValid()) {
00088     cout << "HLTEventAnalyzerAOD::analyze: Error in getting TriggerEvent product from Event!" << endl;
00089     return;
00090   }
00091   // sanity check
00092   assert(triggerResultsHandle_->size()==hltConfig_.size());
00093   
00094   // analyze this event for the triggers requested
00095   if (triggerName_=="@") {
00096     const unsigned int n(hltConfig_.size());
00097     for (unsigned int i=0; i!=n; ++i) {
00098       analyzeTrigger(hltConfig_.triggerName(i));
00099     }
00100   } else {
00101     analyzeTrigger(triggerName_);
00102   }
00103   
00104   cout << endl;
00105 
00106   return;
00107   
00108 }

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

Definition at line 110 of file HLTEventAnalyzerAOD.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), hltConfig_, i, j, m, max, moduleLabel(), HLTConfigProvider::moduleLabels(), HLTConfigProvider::moduleType(), n, processName_, HcalSimpleRecAlgoImpl::reco(), HLTConfigProvider::size(), std, triggerEventHandle_, HLTConfigProvider::triggerIndex(), and triggerResultsHandle_.

Referenced by analyze().

00110                                                                      {
00111   
00112   using namespace std;
00113   using namespace edm;
00114   using namespace reco;
00115   using namespace trigger;
00116   
00117   const unsigned int n(hltConfig_.size());
00118   const unsigned int triggerIndex(hltConfig_.triggerIndex(triggerName));
00119   
00120   // abort on invalid trigger name
00121   if (triggerIndex>=n) {
00122     cout << "HLTEventAnalyzerAOD::analyzeTrigger: path "
00123          << triggerName << " - not found!" << endl;
00124     return;
00125   }
00126   
00127   cout << "HLTEventAnalyzerAOD::analyzeTrigger: path "
00128        << triggerName << " [" << triggerIndex << "]" << endl;
00129   // modules on this trigger path
00130   const unsigned int m(hltConfig_.size(triggerIndex));
00131   const vector<string>& moduleLabels(hltConfig_.moduleLabels(triggerIndex));
00132 
00133   // Results from TriggerResults product
00134   cout << " Trigger path status:"
00135        << " WasRun=" << triggerResultsHandle_->wasrun(triggerIndex)
00136        << " Accept=" << triggerResultsHandle_->accept(triggerIndex)
00137        << " Error =" << triggerResultsHandle_->error(triggerIndex)
00138        << endl;
00139   const unsigned int moduleIndex(triggerResultsHandle_->index(triggerIndex));
00140   cout << " Last active module - label/type: "
00141        << moduleLabels[moduleIndex] << "/" << hltConfig_.moduleType(moduleLabels[moduleIndex])
00142        << " [" << moduleIndex << " out of 0-" << (m-1) << " on this path]"
00143        << endl;
00144   assert (moduleIndex<m);
00145 
00146   // Results from TriggerEvent product - Attention: must look only for
00147   // modules actually run in this path for this event!
00148   for (unsigned int j=0; j<=moduleIndex; ++j) {
00149     const string& moduleLabel(moduleLabels[j]);
00150     const string  moduleType(hltConfig_.moduleType(moduleLabel));
00151     // check whether the module is packed up in TriggerEvent product
00152     const unsigned int filterIndex(triggerEventHandle_->filterIndex(InputTag(moduleLabel,"",processName_)));
00153     if (filterIndex<triggerEventHandle_->sizeFilters()) {
00154       cout << " 'L3' filter in slot " << j << " - label/type " << moduleLabel << "/" << moduleType << endl;
00155       const Vids& VIDS (triggerEventHandle_->filterIds(filterIndex));
00156       const Keys& KEYS(triggerEventHandle_->filterKeys(filterIndex));
00157       const size_type nI(VIDS.size());
00158       const size_type nK(KEYS.size());
00159       assert(nI==nK);
00160       const size_type n(max(nI,nK));
00161       cout << "   " << n  << " accepted 'L3' objects found: " << endl;
00162       const TriggerObjectCollection& TOC(triggerEventHandle_->getObjects());
00163       for (size_type i=0; i!=n; ++i) {
00164         const TriggerObject& TO(TOC[KEYS[i]]);
00165         cout << "   " << i << " " << VIDS[i] << "/" << KEYS[i] << ": "
00166              << TO.id() << " " << TO.pt() << " " << TO.eta() << " " << TO.phi() << " " << TO.mass()
00167              << endl;
00168       }
00169     }
00170   }
00171 
00172    return;
00173 }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 43 of file HLTEventAnalyzerAOD.cc.

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

00044 {
00045   using namespace std;
00046   using namespace edm;
00047   
00048   // HLT config does not change within runs!
00049   if (hltConfig_.init(processName_)) {
00050     // check if trigger name in (new) config
00051     if (triggerName_!="@") { // "@" means: analyze all triggers in config
00052       const unsigned int n(hltConfig_.size());
00053       const unsigned int triggerIndex(hltConfig_.triggerIndex(triggerName_));
00054       if (triggerIndex>=n) {
00055         cout << "HLTEventAnalyzerAOD::beginRun:"
00056              << " TriggerName " << triggerName_ 
00057              << " not available in (new) config!" << endl;
00058         cout << "Available TriggerNames are: " << endl;
00059         hltConfig_.dump("Triggers");
00060       }
00061     }
00062   } else {
00063     cout << "HLTEventAnalyzerAOD::beginRun:"
00064          << " config extraction failure with process name "
00065          << processName_ << endl;
00066   }
00067   return;
00068 
00069 }


Member Data Documentation

HLTConfigProvider HLTEventAnalyzerAOD::hltConfig_ [private]

Definition at line 47 of file HLTEventAnalyzerAOD.h.

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

std::string HLTEventAnalyzerAOD::processName_ [private]

module config parameters

Definition at line 39 of file HLTEventAnalyzerAOD.h.

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

edm::Handle<trigger::TriggerEvent> HLTEventAnalyzerAOD::triggerEventHandle_ [private]

Definition at line 46 of file HLTEventAnalyzerAOD.h.

Referenced by analyze(), and analyzeTrigger().

edm::InputTag HLTEventAnalyzerAOD::triggerEventTag_ [private]

Definition at line 42 of file HLTEventAnalyzerAOD.h.

Referenced by analyze(), and HLTEventAnalyzerAOD().

std::string HLTEventAnalyzerAOD::triggerName_ [private]

Definition at line 40 of file HLTEventAnalyzerAOD.h.

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

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

additional class data memebers

Definition at line 45 of file HLTEventAnalyzerAOD.h.

Referenced by analyze(), and analyzeTrigger().

edm::InputTag HLTEventAnalyzerAOD::triggerResultsTag_ [private]

Definition at line 41 of file HLTEventAnalyzerAOD.h.

Referenced by analyze(), and HLTEventAnalyzerAOD().


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