CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HLTEffCalculator Class Reference

#include <HLTEfficiencyCalculator.h>

Inheritance diagram for HLTEffCalculator:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void endJob ()

Private Attributes

edm::InputTag HLTresCollection
EfficiencyHandlermyEffHandler
std::string outputFileName
int verbosity

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 121 of file HLTEfficiencyCalculator.h.


Constructor & Destructor Documentation

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

Definition at line 25 of file HLTEfficiencyCalculator.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLTresCollection, myEffHandler, outputFileName, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

{
  
   
     outputFileName      = iConfig.getParameter<std::string>("OutputFileName");
     HLTresCollection           = iConfig.getParameter<edm::InputTag>("TriggerResCollection");
     verbosity =  iConfig.getUntrackedParameter<int>("verbosity",0);    
     myEffHandler = new  EfficiencyHandler("TopHLTs", iConfig.getParameter<std::vector<std::string> >("hltPaths"), verbosity);   
}
HLTEffCalculator::~HLTEffCalculator ( )

Definition at line 36 of file HLTEfficiencyCalculator.cc.

{
  
  // do anything here that needs to be done at desctruction time
  // (e.g. close files, deallocate resources etc.)
  
}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 52 of file HLTEfficiencyCalculator.cc.

References edm::InputTag::encode(), EfficiencyHandler::Fill(), edm::Event::getByLabel(), HLTresCollection, LogDebug, and myEffHandler.

{
  using namespace edm;
  
 
  // Trigger 
  Handle<TriggerResults> trh;
  iEvent.getByLabel(HLTresCollection,trh);
  if( ! trh.isValid() ) {
    LogDebug("") << "HL TriggerResults with label ["+HLTresCollection.encode()+"] not found!";
    return;
  }  
  myEffHandler->Fill(iEvent,*trh);
  
}
void HLTEffCalculator::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file HLTEfficiencyCalculator.cc.

{}
void HLTEffCalculator::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 77 of file HLTEfficiencyCalculator.cc.

References F(), myEffHandler, outputFileName, and EfficiencyHandler::WriteAll().

                         {  
        TFile * F = new TFile(outputFileName.c_str(),"recreate");
        myEffHandler->WriteAll(F);
        F->Save();
}

Member Data Documentation

Definition at line 139 of file HLTEfficiencyCalculator.h.

Referenced by analyze(), and HLTEffCalculator().

Definition at line 138 of file HLTEfficiencyCalculator.h.

Referenced by analyze(), endJob(), and HLTEffCalculator().

std::string HLTEffCalculator::outputFileName [private]

Definition at line 137 of file HLTEfficiencyCalculator.h.

Referenced by endJob(), and HLTEffCalculator().

Definition at line 140 of file HLTEfficiencyCalculator.h.

Referenced by HLTEffCalculator().