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 Attributes
L1GlobalTriggerObjectMap Class Reference

#include <L1GlobalTriggerObjectMap.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
 get / set name for algorithm in the object map 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...
 
 L1GlobalTriggerObjectMap ()
 constructor(s) More...
 
const std::vector
< L1GtLogicParser::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 setOperandTokenVector (const std::vector< L1GtLogicParser::OperandToken > &operandTokenVectorValue)
 
void swapCombinationVector (std::vector< CombinationsInCond > &combinationVectorValue)
 
void swapOperandTokenVector (std::vector< L1GtLogicParser::OperandToken > &operandTokenVectorValue)
 
 ~L1GlobalTriggerObjectMap ()
 destructor More...
 

Private Attributes

int m_algoBitNumber
 
bool m_algoGtlResult
 
std::string m_algoName
 
std::vector< CombinationsInCondm_combinationVector
 
std::vector
< L1GtLogicParser::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

$Date$ $Revision$

Description: group typedefs used by L1GlobalTriggerObjectMap.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Description: see header file.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 35 of file L1GlobalTriggerObjectMap.h.

Constructor & Destructor Documentation

L1GlobalTriggerObjectMap::L1GlobalTriggerObjectMap ( )
inline

constructor(s)

Definition at line 41 of file L1GlobalTriggerObjectMap.h.

41 {}
L1GlobalTriggerObjectMap::~L1GlobalTriggerObjectMap ( )
inline

destructor

Definition at line 44 of file L1GlobalTriggerObjectMap.h.

44 {}

Member Function Documentation

int L1GlobalTriggerObjectMap::algoBitNumber ( ) const
inline

get / set bit number for algorithm in the object map

Definition at line 59 of file L1GlobalTriggerObjectMap.h.

References m_algoBitNumber.

Referenced by ConvertObjectMapRecord::produce().

60  {
61  return m_algoBitNumber;
62  }
bool L1GlobalTriggerObjectMap::algoGtlResult ( ) const
inline

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

Definition at line 71 of file L1GlobalTriggerObjectMap.h.

References m_algoGtlResult.

Referenced by CompareToObjectMapRecord::analyze(), and ConvertObjectMapRecord::produce().

71  {
72  return m_algoGtlResult;
73  }
const std::string& L1GlobalTriggerObjectMap::algoName ( ) const
inline

get / set name for algorithm in the object map

Definition at line 49 of file L1GlobalTriggerObjectMap.h.

References m_algoName.

Referenced by CompareToObjectMapRecord::analyze(), and ConvertObjectMapRecord::produce().

50  {
51  return m_algoName;
52  }
const std::vector<CombinationsInCond>& L1GlobalTriggerObjectMap::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 81 of file L1GlobalTriggerObjectMap.h.

References m_combinationVector.

82  {
83  return m_combinationVector;
84  }
std::vector< CombinationsInCond > m_combinationVector
const CombinationsInCond * L1GlobalTriggerObjectMap::getCombinationsInCond ( const std::string &  condNameVal) const

return all the combinations passing the requirements imposed in condition condNameVal

Definition at line 40 of file L1GlobalTriggerObjectMap.cc.

References i, m_combinationVector, and m_operandTokenVector.

Referenced by CompareToObjectMapRecord::analyze(), ConvertObjectMapRecord::produce(), and HLTLevel1GTSeed::seedsL1TriggerObjectMaps().

41  {
42 
43  for (size_t i = 0; i < m_operandTokenVector.size(); ++i) {
44 
45  if ((m_operandTokenVector[i]).tokenName == condNameVal) {
46  return &(m_combinationVector.at((m_operandTokenVector[i]).tokenNumber));
47  }
48 
49  }
50 
51  // return a null address - should not arrive here
52  edm::LogError("L1GlobalTriggerObjectMap")
53  << "\n\n ERROR: The requested condition with tokenName = " << condNameVal
54  << "\n does not exists in the operand token vector."
55  << "\n Returning zero pointer for getCombinationsInCond\n\n" << std::endl;
56 
57  return 0;
58 
59 }
int i
Definition: DBlmapReader.cc:9
std::vector< L1GtLogicParser::OperandToken > m_operandTokenVector
std::vector< CombinationsInCond > m_combinationVector
const CombinationsInCond * L1GlobalTriggerObjectMap::getCombinationsInCond ( const int  condNumberVal) const

return all the combinations passing the requirements imposed in condition condNumberVal

Definition at line 62 of file L1GlobalTriggerObjectMap.cc.

References i, m_combinationVector, and m_operandTokenVector.

62  {
63 
64  for (size_t i = 0; i < m_operandTokenVector.size(); ++i) {
65 
66  if ((m_operandTokenVector[i]).tokenNumber == condNumberVal) {
67  return &(m_combinationVector.at((m_operandTokenVector[i]).tokenNumber));
68  }
69 
70  }
71 
72  // return a null address - should not arrive here
73  edm::LogError("L1GlobalTriggerObjectMap")
74  << "\n\n ERROR: The requested condition with tokenNumber = " << condNumberVal
75  << "\n does not exists in the operand token vector."
76  << "\n Returning zero pointer for getCombinationsInCond\n\n" << std::endl;
77 
78  return 0;
79 
80 }
int i
Definition: DBlmapReader.cc:9
std::vector< L1GtLogicParser::OperandToken > m_operandTokenVector
std::vector< CombinationsInCond > m_combinationVector
const bool L1GlobalTriggerObjectMap::getConditionResult ( const std::string &  condNameVal) const

return the result for the condition condNameVal

Definition at line 82 of file L1GlobalTriggerObjectMap.cc.

References i, and m_operandTokenVector.

82  {
83 
84  for (size_t i = 0; i < m_operandTokenVector.size(); ++i) {
85 
86  if ((m_operandTokenVector[i]).tokenName == condNameVal) {
87  return (m_operandTokenVector[i]).tokenResult;
88  }
89  }
90 
91  // return false - should not arrive here
92  edm::LogError("L1GlobalTriggerObjectMap")
93  << "\n\n ERROR: The requested condition with name = " << condNameVal
94  << "\n does not exists in the operand token vector."
95  << "\n Returning false for getConditionResult\n\n" << std::endl;
96  return false;
97 
98 }
int i
Definition: DBlmapReader.cc:9
std::vector< L1GtLogicParser::OperandToken > m_operandTokenVector
const std::vector<L1GtLogicParser::OperandToken>& L1GlobalTriggerObjectMap::operandTokenVector ( ) const
inline

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

Definition at line 95 of file L1GlobalTriggerObjectMap.h.

References m_operandTokenVector.

Referenced by CompareToObjectMapRecord::analyze(), ConvertObjectMapRecord::produce(), and HLTLevel1GTSeed::seedsL1TriggerObjectMaps().

95  {
96  return m_operandTokenVector;
97  }
std::vector< L1GtLogicParser::OperandToken > m_operandTokenVector
void L1GlobalTriggerObjectMap::print ( std::ostream &  myCout) const

print the full object map

Definition at line 121 of file L1GlobalTriggerObjectMap.cc.

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

Referenced by L1GlobalTriggerGTL::run().

122 {
123 
124  myCout << "L1GlobalTriggerObjectMap: print " << std::endl;
125 
126  myCout << " Algorithm name: " << m_algoName << std::endl;
127  myCout << " Bit number: " << m_algoBitNumber << std::endl;
128  myCout << " GTL result: " << m_algoGtlResult << std::endl;
129 
130  int operandTokenVectorSize = m_operandTokenVector.size();
131 
132  myCout << " Operand token vector size: " << operandTokenVectorSize;
133 
134  if (operandTokenVectorSize == 0) {
135  myCout << " - not properly initialized! " << std::endl;
136  }
137  else {
138  myCout << std::endl;
139 
140  for (int i = 0; i < operandTokenVectorSize; ++i) {
141 
142  myCout << " " << std::setw(5) << (m_operandTokenVector[i]).tokenNumber << "\t"
143  << std::setw(25) << (m_operandTokenVector[i]).tokenName << "\t"
144  << (m_operandTokenVector[i]).tokenResult
145  << std::endl;
146  }
147 
148  }
149 
150  myCout << " CombinationVector size: " << m_combinationVector.size() << std::endl;
151 
152  myCout << " conditions: " << std::endl;
153 
154  std::vector<CombinationsInCond>::const_iterator itVVV;
155  int iCond = 0;
156  for(itVVV = m_combinationVector.begin();
157  itVVV != m_combinationVector.end(); itVVV++) {
158 
159  std::string condName = (m_operandTokenVector[iCond]).tokenName;
160  bool condResult = (m_operandTokenVector[iCond]).tokenResult;
161 
162  myCout << " Condition " << condName << " evaluated to " << condResult
163  << std::endl;
164 
165  myCout << " List of combinations passing all requirements for this condition:"
166  << std::endl;
167 
168  myCout << " ";
169 
170  if ((*itVVV).size() == 0) {
171  myCout << "(none)";
172  } else {
173 
174  CombinationsInCond::const_iterator itVV;
175  for(itVV = (*itVVV).begin(); itVV != (*itVVV).end(); itVV++) {
176 
177  myCout << "( ";
178 
179  std::copy((*itVV).begin(), (*itVV).end(),
180  std::ostream_iterator<int> (myCout, " "));
181 
182  myCout << "); ";
183 
184  }
185 
186  }
187  iCond++;
188  myCout << "\n\n";
189  }
190 }
int i
Definition: DBlmapReader.cc:9
std::vector< L1GtLogicParser::OperandToken > m_operandTokenVector
std::vector< CombinationsInCond > m_combinationVector
void L1GlobalTriggerObjectMap::reset ( void  )

reset the object map

Definition at line 101 of file L1GlobalTriggerObjectMap.cc.

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

Referenced by BeautifulSoup.BeautifulStoneSoup::__init__().

102 {
103 
104  // name of the algorithm
105  m_algoName.clear();
106 
107  // bit number for algorithm
108  m_algoBitNumber = -1;
109 
110  // GTL result of the algorithm
111  m_algoGtlResult = false;
112 
113  // vector of operand tokens for an algorithm
114  m_operandTokenVector.clear();
115 
116  // vector of combinations for all conditions in an algorithm
117  m_combinationVector.clear();
118 
119 }
std::vector< L1GtLogicParser::OperandToken > m_operandTokenVector
std::vector< CombinationsInCond > m_combinationVector
void L1GlobalTriggerObjectMap::setAlgoBitNumber ( int  algoBitNumberValue)
inline

Definition at line 64 of file L1GlobalTriggerObjectMap.h.

References m_algoBitNumber.

Referenced by L1GlobalTriggerGTL::run().

65  {
66  m_algoBitNumber = algoBitNumberValue;
67  }
void L1GlobalTriggerObjectMap::setAlgoGtlResult ( bool  algoGtlResultValue)
inline

Definition at line 75 of file L1GlobalTriggerObjectMap.h.

References m_algoGtlResult.

Referenced by L1GlobalTriggerGTL::run().

75  {
76  m_algoGtlResult = algoGtlResultValue;
77  }
void L1GlobalTriggerObjectMap::setAlgoName ( const std::string &  algoNameValue)
inline

Definition at line 54 of file L1GlobalTriggerObjectMap.h.

References m_algoName.

Referenced by L1GlobalTriggerGTL::run().

54  {
55  m_algoName = algoNameValue;
56  }
void L1GlobalTriggerObjectMap::setCombinationVector ( const std::vector< CombinationsInCond > &  combinationVectorValue)
inline

Definition at line 86 of file L1GlobalTriggerObjectMap.h.

References m_combinationVector.

86  {
87  m_combinationVector = combinationVectorValue;
88  }
std::vector< CombinationsInCond > m_combinationVector
void L1GlobalTriggerObjectMap::setOperandTokenVector ( const std::vector< L1GtLogicParser::OperandToken > &  operandTokenVectorValue)
inline

Definition at line 99 of file L1GlobalTriggerObjectMap.h.

References m_operandTokenVector.

99  {
100  m_operandTokenVector = operandTokenVectorValue;
101  }
std::vector< L1GtLogicParser::OperandToken > m_operandTokenVector
void L1GlobalTriggerObjectMap::swapCombinationVector ( std::vector< CombinationsInCond > &  combinationVectorValue)
inline

Definition at line 89 of file L1GlobalTriggerObjectMap.h.

References m_combinationVector.

Referenced by L1GlobalTriggerGTL::run().

89  {
90  m_combinationVector.swap(combinationVectorValue);
91  }
std::vector< CombinationsInCond > m_combinationVector
void L1GlobalTriggerObjectMap::swapOperandTokenVector ( std::vector< L1GtLogicParser::OperandToken > &  operandTokenVectorValue)
inline

Definition at line 102 of file L1GlobalTriggerObjectMap.h.

References m_operandTokenVector.

Referenced by L1GlobalTriggerGTL::run().

102  {
103  m_operandTokenVector.swap(operandTokenVectorValue);
104  }
std::vector< L1GtLogicParser::OperandToken > m_operandTokenVector

Member Data Documentation

int L1GlobalTriggerObjectMap::m_algoBitNumber
private

Definition at line 131 of file L1GlobalTriggerObjectMap.h.

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

bool L1GlobalTriggerObjectMap::m_algoGtlResult
private

Definition at line 134 of file L1GlobalTriggerObjectMap.h.

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

std::string L1GlobalTriggerObjectMap::m_algoName
private

Definition at line 128 of file L1GlobalTriggerObjectMap.h.

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

std::vector<CombinationsInCond> L1GlobalTriggerObjectMap::m_combinationVector
private
std::vector<L1GtLogicParser::OperandToken> L1GlobalTriggerObjectMap::m_operandTokenVector
private

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

Definition at line 138 of file L1GlobalTriggerObjectMap.h.

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