37 : hltOnlineResults_(consumes<
edm::TriggerResults>(iConfig.getParameter<
edm::InputTag>(
"OnlineResults"))),
38 hltOfflineResults_(consumes<
edm::TriggerResults>(iConfig.getParameter<
edm::InputTag>(
"OfflineResults"))),
40 verbose_(iConfig.getUntrackedParameter<
bool>(
"verbose")),
41 skipPathList_(iConfig.getUntrackedParameter<
std::vector<
std::
string>>(
"skipPaths")),
42 usePathList_(iConfig.getUntrackedParameter<
std::vector<
std::
string>>(
"usePaths")) {
44 produces<StringCollection>(
"failedTriggerDescription");
71 std::map<std::string, unsigned int> offlineNameBitMap;
77 std::map<std::string, unsigned int>::iterator it = offlineNameBitMap.find(
onlineActualNames_[
i]);
78 if (it != offlineNameBitMap.end()) {
82 <<
" not found in Offline " 93 TH1F *
h = fs->
make<TH1F>(it->c_str(), it->c_str(), 10, 0, 10);
94 TAxis *
a = h->GetXaxis();
95 a->SetBinLabel(1,
"OnPass_OffPass");
96 a->SetBinLabel(2,
"OnFail_OffFail");
97 a->SetBinLabel(3,
"OnPass_OffFail");
98 a->SetBinLabel(4,
"OnFail_OffPass");
99 a->SetBinLabel(5,
"OnError_OffError");
100 a->SetBinLabel(6,
"OnRun_OffError");
101 a->SetBinLabel(7,
"OnError_OffRun");
102 a->SetBinLabel(8,
"OnRun_OffNotRun");
103 a->SetBinLabel(9,
"OnNotRun_OffRun");
104 a->SetBinLabel(10,
"OnNotRun_OffNotRun");
158 initialise(*onlineResults, *offlineResults, event);
162 bool hasDisagreement =
false;
166 bool onRun = onlineResults->
wasrun(
i);
167 bool offRun = offlineResults->
wasrun(offlineTriggerBit);
168 bool onAccept = onlineResults->
accept(
i);
169 bool offAccept = offlineResults->
accept(offlineTriggerBit);
170 bool onError = onlineResults->
error(
i);
171 bool offError = offlineResults->
error(offlineTriggerBit);
174 if (onError || offError) {
175 if (onError && offError) {
177 }
else if (onError) {
182 }
else if ((!onRun) || (!offRun)) {
183 if ((!onRun) && (!offRun)) {
191 if (onAccept && offAccept) {
193 }
else if ((!onAccept) && (!offAccept)) {
195 }
else if (onAccept) {
215 std::ostringstream desc;
217 resultDescription->push_back(desc.str());
222 hasDisagreement =
true;
224 hasDisagreement =
true;
230 if (
verbose() && (result > 1)) {
240 event.put(
std::move(resultDescription),
"failedTriggerDescription");
254 std::cout <<
"HLT-Compare ---------- Trigger Comparison Summary ----------" << std::endl;
255 std::cout <<
"HLT-Compare The following events had trigger mismatches:" << std::endl;
256 std::map<unsigned int, std::map<std::string, unsigned int>>::iterator it;
258 std::cout <<
"HLT-Compare Event: " << it->first << std::endl;
259 std::map<std::string, unsigned int>::iterator jt;
260 for (jt = it->second.begin(); jt != it->second.end(); ++jt) {
264 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_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
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_
bool filter(edm::Event &, const edm::EventSetup &) override
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)
~HltComparator() override
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_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override