CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HLTInspect Class Reference

#include <HLTInspect.h>

Inheritance diagram for HLTInspect:
edm::EDAnalyzer

List of all members.

Public Member Functions

 HLTInspect (const edm::ParameterSet &)
 ~HLTInspect ()

Private Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)

Private Attributes

std::vector< std::string > hlNames_
edm::InputTag hlTriggerResults_
bool init_

Detailed Description

Definition at line 33 of file HLTInspect.h.


Constructor & Destructor Documentation

HLTInspect::HLTInspect ( const edm::ParameterSet iConfig) [explicit]

Definition at line 33 of file HLTInspect.cc.

References edm::ParameterSet::getParameter().

{
  hlTriggerResults_ = iConfig.getParameter<edm::InputTag> ("HLTriggerResults");
  init_ = false;
}
HLTInspect::~HLTInspect ( )

Definition at line 39 of file HLTInspect.cc.

{
}

Member Function Documentation

void HLTInspect::analyze ( const edm::Event e,
const edm::EventSetup c 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 42 of file HLTInspect.cc.

References edm::EventBase::bunchCrossing(), gather_cfg::cout, edm::EventID::event(), edm::EventBase::experimentType(), edm::Event::getByLabel(), i, edm::EventBase::id(), edm::EventBase::isRealData(), edm::HandleBase::isValid(), edm::EventBase::luminosityBlock(), n, edm::EventID::run(), edm::Event::triggerNames(), and edm::TriggerNames::triggerNames().

{


  int ievt = iEvent.id().event();
  int irun = iEvent.id().run();
  int ils = iEvent.luminosityBlock();
  int bx = iEvent.bunchCrossing();
//
// trigger type
//
  int trigger_type=-1;
  if (iEvent.isRealData())  trigger_type = iEvent.experimentType();


  //hlt info
  edm::Handle<TriggerResults> HLTR;
  iEvent.getByLabel(hlTriggerResults_,HLTR);


  if(HLTR.isValid() == false) {
        std::cout<< " HLTInspect Error - Could not access Results with name "<<hlTriggerResults_<<std::endl;
  }
  if(HLTR.isValid())
    {
      if (!init_) {
        init_=true;
        const edm::TriggerNames & triggerNames = iEvent.triggerNames(*HLTR);
        hlNames_=triggerNames.triggerNames();
      }
      std::cout << "HLTInspect: Run " << irun << " Ev " << ievt << " LB " << ils << " BX " << bx << " Type "<<trigger_type<< " Acc: " ;
      const unsigned int n(hlNames_.size());
      for (unsigned int i=0; i!=n; ++i) 
            {
              if (HLTR->accept(i)) 
                {
                  std::cout << hlNames_[i] << ",";
                }
            }
          std::cout << std::endl;
        }
      
    
}

Member Data Documentation

std::vector<std::string> HLTInspect::hlNames_ [private]

Definition at line 40 of file HLTInspect.h.

Definition at line 41 of file HLTInspect.h.

bool HLTInspect::init_ [private]

Definition at line 42 of file HLTInspect.h.