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