From 1c80479f237933d15e5077b9d56318c79de664be Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Wed, 10 Dec 2025 15:43:36 -0600 Subject: [PATCH 1/2] Allow filtering by trigger bits, add accessor --- Filters/src/TriggerResultsFilter_module.cc | 80 +++++++++++++------- Mu2eUtilities/inc/TriggerResultsNavigator.hh | 13 ++++ 2 files changed, 67 insertions(+), 26 deletions(-) diff --git a/Filters/src/TriggerResultsFilter_module.cc b/Filters/src/TriggerResultsFilter_module.cc index 3c84a3dcb2..aef812aeaf 100644 --- a/Filters/src/TriggerResultsFilter_module.cc +++ b/Filters/src/TriggerResultsFilter_module.cc @@ -7,8 +7,8 @@ #include #include #include -// root -#include "TString.h" +#include + // art includes #include "art/Framework/Core/EDFilter.h" #include "art/Framework/Principal/Event.h" @@ -16,6 +16,7 @@ #include "canvas/Persistency/Common/TriggerResults.h" #include "cetlib_except/exception.h" #include "fhiclcpp/types/Sequence.h" + // mu2e includes #include "Offline/Mu2eUtilities/inc/TriggerResultsNavigator.hh" @@ -29,12 +30,14 @@ namespace mu2e { using Name=fhicl::Name; using Comment=fhicl::Comment; struct Config { - fhicl::Atom diagLevel{ Name("DiagLevel"), Comment("Diagonstic Level"), 0}; - fhicl::Atom printFirst{ Name("PrintFirst"), - Comment("Print the TriggerResults on the first event"), false}; + fhicl::Atom diagLevel{ Name("DiagLevel"), Comment("Diagonstic Level"), 0}; + fhicl::Atom printFirst{ Name("PrintFirst"), Comment("Print the TriggerResults on the first event"), false}; + fhicl::Atom noFilter{ Name("NoFilter"), Comment("If true, do not filter any events"), false}; fhicl::Atom processName{Name("ProcessName"), Comment("Process which generated TriggerResults")}; fhicl::Sequence triggerNames{ Name("TriggerNames"), - Comment("Trigger line names to test; if any of these are set the event will pass the filter")}; + Comment("Trigger line names to test; if any of these are set the event will pass the filter"), vector()}; + fhicl::Sequence triggerBits{ Name("TriggerBits"), + Comment("Trigger line bits to test; if any of these are set the event will pass the filter"), vector()}; }; using Parameters = art::EDFilter::Table; @@ -46,7 +49,9 @@ namespace mu2e { int _diag; string _pname; // process name for the TriggerResults object to test bool _pfirst; // print lines on first event + bool _noFilter; // if true, do not filter any events std::vector _tnames; // trigger line names; if any of these lines are set, accept the event + std::vector _tbits; // trigger line bits; if any of these lines are set, accept the event std::vector _nset; // number of events passing each line unsigned _nevts, _npassed; }; @@ -57,47 +62,70 @@ namespace mu2e { _diag(config().diagLevel()), _pname(config().processName()), _pfirst(config().printFirst()), + _noFilter(config().noFilter()), _tnames(config().triggerNames()), - _nset(_tnames.size(),0), + _tbits(config().triggerBits()), + _nset(max(_tnames.size(), _tbits.size()),0), _nevts(0),_npassed(0) - {} + { + // Only filter on trigger bits or trigger names, not both + if(_tnames.size()>0 && _tbits.size()>0){ + throw cet::exception("CONFIG")<<"mu2e::TriggerResultsFilter: cannot specify both trigger names and trigger bits to filter on"; + } + if(_tnames.empty() && _tbits.empty() && !_noFilter){ + throw cet::exception("CONFIG")<<"mu2e::TriggerResultsFilter: must specify at least one trigger name or bit to filter on, or set NoFilter to true"; + } + } //================================================================ bool TriggerResultsFilter::filter(art::Event& event) { _nevts++; // find the TriggerResults object for the requested process name - art::InputTag const tag{Form("TriggerResults::%s", _pname.c_str())}; + art::InputTag const tag{format("TriggerResults::{}", _pname.c_str())}; auto trigResultsH = event.getValidHandle(tag); const art::TriggerResults* trigResults = trigResultsH.product(); TriggerResultsNavigator tnav(trigResults); - if(_pfirst){ + if(_pfirst || _diag > 2){ _pfirst = false; tnav.print(); } // loop over all the lines in this TriggerResults and see if any of the requested are set. // Count each line separately for diagnostics bool passed(false); - for(size_t iname=0;iname < _tnames.size(); iname++){ - auto const& tname = _tnames[iname]; - size_t itrig = tnav.findTrigPath(tname); - // require that the line exist - if(itrig == trigResults->size())throw cet::exception("Filter")<<"mu2e::TriggerResultsFilter: cannot find TriggerResults value for trigger " << tname << endl; - if(_diag>0) cout << "trigger line " << itrig << " found for name " << tname << " with value " << tnav.getTrigPath(itrig) << " status " - << trigResults->accept(itrig) << endl; - - if(trigResults->accept(itrig)){ - passed = true; - _nset[iname]++; + const bool use_bits = _tnames.empty(); + const size_t nbits = (use_bits) ? _tbits.size() : _tnames.size(); + for(size_t itrig = 0; itrig < nbits; itrig++) { + try { + auto const& tname = (use_bits) ? tnav.getTrigNameByBit(_tbits[itrig]) : _tnames[itrig]; + const bool accepted = tnav.accepted(tname); + if(_diag>1) printf("[TriggerResultsFilter::%s] Trigger %s (bit %zu) accepted = %o\n", + __func__, tname.c_str(), tnav.getTrigBit(tname), accepted); + if(accepted) { + passed = true; + _nset[itrig]++; + } + } catch (...) { // don't require the trigger to exist, as it may only appear in some runs + if(_diag>0) printf("[TriggerResultsFilter::%s] Trigger list index %zu not found\n", + __func__, itrig); } } - if(passed)_npassed++; - return passed; + if(passed) _npassed++; + return passed || _noFilter; } void TriggerResultsFilter::endJob() { - cout << "filter passed " << _npassed << " of " << _nevts << " events" << endl; - for(size_t iname=0;iname<_tnames.size(); iname++){ - cout << "Trigger Line " << _tnames[iname] << " set for " << _nset[iname] << " events" << endl; + printf("[TriggerResultFilter::%s] Processed %u events, accepted %u events (%8.4f%%)\n", + __func__, _nevts, _npassed, _nevts > 0 ? _npassed*100./_nevts : 0.); + if(_diag > 0) { + if(_tnames.size()>0) { + for(size_t iname=0;iname<_tnames.size(); iname++){ + cout << " Trigger Line " << _tnames[iname] << " set for " << _nset[iname] << " events" << endl; + } + } else if(_tbits.size()>0) { + for(size_t ibit=0;ibit<_tbits.size(); ibit++){ + cout << " Trigger Bit " << _tbits[ibit] << " set for " << _nset[ibit] << " events" << endl; + } + } } } diff --git a/Mu2eUtilities/inc/TriggerResultsNavigator.hh b/Mu2eUtilities/inc/TriggerResultsNavigator.hh index 095aff6933..a738b12bae 100644 --- a/Mu2eUtilities/inc/TriggerResultsNavigator.hh +++ b/Mu2eUtilities/inc/TriggerResultsNavigator.hh @@ -43,8 +43,21 @@ namespace mu2e { return findTrigPathID(name); } + std::string const& getTrigNameByBit(size_t const bit) const { + for (const auto& pair : _trigPathMap) { + if (pair.second == bit) { + return pair.first; + } + } + throw cet::exception("TRIGGER") << "TriggerResultsNavigator: Bit " << bit << " not found"; + } + // Has ith path accepted the event? bool accepted(std::string const& name) const; + bool accepted(unsigned int const bit) const { + auto name = getTrigNameByBit(bit); + return accepted(name); + } bool wasrun(std::string const& name) const; From 2709cea3107db90f975544077a0d53b8d171c082 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Tue, 6 Jan 2026 16:38:11 -0600 Subject: [PATCH 2/2] Update trigger results navigator interface, reduce string comparisons --- Filters/src/TriggerResultsFilter_module.cc | 18 ++- Mu2eUtilities/inc/TriggerResultsNavigator.hh | 56 ++++----- Mu2eUtilities/src/TriggerResultsNavigator.cc | 121 +++++++++++-------- Print/src/TriggerResultsPrinter.cc | 4 +- Trigger/src/ReadTriggerInfo_module.cc | 12 +- Trigger/src/ReadTriggerPath_module.cc | 12 +- 6 files changed, 115 insertions(+), 108 deletions(-) diff --git a/Filters/src/TriggerResultsFilter_module.cc b/Filters/src/TriggerResultsFilter_module.cc index aef812aeaf..aab642e41e 100644 --- a/Filters/src/TriggerResultsFilter_module.cc +++ b/Filters/src/TriggerResultsFilter_module.cc @@ -30,14 +30,12 @@ namespace mu2e { using Name=fhicl::Name; using Comment=fhicl::Comment; struct Config { - fhicl::Atom diagLevel{ Name("DiagLevel"), Comment("Diagonstic Level"), 0}; - fhicl::Atom printFirst{ Name("PrintFirst"), Comment("Print the TriggerResults on the first event"), false}; - fhicl::Atom noFilter{ Name("NoFilter"), Comment("If true, do not filter any events"), false}; - fhicl::Atom processName{Name("ProcessName"), Comment("Process which generated TriggerResults")}; - fhicl::Sequence triggerNames{ Name("TriggerNames"), - Comment("Trigger line names to test; if any of these are set the event will pass the filter"), vector()}; - fhicl::Sequence triggerBits{ Name("TriggerBits"), - Comment("Trigger line bits to test; if any of these are set the event will pass the filter"), vector()}; + fhicl::Atom diagLevel {Name("DiagLevel") , Comment("Diagonstic Level"), 0}; + fhicl::Atom printFirst {Name("PrintFirst") , Comment("Print the TriggerResults on the first event"), false}; + fhicl::Atom noFilter {Name("NoFilter") , Comment("If true, do not filter any events"), false}; + fhicl::Atom processName {Name("ProcessName") , Comment("Process which generated TriggerResults")}; + fhicl::Sequence triggerNames{Name("TriggerNames"), Comment("Trigger line names to test; if any of these are set the event will pass the filter"), vector()}; + fhicl::Sequence triggerBits {Name("TriggerBits") , Comment("Trigger line bits to test; if any of these are set the event will pass the filter"), vector()}; }; using Parameters = art::EDFilter::Table; @@ -96,10 +94,10 @@ namespace mu2e { const size_t nbits = (use_bits) ? _tbits.size() : _tnames.size(); for(size_t itrig = 0; itrig < nbits; itrig++) { try { - auto const& tname = (use_bits) ? tnav.getTrigNameByBit(_tbits[itrig]) : _tnames[itrig]; + auto const& tname = (use_bits) ? tnav.getTrigPathNameByBit(_tbits[itrig]) : _tnames[itrig]; const bool accepted = tnav.accepted(tname); if(_diag>1) printf("[TriggerResultsFilter::%s] Trigger %s (bit %zu) accepted = %o\n", - __func__, tname.c_str(), tnav.getTrigBit(tname), accepted); + __func__, tname.c_str(), tnav.getTrigBitByName(tname), accepted); if(accepted) { passed = true; _nset[itrig]++; diff --git a/Mu2eUtilities/inc/TriggerResultsNavigator.hh b/Mu2eUtilities/inc/TriggerResultsNavigator.hh index a738b12bae..74387fa927 100644 --- a/Mu2eUtilities/inc/TriggerResultsNavigator.hh +++ b/Mu2eUtilities/inc/TriggerResultsNavigator.hh @@ -7,6 +7,7 @@ #include "canvas/Persistency/Common/TriggerResults.h" #include +#include #include #include #include @@ -24,41 +25,27 @@ namespace mu2e { return _trigPathsNames.size(); } - std::vector const& getTrigPaths () const { return _trigPathsNames; } - std::string const& getTrigPath (unsigned int const i) const { return _trigPathsNames.at(i); } - std::string const getTrigPathName(unsigned int const i) const; - size_t getTrigBit (unsigned int const pathID) const; - size_t findTrigPath(std::string const& name) const; - size_t find(std::map const& posmap, std::string const& name) const; - size_t findTrigPathID(std::string const& name) const; + std::vector const& getTrigPaths() const { return _trigPathsNames; } + std::string const& getTrigPathByIndex(unsigned int const index) const { return _trigPathsNames.at(index); } + std::string const& getTrigPathNameByIndex(unsigned int const i) const; + std::string const& getTrigPathNameByBit(unsigned int const bit) const; + size_t getTrigBitByIndex(unsigned int const pathID) const; + size_t getTrigBitByName(const std::string& name) const; + size_t getTrigPathIndex(std::string const& name) const; + size_t getTrigPathIndex(const size_t bit) const; bool validPath(std::string const& name) const { - size_t path_index = findTrigPath(name); - return path_index < _trigPathsNames.size(); + return _trigMap.contains(name); } - - size_t getTrigBit(std::string const& name) const { - if(!validPath(name)) - throw cet::exception("TRIGGER") << "TriggerResultsNavigator: Path name " << name << " not found"; - return findTrigPathID(name); - } - - std::string const& getTrigNameByBit(size_t const bit) const { - for (const auto& pair : _trigPathMap) { - if (pair.second == bit) { - return pair.first; - } - } - throw cet::exception("TRIGGER") << "TriggerResultsNavigator: Bit " << bit << " not found"; + bool validPath(const unsigned int bit) { + return _bitToPathName.contains(bit); } - // Has ith path accepted the event? + // Did the path pass the event bool accepted(std::string const& name) const; - bool accepted(unsigned int const bit) const { - auto name = getTrigNameByBit(bit); - return accepted(name); - } + bool accepted(unsigned int const bit) const; + // Was the path run in the event bool wasrun(std::string const& name) const; //NOTE: the following three functions can be used only within the same job that runs the @@ -71,10 +58,15 @@ namespace mu2e { void print() const; private: - const art::TriggerResults* _trigResults; - std::vector _trigPathsNames; // vector of trigger path names - std::map _trigMap; // map of trigger path name to index in TriggerResults - std::map _trigPathMap; // map of trigger path name to path ID (bit) + const art::TriggerResults* _trigResults; // trigger results info + std::vector _trigPathsNames; // vector of trigger path names + std::unordered_map _trigMap; // map of trigger path name to index in the art::TriggerResults + std::unordered_map _trigPathMap; // map of trigger path name to path ID (bit) + std::unordered_map _indexToPathName; // trigger path index -> name map + std::unordered_map _bitToPathName; // trigger path bit -> name map + std::unordered_map _bitToIndex; // trigger path bit -> index map + + static constexpr size_t NOTFOUND = -1; // special bit/index value for no trigger was found }; diff --git a/Mu2eUtilities/src/TriggerResultsNavigator.cc b/Mu2eUtilities/src/TriggerResultsNavigator.cc index cad94bd119..ad41c4ea4b 100644 --- a/Mu2eUtilities/src/TriggerResultsNavigator.cc +++ b/Mu2eUtilities/src/TriggerResultsNavigator.cc @@ -21,8 +21,9 @@ namespace mu2e { TriggerResultsNavigator::TriggerResultsNavigator(const art::TriggerResults* trigResults): _trigResults(trigResults){ - auto const id = trigResults->parameterSetID(); + // Simplest thing: ParameterSetRegistry has correct ParameterSet + auto const id = trigResults->parameterSetID(); fhicl::ParameterSet pset; fhicl::ParameterSetRegistry::get(id, pset); @@ -32,89 +33,102 @@ namespace mu2e { auto nid = pset_pair.second.id(); assert(nid == pset_pair.first); + // if this is the trigger results parameter set ID, get the trigger path list if(nid == id) { pset = pset_pair.second; - if (pset.has_key("trigger_paths")){ - _trigPathsNames = pset.get>("trigger_paths",std::vector()); + if(pset.has_key("trigger_paths")) { + _trigPathsNames = pset.get>("trigger_paths"); } } } //loop over trigResults to fill the map std::string delimeter=":"; - for (unsigned int i=0; i< _trigPathsNames.size(); ++i){ - size_t pos = _trigPathsNames[i].find(delimeter); - unsigned int bit = std::stoi(_trigPathsNames[i].substr(0, pos)); - std::string pathName = _trigPathsNames[i].substr(pos+1, _trigPathsNames[i].length()); - _trigMap.insert(std::pair(pathName, i)); - _trigPathMap.insert(std::pair(pathName, bit)); + for (size_t index = 0; index < _trigPathsNames.size(); ++index){ + const std::string& path = _trigPathsNames.at(index); + size_t pos = path.find(delimeter); + if(pos == std::string::npos) + throw cet::exception("TRIGGER") << "No path bit found for path " << _trigPathsNames.at(index); + unsigned int bit = std::stoi(path.substr(0, pos)); + std::string pathName = path.substr(pos+1, path.length()); + _trigMap .insert(std::pair(pathName, index)); + _trigPathMap .insert(std::pair(pathName, bit)); + _indexToPathName.insert(std::pair(index, pathName)); + _bitToPathName .insert(std::pair(bit, pathName)); + _bitToIndex .insert(std::pair(bit, index)); } } - std::string const - TriggerResultsNavigator::getTrigPathName(unsigned int const i) const + std::string const& + TriggerResultsNavigator::getTrigPathNameByIndex(unsigned int const index) const { - if (i >= _trigPathsNames.size()) { - throw cet::exception("TRIGGER") << "TRIG PATHID " << i << " NOT FOUND"; + if(!_indexToPathName.contains(index)) { + throw cet::exception("TRIGGER") << "TRIG PATH INDEX " << index << " NOT FOUND"; } - std::string delimeter =":"; - size_t pos = _trigPathsNames[i].find(delimeter); - if (pos >= _trigPathsNames[i].length()) return "TRIG PATH NOT FOUND"; - return _trigPathsNames[i].substr(pos+1, _trigPathsNames[i].length()); + return _indexToPathName.at(index); } - size_t - TriggerResultsNavigator::getTrigBit(unsigned int const i) const + std::string const& + TriggerResultsNavigator::getTrigPathNameByBit(unsigned int const bit) const { - if (i>=_trigPathsNames.size()) { - throw cet::exception("TRIGGER") << "TRIG PATHID " << i << " NOT FOUND"; + if(!_bitToPathName.contains(bit)) { + throw cet::exception("TRIGGER") << "TRIG PATH BIT " << bit << " NOT FOUND"; } - std::string delimeter =":"; - size_t pos = _trigPathsNames[i].find(delimeter); - unsigned int bit = std::stoi(_trigPathsNames[i].substr(0, pos)); - return bit; + return _bitToPathName.at(bit); } size_t - TriggerResultsNavigator::findTrigPath(std::string const& name) const + TriggerResultsNavigator::getTrigBitByIndex(unsigned int const index) const { - return find(_trigMap, name); + if(!_indexToPathName.contains(index)) { + throw cet::exception("TRIGGER") << "TRIG PATH INDEX " << index << " NOT FOUND"; + } + return _trigPathMap.at(_indexToPathName.at(index)); } size_t - TriggerResultsNavigator::find(std::map const& posmap, std::string const& name) const + TriggerResultsNavigator::getTrigBitByName(const std::string& name) const { - auto const pos = posmap.find(name); - if (pos == posmap.cend()) { - return posmap.size(); - } else { - return pos->second; + if(!_trigPathMap.contains(name)) { + throw cet::exception("TRIGGER") << "TRIG PATH NAME " << name << " NOT FOUND"; } + return _trigPathMap.at(name); } + // Return the trigger path index, if found size_t - TriggerResultsNavigator::findTrigPathID(std::string const& name) const + TriggerResultsNavigator::getTrigPathIndex(std::string const& name) const { - if(!validPath(name)) - throw cet::exception("TRIGGER") << "TriggerResultsNavigator: Path name " << name << " not found"; - return find(_trigPathMap, name); + if(!_trigMap.count(name)) return NOTFOUND; + return _trigMap.at(name); + } + size_t + TriggerResultsNavigator::getTrigPathIndex(const size_t bit) const + { + if(!_bitToPathName.count(bit)) return NOTFOUND; + return _trigMap.at(_bitToPathName.at(bit)); } // Has ith path accepted the event? bool TriggerResultsNavigator::accepted(std::string const& name) const { - size_t index = findTrigPath(name); - if (index == _trigResults->size()) return false; - return _trigResults->accept(index); + if(!_trigPathMap.count(name)) return false; + return _trigResults->accept(getTrigPathIndex(name)); + } + + bool + TriggerResultsNavigator::accepted(unsigned int const bit) const { + if(!_bitToIndex.count(bit)) return false; + return _trigResults->accept(getTrigPathIndex(bit)); } bool TriggerResultsNavigator::wasrun(std::string const& name) const { - size_t index = findTrigPath(name); - return _trigResults->wasrun(index); + if(!_trigPathMap.count(name)) return false; + return _trigResults->wasrun(getTrigPathIndex(name)); } std::vector @@ -134,28 +148,30 @@ namespace mu2e { unsigned TriggerResultsNavigator::indexLastModule(std::string const& name) const{ - size_t index = findTrigPath(name); - return _trigResults->index(index); + if(!_trigPathMap.count(name)) return -1; + return _trigResults->index(getTrigPathIndex(name)); } std::string TriggerResultsNavigator::nameLastModule (std::string const& name) const{ unsigned indexLast = indexLastModule(name); - std::vector modulesVec = triggerModules(name); + std::vector modulesVec; + if(indexLast != unsigned(-1)) modulesVec = triggerModules(name); - if ( modulesVec.size() == 0) { + if(modulesVec.empty()) { std::string nn = "PATH "+name+" NOT FOUND"; std::cout << "[TriggerResultsNavigator::nameLastModule] " << nn << std::endl; return nn; - }else { + } else { return modulesVec[indexLast]; } } art::hlt::HLTState TriggerResultsNavigator::state(std::string const& name) const{ - size_t index = findTrigPath(name); - return _trigResults->state(index); + if(!_trigPathMap.count(name)) + throw cet::exception("TRIGGER") << "Path " << name << " not found!"; + return _trigResults->state(getTrigPathIndex(name)); } void @@ -165,9 +181,10 @@ namespace mu2e { std::cout << "// trig_pathName id accepted //" << std::endl; std::cout << "//------------------------------------------------//" << std::endl; - for (unsigned i=0; i< getTrigPaths().size(); ++i) { - const std::string path = getTrigPathName(i); - const int bit = findTrigPathID(path); + const size_t npaths = getTrigPaths().size(); + for (size_t i = 0; i < npaths; ++i) { + const std::string path = getTrigPathNameByIndex(i); + const int bit = getTrigBitByName(path); const bool good = accepted(path); std::cout << std::right; std::cout <<"//"<Integral() <= 0.) { for (unsigned int i=0; i< trigNavig.getTrigPaths().size(); ++i) { - const std::string path = trigNavig.getTrigPathName(i); + const std::string path = trigNavig.getTrigPathNameByIndex(i); _sumHist._hTrigInfo[30]->GetXaxis()->SetBinLabel(_sumHist._hTrigInfo[30]->FindBin(i), path.c_str()); } } //fill the histogram with the accepted trigger bits for (unsigned int i=0; i< trigNavig.getTrigPaths().size(); ++i) { - const std::string path = trigNavig.getTrigPathName(i); + const std::string path = trigNavig.getTrigPathNameByIndex(i); if(trigNavig.accepted(path)) { - _sumHist._hTrigBits->Fill(trigNavig.findTrigPath(path)); - _sumHist._hTrigInfo[15]->Fill(trigNavig.findTrigPathID(path)); //accepted path IDs + _sumHist._hTrigBits->Fill(trigNavig.getTrigPathIndex(path)); + _sumHist._hTrigInfo[15]->Fill(trigNavig.getTrigBitByName(path)); //accepted path IDs _sumHist._hTrigInfo[30]->Fill(i); } } @@ -863,7 +863,7 @@ namespace mu2e { // Loop through all trigger paths, storing trigger info for (unsigned i=0; i < _trigPaths.size(); ++i) { - std::string pathName = trigNavig.getTrigPathName(i); + std::string pathName = trigNavig.getTrigPathNameByIndex(i); std::string& path = pathName; if(_diagLevel > 1) printf("[ReadTriggerInfo::%s] : Checking path %s\n", __func__, path.c_str()); diff --git a/Trigger/src/ReadTriggerPath_module.cc b/Trigger/src/ReadTriggerPath_module.cc index c016a22097..af26649005 100644 --- a/Trigger/src/ReadTriggerPath_module.cc +++ b/Trigger/src/ReadTriggerPath_module.cc @@ -299,7 +299,7 @@ namespace mu2e { //--------------------------------------------------------------------------------// void ReadTriggerPath::trigPathVal(const int Index, TriggerResultsNavigator& trigNavig, summaryInfoHist_& Hist) { if(_diagLevel > 4) printf("[ReadTriggerPath::%s]\n", __func__); - const std::string path = trigNavig.getTrigPathName(Index); + const std::string path = trigNavig.getTrigPathNameByIndex(Index); const unsigned lastModule = trigNavig.indexLastModule(path); auto h = Hist._hTrigModules[Index]; if(!h) throw cet::exception("BADCONFIG") << __func__ << ": Trigger path index " << Index << " is out of bounds for initialized histograms\n"; @@ -455,7 +455,7 @@ namespace mu2e { //initialize bin labels if(_sumHist._hTrigInfo[0]->Integral() <= 0.) { for (unsigned int i=0; i< trigNavig.getTrigPaths().size(); ++i) { - const std::string path = trigNavig.getTrigPathName(i); + const std::string path = trigNavig.getTrigPathNameByIndex(i); _sumHist._hTrigInfo[0]->GetXaxis()->SetBinLabel(_sumHist._hTrigInfo[0]->FindBin(i), path.c_str()); _sumHist._hTrigInfo[1]->GetXaxis()->SetBinLabel(_sumHist._hTrigInfo[1]->FindBin(i), path.c_str()); _sumHist._hTrigInfo[4]->GetXaxis()->SetBinLabel(_sumHist._hTrigInfo[4]->FindBin(i), path.c_str()); @@ -478,7 +478,7 @@ namespace mu2e { bool passed(false), track_passed(false), helix_passed(false), calo_passed(false), minbias_passed(false), unknown(false); unsigned naccept(0), exclusive_idx(-1); for (unsigned i=0; i< trigNavig.getTrigPaths().size(); ++i) { - const std::string path = trigNavig.getTrigPathName(i); + const std::string path = trigNavig.getTrigPathNameByIndex(i); if(_diagLevel > 4) { printf("[ReadTriggerPath::%s] Printing modules in path %s\n", __func__, path.c_str()); auto modules = trigNavig.triggerModules(path); @@ -486,8 +486,8 @@ namespace mu2e { } if(trigNavig.accepted(path)) { - _sumHist._hTrigBits->Fill(trigNavig.findTrigPathID(path)); - _sumHist._hTrigIndices->Fill(trigNavig.findTrigPath(path)); + _sumHist._hTrigBits->Fill(trigNavig.getTrigBitByName(path)); + _sumHist._hTrigIndices->Fill(trigNavig.getTrigPathIndex(path)); _sumHist._hTrigPaths ->Fill(path.c_str(), 1.); // _sumHist._hTrigPaths ->Fill(i); _sumHist._hTrigInfo[0]->Fill(i); @@ -516,7 +516,7 @@ namespace mu2e { } //Fill the correlation matrix for (unsigned j=0; j < trigNavig.getTrigPaths().size(); ++j) { - if(trigNavig.accepted(trigNavig.getTrigPathName(j)) && !skip_exclusive) _sumHist._hTrig2D->Fill(i,j); + if(trigNavig.accepted(trigNavig.getTrigPathNameByIndex(j)) && !skip_exclusive) _sumHist._hTrig2D->Fill(i,j); } }