25 configError_(
"CONFIG_ERROR") {
27 if (config.
exists(
"andOr")) {
38 if (config.
exists(
"andOrDcs")) {
46 if (config.
exists(
"andOrGt")) {
51 if (config.
exists(
"gtDBKey"))
56 if (config.
exists(
"andOrL1")) {
60 if (config.
exists(
"l1DBKey"))
65 if (config.
exists(
"andOrHlt")) {
70 if (config.
exists(
"hltDBKey"))
114 <<
"\" specifies no process";
116 bool hltChanged(
false);
118 edm::LogError(
"TriggerHelper") <<
"HLT config initialization error with process name \"" 155 for (std::vector<int>::const_iterator partitionNumber =
dcsPartitions_.begin();
163 for (std::vector<int>::const_iterator partitionNumber =
dcsPartitions_.begin();
174 switch (dcsPartition) {
201 edm::LogError(
"TriggerHelper") <<
"DCS partition number \"" << dcsPartition
207 return dcsStatus->at(0).ready(dcsPartition);
220 if (!gtReadoutRecord.
isValid()) {
231 ++gtLogicalExpression) {
239 ++gtLogicalExpression) {
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) {
270 if (gtStatusBit ==
"PhysDecl" || gtStatusBit ==
"PhysicsDeclared") {
273 edm::LogError(
"TriggerHelper") <<
"GT status bit \"" << gtStatusBit
282 return negExpr ? (!gtDecision) : gtDecision;
292 l1Gt_->retrieveL1EventSetup(setup);
298 ++l1LogicalExpression) {
306 ++l1LogicalExpression) {
317 if (l1LogicalExpression.empty()) {
323 bool negExpr(
negate(l1LogicalExpression));
324 if (negExpr && l1LogicalExpression.empty()) {
332 for (
size_t iAlgorithm = 0; iAlgorithm < l1AlgoLogicParser.
operandTokenVector().size(); ++iAlgorithm) {
335 const bool decision(
l1Gt_->decision(event, l1AlgoName, error));
339 edm::LogError(
"TriggerHelper") <<
"L1 algorithm \"" << l1AlgoName
340 <<
"\" does not exist in the L1 menu ==> decision: " <<
errorReplyL1_;
342 edm::LogError(
"TriggerHelper") <<
"L1 algorithm \"" << l1AlgoName <<
"\" received error code " << error
343 <<
" from L1GtUtils::decisionBeforeMask ==> decision: " <<
errorReplyL1_;
353 return negExpr ? (!l1Decision) : l1Decision;
372 if (!hltTriggerResults.
isValid()) {
382 ++hltLogicalExpression) {
390 ++hltLogicalExpression) {
401 if (hltLogicalExpression.empty()) {
407 bool negExpr(
negate(hltLogicalExpression));
408 if (negExpr && hltLogicalExpression.empty()) {
416 for (
size_t iPath = 0; iPath < hltAlgoLogicParser.
operandTokenVector().size(); ++iPath) {
421 edm::LogError(
"TriggerHelper") <<
"HLT path \"" << hltPathName <<
"\" is not found in process " 426 if (hltTriggerResults->
error(indexPath)) {
432 const bool decision(hltTriggerResults->
accept(indexPath));
438 return negExpr ? (!hltDecision) : hltDecision;
445 const std::map<std::string, std::string> &expressionMap = logicalExpressions->
m_alcarecoToTrig;
446 std::map<std::string, std::string>::const_iterator listIter = expressionMap.find(key);
447 if (listIter == expressionMap.end()) {
448 edm::LogError(
"TriggerHelper") <<
"No logical expressions found under key " << key
449 <<
" in 'AlCaRecoTriggerBitsRcd'";
452 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::map< std::string, std::string > m_alcarecoToTrig
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?
std::vector< std::string > l1LogicalExpressions_
bool accept() const
Has at least one path accepted the event?
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
def setup(process, global_tag, zero_tesla=False)
std::vector< std::string > decompose(const std::string &concatPaths) const
Decompose one value of map from concatenated string.
const std::string configError_
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_
TriggerHelper(const edm::ParameterSet &config, edm::ConsumesCollector &&iC, T &module)
std::vector< std::string > hltLogicalExpressions_
~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
std::vector< std::string > gtLogicalExpressions_
bool acceptHlt(const edm::Event &event)
bool error() const
Has any path encountered an error (exception)
edm::InputTag hltInputTag_
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)
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
const cms_uint16_t physicsDeclared() const
get/set "physics declared" bit
HLTConfigProvider hltConfig_
edm::InputTag gtInputTag_
std::vector< int > dcsPartitions_
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)
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.
virtual const bool expressionResult() const
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.