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!";
120 std::pair<int, int>
result(std::pair<int, int>(0, 0));
137 if (nL1GTSeedModules == 0) {
140 }
else if (nL1GTSeedModules == 1) {
149 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' with L1T seed: '" << l1tname
150 <<
"' using L1GtUtils: error code = " << l1error <<
"." << std::endl
151 <<
" Note: for this method ('prescaleValues'), only a single L1T name (and not a bit number) is allowed "
154 <<
" For seeds being complex logical expressions, try the new method 'prescaleValuesInDetail'."
164 for (
unsigned int i = 1;
i != nL1GTSeedModules; ++
i) {
168 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' has multiple L1GTSeed modules, "
169 << nL1GTSeedModules <<
", with L1 seeds: " <<
dump
170 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
174 }
else if (l1tType == 2) {
177 if (nL1TSeedModules == 0) {
180 }
else if (nL1TSeedModules == 1) {
188 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' with L1T seed: '" << l1tname
189 <<
"' using L1TGlobalUtil: error cond = " << l1error <<
"." << std::endl
190 <<
" Note: for this method ('prescaleValues'), only a single L1T name (and not a bit number) is allowed "
193 <<
" For seeds being complex logical expressions, try the new method 'prescaleValuesInDetail'."
203 for (
unsigned int i = 1;
i != nL1TSeedModules; ++
i) {
207 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' has multiple L1TSeed modules, "
208 << nL1TSeedModules <<
", with L1T seeds: " <<
dump
209 <<
". (Note: at most one L1TSeed module is allowed for a proper determination of the L1T prescale!)";
216 edm::LogError(
"HLTPrescaleProvider") <<
" Unknown L1T Type " << l1tType <<
" - can not determine L1T prescale! ";
226 std::pair<std::vector<std::pair<std::string, int> >,
int>
result;
245 if (nL1GTSeedModules == 0) {
248 }
else if (nL1GTSeedModules == 1) {
252 l1Logical.logicalExpressionRunUpdate(
iEvent.getRun(), iSetup, l1tname);
253 const std::vector<std::pair<std::string, int> >& errorCodes(l1Logical.errorCodes(
iEvent));
254 result.first = l1Logical.prescaleFactors();
255 int l1error(l1Logical.isValid() ? 0 : 1);
256 for (
auto const& errorCode : errorCodes) {
257 l1error +=
std::abs(errorCode.second);
262 std::ostringstream message;
263 message <<
" Error in determining L1T prescales for HLT path: '" <<
trigger <<
"' with complex L1T seed: '"
264 << l1tname <<
"' using L1GtUtils: " << std::endl
265 <<
" isValid=" << l1Logical.isValid() <<
" l1tname/error/prescale " << errorCodes.size() << std::endl;
266 for (
unsigned int i = 0;
i < errorCodes.size(); ++
i) {
267 message <<
" " <<
i <<
":" << errorCodes[
i].first <<
"/" << errorCodes[
i].second <<
"/"
280 for (
unsigned int i = 1;
i != nL1GTSeedModules; ++
i) {
284 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' has multiple L1GTSeed modules, "
285 << nL1GTSeedModules <<
", with L1 seeds: " <<
dump
286 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
290 }
else if (l1tType == 2) {
293 if (nL1TSeedModules == 0) {
296 }
else if (nL1TSeedModules == 1) {
300 const std::vector<GlobalLogicParser::OperandToken> l1tSeeds = l1tGlobalLogicParser.expressionSeedsOperandList();
303 for (
auto const&
i : l1tSeeds) {
304 const string& l1tSeed =
i.tokenName;
308 result.first.push_back(std::pair<std::string, int>(l1tSeed, l1tPrescale));
313 string l1name = l1tname;
314 std::ostringstream message;
315 message <<
" Error in determining L1T prescales for HLT path: '" <<
trigger <<
"' with complex L1T seed: '"
316 << l1tname <<
"' using L1TGlobalUtil: " << std::endl
317 <<
" isValid=" << l1tGlobalLogicParser.checkLogicalExpression(l1name) <<
" l1tname/error/prescale "
318 << l1tSeeds.size() << std::endl;
319 for (
unsigned int i = 0;
i < l1tSeeds.size(); ++
i) {
320 const string& l1tSeed = l1tSeeds[
i].tokenName;
321 message <<
" " <<
i <<
":" << l1tSeed <<
"/" <<
l1tGlobalUtil_->getPrescaleByName(l1tSeed, l1tPrescale)
322 <<
"/" <<
result.first[
i].second;
334 for (
unsigned int i = 1;
i != nL1TSeedModules; ++
i) {
338 <<
" Error in determining L1T prescale for HLT path: '" <<
trigger <<
"' has multiple L1TSeed modules, "
339 << nL1TSeedModules <<
", with L1T seeds: " <<
dump
340 <<
". (Note: at most one L1TSeed module is allowed for a proper determination of the L1T prescale!)";
347 edm::LogError(
"HLTPrescaleProvider") <<
" Unknown L1T Type " << l1tType <<
" - can not determine L1T prescale! ";
361 throw cms::Exception(
"Configuration") <<
"HLTPrescaleProvider::checkL1GtUtils(),\n"
362 "Attempt to use L1GtUtils object when none was constructed.\n"
363 "Possibly the proper era is not configured or\n"
364 "the module configuration does not use the era properly\n"
365 "or input is from mixed eras";
371 throw cms::Exception(
"Configuration") <<
"HLTPrescaleProvider:::checkL1TGlobalUtil(),\n"
372 "Attempt to use L1TGlobalUtil object when none was constructed.\n"
373 "Possibly the proper era is not configured or\n"
374 "the module configuration does not use the era properly\n"
375 "or input is from mixed eras";