29 , configError_(
"CONFIG_ERROR" )
33 if ( config.
exists(
"andOr" ) ) {
44 if ( config.
exists(
"andOrDcs" ) ) {
52 if ( config.
exists(
"andOrGt" ) ) {
61 if ( config.
exists(
"andOrL1" ) ) {
69 if ( config.
exists(
"andOrHlt" ) ) {
120 bool hltChanged(
false );
136 if ( !
on_ )
return true;
161 for ( std::vector< int >::const_iterator partitionNumber =
dcsPartitions_.begin(); partitionNumber !=
dcsPartitions_.end(); ++partitionNumber ) {
166 for ( std::vector< int >::const_iterator partitionNumber =
dcsPartitions_.begin(); partitionNumber !=
dcsPartitions_.end(); ++partitionNumber ) {
178 switch( dcsPartition ) {
205 edm::LogError(
"TriggerHelper" ) <<
"DCS partition number \"" << dcsPartition <<
"\" does not exist ==> decision: " <<
errorReplyDcs_;
210 return dcsStatus->at( 0 ).ready( dcsPartition );
225 if ( ! gtReadoutRecord.
isValid() ) {
250 if ( gtLogicalExpression.empty() ) {
256 bool negExpr(
negate( gtLogicalExpression ) );
257 if ( negExpr && gtLogicalExpression.empty() ) {
265 for (
size_t iStatusBit = 0; iStatusBit < gtAlgoLogicParser.
operandTokenVector().size(); ++iStatusBit ) {
266 const std::string gtStatusBit( gtAlgoLogicParser.
operandTokenVector().at( iStatusBit ).tokenName );
270 if ( gtStatusBit ==
"PhysDecl" || gtStatusBit ==
"PhysicsDeclared" ) {
271 decision = ( gtReadoutRecord->gtFdlWord().physicsDeclared() == 1 );
281 return negExpr ? ( ! gtDecision ) : gtDecision;
316 if ( l1LogicalExpression.empty() ) {
322 bool negExpr(
negate( l1LogicalExpression ) );
323 if ( negExpr && l1LogicalExpression.empty() ) {
331 for (
size_t iAlgorithm = 0; iAlgorithm < l1AlgoLogicParser.
operandTokenVector().size(); ++iAlgorithm ) {
332 const std::string l1AlgoName( l1AlgoLogicParser.
operandTokenVector().at( iAlgorithm ).tokenName );
334 const bool decision(
l1Gt_.
decision( event, l1AlgoName, error ) );
337 if ( error == 1 )
edm::LogError(
"TriggerHelper" ) <<
"L1 algorithm \"" << l1AlgoName <<
"\" does not exist in the L1 menu ==> decision: " <<
errorReplyL1_;
338 else edm::LogError(
"TriggerHelper" ) <<
"L1 algorithm \"" << l1AlgoName <<
"\" received error code " << error <<
" from L1GtUtils::decisionBeforeMask ==> decision: " <<
errorReplyL1_;
348 return negExpr ? ( ! l1Decision ) : l1Decision;
369 if ( ! hltTriggerResults.
isValid() ) {
394 if ( hltLogicalExpression.empty() ) {
400 bool negExpr(
negate( hltLogicalExpression ) );
401 if ( negExpr && hltLogicalExpression.empty() ) {
409 for (
size_t iPath = 0; iPath < hltAlgoLogicParser.
operandTokenVector().size(); ++iPath ) {
410 const std::string hltPathName( hltAlgoLogicParser.
operandTokenVector().at( iPath ).tokenName );
418 if ( hltTriggerResults->error( indexPath ) ) {
424 const bool decision( hltTriggerResults->accept( indexPath ) );
430 return negExpr ? ( ! hltDecision ) : hltDecision;
442 const std::map< std::string, std::string > & expressionMap = logicalExpressions->m_alcarecoToTrig;
443 std::map< std::string, std::string >::const_iterator listIter = expressionMap.find( key );
444 if ( listIter == expressionMap.end() ) {
445 edm::LogError(
"TriggerHelper" ) <<
"No logical expressions found under key " << key <<
" in 'AlCaRecoTriggerBitsRcd'";
448 return logicalExpressions->decompose( listIter->second );
459 if ( word.at( 0 ) ==
'~' ) {
unsigned int size() const
number of trigger paths in trigger table
T getParameter(std::string const &) const
bool acceptGtLogicalExpression(const edm::Handle< L1GlobalTriggerReadoutRecord > >ReadoutRecord, std::string gtLogicalExpression)
Does this event fulfill this particular GT status bits' logical expression?
bool acceptHltLogicalExpression(const edm::Handle< edm::TriggerResults > &hltTriggerResults, std::string hltLogicalExpression) const
Was this event accepted by this particular HLT paths' logical expression?
bool negate(std::string &word) const
Checks for negated words.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< int > dcsPartitions_
const std::string configError_
TriggerHelper(const edm::ParameterSet &config)
To be called from the ED module's c'tor.
std::vector< std::string > gtLogicalExpressions_
~TriggerHelper()
To be called from d'tors by 'delete'.
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
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 acceptHlt(const edm::Event &event)
Was this event accepted by the configured HLT logical expression combination?
edm::InputTag hltInputTag_
std::vector< std::string > l1LogicalExpressions_
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
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
bool acceptL1(const edm::Event &event, const edm::EventSetup &setup)
Was this event accepted by the configured L1 logical expression combination?
bool acceptL1LogicalExpression(const edm::Event &event, std::string l1LogicalExpression)
Was this event accepted by this particular L1 algorithms' logical expression?
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
HLTConfigProvider hltConfig_
edm::InputTag gtInputTag_
bool acceptDcsPartition(const edm::Handle< DcsStatusCollection > &dcsStatus, int dcsPartition) const
edm::InputTag dcsInputTag_
bool acceptDcs(const edm::Event &event)
bool check(const edm::EventSetup &iSetup)
bool acceptGt(const edm::Event &event)
Does this event fulfill the configured GT status logical expression combination?
std::vector< std::string > expressionsFromDB(const std::string &key, const edm::EventSetup &setup)
Reads and returns logical expressions from DB.
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginedm::Run() methods.
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_
std::vector< std::string > hltLogicalExpressions_
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
virtual const bool expressionResult() const
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.