18 static const unsigned char countMax(2);
36 }
else if (l1tType == 2) {
39 edm::LogError(
"HLTPrescaleProvider") <<
" Unknown L1T Type " << l1tType <<
" - prescales will not be avaiable!";
54 assert(psfsiTech == psfsiPhys);
55 if ((errorTech == 0) && (errorPhys == 0) && (psfsiTech >= 0) && (psfsiPhys >= 0) && (psfsiTech == psfsiPhys)) {
63 <<
" Error in determining HLT prescale set index from L1 data using L1GtUtils:" 64 <<
" Tech/Phys error = " << errorTech <<
"/" << errorPhys <<
" Tech/Phys psfsi = " << psfsiTech <<
"/" 69 }
else if (l1tType == 2) {
77 <<
" Unknown L1T Type " << l1tType <<
" - can not determine prescale set index!";
98 std::pair<int, int>
result(std::pair<int, int>(0, 0));
114 if (nL1GTSeedModules == 0) {
117 }
else if (nL1GTSeedModules == 1) {
126 <<
" Error in determining L1T prescale for HLT path: '" << trigger <<
"' with L1T seed: '" << l1tname
127 <<
"' using L1GtUtils: error code = " << l1error <<
"." << std::endl
128 <<
" Note: for this method ('prescaleValues'), only a single L1T name (and not a bit number) is allowed " 131 <<
" For seeds being complex logical expressions, try the new method 'prescaleValuesInDetail'." 141 for (
unsigned int i = 1;
i != nL1GTSeedModules; ++
i) {
145 <<
" Error in determining L1T prescale for HLT path: '" << trigger <<
"' has multiple L1GTSeed modules, " 146 << nL1GTSeedModules <<
", with L1 seeds: " <<
dump 147 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
151 }
else if (l1tType == 2) {
153 if (nL1TSeedModules == 0) {
156 }
else if (nL1TSeedModules == 1) {
164 <<
" Error in determining L1T prescale for HLT path: '" << trigger <<
"' with L1T seed: '" << l1tname
165 <<
"' using L1TGlobalUtil: error cond = " << l1error <<
"." << std::endl
166 <<
" Note: for this method ('prescaleValues'), only a single L1T name (and not a bit number) is allowed " 169 <<
" For seeds being complex logical expressions, try the new method 'prescaleValuesInDetail'." 179 for (
unsigned int i = 1;
i != nL1TSeedModules; ++
i) {
183 <<
" Error in determining L1T prescale for HLT path: '" << trigger <<
"' has multiple L1TSeed modules, " 184 << nL1TSeedModules <<
", with L1T seeds: " <<
dump 185 <<
". (Note: at most one L1TSeed module is allowed for a proper determination of the L1T prescale!)";
192 edm::LogError(
"HLTPrescaleProvider") <<
" Unknown L1T Type " << l1tType <<
" - can not determine L1T prescale! ";
202 std::pair<std::vector<std::pair<std::string, int> >,
int>
result;
203 result.first.clear();
219 if (nL1GTSeedModules == 0) {
221 result.first.clear();
222 }
else if (nL1GTSeedModules == 1) {
226 l1Logical.logicalExpressionRunUpdate(iEvent.
getRun(), iSetup, l1tname);
227 const std::vector<std::pair<std::string, int> >& errorCodes(l1Logical.errorCodes(iEvent));
228 result.first = l1Logical.prescaleFactors();
229 int l1error(l1Logical.isValid() ? 0 : 1);
230 for (
auto const& errorCode : errorCodes) {
231 l1error +=
std::abs(errorCode.second);
236 std::ostringstream message;
237 message <<
" Error in determining L1T prescales for HLT path: '" << trigger <<
"' with complex L1T seed: '" 238 << l1tname <<
"' using L1GtUtils: " << std::endl
239 <<
" isValid=" << l1Logical.isValid() <<
" l1tname/error/prescale " << errorCodes.size() << std::endl;
240 for (
unsigned int i = 0;
i < errorCodes.size(); ++
i) {
241 message <<
" " <<
i <<
":" << errorCodes[
i].first <<
"/" << errorCodes[
i].second <<
"/" 242 << result.first[
i].second;
247 result.first.clear();
254 for (
unsigned int i = 1;
i != nL1GTSeedModules; ++
i) {
258 <<
" Error in determining L1T prescale for HLT path: '" << trigger <<
"' has multiple L1GTSeed modules, " 259 << nL1GTSeedModules <<
", with L1 seeds: " <<
dump 260 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
262 result.first.clear();
264 }
else if (l1tType == 2) {
266 if (nL1TSeedModules == 0) {
268 result.first.clear();
269 }
else if (nL1TSeedModules == 1) {
273 const std::vector<GlobalLogicParser::OperandToken> l1tSeeds = l1tGlobalLogicParser.expressionSeedsOperandList();
276 for (
auto const&
i : l1tSeeds) {
277 const string& l1tSeed =
i.tokenName;
281 result.first.push_back(std::pair<std::string, int>(l1tSeed, l1tPrescale));
286 string l1name = l1tname;
287 std::ostringstream message;
288 message <<
" Error in determining L1T prescales for HLT path: '" << trigger <<
"' with complex L1T seed: '" 289 << l1tname <<
"' using L1TGlobalUtil: " << std::endl
290 <<
" isValid=" << l1tGlobalLogicParser.checkLogicalExpression(l1name) <<
" l1tname/error/prescale " 291 << l1tSeeds.size() << std::endl;
292 for (
unsigned int i = 0;
i < l1tSeeds.size(); ++
i) {
293 const string& l1tSeed = l1tSeeds[
i].tokenName;
295 <<
"/" << result.first[
i].second;
300 result.first.clear();
307 for (
unsigned int i = 1;
i != nL1TSeedModules; ++
i) {
311 <<
" Error in determining L1T prescale for HLT path: '" << trigger <<
"' has multiple L1TSeed modules, " 312 << nL1TSeedModules <<
", with L1T seeds: " <<
dump 313 <<
". (Note: at most one L1TSeed module is allowed for a proper determination of the L1T prescale!)";
315 result.first.clear();
320 edm::LogError(
"HLTPrescaleProvider") <<
" Unknown L1T Type " << l1tType <<
" - can not determine L1T prescale! ";
322 result.first.clear();
HLTConfigProvider hltConfigProvider_
std::pair< std::vector< std::pair< std::string, int > >, int > prescaleValuesInDetail(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
const std::string moduleType(const std::string &module) const
C++ class name of module.
unsigned int l1tType() const
L1T type (0=unknown, 1=legacy/stage-1 or 2=stage-2)
void retrieveL1Event(const edm::Event &iEvent, const edm::EventSetup &evSetup)
const std::vector< std::vector< std::string > > & hltL1TSeeds() const
const int prescaleFactorSetIndex(const edm::Event &iEvent, const TriggerCategory &trigCategory, int &errorCode) const
Run const & getRun() const
const std::string & moduleLabel(unsigned int trigger, unsigned int module) const
static const unsigned char countMax(2)
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
static const bool useL1GtTriggerMenuLite(false)
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
Abs< T >::type abs(const T &t)
unsigned int prescaleColumn() const
static std::string const triggerResults
l1t::L1TGlobalUtil l1tGlobalUtil_
bool rejectedByHLTPrescaler(const edm::TriggerResults &triggerResults, unsigned int i) const
const std::string & processName() const
process name
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup)
const std::vector< std::vector< std::pair< bool, std::string > > > & hltL1GTSeeds() const
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
std::pair< int, int > prescaleValues(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
Combined L1T (pair.first) and HLT (pair.second) prescales per HLT path.
void getL1GtRunCache(const edm::Run &, const edm::EventSetup &, const bool, const bool)
get all the run-constant quantities for L1 trigger and cache them
const bool getPrescaleByName(const std::string &algName, int &prescale) const
unsigned int prescaleValue(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
combining the two methods above
void retrieveL1Setup(const edm::EventSetup &evSetup)
static const bool useL1EventSetup(true)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
const int prescaleFactor(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger