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 edm::EDConsumerBase

Public Member Functions

 HLTEffCalculator (const edm::ParameterSet &)
 
 ~HLTEffCalculator ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

edm::InputTag HLTresCollection
 
edm::EDGetTokenT
< edm::TriggerResults
HLTresCollectionToken_
 
EfficiencyHandlermyEffHandler
 
std::string outputFileName
 
int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 24 of file HLTEfficiencyCalculator.cc.

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

26 {
27 
28 
29  outputFileName = iConfig.getParameter<std::string>("OutputFileName");
30  HLTresCollection = iConfig.getParameter<edm::InputTag>("TriggerResCollection");
31  verbosity = iConfig.getUntrackedParameter<int>("verbosity",0);
32  myEffHandler = new EfficiencyHandler("TopHLTs", iConfig.getParameter<std::vector<std::string> >("hltPaths"), verbosity);
33  HLTresCollectionToken_ = consumes<edm::TriggerResults>(iConfig.getParameter<edm::InputTag>("TriggerResCollection"));
34 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::TriggerResults > HLTresCollectionToken_
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::getByToken(), HLTresCollection, HLTresCollectionToken_, LogDebug, and myEffHandler.

53 {
54  using namespace edm;
55 
56 
57  // Trigger
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)
edm::EDGetTokenT< edm::TriggerResults > HLTresCollectionToken_
EfficiencyHandler * myEffHandler
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::string encode() const
Definition: InputTag.cc:164
void Fill(const edm::Event &event, const edm::TriggerResults &triggerTable)
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().

edm::EDGetTokenT<edm::TriggerResults> HLTEffCalculator::HLTresCollectionToken_
private

Definition at line 141 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().