CMS 3D CMS Logo

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

#include <GlobalObjectMap.h>

Public Member Functions

int algoBitNumber () const
 get / set bit number for algorithm in the object map More...
 
bool algoGtlResult () const
 
const std::string & algoName () const
 destructor More...
 
const std::vector
< CombinationsInCond > & 
combinationVector () const
 
const CombinationsInCondgetCombinationsInCond (const std::string &condNameVal) const
 return all the combinations passing the requirements imposed in condition condNameVal More...
 
const CombinationsInCondgetCombinationsInCond (const int condNumberVal) const
 return all the combinations passing the requirements imposed in condition condNumberVal More...
 
const bool getConditionResult (const std::string &condNameVal) const
 return the result for the condition condNameVal More...
 
 GlobalObjectMap ()
 constructor(s) More...
 
const std::vector
< L1TObjectTypeInCond > & 
objectTypeVector () const
 
const std::vector
< GlobalLogicParser::OperandToken > & 
operandTokenVector () const
 
void print (std::ostream &myCout) const
 print the full object map More...
 
void reset ()
 reset the object map More...
 
void setAlgoBitNumber (int algoBitNumberValue)
 
void setAlgoGtlResult (bool algoGtlResultValue)
 
void setAlgoName (const std::string &algoNameValue)
 
void setCombinationVector (const std::vector< CombinationsInCond > &combinationVectorValue)
 
void setObjectTypeVector (const std::vector< L1TObjectTypeInCond > &objectTypeVectorValue)
 
void setOperandTokenVector (const std::vector< GlobalLogicParser::OperandToken > &operandTokenVectorValue)
 
void swapCombinationVector (std::vector< CombinationsInCond > &combinationVectorValue)
 
void swapObjectTypeVector (std::vector< L1TObjectTypeInCond > &objectTypeVectorValue)
 
void swapOperandTokenVector (std::vector< GlobalLogicParser::OperandToken > &operandTokenVectorValue)
 

Private Attributes

int m_algoBitNumber
 
bool m_algoGtlResult
 
std::string m_algoName
 
std::vector< CombinationsInCondm_combinationVector
 
std::vector< L1TObjectTypeInCondm_objectTypeVector
 
std::vector
< GlobalLogicParser::OperandToken
m_operandTokenVector
 

Detailed Description

Description: map trigger objects to an algorithm and the conditions therein.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Description: group typedefs used by GlobalObjectMap.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Description: see header file.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 32 of file GlobalObjectMap.h.

Constructor & Destructor Documentation

GlobalObjectMap::GlobalObjectMap ( )
inline

constructor(s)

Definition at line 35 of file GlobalObjectMap.h.

35 {}

Member Function Documentation

int GlobalObjectMap::algoBitNumber ( ) const
inline

get / set bit number for algorithm in the object map

Definition at line 47 of file GlobalObjectMap.h.

References m_algoBitNumber.

Referenced by l1t::GtRecordDump::analyze(), and HLTL1TSeed::seedsL1TriggerObjectMaps().

47 { return m_algoBitNumber; }
bool GlobalObjectMap::algoGtlResult ( ) const
inline

get / set the GTL result for algorithm NOTE: FDL can mask an algorithm!

Definition at line 53 of file GlobalObjectMap.h.

References m_algoGtlResult.

Referenced by l1t::GtRecordDump::analyze(), and HLTL1TSeed::seedsL1TriggerObjectMaps().

53 { return m_algoGtlResult; }
const std::string& GlobalObjectMap::algoName ( ) const
inline

destructor

get / set name for algorithm in the object map

Definition at line 42 of file GlobalObjectMap.h.

References m_algoName.

Referenced by l1t::GtRecordDump::analyze(), and HLTL1TSeed::seedsL1TriggerObjectMaps().

42 { return m_algoName; }
std::string m_algoName
const std::vector<CombinationsInCond>& GlobalObjectMap::combinationVector ( ) const
inline

get / set the vector of combinations for the algorithm return a constant reference to the vector of combinations for the algorithm

Definition at line 59 of file GlobalObjectMap.h.

References m_combinationVector.

Referenced by HLTL1TSeed::seedsL1TriggerObjectMaps().

59 { return m_combinationVector; }
std::vector< CombinationsInCond > m_combinationVector
const CombinationsInCond * GlobalObjectMap::getCombinationsInCond ( const std::string &  condNameVal) const

return all the combinations passing the requirements imposed in condition condNameVal

Definition at line 33 of file GlobalObjectMap.cc.

References mps_fire::i, m_combinationVector, and m_operandTokenVector.

Referenced by l1t::GtRecordDump::analyze(), and HLTL1TSeed::seedsL1TriggerObjectMaps().

33  {
34  for (size_t i = 0; i < m_operandTokenVector.size(); ++i) {
35  if ((m_operandTokenVector[i]).tokenName == condNameVal) {
36  return &(m_combinationVector.at((m_operandTokenVector[i]).tokenNumber));
37  }
38  }
39 
40  // return a null address - should not arrive here
41  edm::LogError("GlobalObjectMap") << "\n\n ERROR: The requested condition with tokenName = " << condNameVal
42  << "\n does not exists in the operand token vector."
43  << "\n Returning zero pointer for getCombinationsInCond\n\n"
44  << std::endl;
45 
46  return nullptr;
47 }
Log< level::Error, false > LogError
std::vector< GlobalLogicParser::OperandToken > m_operandTokenVector
std::vector< CombinationsInCond > m_combinationVector
const CombinationsInCond * GlobalObjectMap::getCombinationsInCond ( const int  condNumberVal) const

return all the combinations passing the requirements imposed in condition condNumberVal

Definition at line 50 of file GlobalObjectMap.cc.

References mps_fire::i, m_combinationVector, and m_operandTokenVector.

50  {
51  for (size_t i = 0; i < m_operandTokenVector.size(); ++i) {
52  if ((m_operandTokenVector[i]).tokenNumber == condNumberVal) {
53  return &(m_combinationVector.at((m_operandTokenVector[i]).tokenNumber));
54  }
55  }
56 
57  // return a null address - should not arrive here
58  edm::LogError("GlobalObjectMap") << "\n\n ERROR: The requested condition with tokenNumber = " << condNumberVal
59  << "\n does not exists in the operand token vector."
60  << "\n Returning zero pointer for getCombinationsInCond\n\n"
61  << std::endl;
62 
63  return nullptr;
64 }
Log< level::Error, false > LogError
std::vector< GlobalLogicParser::OperandToken > m_operandTokenVector
std::vector< CombinationsInCond > m_combinationVector
const bool GlobalObjectMap::getConditionResult ( const std::string &  condNameVal) const

return the result for the condition condNameVal

Definition at line 66 of file GlobalObjectMap.cc.

References mps_fire::i, and m_operandTokenVector.

66  {
67  for (size_t i = 0; i < m_operandTokenVector.size(); ++i) {
68  if ((m_operandTokenVector[i]).tokenName == condNameVal) {
69  return (m_operandTokenVector[i]).tokenResult;
70  }
71  }
72 
73  // return false - should not arrive here
74  edm::LogError("GlobalObjectMap") << "\n\n ERROR: The requested condition with name = " << condNameVal
75  << "\n does not exists in the operand token vector."
76  << "\n Returning false for getConditionResult\n\n"
77  << std::endl;
78  return false;
79 }
Log< level::Error, false > LogError
std::vector< GlobalLogicParser::OperandToken > m_operandTokenVector
const std::vector<L1TObjectTypeInCond>& GlobalObjectMap::objectTypeVector ( ) const
inline

get / set the vector of object types return a constant reference to the vector of operand tokens

Definition at line 81 of file GlobalObjectMap.h.

References m_objectTypeVector.

Referenced by l1t::GtRecordDump::analyze(), and HLTL1TSeed::seedsL1TriggerObjectMaps().

81 { return m_objectTypeVector; }
std::vector< L1TObjectTypeInCond > m_objectTypeVector
const std::vector<GlobalLogicParser::OperandToken>& GlobalObjectMap::operandTokenVector ( ) const
inline

get / set the vector of operand tokens return a constant reference to the vector of operand tokens

Definition at line 70 of file GlobalObjectMap.h.

References m_operandTokenVector.

Referenced by l1t::GtRecordDump::analyze(), and HLTL1TSeed::seedsL1TriggerObjectMaps().

70 { return m_operandTokenVector; }
std::vector< GlobalLogicParser::OperandToken > m_operandTokenVector
void GlobalObjectMap::print ( std::ostream &  myCout) const

print the full object map

Definition at line 98 of file GlobalObjectMap.cc.

References filterCSVwithJSON::copy, mps_fire::i, m_algoBitNumber, m_algoGtlResult, m_algoName, m_combinationVector, m_operandTokenVector, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by l1t::GlobalBoard::runGTL().

98  {
99  myCout << "GlobalObjectMap: print " << std::endl;
100 
101  myCout << " Algorithm name: " << m_algoName << std::endl;
102  myCout << " Bit number: " << m_algoBitNumber << std::endl;
103  myCout << " GTL result: " << m_algoGtlResult << std::endl;
104 
105  int operandTokenVectorSize = m_operandTokenVector.size();
106 
107  myCout << " Operand token vector size: " << operandTokenVectorSize;
108 
109  if (operandTokenVectorSize == 0) {
110  myCout << " - not properly initialized! " << std::endl;
111  } else {
112  myCout << std::endl;
113 
114  for (int i = 0; i < operandTokenVectorSize; ++i) {
115  myCout << " " << std::setw(5) << (m_operandTokenVector[i]).tokenNumber << "\t" << std::setw(25)
116  << (m_operandTokenVector[i]).tokenName << "\t" << (m_operandTokenVector[i]).tokenResult << std::endl;
117  }
118  }
119 
120  myCout << " CombinationVector size: " << m_combinationVector.size() << std::endl;
121 
122  myCout << " conditions: " << std::endl;
123 
124  std::vector<CombinationsInCond>::const_iterator itVVV;
125  int iCond = 0;
126  for (itVVV = m_combinationVector.begin(); itVVV != m_combinationVector.end(); itVVV++) {
127  std::string condName = (m_operandTokenVector[iCond]).tokenName;
128  bool condResult = (m_operandTokenVector[iCond]).tokenResult;
129 
130  myCout << " Condition " << condName << " evaluated to " << condResult << std::endl;
131 
132  myCout << " List of combinations passing all requirements for this condition:" << std::endl;
133 
134  myCout << " ";
135 
136  if ((*itVVV).empty()) {
137  myCout << "(none)";
138  } else {
139  CombinationsInCond::const_iterator itVV;
140  for (itVV = (*itVVV).begin(); itVV != (*itVVV).end(); itVV++) {
141  myCout << "( ";
142 
143  std::copy((*itVV).begin(), (*itVV).end(), std::ostream_iterator<int>(myCout, " "));
144 
145  myCout << "); ";
146  }
147  }
148  iCond++;
149  myCout << "\n\n";
150  }
151 }
std::vector< GlobalLogicParser::OperandToken > m_operandTokenVector
std::vector< CombinationsInCond > m_combinationVector
std::string m_algoName
void GlobalObjectMap::reset ( void  )

reset the object map

Definition at line 81 of file GlobalObjectMap.cc.

References m_algoBitNumber, m_algoGtlResult, m_algoName, m_combinationVector, and m_operandTokenVector.

81  {
82  // name of the algorithm
83  m_algoName.clear();
84 
85  // bit number for algorithm
86  m_algoBitNumber = -1;
87 
88  // GTL result of the algorithm
89  m_algoGtlResult = false;
90 
91  // vector of operand tokens for an algorithm
92  m_operandTokenVector.clear();
93 
94  // vector of combinations for all conditions in an algorithm
95  m_combinationVector.clear();
96 }
std::vector< GlobalLogicParser::OperandToken > m_operandTokenVector
std::vector< CombinationsInCond > m_combinationVector
std::string m_algoName
void GlobalObjectMap::setAlgoBitNumber ( int  algoBitNumberValue)
inline

Definition at line 49 of file GlobalObjectMap.h.

References m_algoBitNumber.

Referenced by l1t::GlobalBoard::runGTL().

49 { m_algoBitNumber = algoBitNumberValue; }
void GlobalObjectMap::setAlgoGtlResult ( bool  algoGtlResultValue)
inline

Definition at line 55 of file GlobalObjectMap.h.

References m_algoGtlResult.

Referenced by l1t::GlobalBoard::runGTL().

55 { m_algoGtlResult = algoGtlResultValue; }
void GlobalObjectMap::setAlgoName ( const std::string &  algoNameValue)
inline

Definition at line 44 of file GlobalObjectMap.h.

References m_algoName.

Referenced by l1t::GlobalBoard::runGTL().

44 { m_algoName = algoNameValue; }
std::string m_algoName
void GlobalObjectMap::setCombinationVector ( const std::vector< CombinationsInCond > &  combinationVectorValue)
inline

Definition at line 61 of file GlobalObjectMap.h.

References m_combinationVector.

61  {
62  m_combinationVector = combinationVectorValue;
63  }
std::vector< CombinationsInCond > m_combinationVector
void GlobalObjectMap::setObjectTypeVector ( const std::vector< L1TObjectTypeInCond > &  objectTypeVectorValue)
inline

Definition at line 82 of file GlobalObjectMap.h.

References m_objectTypeVector.

82  {
83  m_objectTypeVector = objectTypeVectorValue;
84  }
std::vector< L1TObjectTypeInCond > m_objectTypeVector
void GlobalObjectMap::setOperandTokenVector ( const std::vector< GlobalLogicParser::OperandToken > &  operandTokenVectorValue)
inline

Definition at line 72 of file GlobalObjectMap.h.

References m_operandTokenVector.

72  {
73  m_operandTokenVector = operandTokenVectorValue;
74  }
std::vector< GlobalLogicParser::OperandToken > m_operandTokenVector
void GlobalObjectMap::swapCombinationVector ( std::vector< CombinationsInCond > &  combinationVectorValue)
inline

Definition at line 64 of file GlobalObjectMap.h.

References m_combinationVector.

Referenced by l1t::GlobalBoard::runGTL().

64  {
65  m_combinationVector.swap(combinationVectorValue);
66  }
std::vector< CombinationsInCond > m_combinationVector
void GlobalObjectMap::swapObjectTypeVector ( std::vector< L1TObjectTypeInCond > &  objectTypeVectorValue)
inline

Definition at line 85 of file GlobalObjectMap.h.

References m_objectTypeVector.

Referenced by l1t::GlobalBoard::runGTL().

85  {
86  m_objectTypeVector.swap(objectTypeVectorValue);
87  }
std::vector< L1TObjectTypeInCond > m_objectTypeVector
void GlobalObjectMap::swapOperandTokenVector ( std::vector< GlobalLogicParser::OperandToken > &  operandTokenVectorValue)
inline

Definition at line 75 of file GlobalObjectMap.h.

References m_operandTokenVector.

Referenced by l1t::GlobalBoard::runGTL().

75  {
76  m_operandTokenVector.swap(operandTokenVectorValue);
77  }
std::vector< GlobalLogicParser::OperandToken > m_operandTokenVector

Member Data Documentation

int GlobalObjectMap::m_algoBitNumber
private

Definition at line 111 of file GlobalObjectMap.h.

Referenced by algoBitNumber(), print(), reset(), and setAlgoBitNumber().

bool GlobalObjectMap::m_algoGtlResult
private

Definition at line 114 of file GlobalObjectMap.h.

Referenced by algoGtlResult(), print(), reset(), and setAlgoGtlResult().

std::string GlobalObjectMap::m_algoName
private

Definition at line 108 of file GlobalObjectMap.h.

Referenced by algoName(), print(), reset(), and setAlgoName().

std::vector<CombinationsInCond> GlobalObjectMap::m_combinationVector
private
std::vector<L1TObjectTypeInCond> GlobalObjectMap::m_objectTypeVector
private

Definition at line 124 of file GlobalObjectMap.h.

Referenced by objectTypeVector(), setObjectTypeVector(), and swapObjectTypeVector().

std::vector<GlobalLogicParser::OperandToken> GlobalObjectMap::m_operandTokenVector
private

vector of operand tokens for an algorithm (condition name, condition index, condition result)

Definition at line 118 of file GlobalObjectMap.h.

Referenced by getCombinationsInCond(), getConditionResult(), operandTokenVector(), print(), reset(), setOperandTokenVector(), and swapOperandTokenVector().