19 static const unsigned char countMax(2);
40 }
else if (l1tType == 2) {
44 edm::LogError(
"HLTPrescaleProvider") <<
" Unknown L1T Type " << l1tType <<
" - prescales will not be avaiable!";
62 throw cms::Exception(
"LogicError") <<
"HLTPrescaleProvider::prescaleSet,\n"
63 "HLTPrescaleProvider::init was not called at beginRun\n";
75 assert(psfsiTech == psfsiPhys);
76 if ((errorTech == 0) && (errorPhys == 0) && (psfsiTech >= 0) && (psfsiPhys >= 0) && (psfsiTech == psfsiPhys)) {
84 <<
" Error in determining HLT prescale set index from L1 data using L1GtUtils:"
85 <<
" Tech/Phys error = " << errorTech <<
"/" << errorPhys <<
" Tech/Phys psfsi = " << psfsiTech <<
"/"
90 }
else if (l1tType == 2) {
99 <<
" Unknown L1T Type " << l1tType <<
" - can not determine prescale set index!";
108 static constexpr
double kL1RoundingEpsilon = 0.001;
112 <<
", using a FractionalPrescale is a loss of precision";
130 if (nL1GTSeedModules == 0) {
133 }
else if (nL1GTSeedModules == 1) {
142 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' with L1T seed: '" << l1tname
143 <<
"' using L1GtUtils: error code = " << l1error <<
"." << std::endl
144 <<
" Note: for this method ('prescaleValues'), only a single L1T name (and not a bit number) is allowed "
147 <<
" For seeds being complex logical expressions, try the new method 'prescaleValuesInDetail'."
157 for (
unsigned int i = 1;
i != nL1GTSeedModules; ++
i) {
161 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' has multiple L1GTSeed modules, "
162 << nL1GTSeedModules <<
", with L1 seeds: " <<
dump
163 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
167 }
else if (l1tType == 2) {
170 if (nL1TSeedModules == 0) {
173 }
else if (nL1TSeedModules == 1) {
181 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' with L1T seed: '" << l1tname
182 <<
"' using L1TGlobalUtil: error cond = " << l1error <<
"." << std::endl
183 <<
" Note: for this method ('prescaleValues'), only a single L1T name (and not a bit number) is allowed "
186 <<
" For seeds being complex logical expressions, try the new method 'prescaleValuesInDetail'."
196 for (
unsigned int i = 1;
i != nL1TSeedModules; ++
i) {
200 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' has multiple L1TSeed modules, "
201 << nL1TSeedModules <<
", with L1T seeds: " <<
dump
202 <<
". (Note: at most one L1TSeed module is allowed for a proper determination of the L1T prescale!)";
209 edm::LogError(
"HLTPrescaleProvider") <<
" Unknown L1T Type " << l1tType <<
" - can not determine L1T prescale! ";
219 std::vector<std::pair<std::string, double> >
result;
226 if (nL1GTSeedModules == 0) {
229 }
else if (nL1GTSeedModules == 1) {
233 l1Logical.logicalExpressionRunUpdate(
iEvent.getRun(), iSetup, l1tname);
234 const std::vector<std::pair<std::string, int> >& errorCodes(l1Logical.errorCodes(
iEvent));
235 auto resultInt = l1Logical.prescaleFactors();
237 for (
const auto&
entry : resultInt) {
241 int l1error(l1Logical.isValid() ? 0 : 1);
242 for (
auto const& errorCode : errorCodes) {
243 l1error +=
std::abs(errorCode.second);
248 std::ostringstream message;
249 message <<
" Error in determining L1T prescales for HLT path: '" <<
trigger <<
"' with complex L1T seed: '"
250 << l1tname <<
"' using L1GtUtils: " << std::endl
251 <<
" isValid=" << l1Logical.isValid() <<
" l1tname/error/prescale " << errorCodes.size() << std::endl;
252 for (
unsigned int i = 0;
i < errorCodes.size(); ++
i) {
253 message <<
" " <<
i <<
":" << errorCodes[
i].first <<
"/" << errorCodes[
i].second <<
"/" <<
result[
i].second;
265 for (
unsigned int i = 1;
i != nL1GTSeedModules; ++
i) {
269 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' has multiple L1GTSeed modules, "
270 << nL1GTSeedModules <<
", with L1 seeds: " <<
dump
271 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
275 }
else if (l1tType == 2) {
278 if (nL1TSeedModules == 0) {
281 }
else if (nL1TSeedModules == 1) {
285 const std::vector<GlobalLogicParser::OperandToken> l1tSeeds = l1tGlobalLogicParser.expressionSeedsOperandList();
287 double l1tPrescale(-1);
288 for (
auto const&
i : l1tSeeds) {
289 const string& l1tSeed =
i.tokenName;
293 result.push_back(std::pair<std::string, double>(l1tSeed, l1tPrescale));
298 string l1name = l1tname;
299 std::ostringstream message;
300 message <<
" Error in determining L1T prescales for HLT path: '" <<
trigger <<
"' with complex L1T seed: '"
301 << l1tname <<
"' using L1TGlobalUtil: " << std::endl
302 <<
" isValid=" << l1tGlobalLogicParser.checkLogicalExpression(l1name) <<
" l1tname/error/prescale "
303 << l1tSeeds.size() << std::endl;
304 for (
unsigned int i = 0;
i < l1tSeeds.size(); ++
i) {
305 const string& l1tSeed = l1tSeeds[
i].tokenName;
306 message <<
" " <<
i <<
":" << l1tSeed <<
"/" <<
l1tGlobalUtil_->getPrescaleByName(l1tSeed, l1tPrescale)
319 for (
unsigned int i = 1;
i != nL1TSeedModules; ++
i) {
323 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' has multiple L1TSeed modules, "
324 << nL1TSeedModules <<
", with L1T seeds: " <<
dump
325 <<
". (Note: at most one L1TSeed module is allowed for a proper determination of the L1T prescale!)";
332 edm::LogError(
"HLTPrescaleProvider") <<
" Unknown L1T Type " << l1tType <<
" - can not determine L1T prescale! ";
346 throw cms::Exception(
"Configuration") <<
"HLTPrescaleProvider::checkL1GtUtils(),\n"
347 "Attempt to use L1GtUtils object when none was constructed.\n"
348 "Possibly the proper era is not configured or\n"
349 "the module configuration does not use the era properly\n"
350 "or input is from mixed eras";
356 throw cms::Exception(
"Configuration") <<
"HLTPrescaleProvider:::checkL1TGlobalUtil(),\n"
357 "Attempt to use L1TGlobalUtil object when none was constructed.\n"
358 "Possibly the proper era is not configured or\n"
359 "the module configuration does not use the era properly\n"
360 "or input is from mixed eras";