CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
GenericTriggerEventFlag Class Reference

Provides a code based selection for trigger and DCS information in order to have no failing filters in the CMSSW path. More...

#include "CommonTools/TriggerUtils/interface/GenericTriggerEventFlag.h"

Public Member Functions

bool accept (const edm::Event &event, const edm::EventSetup &setup)
 To be called from analyze/filter() methods. More...
 
std::vector< std::string > expressionsFromDB (const std::string &key, const edm::EventSetup &setup)
 Reads and returns logical expressions from DB. More...
 
template<typename T >
 GenericTriggerEventFlag (const edm::ParameterSet &config, edm::ConsumesCollector &&iC, T &module)
 
template<typename T >
 GenericTriggerEventFlag (const edm::ParameterSet &config, edm::ConsumesCollector &iC, T &module)
 
std::string gtDBKey ()
 
std::string hltDBKey ()
 
void initRun (const edm::Run &run, const edm::EventSetup &setup)
 To be called from beginRun() methods. More...
 
std::string l1DBKey ()
 
bool off ()
 
bool on ()
 
 ~GenericTriggerEventFlag ()
 To be called from d'tors by 'delete'. More...
 

Private Member Functions

bool acceptDcs (const edm::Event &event)
 
bool acceptDcsPartition (const edm::Handle< DcsStatusCollection > &dcsStatus, int dcsPartition) const
 
bool acceptGt (const edm::Event &event)
 Does this event fulfill the configured GT status logical expression combination? More...
 
bool acceptGtLogicalExpression (const edm::Event &event, std::string gtLogicalExpression)
 Does this event fulfill this particular GT status bits' logical expression? More...
 
bool acceptHlt (const edm::Event &event)
 Was this event accepted by the configured HLT logical expression combination? More...
 
bool acceptHltLogicalExpression (const edm::Handle< edm::TriggerResults > &hltTriggerResults, std::string hltLogicalExpression) const
 Was this event accepted by this particular HLT paths' logical expression? More...
 
bool acceptL1 (const edm::Event &event, const edm::EventSetup &setup)
 Was this event accepted by the configured L1 logical expression combination? More...
 
bool acceptL1LogicalExpression (const edm::Event &event, std::string l1LogicalExpression)
 Was this event accepted by this particular L1 algorithms' logical expression? More...
 
std::string expandLogicalExpression (const std::vector< std::string > &target, const std::string &expr, bool useAnd=false) const
 Expand wild-carded logical expressions, giving version postfixes priority. More...
 
 GenericTriggerEventFlag (const edm::ParameterSet &config, edm::ConsumesCollector &iC)
 To be called from the ED module's c'tor. More...
 
bool negate (std::string &word) const
 Checks for negated words. More...
 

Private Attributes

bool andOr_
 
bool andOrDcs_
 
bool andOrGt_
 
bool andOrHlt_
 
bool andOrL1_
 
const std::string configError_
 
std::string dbLabel_
 
edm::InputTag dcsInputTag_
 
edm::EDGetTokenT
< DcsStatusCollection
dcsInputToken_
 
std::vector< int > dcsPartitions_
 
const std::string emptyKeyError_
 
bool errorReplyDcs_
 
bool errorReplyGt_
 
bool errorReplyHlt_
 
bool errorReplyL1_
 
std::string gtDBKey_
 
edm::InputTag gtEvmInputTag_
 
edm::EDGetTokenT
< L1GlobalTriggerEvmReadoutRecord
gtEvmInputToken_
 
edm::InputTag gtInputTag_
 
edm::EDGetTokenT
< L1GlobalTriggerReadoutRecord
gtInputToken_
 
std::vector< std::string > gtLogicalExpressions_
 
HLTConfigProvider hltConfig_
 
bool hltConfigInit_
 
std::string hltDBKey_
 
edm::InputTag hltInputTag_
 
edm::EDGetTokenT
< edm::TriggerResults
hltInputToken_
 
std::vector< std::string > hltLogicalExpressions_
 
std::vector< std::string > hltLogicalExpressionsCache_
 
bool l1BeforeMask_
 
std::string l1DBKey_
 
std::unique_ptr< L1GtUtilsl1Gt_
 
std::vector< std::string > l1LogicalExpressions_
 
std::vector< std::string > l1LogicalExpressionsCache_
 
bool on_
 
bool onDcs_
 
bool onGt_
 
bool onHlt_
 
bool onL1_
 
unsigned verbose_
 
edm::ESWatcher
< AlCaRecoTriggerBitsRcd > * 
watchDB_
 

Detailed Description

Provides a code based selection for trigger and DCS information in order to have no failing filters in the CMSSW path.

[...]

Author
Volker Adler
Version
Id:
GenericTriggerEventFlag.h,v 1.5 2012/01/19 20:17:34 vadler Exp

Definition at line 40 of file GenericTriggerEventFlag.h.

Constructor & Destructor Documentation

template<typename T >
GenericTriggerEventFlag::GenericTriggerEventFlag ( const edm::ParameterSet config,
edm::ConsumesCollector &&  iC,
T module 
)

Definition at line 143 of file GenericTriggerEventFlag.h.

143  :
144  GenericTriggerEventFlag(config, iC, module) {
145 }
GenericTriggerEventFlag(const edm::ParameterSet &config, edm::ConsumesCollector &&iC, T &module)
Definition: vlib.h:208
template<typename T >
GenericTriggerEventFlag::GenericTriggerEventFlag ( const edm::ParameterSet config,
edm::ConsumesCollector iC,
T module 
)

Definition at line 148 of file GenericTriggerEventFlag.h.

References l1Gt_.

148  :
149  GenericTriggerEventFlag(config, iC) {
150  l1Gt_.reset(new L1GtUtils(config, iC, false, module));
151 }
GenericTriggerEventFlag(const edm::ParameterSet &config, edm::ConsumesCollector &&iC, T &module)
std::unique_ptr< L1GtUtils > l1Gt_
Definition: vlib.h:208
GenericTriggerEventFlag::~GenericTriggerEventFlag ( )

To be called from d'tors by 'delete'.

Definition at line 120 of file GenericTriggerEventFlag.cc.

References on_, and watchDB_.

121 {
122 
123  if ( on_ ) delete watchDB_;
124 
125 }
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_
GenericTriggerEventFlag::GenericTriggerEventFlag ( const edm::ParameterSet config,
edm::ConsumesCollector iC 
)
private

To be called from the ED module's c'tor.

Definition at line 25 of file GenericTriggerEventFlag.cc.

References andOr_, andOrDcs_, andOrGt_, andOrHlt_, andOrL1_, dbLabel_, dcsInputTag_, dcsInputToken_, dcsPartitions_, errorReplyDcs_, errorReplyGt_, errorReplyHlt_, errorReplyL1_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), gtDBKey_, gtEvmInputTag_, gtEvmInputToken_, gtInputTag_, gtInputToken_, gtLogicalExpressions_, hltDBKey_, hltInputTag_, hltInputToken_, hltLogicalExpressionsCache_, l1BeforeMask_, l1DBKey_, l1LogicalExpressionsCache_, edm::ConsumesCollector::mayConsume(), on_, onDcs_, onGt_, onHlt_, onL1_, AlCaHLTBitMon_QueryRunRegistry::string, verbose_, and watchDB_.

26  : watchDB_( 0 )
27  , hltConfigInit_( false )
28  , andOr_( false )
29  , dbLabel_( "" )
30  , verbose_( 0 )
31  , andOrDcs_( false )
32  , errorReplyDcs_( false )
33  , andOrGt_( false )
34  , gtInputTag_( "" )
35  , gtEvmInputTag_( "" )
36  , gtDBKey_( "" )
37  , errorReplyGt_( false )
38  , andOrL1_( false )
39  , l1BeforeMask_( true )
40  , l1DBKey_( "" )
41  , errorReplyL1_( false )
42  , andOrHlt_( false )
43  , hltDBKey_( "" )
44  , errorReplyHlt_( false )
45  , on_( true )
46  , onDcs_( true )
47  , onGt_( true )
48  , onL1_( true )
49  , onHlt_( true )
50  , configError_( "CONFIG_ERROR" )
51  , emptyKeyError_( "EMPTY_KEY_ERROR" )
52 {
53 
54  // General switch(es)
55  if ( config.exists( "andOr" ) ) {
56  andOr_ = config.getParameter< bool >( "andOr" );
57  if ( config.exists( "verbosityLevel" ) ) verbose_ = config.getParameter< unsigned >( "verbosityLevel" );
58  } else {
59  on_ = false;
60  onDcs_ = false;
61  onGt_ = false;
62  onL1_ = false;
63  onHlt_ = false;
64  }
65 
66  if ( on_ ) {
67  if ( config.exists( "andOrDcs" ) ) {
68  andOrDcs_ = config.getParameter< bool >( "andOrDcs" );
69  dcsInputTag_ = config.getParameter< edm::InputTag >( "dcsInputTag" );
71  dcsPartitions_ = config.getParameter< std::vector< int > >( "dcsPartitions" );
72  errorReplyDcs_ = config.getParameter< bool >( "errorReplyDcs" );
73  } else {
74  onDcs_ = false;
75  }
76  if ( config.exists( "andOrGt" ) ) {
77  andOrGt_ = config.getParameter< bool >( "andOrGt" );
78  gtInputTag_ = config.getParameter< edm::InputTag >( "gtInputTag" );
80  gtLogicalExpressions_ = config.getParameter< std::vector< std::string > >( "gtStatusBits" );
81  errorReplyGt_ = config.getParameter< bool >( "errorReplyGt" );
82  if ( config.exists( "gtEvmInputTag" ) ) {
83  gtEvmInputTag_ = config.getParameter< edm::InputTag >( "gtEvmInputTag" );
85  }
86  if ( config.exists( "gtDBKey" ) ) gtDBKey_ = config.getParameter< std::string >( "gtDBKey" );
87  } else {
88  onGt_ = false;
89  }
90  if ( config.exists( "andOrL1" ) ) {
91  andOrL1_ = config.getParameter< bool >( "andOrL1" );
92  l1LogicalExpressionsCache_ = config.getParameter< std::vector< std::string > >( "l1Algorithms" );
93  errorReplyL1_ = config.getParameter< bool >( "errorReplyL1" );
94  if ( config.exists( "l1DBKey" ) ) l1DBKey_ = config.getParameter< std::string >( "l1DBKey" );
95  if ( config.exists( "l1BeforeMask" ) ) l1BeforeMask_ = config.getParameter< bool >( "l1BeforeMask" );
96  } else {
97  onL1_ = false;
98  }
99  if ( config.exists( "andOrHlt" ) ) {
100  andOrHlt_ = config.getParameter< bool >( "andOrHlt" );
101  hltInputTag_ = config.getParameter< edm::InputTag >( "hltInputTag" );
103  hltLogicalExpressionsCache_ = config.getParameter< std::vector< std::string > >( "hltPaths" );
104  errorReplyHlt_ = config.getParameter< bool >( "errorReplyHlt" );
105  if ( config.exists( "hltDBKey" ) ) hltDBKey_ = config.getParameter< std::string >( "hltDBKey" );
106  } else {
107  onHlt_ = false;
108  }
109  if ( ! onDcs_ && ! onGt_ && ! onL1_ && ! onHlt_ ) on_ = false;
110  else {
111  if ( config.exists( "dbLabel" ) ) dbLabel_ = config.getParameter< std::string >( "dbLabel" );
113  }
114  }
115 
116 }
T getParameter(std::string const &) const
std::vector< int > dcsPartitions_
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtInputToken_
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
std::vector< std::string > gtLogicalExpressions_
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< edm::TriggerResults > hltInputToken_
std::vector< std::string > l1LogicalExpressionsCache_
edm::EDGetTokenT< DcsStatusCollection > dcsInputToken_
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmInputToken_
std::vector< DcsStatus > DcsStatusCollection
Definition: DcsStatus.h:116
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_
std::vector< std::string > hltLogicalExpressionsCache_

Member Function Documentation

bool GenericTriggerEventFlag::accept ( const edm::Event event,
const edm::EventSetup setup 
)

To be called from analyze/filter() methods.

Definition at line 217 of file GenericTriggerEventFlag.cc.

References acceptDcs(), acceptGt(), acceptHlt(), acceptL1(), andOr_, and on_.

Referenced by MonitorTrackResiduals::analyze(), dEdxHitAnalyzer::analyze(), dEdxAnalyzer::analyze(), SiStripMonitorCluster::analyze(), TrackingMonitor::analyze(), LogMessageMonitor::analyze(), SiStripMonitorTrack::analyze(), Vispa.Gui.BoxContentDialog.BoxContentDialog::apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::apply(), and esMonitoring.FDJsonServer::handle_accept().

218 {
219 
220  if ( ! on_ ) return true;
221 
222  // Determine decision
223  if ( andOr_ ) return ( acceptDcs( event ) || acceptGt( event ) || acceptL1( event, setup ) || acceptHlt( event ) );
224  return ( acceptDcs( event ) && acceptGt( event ) && acceptL1( event, setup ) && acceptHlt( event ) );
225 
226 }
bool acceptHlt(const edm::Event &event)
Was this event accepted by the configured HLT logical expression combination?
bool acceptDcs(const edm::Event &event)
bool acceptL1(const edm::Event &event, const edm::EventSetup &setup)
Was this event accepted by the configured L1 logical expression combination?
bool acceptGt(const edm::Event &event)
Does this event fulfill the configured GT status logical expression combination?
bool GenericTriggerEventFlag::acceptDcs ( const edm::Event event)
private

Definition at line 229 of file GenericTriggerEventFlag.cc.

References acceptDcsPartition(), andOr_, andOrDcs_, dcsInputTag_, dcsInputToken_, dcsPartitions_, edm::InputTag::encode(), errorReplyDcs_, edm::HandleBase::isValid(), onDcs_, and verbose_.

Referenced by accept().

230 {
231 
232  // An empty DCS partitions list acts as switch.
233  if ( ! onDcs_ || dcsPartitions_.empty() ) return ( ! andOr_ ); // logically neutral, depending on base logical connective
234 
235  // Accessing the DcsStatusCollection
237  event.getByToken( dcsInputToken_, dcsStatus );
238  if ( ! dcsStatus.isValid() ) {
239  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "DcsStatusCollection product with InputTag \"" << dcsInputTag_.encode() << "\" not in event ==> decision: " << errorReplyDcs_;
240  return errorReplyDcs_;
241  }
242  if ( ( *dcsStatus ).size() == 0 ) {
243  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "DcsStatusCollection product with InputTag \"" << dcsInputTag_.encode() << "\" empty ==> decision: " << errorReplyDcs_;
244  return errorReplyDcs_;
245  }
246 
247  // Determine decision of DCS partition combination and return
248  if ( andOrDcs_ ) { // OR combination
249  for ( std::vector< int >::const_iterator partitionNumber = dcsPartitions_.begin(); partitionNumber != dcsPartitions_.end(); ++partitionNumber ) {
250  if ( acceptDcsPartition( dcsStatus, *partitionNumber ) ) return true;
251  }
252  return false;
253  }
254  for ( std::vector< int >::const_iterator partitionNumber = dcsPartitions_.begin(); partitionNumber != dcsPartitions_.end(); ++partitionNumber ) {
255  if ( ! acceptDcsPartition( dcsStatus, *partitionNumber ) ) return false;
256  }
257  return true;
258 
259 }
std::vector< int > dcsPartitions_
std::string encode() const
Definition: InputTag.cc:164
bool acceptDcsPartition(const edm::Handle< DcsStatusCollection > &dcsStatus, int dcsPartition) const
edm::EDGetTokenT< DcsStatusCollection > dcsInputToken_
bool isValid() const
Definition: HandleBase.h:75
bool GenericTriggerEventFlag::acceptDcsPartition ( const edm::Handle< DcsStatusCollection > &  dcsStatus,
int  dcsPartition 
) const
private

Definition at line 262 of file GenericTriggerEventFlag.cc.

References DcsStatus::BPIX, DcsStatus::CASTOR, DcsStatus::CSCm, DcsStatus::CSCp, DcsStatus::DT0, DcsStatus::DTm, DcsStatus::DTp, DcsStatus::EBm, DcsStatus::EBp, DcsStatus::EEm, DcsStatus::EEp, errorReplyDcs_, DcsStatus::ESm, DcsStatus::ESp, DcsStatus::FPIX, DcsStatus::HBHEa, DcsStatus::HBHEb, DcsStatus::HBHEc, DcsStatus::HF, DcsStatus::HO, DcsStatus::RPC, DcsStatus::TECm, DcsStatus::TECp, DcsStatus::TIBTID, DcsStatus::TOB, and verbose_.

Referenced by acceptDcs().

263 {
264 
265  // Error checks
266  switch( dcsPartition ) {
267  case DcsStatus::EBp :
268  case DcsStatus::EBm :
269  case DcsStatus::EEp :
270  case DcsStatus::EEm :
271  case DcsStatus::HBHEa :
272  case DcsStatus::HBHEb :
273  case DcsStatus::HBHEc :
274  case DcsStatus::HF :
275  case DcsStatus::HO :
276  case DcsStatus::RPC :
277  case DcsStatus::DT0 :
278  case DcsStatus::DTp :
279  case DcsStatus::DTm :
280  case DcsStatus::CSCp :
281  case DcsStatus::CSCm :
282  case DcsStatus::CASTOR:
283  case DcsStatus::TIBTID:
284  case DcsStatus::TOB :
285  case DcsStatus::TECp :
286  case DcsStatus::TECm :
287  case DcsStatus::BPIX :
288  case DcsStatus::FPIX :
289  case DcsStatus::ESp :
290  case DcsStatus::ESm :
291  break;
292  default:
293  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "DCS partition number \"" << dcsPartition << "\" does not exist ==> decision: " << errorReplyDcs_;
294  return errorReplyDcs_;
295  }
296 
297  // Determine decision
298  return dcsStatus->at( 0 ).ready( dcsPartition );
299 
300 }
bool GenericTriggerEventFlag::acceptGt ( const edm::Event event)
private

Does this event fulfill the configured GT status logical expression combination?

Definition at line 304 of file GenericTriggerEventFlag.cc.

References acceptGtLogicalExpression(), andOr_, andOrGt_, gtLogicalExpressions_, and onGt_.

Referenced by accept().

305 {
306 
307  // An empty GT status bits logical expressions list acts as switch.
308  if ( ! onGt_ || gtLogicalExpressions_.empty() ) return ( ! andOr_ ); // logically neutral, depending on base logical connective
309 
310  // Determine decision of GT status bits logical expression combination and return
311  if ( andOrGt_ ) { // OR combination
312  for ( std::vector< std::string >::const_iterator gtLogicalExpression = gtLogicalExpressions_.begin(); gtLogicalExpression != gtLogicalExpressions_.end(); ++gtLogicalExpression ) {
313  if ( acceptGtLogicalExpression( event, *gtLogicalExpression ) ) return true;
314  }
315  return false;
316  }
317  for ( std::vector< std::string >::const_iterator gtLogicalExpression = gtLogicalExpressions_.begin(); gtLogicalExpression != gtLogicalExpressions_.end(); ++gtLogicalExpression ) {
318  if ( ! acceptGtLogicalExpression( event, *gtLogicalExpression ) ) return false;
319  }
320  return true;
321 
322 }
std::vector< std::string > gtLogicalExpressions_
bool acceptGtLogicalExpression(const edm::Event &event, std::string gtLogicalExpression)
Does this event fulfill this particular GT status bits&#39; logical expression?
bool GenericTriggerEventFlag::acceptGtLogicalExpression ( const edm::Event event,
std::string  gtLogicalExpression 
)
private

Does this event fulfill this particular GT status bits' logical expression?

Definition at line 326 of file GenericTriggerEventFlag.cc.

References edm::InputTag::encode(), errorReplyDcs_, errorReplyGt_, L1GtLogicParser::expressionResult(), gtEvmInputTag_, gtEvmInputToken_, gtInputTag_, gtInputToken_, edm::HandleBase::isValid(), negate(), L1GtLogicParser::operandTokenVector(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by acceptGt().

327 {
328 
329  // Check empty std::strings
330  if ( gtLogicalExpression.empty() ) {
331  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "Empty logical expression ==> decision: " << errorReplyGt_;
332  return errorReplyGt_;
333  }
334 
335  // Negated paths
336  bool negExpr( negate( gtLogicalExpression ) );
337  if ( negExpr && gtLogicalExpression.empty() ) {
338  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "Empty (negated) logical expression ==> decision: " << errorReplyGt_;
339  return errorReplyGt_;
340  }
341 
342  // Parse logical expression and determine GT status bit decision
343  L1GtLogicParser gtAlgoLogicParser( gtLogicalExpression );
344  // Loop over status bits
345  for ( size_t iStatusBit = 0; iStatusBit < gtAlgoLogicParser.operandTokenVector().size(); ++iStatusBit ) {
346  const std::string gtStatusBit( gtAlgoLogicParser.operandTokenVector().at( iStatusBit ).tokenName );
347  // Manipulate status bit decision as stored in the parser
348  bool decision( errorReplyDcs_ );
349  // Hard-coded status bits!!!
350  if ( gtStatusBit == "PhysDecl" || gtStatusBit == "PhysicsDeclared" ) {
352  event.getByToken( gtInputToken_, gtReadoutRecord );
353  if ( ! gtReadoutRecord.isValid() ) {
354  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "L1GlobalTriggerReadoutRecord product with InputTag \"" << gtInputTag_.encode() << "\" not in event ==> decision: " << errorReplyGt_;
355  gtAlgoLogicParser.operandTokenVector().at( iStatusBit ).tokenResult = errorReplyDcs_;
356  continue;
357  }
358  decision = ( gtReadoutRecord->gtFdlWord().physicsDeclared() == 1 );
359  } else if ( gtStatusBit == "Stable" || gtStatusBit == "StableBeam" || gtStatusBit == "Adjust" || gtStatusBit == "Sqeeze" || gtStatusBit == "Flat" || gtStatusBit == "FlatTop" ||
360  gtStatusBit == "7TeV" || gtStatusBit == "8TeV" || gtStatusBit == "2360GeV" || gtStatusBit == "900GeV" ) {
362  event.getByToken( gtEvmInputToken_, gtEvmReadoutRecord );
363  if ( ! gtEvmReadoutRecord.isValid() ) {
364  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "L1GlobalTriggerEvmReadoutRecord product with InputTag \"" << gtEvmInputTag_.encode() << "\" not in event ==> decision: " << errorReplyGt_;
365  gtAlgoLogicParser.operandTokenVector().at( iStatusBit ).tokenResult = errorReplyDcs_;
366  continue;
367  }
368  if ( gtStatusBit == "Stable" || gtStatusBit == "StableBeam" ) {
369  decision = ( gtEvmReadoutRecord->gtfeWord().beamMode() == 11 );
370  } else if ( gtStatusBit == "Adjust" ) {
371  decision = ( 10 <= gtEvmReadoutRecord->gtfeWord().beamMode() && gtEvmReadoutRecord->gtfeWord().beamMode() <= 11 );
372  } else if ( gtStatusBit == "Sqeeze" ) {
373  decision = ( 9 <= gtEvmReadoutRecord->gtfeWord().beamMode() && gtEvmReadoutRecord->gtfeWord().beamMode() <= 11 );
374  } else if ( gtStatusBit == "Flat" || gtStatusBit == "FlatTop" ) {
375  decision = ( 8 <= gtEvmReadoutRecord->gtfeWord().beamMode() && gtEvmReadoutRecord->gtfeWord().beamMode() <= 11 );
376  } else if ( gtStatusBit == "7TeV" ) {
377  decision = ( gtEvmReadoutRecord->gtfeWord().beamMomentum() == 3500 );
378  } else if ( gtStatusBit == "8TeV" ) {
379  decision = ( gtEvmReadoutRecord->gtfeWord().beamMomentum() == 4000 );
380  } else if ( gtStatusBit == "2360GeV" ) {
381  decision = ( gtEvmReadoutRecord->gtfeWord().beamMomentum() == 1180 );
382  } else if ( gtStatusBit == "900GeV" ) {
383  decision = ( gtEvmReadoutRecord->gtfeWord().beamMomentum() == 450 );
384  }
385  } else {
386  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "GT status bit \"" << gtStatusBit << "\" is not defined ==> decision: " << errorReplyGt_;
387  }
388  gtAlgoLogicParser.operandTokenVector().at( iStatusBit ).tokenResult = decision;
389  }
390 
391  // Determine decision
392  const bool gtDecision( gtAlgoLogicParser.expressionResult() );
393  return negExpr ? ( ! gtDecision ) : gtDecision;
394 
395 }
bool negate(std::string &word) const
Checks for negated words.
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtInputToken_
std::string encode() const
Definition: InputTag.cc:164
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmInputToken_
bool isValid() const
Definition: HandleBase.h:75
bool GenericTriggerEventFlag::acceptHlt ( const edm::Event event)
private

Was this event accepted by the configured HLT logical expression combination?

Definition at line 468 of file GenericTriggerEventFlag.cc.

References acceptHltLogicalExpression(), andOr_, andOrHlt_, edm::InputTag::encode(), errorReplyDcs_, errorReplyHlt_, hltConfigInit_, hltInputTag_, hltInputToken_, hltLogicalExpressions_, edm::HandleBase::isValid(), onHlt_, and verbose_.

Referenced by accept().

469 {
470 
471  // An empty HLT logical expressions list acts as switch.
472  if ( ! onHlt_ || hltLogicalExpressions_.empty() ) return ( ! andOr_ ); // logically neutral, depending on base logical connective
473 
474  // Checking the HLT configuration,
475  if ( ! hltConfigInit_ ) {
476  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "HLT config error ==> decision: " << errorReplyHlt_;
477  return errorReplyHlt_;
478  }
479 
480  // Accessing the TriggerResults
481  edm::Handle< edm::TriggerResults > hltTriggerResults;
482  event.getByToken( hltInputToken_, hltTriggerResults );
483  if ( ! hltTriggerResults.isValid() ) {
484  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "TriggerResults product with InputTag \"" << hltInputTag_.encode() << "\" not in event ==> decision: " << errorReplyHlt_;
485  return errorReplyHlt_;
486  }
487  if ( ( *hltTriggerResults ).size() == 0 ) {
488  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "TriggerResults product with InputTag \"" << hltInputTag_.encode() << "\" empty ==> decision: " << errorReplyHlt_;
489  return errorReplyDcs_;
490  }
491 
492  // Determine decision of HLT logical expression combination and return
493  if ( andOrHlt_ ) { // OR combination
494  for ( std::vector< std::string >::const_iterator hltLogicalExpression = hltLogicalExpressions_.begin(); hltLogicalExpression != hltLogicalExpressions_.end(); ++hltLogicalExpression ) {
495  if ( acceptHltLogicalExpression( hltTriggerResults, *hltLogicalExpression ) ) return true;
496  }
497  return false;
498  }
499  for ( std::vector< std::string >::const_iterator hltLogicalExpression = hltLogicalExpressions_.begin(); hltLogicalExpression != hltLogicalExpressions_.end(); ++hltLogicalExpression ) {
500  if ( ! acceptHltLogicalExpression( hltTriggerResults, *hltLogicalExpression ) ) return false;
501  }
502  return true;
503 
504 }
std::vector< std::string > hltLogicalExpressions_
edm::EDGetTokenT< edm::TriggerResults > hltInputToken_
std::string encode() const
Definition: InputTag.cc:164
bool isValid() const
Definition: HandleBase.h:75
bool acceptHltLogicalExpression(const edm::Handle< edm::TriggerResults > &hltTriggerResults, std::string hltLogicalExpression) const
Was this event accepted by this particular HLT paths&#39; logical expression?
bool GenericTriggerEventFlag::acceptHltLogicalExpression ( const edm::Handle< edm::TriggerResults > &  hltTriggerResults,
std::string  hltLogicalExpression 
) const
private

Was this event accepted by this particular HLT paths' logical expression?

Definition at line 508 of file GenericTriggerEventFlag.cc.

References errorReplyHlt_, L1GtLogicParser::expressionResult(), hltConfig_, hltInputTag_, negate(), L1GtLogicParser::operandTokenVector(), edm::InputTag::process(), HLTConfigProvider::size(), AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::triggerIndex(), and verbose_.

Referenced by acceptHlt().

509 {
510 
511  // Check empty std::strings
512  if ( hltLogicalExpression.empty() ) {
513  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "Empty logical expression ==> decision: " << errorReplyHlt_;
514  return errorReplyHlt_;
515  }
516 
517  // Negated paths
518  bool negExpr( negate( hltLogicalExpression ) );
519  if ( negExpr && hltLogicalExpression.empty() ) {
520  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "Empty (negated) logical expression ==> decision: " << errorReplyHlt_;
521  return errorReplyHlt_;
522  }
523 
524  // Parse logical expression and determine HLT decision
525  L1GtLogicParser hltAlgoLogicParser( hltLogicalExpression );
526  // Loop over paths
527  for ( size_t iPath = 0; iPath < hltAlgoLogicParser.operandTokenVector().size(); ++iPath ) {
528  const std::string hltPathName( hltAlgoLogicParser.operandTokenVector().at( iPath ).tokenName );
529  const unsigned indexPath( hltConfig_.triggerIndex( hltPathName ) );
530  // Further error checks
531  if ( indexPath == hltConfig_.size() ) {
532  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "HLT path \"" << hltPathName << "\" is not found in process " << hltInputTag_.process() << " ==> decision: " << errorReplyHlt_;
533  hltAlgoLogicParser.operandTokenVector().at( iPath ).tokenResult = errorReplyHlt_;
534  continue;
535  }
536  if ( hltTriggerResults->error( indexPath ) ) {
537  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "HLT path \"" << hltPathName << "\" in error ==> decision: " << errorReplyHlt_;
538  hltAlgoLogicParser.operandTokenVector().at( iPath ).tokenResult = errorReplyHlt_;
539  continue;
540  }
541  // Manipulate algo decision as stored in the parser
542  const bool decision( hltTriggerResults->accept( indexPath ) );
543  hltAlgoLogicParser.operandTokenVector().at( iPath ).tokenResult = decision;
544  }
545 
546  // Determine decision
547  const bool hltDecision( hltAlgoLogicParser.expressionResult() );
548  return negExpr ? ( ! hltDecision ) : hltDecision;
549 
550 }
unsigned int size() const
number of trigger paths in trigger table
bool negate(std::string &word) const
Checks for negated words.
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
std::string const & process() const
Definition: InputTag.h:47
bool GenericTriggerEventFlag::acceptL1 ( const edm::Event event,
const edm::EventSetup setup 
)
private

Was this event accepted by the configured L1 logical expression combination?

Definition at line 399 of file GenericTriggerEventFlag.cc.

References acceptL1LogicalExpression(), andOr_, andOrL1_, l1Gt_, l1LogicalExpressions_, onL1_, useL1EventSetup(), and useL1GtTriggerMenuLite().

Referenced by accept().

400 {
401 
402  // An empty L1 logical expressions list acts as switch.
403  if ( ! onL1_ || l1LogicalExpressions_.empty() ) return ( ! andOr_ ); // logically neutral, depending on base logical connective
404 
405  // Getting the L1 event setup
406  l1Gt_->getL1GtRunCache( event, setup, useL1EventSetup, useL1GtTriggerMenuLite ); // FIXME This can possibly go to initRun()
407 
408  // Determine decision of L1 logical expression combination and return
409  if ( andOrL1_ ) { // OR combination
410  for ( std::vector< std::string >::const_iterator l1LogicalExpression = l1LogicalExpressions_.begin(); l1LogicalExpression != l1LogicalExpressions_.end(); ++l1LogicalExpression ) {
411  if ( acceptL1LogicalExpression( event, *l1LogicalExpression ) ) return true;
412  }
413  return false;
414  }
415  for ( std::vector< std::string >::const_iterator l1LogicalExpression = l1LogicalExpressions_.begin(); l1LogicalExpression != l1LogicalExpressions_.end(); ++l1LogicalExpression ) {
416  if ( ! acceptL1LogicalExpression( event, *l1LogicalExpression ) ) return false;
417  }
418  return true;
419 
420 }
static const bool useL1GtTriggerMenuLite(false)
std::unique_ptr< L1GtUtils > l1Gt_
bool acceptL1LogicalExpression(const edm::Event &event, std::string l1LogicalExpression)
Was this event accepted by this particular L1 algorithms&#39; logical expression?
static const bool useL1EventSetup(true)
std::vector< std::string > l1LogicalExpressions_
bool GenericTriggerEventFlag::acceptL1LogicalExpression ( const edm::Event event,
std::string  l1LogicalExpression 
)
private

Was this event accepted by this particular L1 algorithms' logical expression?

Definition at line 424 of file GenericTriggerEventFlag.cc.

References relativeConstraints::error, errorReplyL1_, L1GtLogicParser::expressionResult(), l1BeforeMask_, l1Gt_, negate(), L1GtLogicParser::operandTokenVector(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by acceptL1().

425 {
426 
427  // Check empty std::strings
428  if ( l1LogicalExpression.empty() ) {
429  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "Empty logical expression ==> decision: " << errorReplyL1_;
430  return errorReplyL1_;
431  }
432 
433  // Negated logical expression
434  bool negExpr( negate( l1LogicalExpression ) );
435  if ( negExpr && l1LogicalExpression.empty() ) {
436  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "Empty (negated) logical expression ==> decision: " << errorReplyL1_;
437  return errorReplyL1_;
438  }
439 
440  // Parse logical expression and determine L1 decision
441  L1GtLogicParser l1AlgoLogicParser( l1LogicalExpression );
442  // Loop over algorithms
443  for ( size_t iAlgorithm = 0; iAlgorithm < l1AlgoLogicParser.operandTokenVector().size(); ++iAlgorithm ) {
444  const std::string l1AlgoName( l1AlgoLogicParser.operandTokenVector().at( iAlgorithm ).tokenName );
445  int error( -1 );
446  const bool decision( l1BeforeMask_ ? l1Gt_->decisionBeforeMask( event, l1AlgoName, error ) : l1Gt_->decisionAfterMask( event, l1AlgoName, error ) );
447  // Error checks
448  if ( error != 0 ) {
449  if ( verbose_ > 1 ) {
450  if ( error == 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "L1 algorithm \"" << l1AlgoName << "\" does not exist in the L1 menu ==> decision: " << errorReplyL1_;
451  else edm::LogWarning( "GenericTriggerEventFlag" ) << "L1 algorithm \"" << l1AlgoName << "\" received error code " << error << " from L1GtUtils::decisionBeforeMask ==> decision: " << errorReplyL1_;
452  }
453  l1AlgoLogicParser.operandTokenVector().at( iAlgorithm ).tokenResult = errorReplyL1_;
454  continue;
455  }
456  // Manipulate algo decision as stored in the parser
457  l1AlgoLogicParser.operandTokenVector().at( iAlgorithm ).tokenResult = decision;
458  }
459 
460  // Return decision
461  const bool l1Decision( l1AlgoLogicParser.expressionResult() );
462  return negExpr ? ( ! l1Decision ) : l1Decision;
463 
464 }
bool negate(std::string &word) const
Checks for negated words.
std::unique_ptr< L1GtUtils > l1Gt_
std::string GenericTriggerEventFlag::expandLogicalExpression ( const std::vector< std::string > &  target,
const std::string &  expr,
bool  useAnd = false 
) const
private

Expand wild-carded logical expressions, giving version postfixes priority.

Definition at line 555 of file GenericTriggerEventFlag.cc.

References hltConfig_, HLTConfigProvider::matched(), HLTConfigProvider::restoreVersion(), AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

Referenced by initRun().

556 {
557 
558  // Find matching entries in the menu
559  std::vector< std::string > matched;
560  const std::string versionWildcard( "_v*" );
561  if ( expr.substr( expr.size() - versionWildcard.size() ) == versionWildcard ) {
562  const std::string exprBase( expr.substr( 0, expr.size() - versionWildcard.size() ) );
563  matched = hltConfig_.restoreVersion( targets, exprBase );
564  } else {
565  matched = hltConfig_.matched( targets, expr );
566  }
567 
568  // Return input, if no match is found
569  if ( matched.empty() ) {
570  if ( verbose_ > 1 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "Logical expression: \"" << expr << "\" could not be resolved";
571  return expr;
572  }
573 
574  // Compose logical expression
575  std::string expanded( "(" );
576  for ( unsigned iVers = 0; iVers < matched.size(); ++iVers ) {
577  if ( iVers > 0 ) expanded.append( useAnd ? " AND " : " OR " );
578  expanded.append( matched.at( iVers ) );
579  }
580  expanded.append( ")" );
581  if ( verbose_ > 1 ) edm::LogInfo( "GenericTriggerEventFlag" ) << "Logical expression: \"" << expr << "\"\n"
582  << " --> expanded to \"" << expanded << "\"";
583 
584  return expanded;
585 
586 }
static const std::vector< std::string > matched(const std::vector< std::string > &inputs, const std::string &pattern)
regexp processing
static const std::vector< std::string > restoreVersion(const std::vector< std::string > &inputs, const std::string &trigger)
std::vector< std::string > GenericTriggerEventFlag::expressionsFromDB ( const std::string &  key,
const edm::EventSetup setup 
)

Reads and returns logical expressions from DB.

Definition at line 606 of file GenericTriggerEventFlag.cc.

References configError_, dbLabel_, emptyKeyError_, edm::EventSetup::get(), HLT_25ns14e33_v1_cff::labels, and verbose_.

Referenced by initRun().

607 {
608 
609  if ( key.size() == 0 ) return std::vector< std::string >( 1, emptyKeyError_ );
610  edm::ESHandle< AlCaRecoTriggerBits > logicalExpressions;
611  std::vector< edm::eventsetup::DataKey > labels;
612  setup.get< AlCaRecoTriggerBitsRcd >().fillRegisteredDataKeys( labels );
613  std::vector< edm::eventsetup::DataKey >::const_iterator iKey = labels.begin();
614  while ( iKey != labels.end() && iKey->name().value() != dbLabel_ ) ++iKey;
615  if ( iKey == labels.end() ) {
616  if ( verbose_ > 0 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "Label " << dbLabel_ << " not found in DB for 'AlCaRecoTriggerBitsRcd'";
617  return std::vector< std::string >( 1, configError_ );
618  }
619  setup.get< AlCaRecoTriggerBitsRcd >().get( dbLabel_, logicalExpressions );
620  const std::map< std::string, std::string > & expressionMap = logicalExpressions->m_alcarecoToTrig;
621  std::map< std::string, std::string >::const_iterator listIter = expressionMap.find( key );
622  if ( listIter == expressionMap.end() ) {
623  if ( verbose_ > 0 ) edm::LogWarning( "GenericTriggerEventFlag" ) << "No logical expressions found under key " << key << " in 'AlCaRecoTriggerBitsRcd'";
624  return std::vector< std::string >( 1, configError_ );
625  }
626  return logicalExpressions->decompose( listIter->second );
627 
628 }
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
const T & get() const
Definition: EventSetup.h:56
std::string GenericTriggerEventFlag::gtDBKey ( )
inline

Definition at line 134 of file GenericTriggerEventFlag.h.

References gtDBKey_.

134 { return gtDBKey_ ; } // can be empty
std::string GenericTriggerEventFlag::hltDBKey ( )
inline

Definition at line 136 of file GenericTriggerEventFlag.h.

References hltDBKey_.

136 { return hltDBKey_; } // can be empty
void GenericTriggerEventFlag::initRun ( const edm::Run run,
const edm::EventSetup setup 
)

To be called from beginRun() methods.

Definition at line 129 of file GenericTriggerEventFlag.cc.

References edm::ESWatcher< T >::check(), configError_, edm::InputTag::encode(), expandLogicalExpression(), expressionsFromDB(), edm::EventSetup::get(), gtDBKey_, gtLogicalExpressions_, hltConfig_, hltConfigInit_, hltDBKey_, hltInputTag_, hltLogicalExpressions_, hltLogicalExpressionsCache_, HLTConfigProvider::init(), l1DBKey_, l1Gt_, l1LogicalExpressions_, l1LogicalExpressionsCache_, onGt_, onHlt_, onL1_, edm::InputTag::process(), HLTConfigProvider::size(), AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::triggerNames(), useL1EventSetup(), useL1GtTriggerMenuLite(), verbose_, and watchDB_.

Referenced by dEdxAnalyzer::bookHistograms(), TrackingMonitor::bookHistograms(), LogMessageMonitor::bookHistograms(), MonitorTrackResiduals::dqmBeginRun(), dEdxHitAnalyzer::dqmBeginRun(), SiStripMonitorCluster::dqmBeginRun(), SiStripMonitorTrack::dqmBeginRun(), and TauTagValidation::dqmBeginRun().

130 {
131 
132  if ( watchDB_->check( setup ) ) {
133  if ( onGt_ && gtDBKey_.size() > 0 ) {
134  const std::vector< std::string > exprs( expressionsFromDB( gtDBKey_, setup ) );
135  if ( exprs.empty() || exprs.at( 0 ) != configError_ ) gtLogicalExpressions_ = exprs;
136  }
137  if ( onL1_ && l1DBKey_.size() > 0 ) {
138  const std::vector< std::string > exprs( expressionsFromDB( l1DBKey_, setup ) );
139  if ( exprs.empty() || exprs.at( 0 ) != configError_ ) l1LogicalExpressionsCache_ = exprs;
140  }
141  if ( onHlt_ && hltDBKey_.size() > 0 ) {
142  const std::vector< std::string > exprs( expressionsFromDB( hltDBKey_, setup ) );
143  if ( exprs.empty() || exprs.at( 0 ) != configError_ ) hltLogicalExpressionsCache_ = exprs;
144  }
145  }
146 
147  // Re-initialise starting valuse before wild-card expansion
150 
151  hltConfigInit_ = false;
152  if ( onHlt_ ) {
153  if ( hltInputTag_.process().size() == 0 ) {
154  if ( verbose_ > 0 ) edm::LogError( "GenericTriggerEventFlag" ) << "HLT TriggerResults InputTag \"" << hltInputTag_.encode() << "\" specifies no process";
155  } else {
156  bool hltChanged( false );
157  if ( ! hltConfig_.init( run, setup, hltInputTag_.process(), hltChanged ) ) {
158  if ( verbose_ > 0 ) edm::LogError( "GenericTriggerEventFlag" ) << "HLT config initialization error with process name \"" << hltInputTag_.process() << "\"";
159  } else if ( hltConfig_.size() <= 0 ) {
160  if ( verbose_ > 0 ) edm::LogError( "GenericTriggerEventFlag" ) << "HLT config size error";
161  } else hltConfigInit_ = true;
162  }
163  }
164 
165  // Expand version wild-cards in HLT logical expressions
166  // L1
167  if ( onL1_ ) {
168  // build vector of algo names
169  l1Gt_->getL1GtRunCache( run, setup, useL1EventSetup, useL1GtTriggerMenuLite );
170  edm::ESHandle< L1GtTriggerMenu > handleL1GtTriggerMenu;
171  setup.get< L1GtTriggerMenuRcd >().get( handleL1GtTriggerMenu );
172 // L1GtTriggerMenu l1GtTriggerMenu( *handleL1GtTriggerMenu );
173  std::vector< std::string > algoNames;
174 // const AlgorithmMap l1GtPhys( l1GtTriggerMenu.gtAlgorithmMap() );
175  const AlgorithmMap l1GtPhys( handleL1GtTriggerMenu->gtAlgorithmMap() );
176  for ( CItAlgo iAlgo = l1GtPhys.begin(); iAlgo != l1GtPhys.end(); ++iAlgo ) {
177  algoNames.push_back( iAlgo->second.algoName() );
178  }
179 // const AlgorithmMap l1GtTech( l1GtTriggerMenu.gtTechnicalTriggerMap() );
180  const AlgorithmMap l1GtTech( handleL1GtTriggerMenu->gtTechnicalTriggerMap() );
181  for ( CItAlgo iAlgo = l1GtTech.begin(); iAlgo != l1GtTech.end(); ++iAlgo ) {
182  algoNames.push_back( iAlgo->second.algoName() );
183  }
184  for ( unsigned iExpr = 0; iExpr < l1LogicalExpressions_.size(); ++iExpr ) {
185  std::string l1LogicalExpression( l1LogicalExpressions_.at( iExpr ) );
186  L1GtLogicParser l1AlgoLogicParser( l1LogicalExpression );
187  // Loop over algorithms
188  for ( size_t iAlgo = 0; iAlgo < l1AlgoLogicParser.operandTokenVector().size(); ++iAlgo ) {
189  const std::string l1AlgoName( l1AlgoLogicParser.operandTokenVector().at( iAlgo ).tokenName );
190  if ( l1AlgoName.find( '*' ) != std::string::npos ) {
191  l1LogicalExpression.replace( l1LogicalExpression.find( l1AlgoName ), l1AlgoName.size(), expandLogicalExpression( algoNames, l1AlgoName ) );
192  }
193  }
194  l1LogicalExpressions_[ iExpr ] = l1LogicalExpression;
195  }
196  }
197  // HLT
198  if ( hltConfigInit_ ) {
199  for ( unsigned iExpr = 0; iExpr < hltLogicalExpressions_.size(); ++iExpr ) {
200  std::string hltLogicalExpression( hltLogicalExpressions_.at( iExpr ) );
201  L1GtLogicParser hltAlgoLogicParser( hltLogicalExpression );
202  // Loop over paths
203  for ( size_t iPath = 0; iPath < hltAlgoLogicParser.operandTokenVector().size(); ++iPath ) {
204  const std::string hltPathName( hltAlgoLogicParser.operandTokenVector().at( iPath ).tokenName );
205  if ( hltPathName.find( '*' ) != std::string::npos ) {
206  hltLogicalExpression.replace( hltLogicalExpression.find( hltPathName ), hltPathName.size(), expandLogicalExpression( hltConfig_.triggerNames(), hltPathName ) );
207  }
208  }
209  hltLogicalExpressions_[ iExpr ] = hltLogicalExpression;
210  }
211  }
212 
213 }
unsigned int size() const
number of trigger paths in trigger table
static const bool useL1GtTriggerMenuLite(false)
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
std::vector< std::string > gtLogicalExpressions_
std::vector< std::string > hltLogicalExpressions_
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::string encode() const
Definition: InputTag.cc:164
std::unique_ptr< L1GtUtils > l1Gt_
std::vector< std::string > l1LogicalExpressionsCache_
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
std::vector< std::string > expressionsFromDB(const std::string &key, const edm::EventSetup &setup)
Reads and returns logical expressions from DB.
static const bool useL1EventSetup(true)
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_
std::vector< std::string > hltLogicalExpressionsCache_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const T & get() const
Definition: EventSetup.h:56
std::vector< std::string > l1LogicalExpressions_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
std::string const & process() const
Definition: InputTag.h:47
std::string expandLogicalExpression(const std::vector< std::string > &target, const std::string &expr, bool useAnd=false) const
Expand wild-carded logical expressions, giving version postfixes priority.
std::string GenericTriggerEventFlag::l1DBKey ( )
inline

Definition at line 135 of file GenericTriggerEventFlag.h.

References l1DBKey_.

135 { return l1DBKey_ ; } // can be empty
bool GenericTriggerEventFlag::negate ( std::string &  word) const
private

Checks for negated words.

Definition at line 591 of file GenericTriggerEventFlag.cc.

Referenced by acceptGtLogicalExpression(), acceptHltLogicalExpression(), and acceptL1LogicalExpression().

592 {
593 
594  bool negate( false );
595  if ( word.at( 0 ) == '~' ) {
596  negate = true;
597  word.erase( 0, 1 );
598  }
599  return negate;
600 
601 }
bool negate(std::string &word) const
Checks for negated words.
bool GenericTriggerEventFlag::off ( )
inline

Definition at line 100 of file GenericTriggerEventFlag.h.

References on_.

100 { return ( ! on_ ); }
bool GenericTriggerEventFlag::on ( )
inline

Member Data Documentation

bool GenericTriggerEventFlag::andOr_
private
bool GenericTriggerEventFlag::andOrDcs_
private

Definition at line 51 of file GenericTriggerEventFlag.h.

Referenced by acceptDcs(), and GenericTriggerEventFlag().

bool GenericTriggerEventFlag::andOrGt_
private

Definition at line 56 of file GenericTriggerEventFlag.h.

Referenced by acceptGt(), and GenericTriggerEventFlag().

bool GenericTriggerEventFlag::andOrHlt_
private

Definition at line 70 of file GenericTriggerEventFlag.h.

Referenced by acceptHlt(), and GenericTriggerEventFlag().

bool GenericTriggerEventFlag::andOrL1_
private

Definition at line 64 of file GenericTriggerEventFlag.h.

Referenced by acceptL1(), and GenericTriggerEventFlag().

const std::string GenericTriggerEventFlag::configError_
private

Definition at line 84 of file GenericTriggerEventFlag.h.

Referenced by expressionsFromDB(), and initRun().

std::string GenericTriggerEventFlag::dbLabel_
private

Definition at line 49 of file GenericTriggerEventFlag.h.

Referenced by expressionsFromDB(), and GenericTriggerEventFlag().

edm::InputTag GenericTriggerEventFlag::dcsInputTag_
private

Definition at line 52 of file GenericTriggerEventFlag.h.

Referenced by acceptDcs(), and GenericTriggerEventFlag().

edm::EDGetTokenT< DcsStatusCollection > GenericTriggerEventFlag::dcsInputToken_
private

Definition at line 53 of file GenericTriggerEventFlag.h.

Referenced by acceptDcs(), and GenericTriggerEventFlag().

std::vector< int > GenericTriggerEventFlag::dcsPartitions_
private

Definition at line 54 of file GenericTriggerEventFlag.h.

Referenced by acceptDcs(), and GenericTriggerEventFlag().

const std::string GenericTriggerEventFlag::emptyKeyError_
private

Definition at line 85 of file GenericTriggerEventFlag.h.

Referenced by expressionsFromDB().

bool GenericTriggerEventFlag::errorReplyDcs_
private
bool GenericTriggerEventFlag::errorReplyGt_
private

Definition at line 63 of file GenericTriggerEventFlag.h.

Referenced by acceptGtLogicalExpression(), and GenericTriggerEventFlag().

bool GenericTriggerEventFlag::errorReplyHlt_
private
bool GenericTriggerEventFlag::errorReplyL1_
private

Definition at line 69 of file GenericTriggerEventFlag.h.

Referenced by acceptL1LogicalExpression(), and GenericTriggerEventFlag().

std::string GenericTriggerEventFlag::gtDBKey_
private

Definition at line 61 of file GenericTriggerEventFlag.h.

Referenced by GenericTriggerEventFlag(), gtDBKey(), and initRun().

edm::InputTag GenericTriggerEventFlag::gtEvmInputTag_
private

Definition at line 59 of file GenericTriggerEventFlag.h.

Referenced by acceptGtLogicalExpression(), and GenericTriggerEventFlag().

edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > GenericTriggerEventFlag::gtEvmInputToken_
private

Definition at line 60 of file GenericTriggerEventFlag.h.

Referenced by acceptGtLogicalExpression(), and GenericTriggerEventFlag().

edm::InputTag GenericTriggerEventFlag::gtInputTag_
private

Definition at line 57 of file GenericTriggerEventFlag.h.

Referenced by acceptGtLogicalExpression(), and GenericTriggerEventFlag().

edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > GenericTriggerEventFlag::gtInputToken_
private

Definition at line 58 of file GenericTriggerEventFlag.h.

Referenced by acceptGtLogicalExpression(), and GenericTriggerEventFlag().

std::vector< std::string > GenericTriggerEventFlag::gtLogicalExpressions_
private

Definition at line 62 of file GenericTriggerEventFlag.h.

Referenced by acceptGt(), GenericTriggerEventFlag(), and initRun().

HLTConfigProvider GenericTriggerEventFlag::hltConfig_
private
bool GenericTriggerEventFlag::hltConfigInit_
private

Definition at line 46 of file GenericTriggerEventFlag.h.

Referenced by acceptHlt(), and initRun().

std::string GenericTriggerEventFlag::hltDBKey_
private

Definition at line 73 of file GenericTriggerEventFlag.h.

Referenced by GenericTriggerEventFlag(), hltDBKey(), and initRun().

edm::InputTag GenericTriggerEventFlag::hltInputTag_
private
edm::EDGetTokenT< edm::TriggerResults > GenericTriggerEventFlag::hltInputToken_
private

Definition at line 72 of file GenericTriggerEventFlag.h.

Referenced by acceptHlt(), and GenericTriggerEventFlag().

std::vector< std::string > GenericTriggerEventFlag::hltLogicalExpressions_
private

Definition at line 75 of file GenericTriggerEventFlag.h.

Referenced by acceptHlt(), and initRun().

std::vector< std::string > GenericTriggerEventFlag::hltLogicalExpressionsCache_
private

Definition at line 74 of file GenericTriggerEventFlag.h.

Referenced by GenericTriggerEventFlag(), and initRun().

bool GenericTriggerEventFlag::l1BeforeMask_
private

Definition at line 65 of file GenericTriggerEventFlag.h.

Referenced by acceptL1LogicalExpression(), and GenericTriggerEventFlag().

std::string GenericTriggerEventFlag::l1DBKey_
private

Definition at line 66 of file GenericTriggerEventFlag.h.

Referenced by GenericTriggerEventFlag(), initRun(), and l1DBKey().

std::unique_ptr<L1GtUtils> GenericTriggerEventFlag::l1Gt_
private
std::vector< std::string > GenericTriggerEventFlag::l1LogicalExpressions_
private

Definition at line 68 of file GenericTriggerEventFlag.h.

Referenced by acceptL1(), and initRun().

std::vector< std::string > GenericTriggerEventFlag::l1LogicalExpressionsCache_
private

Definition at line 67 of file GenericTriggerEventFlag.h.

Referenced by GenericTriggerEventFlag(), and initRun().

bool GenericTriggerEventFlag::on_
private
bool GenericTriggerEventFlag::onDcs_
private

Definition at line 79 of file GenericTriggerEventFlag.h.

Referenced by acceptDcs(), and GenericTriggerEventFlag().

bool GenericTriggerEventFlag::onGt_
private

Definition at line 80 of file GenericTriggerEventFlag.h.

Referenced by acceptGt(), GenericTriggerEventFlag(), and initRun().

bool GenericTriggerEventFlag::onHlt_
private

Definition at line 82 of file GenericTriggerEventFlag.h.

Referenced by acceptHlt(), GenericTriggerEventFlag(), and initRun().

bool GenericTriggerEventFlag::onL1_
private

Definition at line 81 of file GenericTriggerEventFlag.h.

Referenced by acceptL1(), GenericTriggerEventFlag(), and initRun().

unsigned GenericTriggerEventFlag::verbose_
private
edm::ESWatcher< AlCaRecoTriggerBitsRcd >* GenericTriggerEventFlag::watchDB_
private