30 , configError_(
"CONFIG_ERROR" )
34 if ( config.
exists(
"andOr" ) ) {
46 if ( config.
exists(
"andOrDcs" ) ) {
54 if ( config.
exists(
"andOrGt" ) ) {
63 if ( config.
exists(
"andOrL1" ) ) {
71 if ( config.
exists(
"andOrHlt" ) ) {
122 bool hltChanged(
false );
138 if ( !
on_ )
return true;
160 if ( ( *dcsStatus ).size() == 0 ) {
167 for ( std::vector< int >::const_iterator partitionNumber =
dcsPartitions_.begin(); partitionNumber !=
dcsPartitions_.end(); ++partitionNumber ) {
172 for ( std::vector< int >::const_iterator partitionNumber =
dcsPartitions_.begin(); partitionNumber !=
dcsPartitions_.end(); ++partitionNumber ) {
184 switch( dcsPartition ) {
216 return dcsStatus->at( 0 ).ready( dcsPartition );
231 if ( ! gtReadoutRecord.
isValid() ) {
256 if ( gtLogicalExpression.empty() ) {
262 bool negExpr(
negate( gtLogicalExpression ) );
263 if ( negExpr && gtLogicalExpression.empty() ) {
271 for (
size_t iStatusBit = 0; iStatusBit < gtAlgoLogicParser.
operandTokenVector().size(); ++iStatusBit ) {
272 const std::string gtStatusBit( gtAlgoLogicParser.
operandTokenVector().at( iStatusBit ).tokenName );
276 if ( gtStatusBit ==
"PhysDecl" || gtStatusBit ==
"PhysicsDeclared" ) {
277 decision = ( gtReadoutRecord->gtFdlWord().physicsDeclared() == 1 );
287 return negExpr ? ( ! gtDecision ) : gtDecision;
322 if ( l1LogicalExpression.empty() ) {
328 bool negExpr(
negate( l1LogicalExpression ) );
329 if ( negExpr && l1LogicalExpression.empty() ) {
337 for (
size_t iAlgorithm = 0; iAlgorithm < l1AlgoLogicParser.
operandTokenVector().size(); ++iAlgorithm ) {
338 const std::string l1AlgoName( l1AlgoLogicParser.
operandTokenVector().at( iAlgorithm ).tokenName );
340 const bool decision(
l1Gt_.
decision( event, l1AlgoName, error ) );
344 if ( error == 1 )
edm::LogWarning(
"GenericTriggerEventFlag" ) <<
"L1 algorithm \"" << l1AlgoName <<
"\" does not exist in the L1 menu ==> decision: " <<
errorReplyL1_;
345 else edm::LogWarning(
"GenericTriggerEventFlag" ) <<
"L1 algorithm \"" << l1AlgoName <<
"\" received error code " << error <<
" from L1GtUtils::decisionBeforeMask ==> decision: " <<
errorReplyL1_;
356 return negExpr ? ( ! l1Decision ) : l1Decision;
377 if ( ! hltTriggerResults.
isValid() ) {
381 if ( ( *hltTriggerResults ).size() == 0 ) {
406 if ( hltLogicalExpression.empty() ) {
412 bool negExpr(
negate( hltLogicalExpression ) );
413 if ( negExpr && hltLogicalExpression.empty() ) {
421 for (
size_t iPath = 0; iPath < hltAlgoLogicParser.
operandTokenVector().size(); ++iPath ) {
422 const std::string hltPathName( hltAlgoLogicParser.
operandTokenVector().at( iPath ).tokenName );
430 if ( hltTriggerResults->error( indexPath ) ) {
436 const bool decision( hltTriggerResults->accept( indexPath ) );
442 return negExpr ? ( ! hltDecision ) : hltDecision;
454 const std::map< std::string, std::string > & expressionMap = logicalExpressions->m_alcarecoToTrig;
455 std::map< std::string, std::string >::const_iterator listIter = expressionMap.find( key );
456 if ( listIter == expressionMap.end() ) {
457 if (
verbose_ > 0 )
edm::LogWarning(
"GenericTriggerEventFlag" ) <<
"No logical expressions found under key " << key <<
" in 'AlCaRecoTriggerBitsRcd'";
460 return logicalExpressions->decompose( listIter->second );
471 if ( word.at( 0 ) ==
'~' ) {
unsigned int size() const
number of trigger paths in trigger table
bool negate(std::string &word) const
Checks for negated words.
T getParameter(std::string const &) const
HLTConfigProvider hltConfig_
std::vector< int > dcsPartitions_
edm::InputTag hltInputTag_
std::vector< std::string > gtLogicalExpressions_
std::vector< std::string > hltLogicalExpressions_
edm::InputTag gtInputTag_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool acceptHlt(const edm::Event &event)
Was this event accepted by the configured HLT logical expression combination?
bool acceptGtLogicalExpression(const edm::Handle< L1GlobalTriggerReadoutRecord > >ReadoutRecord, std::string gtLogicalExpression)
Does this event fulfill this particular GT status bits' logical expression?
bool acceptDcsPartition(const edm::Handle< DcsStatusCollection > &dcsStatus, int dcsPartition) const
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
std::vector< std::string > expressionsFromDB(const std::string &key, const edm::EventSetup &setup)
Reads and returns logical expressions from DB.
const bool decision(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
std::vector< OperandToken > & operandTokenVector()
return the vector of operand tokens
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
bool acceptL1LogicalExpression(const edm::Event &event, std::string l1LogicalExpression)
Was this event accepted by this particular L1 algorithms' logical expression?
GenericTriggerEventFlag(const edm::ParameterSet &config)
To be called from the ED module's c'tor.
~GenericTriggerEventFlag()
To be called from d'tors by 'delete'.
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
const std::string configError_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_
bool acceptDcs(const edm::Event &event)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
std::vector< std::string > l1LogicalExpressions_
bool check(const edm::EventSetup &iSetup)
edm::InputTag dcsInputTag_
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginedm::Run() methods.
bool acceptHltLogicalExpression(const edm::Handle< edm::TriggerResults > &hltTriggerResults, std::string hltLogicalExpression) const
Was this event accepted by this particular HLT paths' logical expression?
bool acceptL1(const edm::Event &event, const edm::EventSetup &setup)
Was this event accepted by the configured L1 logical expression combination?
virtual const bool expressionResult() const
bool acceptGt(const edm::Event &event)
Does this event fulfill the configured GT status logical expression combination?