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 // $Id: HLTEfficiencyCalculator.cc,v 1.1 2012/08/01 08:26:04 ajafari Exp $
16 //
17 //
18 
19 
22 #include "TFile.h"
23 
24 
26 
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 }
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
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 }
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
EfficiencyHandler * myEffHandler
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)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
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