18 static const unsigned char countMax(2);
37 }
else if (l1tType==2) {
41 <<
" Unknown L1T Type " << l1tType <<
" - prescales will not be avaiable!";
56 assert(psfsiTech==psfsiPhys);
57 if ( (errorTech==0) && (errorPhys==0) &&
58 (psfsiTech>=0) && (psfsiPhys>=0) && (psfsiTech==psfsiPhys) ) {
66 <<
" Error in determining HLT prescale set index from L1 data using L1GtUtils:" 67 <<
" Tech/Phys error = " << errorTech <<
"/" << errorPhys
68 <<
" Tech/Phys psfsi = " << psfsiTech <<
"/" << psfsiPhys;
72 }
else if (l1tType==2) {
80 <<
" Unknown L1T Type " << l1tType <<
" - can not determine prescale set index!";
104 std::pair<int,int>
result(std::pair<int,int>(0,0));
120 if (nL1GTSeedModules==0) {
123 }
else if (nL1GTSeedModules==1) {
132 <<
" Error in determining L1T prescale for HLT path: '" << trigger
133 <<
"' with L1T seed: '" << l1tname
134 <<
"' using L1GtUtils: error code = " << l1error <<
"." << std::endl
135 <<
" Note: for this method ('prescaleValues'), only a single L1T name (and not a bit number) is allowed as seed!" 137 <<
" For seeds being complex logical expressions, try the new method 'prescaleValuesInDetail'."<< std::endl;
146 for (
unsigned int i=1;
i!=nL1GTSeedModules; ++
i) {
150 <<
" Error in determining L1T prescale for HLT path: '" << trigger
151 <<
"' has multiple L1GTSeed modules, " << nL1GTSeedModules
152 <<
", with L1 seeds: " <<
dump 153 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
157 }
else if (l1tType==2){
159 if (nL1TSeedModules==0) {
162 }
else if (nL1TSeedModules==1) {
170 <<
" Error in determining L1T prescale for HLT path: '" << trigger
171 <<
"' with L1T seed: '" << l1tname
172 <<
"' using L1TGlobalUtil: error cond = " << l1error <<
"." << std::endl
173 <<
" Note: for this method ('prescaleValues'), only a single L1T name (and not a bit number) is allowed as seed!" 175 <<
" For seeds being complex logical expressions, try the new method 'prescaleValuesInDetail'."<< std::endl;
184 for (
unsigned int i=1;
i!=nL1TSeedModules; ++
i) {
188 <<
" Error in determining L1T prescale for HLT path: '" << trigger
189 <<
"' has multiple L1TSeed modules, " << nL1TSeedModules
190 <<
", with L1T seeds: " <<
dump 191 <<
". (Note: at most one L1TSeed module is allowed for a proper determination of the L1T prescale!)";
199 <<
" Unknown L1T Type " << l1tType <<
" - can not determine L1T prescale! ";
207 std::pair<std::vector<std::pair<std::string,int> >,
int>
212 std::pair<std::vector<std::pair<std::string,int> >,
int>
result;
213 result.first.clear();
229 if (nL1GTSeedModules==0) {
231 result.first.clear();
232 }
else if (nL1GTSeedModules==1) {
236 l1Logical.logicalExpressionRunUpdate(iEvent.
getRun(),iSetup,l1tname);
237 const std::vector<std::pair<std::string, int> >& errorCodes(l1Logical.errorCodes(iEvent));
238 result.first = l1Logical.prescaleFactors();
239 int l1error(l1Logical.isValid() ? 0 : 1);
240 for (
auto const & errorCode : errorCodes) {
241 l1error +=
std::abs(errorCode.second);
246 std::ostringstream message;
248 <<
" Error in determining L1T prescales for HLT path: '" << trigger
249 <<
"' with complex L1T seed: '" << l1tname
250 <<
"' using L1GtUtils: " << std::endl
251 <<
" isValid=" << l1Logical.isValid()
252 <<
" l1tname/error/prescale " << errorCodes.size()
254 for (
unsigned int i=0;
i< errorCodes.size(); ++
i) {
255 message <<
" " <<
i <<
":" << errorCodes[
i].first <<
"/" << errorCodes[
i].second <<
"/" 256 << result.first[
i].second;
261 result.first.clear();
268 for (
unsigned int i=1;
i!=nL1GTSeedModules; ++
i) {
272 <<
" Error in determining L1T prescale for HLT path: '" << trigger
273 <<
"' has multiple L1GTSeed modules, " << nL1GTSeedModules
274 <<
", with L1 seeds: " <<
dump 275 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
277 result.first.clear();
279 }
else if (l1tType==2){
281 if (nL1TSeedModules==0) {
283 result.first.clear();
284 }
else if (nL1TSeedModules==1) {
288 const std::vector<GlobalLogicParser::OperandToken> l1tSeeds = l1tGlobalLogicParser.expressionSeedsOperandList();
291 for (
auto const &
i : l1tSeeds) {
292 const string& l1tSeed =
i.tokenName;
296 result.first.push_back(std::pair<std::string,int>(l1tSeed,l1tPrescale));
301 string l1name = l1tname;
302 std::ostringstream message;
304 <<
" Error in determining L1T prescales for HLT path: '" << trigger
305 <<
"' with complex L1T seed: '" << l1tname
306 <<
"' using L1TGlobalUtil: " << std::endl
307 <<
" isValid=" << l1tGlobalLogicParser.checkLogicalExpression(l1name)
308 <<
" l1tname/error/prescale " << l1tSeeds.size()
310 for (
unsigned int i=0;
i<l1tSeeds.size(); ++
i) {
311 const string& l1tSeed = l1tSeeds[
i].tokenName;
313 << result.first[
i].second;
318 result.first.clear();
325 for (
unsigned int i=1;
i!=nL1TSeedModules; ++
i) {
329 <<
" Error in determining L1T prescale for HLT path: '" << trigger
330 <<
"' has multiple L1TSeed modules, " << nL1TSeedModules
331 <<
", with L1T seeds: " <<
dump 332 <<
". (Note: at most one L1TSeed module is allowed for a proper determination of the L1T prescale!)";
334 result.first.clear();
340 <<
" Unknown L1T Type " << l1tType <<
" - can not determine L1T prescale! ";
342 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
const std::vector< std::vector< std::pair< bool, std::string > > > & hltL1GTSeeds() 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)
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