33 hltOnlineResults_(consumes<
edm::TriggerResults>(iConfig.getParameter<
edm::InputTag>(
"OnlineResults"))),
34 hltOfflineResults_(consumes<
edm::TriggerResults>(iConfig.getParameter<
edm::InputTag>(
"OfflineResults"))),
36 verbose_(iConfig.getUntrackedParameter<bool>(
"verbose")),
37 skipPathList_(iConfig.getUntrackedParameter<
std::vector<
std::
string> >(
"skipPaths")),
38 usePathList_(iConfig.getUntrackedParameter<
std::vector<
std::
string> >(
"usePaths"))
41 produces<StringCollection >(
"failedTriggerDescription");
76 std::map<std::string, unsigned int >offlineNameBitMap;
82 std::map<std::string, unsigned int >::iterator it =
84 if (it != offlineNameBitMap.end()) {
90 <<
" not found in Offline " 102 TH1F *
h = fs->
make<TH1F>(it->c_str(), it->c_str(), 10, 0, 10);
103 TAxis *
a = h->GetXaxis();
104 a->SetBinLabel(1,
"OnPass_OffPass");
105 a->SetBinLabel(2,
"OnFail_OffFail");
106 a->SetBinLabel(3,
"OnPass_OffFail");
107 a->SetBinLabel(4,
"OnFail_OffPass");
108 a->SetBinLabel(5,
"OnError_OffError");
109 a->SetBinLabel(6,
"OnRun_OffError");
110 a->SetBinLabel(7,
"OnError_OffRun");
111 a->SetBinLabel(8,
"OnRun_OffNotRun");
112 a->SetBinLabel(9,
"OnNotRun_OffRun");
113 a->SetBinLabel(10,
"OnNotRun_OffNotRun");
171 initialise(*onlineResults, *offlineResults, event);
175 bool hasDisagreement =
false;
179 bool onRun = onlineResults->
wasrun(
i);
180 bool offRun = offlineResults->
wasrun(offlineTriggerBit);
181 bool onAccept = onlineResults->
accept(
i);
182 bool offAccept = offlineResults->
accept(offlineTriggerBit);
183 bool onError = onlineResults->
error(
i);
184 bool offError = offlineResults->
error(offlineTriggerBit);
187 if (onError || offError) {
188 if (onError && offError) {
198 else if ((!onRun) || (!offRun)) {
199 if ((!onRun) && (!offRun)) {
210 if (onAccept && offAccept) {
213 else if ((!onAccept) && (!offAccept)) {
236 std::cout <<
"Found disagreemenet " << result <<
", name is " 240 std::ostringstream desc;
242 resultDescription->push_back(desc.str());
250 hasDisagreement =
true;
253 hasDisagreement =
true;
259 if (
verbose() && (result > 1)) {
260 std::cout <<
"HLT-Compare: Event " <<
event.id().event()
270 event.put(
std::move(resultDescription),
"failedTriggerDescription");
273 if ( hasDisagreement )
290 std::cout <<
"HLT-Compare ---------- Trigger Comparison Summary ----------" << std::endl;
291 std::cout <<
"HLT-Compare The following events had trigger mismatches:" << std::endl;
292 std::map<unsigned int, std::map<std::string, unsigned int> >::iterator it;
294 std::cout <<
"HLT-Compare Event: " << it->first << std::endl;
295 std::map<std::string, unsigned int>::iterator jt;
296 for(jt = it->second.begin(); jt != it->second.end(); ++jt) {
300 std::cout <<
"HLT-Compare ------------ End Trigger Comparison ------------" << std::endl;
bool wasrun() const
Was at least one path run?
unsigned int numTriggers_
std::vector< unsigned int > onlineToOfflineBitMappings_
virtual bool filter(edm::Event &, const edm::EventSetup &)
bool accept() const
Has at least one path accepted the event?
T * make(const Args &...args) const
make new ROOT object
edm::EDGetTokenT< edm::TriggerResults > hltOnlineResults_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Strings const & triggerNames() const
HltComparator(const edm::ParameterSet &)
std::vector< TH1F * > comparisonHists_
edm::EDGetTokenT< edm::TriggerResults > hltOfflineResults_
std::vector< std::string > onlineActualNames_
std::vector< std::string > usePathList_
std::vector< std::string > offlineActualNames_
bool error() const
Has any path encountered an error (exception)
void initialise(const edm::TriggerResults &, const edm::TriggerResults &, edm::Event &e)
std::string formatResult(const unsigned int)
std::vector< std::string > skipPathList_
std::vector< std::string > StringCollection
std::map< unsigned int, std::map< std::string, unsigned int > > triggerComparisonErrors_
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override