CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTEfficiencyCalculator.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Class: HLTEffCalculator
4 //
12 //
13 // Original Author: Abideh Jafari
14 // Created: Wed Aug 01 09:06:32 CEST 2012
15 //
16 //
17 
18 
21 #include "TFile.h"
22 
23 
25 
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 }
35 
37 {
38 
39  // do anything here that needs to be done at desctruction time
40  // (e.g. close files, deallocate resources etc.)
41 
42 }
43 
44 
45 //
46 // member functions
47 //
48 
49 
50 // ------------ method called to for each event ------------
51 void
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 }
67 
68 
69 
70 // ------------ method called once each job just before starting event loop ------------
71 void
73 {}
74 
75 // ------------ method called once each job just after ending the event loop ------------
76 void
78  TFile * F = new TFile(outputFileName.c_str(),"recreate");
80  F->Save();
81 }
82 
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
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
HLTEffCalculator(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:243
void Fill(const edm::Event &event, const edm::TriggerResults &triggerTable)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void WriteAll(TDirectory *d)
edm::InputTag HLTresCollection
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281