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 2543 of file L1GtUtils.cc.

References initialize().

2544  :
2545 
2546  m_logicalExpression(expression),
2547 
2548  m_l1GtUtils(l1GtUtils),
2549 
2551 
2553 
2554  m_l1ConfCode(-1),
2555 
2556  m_validL1Configuration(false),
2557 
2558  m_validLogicalExpression(false),
2559 
2561 
2562  m_l1ResultsAlreadyCalled(false),
2563 
2565 
2566  m_expBitsTechTrigger(false) {
2567 
2568  initialize();
2569 }
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 2571 of file L1GtUtils.cc.

References initialize().

2574  :
2575 
2576  m_logicalExpression(expression),
2577 
2578  m_l1GtUtils(l1GtUtils),
2579 
2580  m_l1GtRecordInputTag(l1GtRecordInputTag),
2581 
2582  m_l1GtReadoutRecordInputTag(l1GtReadoutRecordInputTag),
2583 
2584  m_l1ConfCode(-1),
2585 
2586  m_validL1Configuration(false),
2587 
2588  m_validLogicalExpression(false),
2589 
2590  m_l1GtInputTagsFromProv(false),
2591 
2592  m_l1ResultsAlreadyCalled(false),
2593 
2595 
2596  m_expBitsTechTrigger(false) {
2597 
2598  initialize();
2599 }
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 2602 of file L1GtUtils.cc.

2602  {
2603 
2604  // empty
2605 
2606 }

Member Function Documentation

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

Definition at line 2831 of file L1GtUtils.cc.

References Exception.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

2831  {
2832 
2833  // throw an exception if the result is not computed once per event - user usage error
2834  if (!m_l1ResultsAlreadyCalled) {
2835  throw cms::Exception("FailModule") << "\nUsage error: "
2836  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2837  << std::endl;
2838  }
2839 
2840  return m_decisionsAfterMask;
2841 
2842 }
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 2818 of file L1GtUtils.cc.

References Exception.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

2818  {
2819 
2820  // throw an exception if the result is not computed once per event - user usage error
2821  if (!m_l1ResultsAlreadyCalled) {
2822  throw cms::Exception("FailModule") << "\nUsage error: "
2823  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2824  << std::endl;
2825  }
2826 
2827  return m_decisionsBeforeMask;
2828 
2829 }
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 2870 of file L1GtUtils.cc.

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

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

2871  {
2872 
2873  m_l1ResultsAlreadyCalled = false;
2874 
2875  // if not a valid L1 configuration, reset all quantities and return
2876  if (!m_validL1Configuration) {
2882 
2883  m_l1ResultsAlreadyCalled = true;
2884  return m_errorCodes;
2885 
2886  }
2887 
2889 
2892 
2893  } else {
2894 
2896  }
2897 
2898  m_l1ResultsAlreadyCalled = true;
2899 
2900  return m_errorCodes;
2901 
2902 }
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:2920
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:2904
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 2608 of file L1GtUtils.cc.

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

Referenced by LogicalExpressionL1Results().

2608  {
2609 
2610  // get the vector of triggers corresponding to the logical expression
2611  // check also the logical expression - add/remove spaces if needed
2612 
2613  try {
2614 
2615  L1GtLogicParser m_l1AlgoLogicParser = L1GtLogicParser(
2617 
2618  // list of L1 triggers from the logical expression
2619  m_expL1Triggers = m_l1AlgoLogicParser.operandTokenVector();
2621 
2622  m_validLogicalExpression = true;
2623 
2624  } catch (cms::Exception & ex) {
2625  m_validLogicalExpression = false;
2626 
2627  LogDebug("L1GtUtils") << ex;
2628  LogDebug("L1GtUtils") << ex.what();
2629  LogDebug("L1GtUtils") << ex.explainSelf();
2630  }
2631 
2632  // try to convert the string representing each L1 trigger to bit number,
2633  // to check if the logical expression is constructed from bit numbers
2634  // trade-off: cache it here, irrespective of the expression
2635  // when the conversion fails (normally for the first seed,
2636  // if not expression of technical trigger bits), stop and
2637  // set m_expBitsTechTrigger to false
2638 
2639  m_expBitsTechTrigger = true;
2640 
2641  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2642  const std::string& bitString = (m_expL1Triggers[iTrig]).tokenName;
2643  std::istringstream bitStream(bitString);
2644  int bitInt;
2645 
2646  if ((bitStream >> bitInt).fail()) {
2647 
2648  m_expBitsTechTrigger = false;
2649 
2650  break;
2651  }
2652 
2653  (m_expL1Triggers[iTrig]).tokenNumber = bitInt;
2654 
2655  }
2656 
2657  // resize and fill
2658  m_decisionsBeforeMask.resize(m_expL1TriggersSize);
2659  m_decisionsAfterMask.resize(m_expL1TriggersSize);
2660  m_prescaleFactors.resize(m_expL1TriggersSize);
2661  m_triggerMasks.resize(m_expL1TriggersSize);
2662  m_errorCodes.resize(m_expL1TriggersSize);
2663  m_expTriggerCategory.resize(m_expL1TriggersSize);
2664  m_expTriggerInMenu.resize(m_expL1TriggersSize);
2665 
2666  LogDebug("L1GtUtils") << std::endl;
2667  LogTrace("L1GtUtils") << "\nLogical expression\n " << m_logicalExpression
2668  << "\n has " << m_expL1TriggersSize << " L1 triggers" << std::endl;
2669  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2670 
2671  const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
2672  LogTrace("L1GtUtils") << " " << trigNameOrAlias << std::endl;
2673 
2674  (m_decisionsBeforeMask[iTrig]).first = trigNameOrAlias;
2675  (m_decisionsBeforeMask[iTrig]).second = false;
2676 
2677  (m_decisionsAfterMask[iTrig]).first = trigNameOrAlias;
2678  (m_decisionsAfterMask[iTrig]).second = false;
2679 
2680  (m_prescaleFactors[iTrig]).first = trigNameOrAlias;
2681  (m_prescaleFactors[iTrig]).second = -1;
2682 
2683  (m_triggerMasks[iTrig]).first = trigNameOrAlias;
2684  (m_triggerMasks[iTrig]).second = -1;
2685 
2686  (m_errorCodes[iTrig]).first = trigNameOrAlias;
2687  (m_errorCodes[iTrig]).second = -1;
2688 
2690 
2691  m_expTriggerInMenu[iTrig] = false;
2692 
2693  }
2694  LogTrace("L1GtUtils") << std::endl;
2695 
2696  return true;
2697 
2698 }
#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
#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(), HLTConfigProvider::prescaleValuesInDetail(), and core.AutoHandle.AutoHandle::ReallyLoad().

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 2920 of file L1GtUtils.cc.

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

2922  {
2923 
2924  // reset the vectors before filling them
2930 
2931  // initialization of actual values for each trigger
2932  bool decisionBeforeMaskValue = false;
2933  bool decisionAfterMaskValue = false;
2934  int prescaleFactorValue = -1;
2935  int triggerMaskValue = -1;
2936  int errorCode = -1;
2937 
2938  LogDebug("L1GtUtils") << std::endl;
2939  LogTrace("L1GtUtils") << "\nLogical expression\n " << m_logicalExpression
2940  << std::endl;
2941 
2942  // for each trigger, if it is in the L1 menu, get the prescale factor and trigger mask
2943 
2944  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2945 
2946  const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
2947 
2948  if (m_expTriggerInMenu[iTrig]) {
2949  errorCode = m_l1GtUtils.l1Results(iEvent, l1GtRecordInputTag,
2950  l1GtReadoutRecordInputTag, trigNameOrAlias,
2951  decisionBeforeMaskValue, decisionAfterMaskValue,
2952  prescaleFactorValue, triggerMaskValue);
2953 
2954  if (errorCode != 0) {
2955 
2956  // error while retrieving the results
2957  // for this trigger: set prescale factor to -1, trigger mask to -1
2958 
2959  decisionBeforeMaskValue = false;
2960  decisionAfterMaskValue = false;
2961  prescaleFactorValue = -1;
2962  triggerMaskValue = -1;
2963 
2964  }
2965 
2966  } else {
2967  // no trigger name or trigger alias in the menu, no bits:
2968  // for this trigger: set prescale factor to -1, set the error code
2969 
2970  decisionBeforeMaskValue = false;
2971  decisionAfterMaskValue = false;
2972  prescaleFactorValue = -1;
2973  triggerMaskValue = -1;
2974  errorCode = m_l1ConfCode + 1;
2975 
2976  }
2977 
2978  LogTrace("L1GtUtils") << "\n" << trigNameOrAlias << ":" << std::endl;
2979 
2980  (m_decisionsBeforeMask[iTrig]).second = decisionBeforeMaskValue;
2981  LogTrace("L1GtUtils") << " decision before mask = "
2982  << decisionBeforeMaskValue << std::endl;
2983 
2984  (m_decisionsAfterMask[iTrig]).second = decisionAfterMaskValue;
2985  LogTrace("L1GtUtils") << " decision after mask = "
2986  << decisionAfterMaskValue << std::endl;
2987 
2988  (m_prescaleFactors[iTrig]).second = prescaleFactorValue;
2989  LogTrace("L1GtUtils") << " prescale factor = "
2990  << prescaleFactorValue << std::endl;
2991 
2992  (m_triggerMasks[iTrig]).second = triggerMaskValue;
2993  LogTrace("L1GtUtils") << " trigger mask = "
2994  << triggerMaskValue << std::endl;
2995 
2996  (m_errorCodes[iTrig]).second = errorCode;
2997  LogTrace("L1GtUtils") << " error code = " << errorCode
2998  << std::endl;
2999 
3000  }
3001 
3002  LogDebug("L1GtUtils") << std::endl;
3003 
3004 }
#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:1008
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:2904
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 2701 of file L1GtUtils.cc.

References initialize().

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

2703  {
2704 
2705  // initialize error code
2706  int errorCode = 0;
2707 
2708  // logical expression has changed - one must re-initialize all quantities related to the logical expression
2709  // and clear the vectors
2710 
2711  m_logicalExpression = logicExpression;
2712  m_validLogicalExpression = false;
2713 
2714  m_l1ResultsAlreadyCalled = false;
2715 
2716  m_expL1TriggersSize = 0;
2717  m_expBitsTechTrigger = false;
2718 
2719  //
2720  m_decisionsBeforeMask.clear();
2721  m_decisionsAfterMask.clear();
2722  m_prescaleFactors.clear();
2723  m_triggerMasks.clear();
2724  m_errorCodes.clear();
2725  m_expTriggerCategory.clear();
2726  m_expTriggerInMenu.clear();
2727 
2728 
2729  initialize();
2730 
2731  //
2732  errorCode = logicalExpressionRunUpdate(iRun, evSetup);
2733 
2734  return errorCode;
2735 
2736 }
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:2701
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 2739 of file L1GtUtils.cc.

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

2740  {
2741 
2742  // check first that a valid L1 configuration was retrieved,
2743  // to prevent also calls before the L1 configuration retrieval
2744 
2745  // initialize error code and L1 configuration code
2746  int errorCode = 0;
2747  int l1ConfCode = 0;
2748 
2749  if (!(m_l1GtUtils.availableL1Configuration(errorCode, l1ConfCode))) {
2750 
2751  m_validL1Configuration = false;
2752  return errorCode;
2753  } else {
2754 
2755  m_validL1Configuration = true;
2756  m_l1ConfCode = l1ConfCode;
2757  }
2758 
2759  // check if the trigger (name of alias) from the logical expression are in the menu,
2760  // if names are used, set tokenNumber to the corresponding bit number
2761  // if technical trigger bits, set tokenName to the corresponding technical trigger name, if
2762  // a technical trigger exists on that bit
2763  // for each trigger, set also the trigger category
2764 
2765  // initialization
2767  int bitNumber = -1;
2768 
2769  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2770 
2771  trigCategory = L1GtUtils::AlgorithmTrigger;
2772  bitNumber = -1;
2773  const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
2774 
2775  if (!m_expBitsTechTrigger) {
2776  const bool triggerInMenu = m_l1GtUtils.l1AlgoTechTrigBitNumber(
2777  trigNameOrAlias, trigCategory, bitNumber);
2778 
2779  (m_expL1Triggers[iTrig]).tokenNumber = bitNumber;
2780  m_expTriggerCategory[iTrig] = trigCategory;
2781  m_expTriggerInMenu[iTrig] = triggerInMenu;
2782 
2783  } else {
2784 
2785  std::string aliasL1Trigger;
2786  std::string nameL1Trigger;
2787 
2788  trigCategory = L1GtUtils::TechnicalTrigger;
2789  bitNumber = (m_expL1Triggers[iTrig]).tokenNumber;
2790 
2791  const bool triggerInMenu = m_l1GtUtils.l1TriggerNameFromBit(
2792  bitNumber, trigCategory, aliasL1Trigger, nameL1Trigger);
2793 
2794  if (!triggerInMenu) {
2795  aliasL1Trigger = "Technical_trigger_bit_"
2796  + (m_expL1Triggers[iTrig]).tokenName + "_empty";
2797  }
2798 
2799  (m_expL1Triggers[iTrig]).tokenName = aliasL1Trigger;
2800  m_expTriggerCategory[iTrig] = trigCategory;
2801  m_expTriggerInMenu[iTrig] = triggerInMenu;
2802 
2803  // put the names of the technical triggers in the returned quantities
2804 
2805  (m_decisionsBeforeMask[iTrig]).first = aliasL1Trigger;
2806  (m_decisionsAfterMask[iTrig]).first = aliasL1Trigger;
2807  (m_prescaleFactors[iTrig]).first = aliasL1Trigger;
2808  (m_triggerMasks[iTrig]).first = aliasL1Trigger;
2809  (m_errorCodes[iTrig]).first = aliasL1Trigger;
2810 
2811  }
2812  }
2813 
2814  return errorCode;
2815 
2816 }
const bool l1TriggerNameFromBit(const int &bitNumber, const TriggerCategory &trigCategory, std::string &aliasL1Trigger, std::string &nameL1Trigger) const
Definition: L1GtUtils.cc:798
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:671
TriggerCategory
Definition: L1GtUtils.h:58
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2416
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 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 2844 of file L1GtUtils.cc.

References Exception.

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

2844  {
2845 
2846  // throw an exception if the result is not computed once per event - user usage error
2847  if (!m_l1ResultsAlreadyCalled) {
2848  throw cms::Exception("FailModule") << "\nUsage error: "
2849  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2850  << std::endl;
2851  }
2852 
2853  return m_prescaleFactors;
2854 
2855 }
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 2904 of file L1GtUtils.cc.

References edm::second().

2905  {
2906  std::vector<std::pair<std::string, bool> > pairVector = _pairVector;
2907  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2908  (pairVector[iTrig]).second = false;
2909  }
2910 }
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 2912 of file L1GtUtils.cc.

References edm::second().

2913  {
2914  std::vector<std::pair<std::string, int> > pairVector = _pairVector;
2915  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2916  (pairVector[iTrig]).second = -1;
2917  }
2918 }
U second(std::pair< T, U > const &p)
const std::vector< std::pair< std::string, int > > & L1GtUtils::LogicalExpressionL1Results::triggerMasks ( )

Definition at line 2857 of file L1GtUtils.cc.

References Exception.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

2857  {
2858 
2859  // throw an exception if the result is not computed once per event - user usage error
2860  if (!m_l1ResultsAlreadyCalled) {
2861  throw cms::Exception("FailModule") << "\nUsage error: "
2862  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2863  << std::endl;
2864  }
2865 
2866  return m_triggerMasks;
2867 
2868 }
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().