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

References initialize().

2423  :
2424 
2425  m_logicalExpression(expression),
2426 
2427  m_l1GtUtils(l1GtUtils),
2428 
2430 
2432 
2433  m_l1ConfCode(-1),
2434 
2435  m_validL1Configuration(false),
2436 
2437  m_validLogicalExpression(false),
2438 
2440 
2441  m_l1ResultsAlreadyCalled(false),
2442 
2444 
2445  m_expBitsTechTrigger(false) {
2446 
2447  initialize();
2448 }
bool m_validLogicalExpression
true if the logical expression uses accepted L1GtLogicParser operators
Definition: L1GtUtils.h:163
int m_l1ConfCode
code for L1 trigger configuration
Definition: L1GtUtils.h:157
std::string m_logicalExpression
private members as input parameters
Definition: L1GtUtils.h:145
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:170
bool m_expBitsTechTrigger
flag true, if the logical expression is built from technical trigger bits
Definition: L1GtUtils.h:179
bool m_validL1Configuration
true if valid L1 configuration - if not, reset all quantities and return
Definition: L1GtUtils.h:160
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 2450 of file L1GtUtils.cc.

References initialize().

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

destructor

Definition at line 2481 of file L1GtUtils.cc.

2481  {
2482 
2483  // empty
2484 
2485 }

Member Function Documentation

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

Definition at line 2710 of file L1GtUtils.cc.

References edm::hlt::Exception.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

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

Definition at line 2697 of file L1GtUtils.cc.

References edm::hlt::Exception.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

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

Definition at line 2749 of file L1GtUtils.cc.

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

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

2750  {
2751 
2752  m_l1ResultsAlreadyCalled = false;
2753 
2754  // if not a valid L1 configuration, reset all quantities and return
2755  if (!m_validL1Configuration) {
2761 
2762  m_l1ResultsAlreadyCalled = true;
2763  return m_errorCodes;
2764 
2765  }
2766 
2768 
2771 
2772  } else {
2773 
2775  }
2776 
2777  m_l1ResultsAlreadyCalled = true;
2778 
2779  return m_errorCodes;
2780 
2781 }
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:186
const edm::InputTag & provL1GtReadoutRecordInputTag()
Definition: L1GtUtils.h:244
void l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag)
Definition: L1GtUtils.cc:2799
const edm::InputTag & provL1GtRecordInputTag()
return the input tags found from provenance
Definition: L1GtUtils.h:240
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:190
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:189
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:188
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:170
void reset(const std::vector< std::pair< std::string, bool > > &) const
reset for each L1 trigger the value from pair.second
Definition: L1GtUtils.cc:2783
bool m_validL1Configuration
true if valid L1 configuration - if not, reset all quantities and return
Definition: L1GtUtils.h:160
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:187
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 114 of file L1GtUtils.h.

References m_expL1Triggers.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

114  {
115  return m_expL1Triggers;
116  }
std::vector< L1GtLogicParser::OperandToken > m_expL1Triggers
Definition: L1GtUtils.h:172
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 2487 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().

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

return true if the logical expression is syntactically correct

Definition at line 99 of file L1GtUtils.h.

References m_validLogicalExpression.

Referenced by L1GtAnalyzer::beginRun().

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

Definition at line 2799 of file L1GtUtils.cc.

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

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

Referenced by L1GtAnalyzer::beginRun().

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

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

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

Definition at line 2723 of file L1GtUtils.cc.

References edm::hlt::Exception.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

2723  {
2724 
2725  // throw an exception if the result is not computed once per event - user usage error
2726  if (!m_l1ResultsAlreadyCalled) {
2727  throw cms::Exception("FailModule") << "\nUsage error: "
2728  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2729  << std::endl;
2730  }
2731 
2732  return m_prescaleFactors;
2733 
2734 }
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:188
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:170
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 2783 of file L1GtUtils.cc.

References edm::second().

2784  {
2785  std::vector<std::pair<std::string, bool> > pairVector = _pairVector;
2786  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2787  (pairVector[iTrig]).second = false;
2788  }
2789 }
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 2791 of file L1GtUtils.cc.

References edm::second().

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

Definition at line 2736 of file L1GtUtils.cc.

References edm::hlt::Exception.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

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

Member Data Documentation

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

Definition at line 187 of file L1GtUtils.h.

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

Definition at line 186 of file L1GtUtils.h.

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

Definition at line 190 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 179 of file L1GtUtils.h.

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

Definition at line 172 of file L1GtUtils.h.

Referenced by expL1Triggers().

size_t L1GtUtils::LogicalExpressionL1Results::m_expL1TriggersSize
private

Definition at line 173 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 176 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 183 of file L1GtUtils.h.

int L1GtUtils::LogicalExpressionL1Results::m_l1ConfCode
private

code for L1 trigger configuration

Definition at line 157 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 167 of file L1GtUtils.h.

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

Definition at line 150 of file L1GtUtils.h.

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

Definition at line 149 of file L1GtUtils.h.

L1GtUtils& L1GtUtils::LogicalExpressionL1Results::m_l1GtUtils
private

Definition at line 147 of file L1GtUtils.h.

bool L1GtUtils::LogicalExpressionL1Results::m_l1ResultsAlreadyCalled
private

set to true if the method l1Results was called once

Definition at line 170 of file L1GtUtils.h.

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

private members as input parameters

logical expression

Definition at line 145 of file L1GtUtils.h.

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

Definition at line 188 of file L1GtUtils.h.

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

Definition at line 189 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 160 of file L1GtUtils.h.

bool L1GtUtils::LogicalExpressionL1Results::m_validLogicalExpression
private

true if the logical expression uses accepted L1GtLogicParser operators

Definition at line 163 of file L1GtUtils.h.

Referenced by isValid().