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
L1GtUtils::LogicalExpressionL1Results Class Reference

#include <L1GtUtils.h>

Public Member Functions

const std::vector< std::pair
< std::string, bool > > & 
decisionsAfterMask ()
 
const std::vector< std::pair
< std::string, bool > > & 
decisionsBeforeMask ()
 
const std::vector< std::pair
< std::string, int > > & 
errorCodes (const edm::Event &)
 
const std::vector
< L1GtLogicParser::OperandToken > & 
expL1Triggers ()
 list of triggers in the logical expression, trigger decisions, prescale factors and masks, error codes More...
 
bool isValid ()
 return true if the logical expression is syntactically correct More...
 
 LogicalExpressionL1Results (const std::string &, L1GtUtils &)
 constructor(s) More...
 
 LogicalExpressionL1Results (const std::string &, L1GtUtils &, const edm::InputTag &, const edm::InputTag &)
 
const int logicalExpressionRunUpdate (const edm::Run &, const edm::EventSetup &, const std::string &)
 
const int logicalExpressionRunUpdate (const edm::Run &, const edm::EventSetup &)
 keep the logical expression given in the previous run More...
 
const std::vector< std::pair
< std::string, int > > & 
prescaleFactors ()
 
const std::vector< std::pair
< std::string, int > > & 
triggerMasks ()
 
 ~LogicalExpressionL1Results ()
 destructor More...
 

Private Member Functions

bool initialize ()
 
void l1Results (const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag)
 
void reset (const std::vector< std::pair< std::string, bool > > &) const
 reset for each L1 trigger the value from pair.second More...
 
void reset (const std::vector< std::pair< std::string, int > > &) const
 

Private Attributes

std::vector< std::pair
< std::string, bool > > 
m_decisionsAfterMask
 
std::vector< std::pair
< std::string, bool > > 
m_decisionsBeforeMask
 
std::vector< std::pair
< std::string, int > > 
m_errorCodes
 
bool m_expBitsTechTrigger
 flag true, if the logical expression is built from technical trigger bits More...
 
std::vector
< L1GtLogicParser::OperandToken
m_expL1Triggers
 
size_t m_expL1TriggersSize
 
std::vector
< L1GtUtils::TriggerCategory
m_expTriggerCategory
 trigger category for each L1 trigger in the logical expression More...
 
std::vector< bool > m_expTriggerInMenu
 
int m_l1ConfCode
 code for L1 trigger configuration More...
 
bool m_l1GtInputTagsFromProv
 
edm::InputTag m_l1GtReadoutRecordInputTag
 
edm::InputTag m_l1GtRecordInputTag
 
L1GtUtilsm_l1GtUtils
 
bool m_l1ResultsAlreadyCalled
 set to true if the method l1Results was called once More...
 
std::string m_logicalExpression
 private members as input parameters More...
 
std::vector< std::pair
< std::string, int > > 
m_prescaleFactors
 
std::vector< std::pair
< std::string, int > > 
m_triggerMasks
 
bool m_validL1Configuration
 true if valid L1 configuration - if not, reset all quantities and return More...
 
bool m_validLogicalExpression
 true if the logical expression uses accepted L1GtLogicParser operators More...
 

Detailed Description

Definition at line 77 of file L1GtUtils.h.

Constructor & Destructor Documentation

L1GtUtils::LogicalExpressionL1Results::LogicalExpressionL1Results ( const std::string &  expression,
L1GtUtils l1GtUtils 
)
explicit

constructor(s)

trigger decisions, prescale factors and masks from GT record(s) with input tag(s) from provenance

Definition at line 2420 of file L1GtUtils.cc.

References initialize().

2421  :
2422 
2423  m_logicalExpression(expression),
2424 
2425  m_l1GtUtils(l1GtUtils),
2426 
2428 
2430 
2431  m_l1ConfCode(-1),
2432 
2433  m_validL1Configuration(false),
2434 
2435  m_validLogicalExpression(false),
2436 
2438 
2439  m_l1ResultsAlreadyCalled(false),
2440 
2442 
2443  m_expBitsTechTrigger(false) {
2444 
2445  initialize();
2446 }
bool m_validLogicalExpression
true if the logical expression uses accepted L1GtLogicParser operators
Definition: L1GtUtils.h:161
int m_l1ConfCode
code for L1 trigger configuration
Definition: L1GtUtils.h:155
std::string m_logicalExpression
private members as input parameters
Definition: L1GtUtils.h:143
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:168
bool m_expBitsTechTrigger
flag true, if the logical expression is built from technical trigger bits
Definition: L1GtUtils.h:177
bool m_validL1Configuration
true if valid L1 configuration - if not, reset all quantities and return
Definition: L1GtUtils.h:158
L1GtUtils::LogicalExpressionL1Results::LogicalExpressionL1Results ( const std::string &  expression,
L1GtUtils l1GtUtils,
const edm::InputTag l1GtRecordInputTag,
const edm::InputTag l1GtReadoutRecordInputTag 
)
explicit

trigger decisions, prescale factors and masks from GT record(s) with input tag(s) explicitly given

Definition at line 2448 of file L1GtUtils.cc.

References initialize().

2451  :
2452 
2453  m_logicalExpression(expression),
2454 
2455  m_l1GtUtils(l1GtUtils),
2456 
2457  m_l1GtRecordInputTag(l1GtRecordInputTag),
2458 
2459  m_l1GtReadoutRecordInputTag(l1GtReadoutRecordInputTag),
2460 
2461  m_l1ConfCode(-1),
2462 
2463  m_validL1Configuration(false),
2464 
2465  m_validLogicalExpression(false),
2466 
2467  m_l1GtInputTagsFromProv(false),
2468 
2469  m_l1ResultsAlreadyCalled(false),
2470 
2472 
2473  m_expBitsTechTrigger(false) {
2474 
2475  initialize();
2476 }
bool m_validLogicalExpression
true if the logical expression uses accepted L1GtLogicParser operators
Definition: L1GtUtils.h:161
int m_l1ConfCode
code for L1 trigger configuration
Definition: L1GtUtils.h:155
std::string m_logicalExpression
private members as input parameters
Definition: L1GtUtils.h:143
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:168
bool m_expBitsTechTrigger
flag true, if the logical expression is built from technical trigger bits
Definition: L1GtUtils.h:177
bool m_validL1Configuration
true if valid L1 configuration - if not, reset all quantities and return
Definition: L1GtUtils.h:158
L1GtUtils::LogicalExpressionL1Results::~LogicalExpressionL1Results ( )

destructor

Definition at line 2479 of file L1GtUtils.cc.

2479  {
2480 
2481  // empty
2482 
2483 }

Member Function Documentation

const std::vector< std::pair< std::string, bool > > & L1GtUtils::LogicalExpressionL1Results::decisionsAfterMask ( )

Definition at line 2708 of file L1GtUtils.cc.

References edm::hlt::Exception.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

2708  {
2709 
2710  // throw an exception if the result is not computed once per event - user usage error
2711  if (!m_l1ResultsAlreadyCalled) {
2712  throw cms::Exception("FailModule") << "\nUsage error: "
2713  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2714  << std::endl;
2715  }
2716 
2717  return m_decisionsAfterMask;
2718 
2719 }
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:168
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:185
const std::vector< std::pair< std::string, bool > > & L1GtUtils::LogicalExpressionL1Results::decisionsBeforeMask ( )

Definition at line 2695 of file L1GtUtils.cc.

References edm::hlt::Exception.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

2695  {
2696 
2697  // throw an exception if the result is not computed once per event - user usage error
2698  if (!m_l1ResultsAlreadyCalled) {
2699  throw cms::Exception("FailModule") << "\nUsage error: "
2700  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2701  << std::endl;
2702  }
2703 
2704  return m_decisionsBeforeMask;
2705 
2706 }
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:184
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:168
const std::vector< std::pair< std::string, int > > & L1GtUtils::LogicalExpressionL1Results::errorCodes ( const edm::Event iEvent)

Definition at line 2747 of file L1GtUtils.cc.

References L1GtUtils::l1Results(), and reset().

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore(), and HLTConfigProvider::prescaleValuesInDetail().

2748  {
2749 
2750  m_l1ResultsAlreadyCalled = false;
2751 
2752  // if not a valid L1 configuration, reset all quantities and return
2753  if (!m_validL1Configuration) {
2759 
2760  m_l1ResultsAlreadyCalled = true;
2761  return m_errorCodes;
2762 
2763  }
2764 
2766 
2769 
2770  } else {
2771 
2773  }
2774 
2775  m_l1ResultsAlreadyCalled = true;
2776 
2777  return m_errorCodes;
2778 
2779 }
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:184
const edm::InputTag & provL1GtReadoutRecordInputTag()
Definition: L1GtUtils.h:242
void l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag)
Definition: L1GtUtils.cc:2797
const edm::InputTag & provL1GtRecordInputTag()
return the input tags found from provenance
Definition: L1GtUtils.h:238
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:188
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:187
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:186
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:168
void reset(const std::vector< std::pair< std::string, bool > > &) const
reset for each L1 trigger the value from pair.second
Definition: L1GtUtils.cc:2781
bool m_validL1Configuration
true if valid L1 configuration - if not, reset all quantities and return
Definition: L1GtUtils.h:158
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:185
const std::vector<L1GtLogicParser::OperandToken>& L1GtUtils::LogicalExpressionL1Results::expL1Triggers ( )
inline

list of triggers in the logical expression, trigger decisions, prescale factors and masks, error codes

Definition at line 112 of file L1GtUtils.h.

References m_expL1Triggers.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

112  {
113  return m_expL1Triggers;
114  }
std::vector< L1GtLogicParser::OperandToken > m_expL1Triggers
Definition: L1GtUtils.h:170
bool L1GtUtils::LogicalExpressionL1Results::initialize ( )
private

parse the logical expression, initialize the private members to required size such that one can just reset them

Definition at line 2485 of file L1GtUtils.cc.

References L1GtUtils::AlgorithmTrigger, cms::Exception::explainSelf(), cmsPerfPublish::fail(), first, LogDebug, LogTrace, L1GtLogicParser::operandTokenVector(), edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, and cms::Exception::what().

Referenced by LogicalExpressionL1Results().

2485  {
2486 
2487  // get the vector of triggers corresponding to the logical expression
2488  // check also the logical expression - add/remove spaces if needed
2489 
2490  try {
2491 
2492  L1GtLogicParser m_l1AlgoLogicParser = L1GtLogicParser(
2494 
2495  // list of L1 triggers from the logical expression
2496  m_expL1Triggers = m_l1AlgoLogicParser.operandTokenVector();
2498 
2499  m_validLogicalExpression = true;
2500 
2501  } catch (cms::Exception & ex) {
2502  m_validLogicalExpression = false;
2503 
2504  edm::LogWarning("L1GtUtils") << ex;
2505  edm::LogWarning("L1GtUtils") << ex.what();
2506  edm::LogWarning("L1GtUtils") << ex.explainSelf();
2507  }
2508 
2509  // try to convert the string representing each L1 trigger to bit number,
2510  // to check if the logical expression is constructed from bit numbers
2511  // trade-off: cache it here, irrespective of the expression
2512  // when the conversion fails (normally for the first seed,
2513  // if not expression of technical trigger bits), stop and
2514  // set m_expBitsTechTrigger to false
2515 
2516  m_expBitsTechTrigger = true;
2517 
2518  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2519  const std::string& bitString = (m_expL1Triggers[iTrig]).tokenName;
2520  std::istringstream bitStream(bitString);
2521  int bitInt;
2522 
2523  if ((bitStream >> bitInt).fail()) {
2524 
2525  m_expBitsTechTrigger = false;
2526 
2527  break;
2528  }
2529 
2530  (m_expL1Triggers[iTrig]).tokenNumber = bitInt;
2531 
2532  }
2533 
2534  // resize and fill
2535  m_decisionsBeforeMask.resize(m_expL1TriggersSize);
2536  m_decisionsAfterMask.resize(m_expL1TriggersSize);
2537  m_prescaleFactors.resize(m_expL1TriggersSize);
2538  m_triggerMasks.resize(m_expL1TriggersSize);
2539  m_errorCodes.resize(m_expL1TriggersSize);
2540  m_expTriggerCategory.resize(m_expL1TriggersSize);
2541  m_expTriggerInMenu.resize(m_expL1TriggersSize);
2542 
2543  LogDebug("L1GtUtils") << std::endl;
2544  LogTrace("L1GtUtils") << "\nLogical expression\n " << m_logicalExpression
2545  << "\n has " << m_expL1TriggersSize << " L1 triggers" << std::endl;
2546  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2547 
2548  const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
2549  LogTrace("L1GtUtils") << " " << trigNameOrAlias << std::endl;
2550 
2551  (m_decisionsBeforeMask[iTrig]).first = trigNameOrAlias;
2552  (m_decisionsBeforeMask[iTrig]).second = false;
2553 
2554  (m_decisionsAfterMask[iTrig]).first = trigNameOrAlias;
2555  (m_decisionsAfterMask[iTrig]).second = false;
2556 
2557  (m_prescaleFactors[iTrig]).first = trigNameOrAlias;
2558  (m_prescaleFactors[iTrig]).second = -1;
2559 
2560  (m_triggerMasks[iTrig]).first = trigNameOrAlias;
2561  (m_triggerMasks[iTrig]).second = -1;
2562 
2563  (m_errorCodes[iTrig]).first = trigNameOrAlias;
2564  (m_errorCodes[iTrig]).second = -1;
2565 
2567 
2568  m_expTriggerInMenu[iTrig] = false;
2569 
2570  }
2571  LogTrace("L1GtUtils") << std::endl;
2572 
2573  return true;
2574 
2575 }
#define LogDebug(id)
virtual char const * what() const
Definition: Exception.cc:141
bool m_validLogicalExpression
true if the logical expression uses accepted L1GtLogicParser operators
Definition: L1GtUtils.h:161
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:184
std::vector< L1GtLogicParser::OperandToken > m_expL1Triggers
Definition: L1GtUtils.h:170
virtual std::string explainSelf() const
Definition: Exception.cc:146
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:188
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:187
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:186
std::vector< OperandToken > & operandTokenVector()
return the vector of operand tokens
std::string m_logicalExpression
private members as input parameters
Definition: L1GtUtils.h:143
std::vector< bool > m_expTriggerInMenu
Definition: L1GtUtils.h:181
bool first
Definition: L1TdeRCT.cc:79
#define LogTrace(id)
bool m_expBitsTechTrigger
flag true, if the logical expression is built from technical trigger bits
Definition: L1GtUtils.h:177
std::vector< L1GtUtils::TriggerCategory > m_expTriggerCategory
trigger category for each L1 trigger in the logical expression
Definition: L1GtUtils.h:174
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:185
bool L1GtUtils::LogicalExpressionL1Results::isValid ( void  )
inline

return true if the logical expression is syntactically correct

Definition at line 97 of file L1GtUtils.h.

References m_validLogicalExpression.

Referenced by L1GtAnalyzer::beginRun(), and HLTConfigProvider::prescaleValuesInDetail().

97  {
99  }
bool m_validLogicalExpression
true if the logical expression uses accepted L1GtLogicParser operators
Definition: L1GtUtils.h:161
void L1GtUtils::LogicalExpressionL1Results::l1Results ( const edm::Event iEvent,
const edm::InputTag l1GtRecordInputTag,
const edm::InputTag l1GtReadoutRecordInputTag 
)
private

Definition at line 2797 of file L1GtUtils.cc.

References LogDebug, LogTrace, reset(), edm::second(), and AlCaHLTBitMon_QueryRunRegistry::string.

2799  {
2800 
2801  // reset the vectors before filling them
2807 
2808  // initialization of actual values for each trigger
2809  bool decisionBeforeMaskValue = false;
2810  bool decisionAfterMaskValue = false;
2811  int prescaleFactorValue = -1;
2812  int triggerMaskValue = -1;
2813  int errorCode = -1;
2814 
2815  LogDebug("L1GtUtils") << std::endl;
2816  LogTrace("L1GtUtils") << "\nLogical expression\n " << m_logicalExpression
2817  << std::endl;
2818 
2819  // for each trigger, if it is in the L1 menu, get the prescale factor and trigger mask
2820 
2821  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2822 
2823  const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
2824 
2825  if (m_expTriggerInMenu[iTrig]) {
2826  errorCode = m_l1GtUtils.l1Results(iEvent, l1GtRecordInputTag,
2827  l1GtReadoutRecordInputTag, trigNameOrAlias,
2828  decisionBeforeMaskValue, decisionAfterMaskValue,
2829  prescaleFactorValue, triggerMaskValue);
2830 
2831  if (errorCode != 0) {
2832 
2833  // error while retrieving the results
2834  // for this trigger: set prescale factor to -1, trigger mask to -1
2835 
2836  decisionBeforeMaskValue = false;
2837  decisionAfterMaskValue = false;
2838  prescaleFactorValue = -1;
2839  triggerMaskValue = -1;
2840 
2841  }
2842 
2843  } else {
2844  // no trigger name or trigger alias in the menu, no bits:
2845  // for this trigger: set prescale factor to -1, set the error code
2846 
2847  decisionBeforeMaskValue = false;
2848  decisionAfterMaskValue = false;
2849  prescaleFactorValue = -1;
2850  triggerMaskValue = -1;
2851  errorCode = m_l1ConfCode + 1;
2852 
2853  }
2854 
2855  LogTrace("L1GtUtils") << "\n" << trigNameOrAlias << ":" << std::endl;
2856 
2857  (m_decisionsBeforeMask[iTrig]).second = decisionBeforeMaskValue;
2858  LogTrace("L1GtUtils") << " decision before mask = "
2859  << decisionBeforeMaskValue << std::endl;
2860 
2861  (m_decisionsAfterMask[iTrig]).second = decisionAfterMaskValue;
2862  LogTrace("L1GtUtils") << " decision after mask = "
2863  << decisionAfterMaskValue << std::endl;
2864 
2865  (m_prescaleFactors[iTrig]).second = prescaleFactorValue;
2866  LogTrace("L1GtUtils") << " prescale factor = "
2867  << prescaleFactorValue << std::endl;
2868 
2869  (m_triggerMasks[iTrig]).second = triggerMaskValue;
2870  LogTrace("L1GtUtils") << " trigger mask = "
2871  << triggerMaskValue << std::endl;
2872 
2873  (m_errorCodes[iTrig]).second = errorCode;
2874  LogTrace("L1GtUtils") << " error code = " << errorCode
2875  << std::endl;
2876 
2877  }
2878 
2879  LogDebug("L1GtUtils") << std::endl;
2880 
2881 }
#define LogDebug(id)
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:184
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
std::vector< L1GtLogicParser::OperandToken > m_expL1Triggers
Definition: L1GtUtils.h:170
int m_l1ConfCode
code for L1 trigger configuration
Definition: L1GtUtils.h:155
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:188
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:187
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:186
std::string m_logicalExpression
private members as input parameters
Definition: L1GtUtils.h:143
std::vector< bool > m_expTriggerInMenu
Definition: L1GtUtils.h:181
#define LogTrace(id)
void reset(const std::vector< std::pair< std::string, bool > > &) const
reset for each L1 trigger the value from pair.second
Definition: L1GtUtils.cc:2781
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:185
const int L1GtUtils::LogicalExpressionL1Results::logicalExpressionRunUpdate ( const edm::Run iRun,
const edm::EventSetup evSetup,
const std::string &  logicExpression 
)

update quantities related to the logical expression at the beginning of the run new logical expression, replacing the logical expression given the in previous run

Definition at line 2578 of file L1GtUtils.cc.

Referenced by L1GtAnalyzer::beginRun(), and HLTConfigProvider::prescaleValuesInDetail().

2580  {
2581 
2582  // initialize error code
2583  int errorCode = 0;
2584 
2585  // logical expression has changed - one must re-initialize all quantities related to the logical expression
2586  // and clear the vectors
2587 
2588  m_logicalExpression = logicExpression;
2589  m_validLogicalExpression = false;
2590 
2591  m_l1ResultsAlreadyCalled = false;
2592 
2593  m_expL1TriggersSize = 0;
2594  m_expBitsTechTrigger = false;
2595 
2596  //
2597  m_decisionsBeforeMask.clear();
2598  m_decisionsAfterMask.clear();
2599  m_prescaleFactors.clear();
2600  m_triggerMasks.clear();
2601  m_errorCodes.clear();
2602  m_expTriggerCategory.clear();
2603  m_expTriggerInMenu.clear();
2604 
2605 
2606  initialize();
2607 
2608  //
2609  errorCode = logicalExpressionRunUpdate(iRun, evSetup);
2610 
2611  return errorCode;
2612 
2613 }
bool m_validLogicalExpression
true if the logical expression uses accepted L1GtLogicParser operators
Definition: L1GtUtils.h:161
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:184
const int logicalExpressionRunUpdate(const edm::Run &, const edm::EventSetup &, const std::string &)
Definition: L1GtUtils.cc:2578
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:188
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:187
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:186
std::string m_logicalExpression
private members as input parameters
Definition: L1GtUtils.h:143
std::vector< bool > m_expTriggerInMenu
Definition: L1GtUtils.h:181
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:168
bool m_expBitsTechTrigger
flag true, if the logical expression is built from technical trigger bits
Definition: L1GtUtils.h:177
std::vector< L1GtUtils::TriggerCategory > m_expTriggerCategory
trigger category for each L1 trigger in the logical expression
Definition: L1GtUtils.h:174
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:185
const int L1GtUtils::LogicalExpressionL1Results::logicalExpressionRunUpdate ( const edm::Run iRun,
const edm::EventSetup evSetup 
)

keep the logical expression given in the previous run

Definition at line 2616 of file L1GtUtils.cc.

References L1GtUtils::AlgorithmTrigger, first, AlCaHLTBitMon_QueryRunRegistry::string, and L1GtUtils::TechnicalTrigger.

2617  {
2618 
2619  // check first that a valid L1 configuration was retrieved,
2620  // to prevent also calls before the L1 configuration retrieval
2621 
2622  // initialize error code and L1 configuration code
2623  int errorCode = 0;
2624  int l1ConfCode = 0;
2625 
2626  if (!(m_l1GtUtils.availableL1Configuration(errorCode, l1ConfCode))) {
2627 
2628  m_validL1Configuration = false;
2629  return errorCode;
2630  } else {
2631 
2632  m_validL1Configuration = true;
2633  m_l1ConfCode = l1ConfCode;
2634  }
2635 
2636  // check if the trigger (name of alias) from the logical expression are in the menu,
2637  // if names are used, set tokenNumber to the corresponding bit number
2638  // if technical trigger bits, set tokenName to the corresponding technical trigger name, if
2639  // a technical trigger exists on that bit
2640  // for each trigger, set also the trigger category
2641 
2642  // initialization
2644  int bitNumber = -1;
2645 
2646  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2647 
2648  trigCategory = L1GtUtils::AlgorithmTrigger;
2649  bitNumber = -1;
2650  const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
2651 
2652  if (!m_expBitsTechTrigger) {
2653  const bool triggerInMenu = m_l1GtUtils.l1AlgoTechTrigBitNumber(
2654  trigNameOrAlias, trigCategory, bitNumber);
2655 
2656  (m_expL1Triggers[iTrig]).tokenNumber = bitNumber;
2657  m_expTriggerCategory[iTrig] = trigCategory;
2658  m_expTriggerInMenu[iTrig] = triggerInMenu;
2659 
2660  } else {
2661 
2662  std::string aliasL1Trigger;
2663  std::string nameL1Trigger;
2664 
2665  trigCategory = L1GtUtils::TechnicalTrigger;
2666  bitNumber = (m_expL1Triggers[iTrig]).tokenNumber;
2667 
2668  const bool triggerInMenu = m_l1GtUtils.l1TriggerNameFromBit(
2669  bitNumber, trigCategory, aliasL1Trigger, nameL1Trigger);
2670 
2671  if (!triggerInMenu) {
2672  aliasL1Trigger = "Technical_trigger_bit_"
2673  + (m_expL1Triggers[iTrig]).tokenName + "_empty";
2674  }
2675 
2676  (m_expL1Triggers[iTrig]).tokenName = aliasL1Trigger;
2677  m_expTriggerCategory[iTrig] = trigCategory;
2678  m_expTriggerInMenu[iTrig] = triggerInMenu;
2679 
2680  // put the names of the technical triggers in the returned quantities
2681 
2682  (m_decisionsBeforeMask[iTrig]).first = aliasL1Trigger;
2683  (m_decisionsAfterMask[iTrig]).first = aliasL1Trigger;
2684  (m_prescaleFactors[iTrig]).first = aliasL1Trigger;
2685  (m_triggerMasks[iTrig]).first = aliasL1Trigger;
2686  (m_errorCodes[iTrig]).first = aliasL1Trigger;
2687 
2688  }
2689  }
2690 
2691  return errorCode;
2692 
2693 }
const bool l1TriggerNameFromBit(const int &bitNumber, const TriggerCategory &trigCategory, std::string &aliasL1Trigger, std::string &nameL1Trigger) const
Definition: L1GtUtils.cc:675
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:184
std::vector< L1GtLogicParser::OperandToken > m_expL1Triggers
Definition: L1GtUtils.h:170
int m_l1ConfCode
code for L1 trigger configuration
Definition: L1GtUtils.h:155
const bool l1AlgoTechTrigBitNumber(const std::string &nameAlgoTechTrig, TriggerCategory &trigCategory, int &bitNumber) const
Definition: L1GtUtils.cc:548
TriggerCategory
Definition: L1GtUtils.h:58
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2293
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:188
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:187
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:186
std::vector< bool > m_expTriggerInMenu
Definition: L1GtUtils.h:181
bool first
Definition: L1TdeRCT.cc:79
bool m_expBitsTechTrigger
flag true, if the logical expression is built from technical trigger bits
Definition: L1GtUtils.h:177
std::vector< L1GtUtils::TriggerCategory > m_expTriggerCategory
trigger category for each L1 trigger in the logical expression
Definition: L1GtUtils.h:174
bool m_validL1Configuration
true if valid L1 configuration - if not, reset all quantities and return
Definition: L1GtUtils.h:158
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:185
const std::vector< std::pair< std::string, int > > & L1GtUtils::LogicalExpressionL1Results::prescaleFactors ( )

Definition at line 2721 of file L1GtUtils.cc.

References edm::hlt::Exception.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore(), and HLTConfigProvider::prescaleValuesInDetail().

2721  {
2722 
2723  // throw an exception if the result is not computed once per event - user usage error
2724  if (!m_l1ResultsAlreadyCalled) {
2725  throw cms::Exception("FailModule") << "\nUsage error: "
2726  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2727  << std::endl;
2728  }
2729 
2730  return m_prescaleFactors;
2731 
2732 }
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:186
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:168
void L1GtUtils::LogicalExpressionL1Results::reset ( const std::vector< std::pair< std::string, bool > > &  _pairVector) const
private

reset for each L1 trigger the value from pair.second

Definition at line 2781 of file L1GtUtils.cc.

References edm::second().

2782  {
2783  std::vector<std::pair<std::string, bool> > pairVector = _pairVector;
2784  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2785  (pairVector[iTrig]).second = false;
2786  }
2787 }
U second(std::pair< T, U > const &p)
void L1GtUtils::LogicalExpressionL1Results::reset ( const std::vector< std::pair< std::string, int > > &  _pairVector) const
private

Definition at line 2789 of file L1GtUtils.cc.

References edm::second().

2790  {
2791  std::vector<std::pair<std::string, int> > pairVector = _pairVector;
2792  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2793  (pairVector[iTrig]).second = -1;
2794  }
2795 }
U second(std::pair< T, U > const &p)
const std::vector< std::pair< std::string, int > > & L1GtUtils::LogicalExpressionL1Results::triggerMasks ( )

Definition at line 2734 of file L1GtUtils.cc.

References edm::hlt::Exception.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

2734  {
2735 
2736  // throw an exception if the result is not computed once per event - user usage error
2737  if (!m_l1ResultsAlreadyCalled) {
2738  throw cms::Exception("FailModule") << "\nUsage error: "
2739  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2740  << std::endl;
2741  }
2742 
2743  return m_triggerMasks;
2744 
2745 }
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:187
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:168

Member Data Documentation

std::vector<std::pair<std::string, bool> > L1GtUtils::LogicalExpressionL1Results::m_decisionsAfterMask
private

Definition at line 185 of file L1GtUtils.h.

std::vector<std::pair<std::string, bool> > L1GtUtils::LogicalExpressionL1Results::m_decisionsBeforeMask
private

Definition at line 184 of file L1GtUtils.h.

std::vector<std::pair<std::string, int> > L1GtUtils::LogicalExpressionL1Results::m_errorCodes
private

Definition at line 188 of file L1GtUtils.h.

bool L1GtUtils::LogicalExpressionL1Results::m_expBitsTechTrigger
private

flag true, if the logical expression is built from technical trigger bits

Definition at line 177 of file L1GtUtils.h.

std::vector<L1GtLogicParser::OperandToken> L1GtUtils::LogicalExpressionL1Results::m_expL1Triggers
private

Definition at line 170 of file L1GtUtils.h.

Referenced by expL1Triggers().

size_t L1GtUtils::LogicalExpressionL1Results::m_expL1TriggersSize
private

Definition at line 171 of file L1GtUtils.h.

std::vector<L1GtUtils::TriggerCategory> L1GtUtils::LogicalExpressionL1Results::m_expTriggerCategory
private

trigger category for each L1 trigger in the logical expression

Definition at line 174 of file L1GtUtils.h.

std::vector<bool> L1GtUtils::LogicalExpressionL1Results::m_expTriggerInMenu
private

for each L1 trigger in the logical expression, true if the trigger is found in the current L1 menu

Definition at line 181 of file L1GtUtils.h.

int L1GtUtils::LogicalExpressionL1Results::m_l1ConfCode
private

code for L1 trigger configuration

Definition at line 155 of file L1GtUtils.h.

bool L1GtUtils::LogicalExpressionL1Results::m_l1GtInputTagsFromProv
private

true if input tags for GT records are to be found from provenance (if both input tags from constructors are empty)

Definition at line 165 of file L1GtUtils.h.

edm::InputTag L1GtUtils::LogicalExpressionL1Results::m_l1GtReadoutRecordInputTag
private

Definition at line 148 of file L1GtUtils.h.

edm::InputTag L1GtUtils::LogicalExpressionL1Results::m_l1GtRecordInputTag
private

Definition at line 147 of file L1GtUtils.h.

L1GtUtils& L1GtUtils::LogicalExpressionL1Results::m_l1GtUtils
private

Definition at line 145 of file L1GtUtils.h.

bool L1GtUtils::LogicalExpressionL1Results::m_l1ResultsAlreadyCalled
private

set to true if the method l1Results was called once

Definition at line 168 of file L1GtUtils.h.

std::string L1GtUtils::LogicalExpressionL1Results::m_logicalExpression
private

private members as input parameters

logical expression

Definition at line 143 of file L1GtUtils.h.

std::vector<std::pair<std::string, int> > L1GtUtils::LogicalExpressionL1Results::m_prescaleFactors
private

Definition at line 186 of file L1GtUtils.h.

std::vector<std::pair<std::string, int> > L1GtUtils::LogicalExpressionL1Results::m_triggerMasks
private

Definition at line 187 of file L1GtUtils.h.

bool L1GtUtils::LogicalExpressionL1Results::m_validL1Configuration
private

true if valid L1 configuration - if not, reset all quantities and return

Definition at line 158 of file L1GtUtils.h.

bool L1GtUtils::LogicalExpressionL1Results::m_validLogicalExpression
private

true if the logical expression uses accepted L1GtLogicParser operators

Definition at line 161 of file L1GtUtils.h.

Referenced by isValid().