ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/HLTAnalyzer.h
Revision: 1.4
Committed: Wed Jun 10 11:17:05 2009 UTC (15 years, 10 months ago) by lethuill
Content type: text/plain
Branch: MAIN
CVS Tags: all_3_3_2_01, all_3_2_5_02, all_3_2_5_01, all_2_2_9_03, all_2_2_9_02, all_2_2_9_01, HEAD
Branch point for: CMSSW_2_2_X_br
Changes since 1.3: +50 -60 lines
Log Message:
Better protection against missing collection / Cleaning data format selection / Last iteration for migration to PAT of Photons

File Contents

# User Rev Content
1 mlethuil 1.1 #ifndef HLTAnalyzer_h
2     #define HLTAnalyzer_h
3    
4     // system include files
5     #include <memory>
6     #include <string>
7     #include <iostream>
8    
9     // user include files
10 lethuill 1.2 //#include "FWCore/Framework/interface/Frameworkfwd.h"
11     //#include "FWCore/Framework/interface/EDAnalyzer.h"
12     //#include "FWCore/Framework/interface/MakerMacros.h"
13 mlethuil 1.1 #include "FWCore/Framework/interface/Event.h"
14     #include "FWCore/ParameterSet/interface/ParameterSet.h"
15     #include "FWCore/Framework/interface/ESHandle.h"
16 lethuill 1.2
17 mlethuil 1.1 #include "FWCore/Framework/interface/TriggerNames.h"
18     #include "DataFormats/Common/interface/TriggerResults.h"
19    
20 lethuill 1.3 #include "../interface/TRootRun.h"
21     #include "../interface/TRootEvent.h"
22 mlethuil 1.1
23     #include <iomanip>
24    
25    
26 lethuill 1.4 class HLTAnalyzer
27     {
28    
29     public:
30    
31     HLTAnalyzer(const edm::ParameterSet& producersNames, int verbosity);
32     ~HLTAnalyzer() {;}
33    
34     void setVerbosity(int verbosity) {verbosity_ = verbosity; };
35     bool init(const edm::Event& iEvent, TRootEvent* rootEvent);
36     bool process(const edm::Event& iEvent, TRootEvent* rootEvent);
37     void printStats();
38     void copySummary(TRootRun* runInfos);
39    
40     unsigned int nHLTPaths() const { return hltNames_.size(); }
41    
42     unsigned int nEvents() const { return nEvents_; }
43     unsigned int nWasRun() const { return nWasRun_; }
44     unsigned int nAccept() const { return nAccept_; }
45     unsigned int nErrors() const { return nErrors_; }
46    
47     std::vector<unsigned int> hltWasRun() const { return hltWasRun_; }
48     std::vector<unsigned int> hltAccept() const { return hltAccept_; }
49     std::vector<unsigned int> hltErrors() const { return hltErrors_; }
50     std::vector<std::string> hltNames() const { return hltNames_; }
51    
52     unsigned int hltWasRun(unsigned ipath) const { return (hltWasRun_.size()>ipath ? hltWasRun_.at(ipath) : 0 ); }
53     unsigned int hltAccept(unsigned ipath) const { return (hltAccept_.size()>ipath ? hltAccept_.at(ipath) : 0 ); }
54     unsigned int hltErrors(unsigned ipath) const { return (hltErrors_.size()>ipath ? hltErrors_.at(ipath) : 0 ); }
55     std::string hltNames(unsigned ipath) const { return (hltNames_.size()>ipath ? hltNames_.at(ipath) : "noname" ); }
56    
57     private:
58    
59     int verbosity_;
60    
61     edm::InputTag triggerResultsTag_; // Input tag for TriggerResults
62     edm::TriggerNames triggerNames_; // TriggerNames class
63    
64     unsigned int nEvents_; // number of events processed
65     unsigned int nWasRun_; // # where at least one HLT was run
66     unsigned int nAccept_; // # of accepted events
67     unsigned int nErrors_; // # where at least one HLT had error
68    
69     std::vector<unsigned int> hltWasRun_; // # where HLT[i] was run
70     std::vector<unsigned int> hltAccept_; // # of events accepted by HLT[i]
71     std::vector<unsigned int> hltErrors_; // # of events with error in HLT[i]
72     std::vector<std::string> hltNames_; // name of each HLT algorithm
73    
74     bool allowMissingCollection_;
75    
76 mlethuil 1.1 };
77    
78     #endif