CMS 3D CMS Logo

L1GtHfBitCountsTemplate.cc
Go to the documentation of this file.
1 
17 // this class header
19 
20 // system include files
21 
22 #include <iostream>
23 #include <iomanip>
24 
25 // user include files
26 
27 // base class
28 
31 
32 // forward declarations
33 
34 // constructors
36  : L1GtCondition()
37 {
38 
40 
41 }
42 
44  : L1GtCondition(cName)
45 {
46 
48 
49 }
50 
52  const L1GtConditionType& cType)
53  : L1GtCondition(cName, CondHfBitCounts, cType)
54 {
55 
57 
58  // should be always 1 - they are global quantities...
59  int nObjects = nrObjects();
60 
61  if (nObjects > 0) {
62  m_objectParameter.reserve(nObjects);
63 
64  m_objectType.reserve(nObjects);
65  m_objectType.assign(nObjects, HfBitCounts);
66  }
67 
68 }
69 
70 // copy constructor
73 {
74  copy(cp);
75 }
76 
77 // destructor
79 {
80  // empty now
81 }
82 
83 // assign operator
85 {
86 
87  copy(cp);
88  return *this;
89 }
90 
91 
92 // setConditionParameter - set the parameters of the condition
94  const std::vector<ObjectParameter>& objParameter)
95 {
96 
97  m_objectParameter = objParameter;
98 
99 }
100 
101 void L1GtHfBitCountsTemplate::print(std::ostream& myCout) const
102 {
103 
104  myCout << "\n L1GtHfBitCountsTemplate print..." << std::endl;
105 
106  L1GtCondition::print(myCout);
107 
108  int nObjects = nrObjects();
109 
110  for (int i = 0; i < nObjects; i++) {
111  myCout << std::endl;
112  myCout << " Template for object " << i << std::endl;
113  myCout << " countIndex = "
114  << std::hex << m_objectParameter[i].countIndex << " [ dec ]" << std::endl;
115  myCout << " countThreshold = "
116  << std::hex << m_objectParameter[i].countThreshold << " [ hex ]" << std::endl;
117 
118  }
119 
120  // reset to decimal output
121  myCout << std::dec << std::endl;
122 }
123 
124 // output stream operator
125 std::ostream& operator<<(std::ostream& os, const L1GtHfBitCountsTemplate& result)
126 {
127  result.print(os);
128  return os;
129 
130 }
131 
133 {
134 
135  m_condName = cp.condName();
137  m_condType = cp.condType();
138  m_objectType = cp.objectType();
139  m_condGEq = cp.condGEq();
140  m_condChipNr = cp.condChipNr();
141 
143 
144 }
145 
146 
147 
const int nrObjects() const
get number of trigger objects
virtual void print(std::ostream &myCout) const
print the condition
const std::string & condName() const
get / set condition name
Definition: L1GtCondition.h:57
const int & condChipNr() const
get / set the condition-chip number the condition is located on
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
Definition: L1GtCondition.h:90
std::vector< L1GtObject > m_objectType
the trigger object type(s)
L1GtConditionType
virtual void print(std::ostream &myCout) const
print condition
L1GtConditionType m_condType
the type of the condition (1s, etc)
L1GtConditionCategory m_condCategory
the category of the condition
std::vector< ObjectParameter > m_objectParameter
variables containing the parameters
const L1GtConditionType & condType() const
get / set the type of the condition (1s, etc)
Definition: L1GtCondition.h:79
std::string m_condName
the name of the condition
const L1GtConditionCategory & condCategory() const
get / set the category of the condition
Definition: L1GtCondition.h:68
friend std::ostream & operator<<(std::ostream &, const L1GtHfBitCountsTemplate &)
output stream operator
L1GtHfBitCountsTemplate & operator=(const L1GtHfBitCountsTemplate &)
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
bool m_condGEq
the operator used for the condition (>=, =): true for >=
const bool condGEq() const
get / set condition GEq flag
const std::vector< ObjectParameter > * objectParameter() const
int m_condChipNr
condition is located on condition chip m_condChipNr
void copy(const L1GtHfBitCountsTemplate &cp)
copy function for copy constructor and operator=