1 #ifndef CommonTools_TriggerUtils_PrescaleWeightProvider_h 2 #define CommonTools_TriggerUtils_PrescaleWeightProvider_h 23 #include <type_traits> 40 class ConsumesCollector;
78 template <
typename T =
int>
99 static_assert(std::is_same_v<T, double>
or std::is_same_v<T, FractionalPrescale>,
100 "\n\tPlease use prescaleWeight<double> or prescaleWeight<FractionalPrescale>" 101 "\n\t(other types for HLT prescales are not supported anymore by PrescaleWeightProvider");
120 const int SENTINEL(-1);
128 edm::LogError(
"PrescaleWeightProvider::prescaleWeight") <<
"HLT path \"" <<
hltPath <<
"\" does not exist";
134 const std::vector<std::pair<bool, std::string> >& level1Seeds =
hltConfig.hltL1GTSeeds(
hltPath);
135 if (level1Seeds.size() != 1) {
138 <<
"HLT path \"" <<
hltPath <<
"\" provides too many L1 seeds";
145 <<
"Failed to parse L1 seeds for HLT path \"" <<
hltPath <<
"\"";
149 int l1Prescale(SENTINEL);
151 int l1TempPrescale(SENTINEL);
153 if (level1Seeds.at(0).first) {
174 if (l1TempPrescale > 0) {
175 if (l1Prescale == SENTINEL || l1Prescale > l1TempPrescale)
176 l1Prescale = l1TempPrescale;
179 if (l1Prescale == SENTINEL) {
182 <<
"Unable to find the L1 prescale for HLT path \"" <<
hltPath <<
"\"";
198 <<
"No valid weight for any requested HLT path, returning default weight of 1";
205 #endif // CommonTools_TriggerUtils_PrescaleWeightProvider_h
PrescaleWeightProvider(const edm::ParameterSet &config, edm::ConsumesCollector &&iC, T &module)
const int prescaleFactor(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
edm::Handle< L1GtTriggerMenuLite > triggerMenuLite_
dictionary config
Read in AllInOne config in JSON format.
edm::InputTag triggerResultsTag_
Log< level::Error, false > LogError
std::vector< std::string > l1SeedPaths_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::vector< std::string > hltPaths_
std::unique_ptr< HLTPrescaleProvider > hltPrescaleProvider_
void initRun(const edm::Run &run, const edm::EventSetup &setup)
static std::string const triggerResults
edm::EDGetTokenT< L1GtTriggerMenuLite > l1GtTriggerMenuLiteToken_
T prescaleWeight(const edm::Event &event, const edm::EventSetup &setup)
const bool decision(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
~PrescaleWeightProvider()
Log< level::Warning, false > LogWarning
edm::InputTag l1GtTriggerMenuLiteTag_
void parseL1Seeds(const std::string &l1Seeds)