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 Member Functions | Private Attributes
HLTEffCalculator Class Reference

#include <HLTEfficiencyCalculator.h>

Inheritance diagram for HLTEffCalculator:
edm::EDAnalyzer

Public Member Functions

 HLTEffCalculator (const edm::ParameterSet &)
 
 ~HLTEffCalculator ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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
 

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

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, and verbosity.

27 {
28 
29 
30  outputFileName = iConfig.getParameter<std::string>("OutputFileName");
31  HLTresCollection = iConfig.getParameter<edm::InputTag>("TriggerResCollection");
32  verbosity = iConfig.getUntrackedParameter<int>("verbosity",0);
33  myEffHandler = new EfficiencyHandler("TopHLTs", iConfig.getParameter<std::vector<std::string> >("hltPaths"), verbosity);
34 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
EfficiencyHandler * myEffHandler
edm::InputTag HLTresCollection
HLTEffCalculator::~HLTEffCalculator ( )

Definition at line 36 of file HLTEfficiencyCalculator.cc.

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

Member Function Documentation

void HLTEffCalculator::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 52 of file HLTEfficiencyCalculator.cc.

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

53 {
54  using namespace edm;
55 
56 
57  // Trigger
59  iEvent.getByLabel(HLTresCollection,trh);
60  if( ! trh.isValid() ) {
61  LogDebug("") << "HL TriggerResults with label ["+HLTresCollection.encode()+"] not found!";
62  return;
63  }
64  myEffHandler->Fill(iEvent,*trh);
65 
66 }
#define LogDebug(id)
EfficiencyHandler * myEffHandler
std::string encode() const
Definition: InputTag.cc:72
void Fill(const edm::Event &event, const edm::TriggerResults &triggerTable)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::InputTag HLTresCollection
void HLTEffCalculator::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file HLTEfficiencyCalculator.cc.

73 {}
void HLTEffCalculator::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 77 of file HLTEfficiencyCalculator.cc.

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

77  {
78  TFile * F = new TFile(outputFileName.c_str(),"recreate");
80  F->Save();
81 }
EfficiencyHandler * myEffHandler
void WriteAll(TDirectory *d)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281

Member Data Documentation

edm::InputTag HLTEffCalculator::HLTresCollection
private

Definition at line 139 of file HLTEfficiencyCalculator.h.

Referenced by analyze(), and HLTEffCalculator().

EfficiencyHandler* HLTEffCalculator::myEffHandler
private

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

int HLTEffCalculator::verbosity
private

Definition at line 140 of file HLTEfficiencyCalculator.h.

Referenced by HLTEffCalculator().