28 , configError_(
"CONFIG_ERROR" )
32 if ( config.
exists(
"andOr" ) ) {
43 if ( config.
exists(
"andOrDcs" ) ) {
51 if ( config.
exists(
"andOrGt" ) ) {
60 if ( config.
exists(
"andOrL1" ) ) {
68 if ( config.
exists(
"andOrHlt" ) ) {
119 bool hltChanged(
false );
135 if ( !
on_ )
return true;
160 for ( std::vector< int >::const_iterator partitionNumber =
dcsPartitions_.begin(); partitionNumber !=
dcsPartitions_.end(); ++partitionNumber ) {
165 for ( std::vector< int >::const_iterator partitionNumber =
dcsPartitions_.begin(); partitionNumber !=
dcsPartitions_.end(); ++partitionNumber ) {
177 switch( dcsPartition ) {
204 edm::LogError(
"TriggerHelper" ) <<
"DCS partition number \"" << dcsPartition <<
"\" does not exist ==> decision: " <<
errorReplyDcs_;
209 return dcsStatus->at( 0 ).ready( dcsPartition );
224 if ( ! gtReadoutRecord.
isValid() ) {
249 if ( gtLogicalExpression.empty() ) {
255 bool negExpr(
negate( gtLogicalExpression ) );
256 if ( negExpr && gtLogicalExpression.empty() ) {
264 for (
size_t iStatusBit = 0; iStatusBit < gtAlgoLogicParser.
operandTokenVector().size(); ++iStatusBit ) {
269 if ( gtStatusBit ==
"PhysDecl" || gtStatusBit ==
"PhysicsDeclared" ) {
270 decision = ( gtReadoutRecord->gtFdlWord().physicsDeclared() == 1 );
280 return negExpr ? ( ! gtDecision ) : gtDecision;
293 l1Gt_->retrieveL1EventSetup( setup );
315 if ( l1LogicalExpression.empty() ) {
321 bool negExpr(
negate( l1LogicalExpression ) );
322 if ( negExpr && l1LogicalExpression.empty() ) {
330 for (
size_t iAlgorithm = 0; iAlgorithm < l1AlgoLogicParser.
operandTokenVector().size(); ++iAlgorithm ) {
333 const bool decision(
l1Gt_->decision( event, l1AlgoName, error ) );
336 if ( error == 1 )
edm::LogError(
"TriggerHelper" ) <<
"L1 algorithm \"" << l1AlgoName <<
"\" does not exist in the L1 menu ==> decision: " <<
errorReplyL1_;
337 else edm::LogError(
"TriggerHelper" ) <<
"L1 algorithm \"" << l1AlgoName <<
"\" received error code " << error <<
" from L1GtUtils::decisionBeforeMask ==> decision: " <<
errorReplyL1_;
347 return negExpr ? ( ! l1Decision ) : l1Decision;
368 if ( ! hltTriggerResults.
isValid() ) {
393 if ( hltLogicalExpression.empty() ) {
399 bool negExpr(
negate( hltLogicalExpression ) );
400 if ( negExpr && hltLogicalExpression.empty() ) {
408 for (
size_t iPath = 0; iPath < hltAlgoLogicParser.
operandTokenVector().size(); ++iPath ) {
417 if ( hltTriggerResults->error( indexPath ) ) {
423 const bool decision( hltTriggerResults->accept( indexPath ) );
429 return negExpr ? ( ! hltDecision ) : hltDecision;
441 const std::map< std::string, std::string > & expressionMap = logicalExpressions->m_alcarecoToTrig;
442 std::map< std::string, std::string >::const_iterator listIter = expressionMap.find( key );
443 if ( listIter == expressionMap.end() ) {
444 edm::LogError(
"TriggerHelper" ) <<
"No logical expressions found under key " << key <<
" in 'AlCaRecoTriggerBitsRcd'";
447 return logicalExpressions->decompose( listIter->second );
458 if ( word.at( 0 ) ==
'~' ) {
unsigned int size() const
number of trigger paths in trigger table
T getParameter(std::string const &) const
std::unique_ptr< L1GtUtils > l1Gt_
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_
std::vector< std::string > gtLogicalExpressions_
TriggerHelper(const edm::ParameterSet &config, edm::ConsumesCollector &&iC, T &module)
~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)
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_
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
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
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.