CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtCorrelationTemplate.cc
Go to the documentation of this file.
1 
18 // this class header
20 
21 // system include files
22 
23 #include <iostream>
24 #include <iomanip>
25 
26 // user include files
27 // base class
28 
30 
31 // forward declarations
32 
33 // constructors
34 // default
35 
37  : L1GtCondition()
38 {
39 
42  m_condChipNr = -1;
43 
44  // there are in fact two objects
45  int nObjects = nrObjects();
46 
47  if (nObjects > 0) {
48  m_objectType.reserve(nObjects);
49  }
50 
53  m_cond0Index = -1;
54  m_cond1Index = -1;
55 
56 }
57 
58 // from condition name
60  : L1GtCondition(cName)
61 {
62 
65  m_condChipNr = -1;
66 
67  // there are in fact two objects
68  int nObjects = nrObjects();
69 
70  if (nObjects > 0) {
71  m_objectType.reserve(nObjects);
72  }
73 
76  m_cond0Index = -1;
77  m_cond1Index = -1;
78 
79 }
80 
81 // from condition name, the category of first sub-condition, the category of the
82 // second sub-condition, the index of first sub-condition in the cor* vector,
83 // the index of second sub-condition in the cor* vector
85  const L1GtConditionCategory& cond0Cat,
86  const L1GtConditionCategory& cond1Cat,
87  const int cond0Index,
88  const int cond1index) :
89  L1GtCondition(cName),
90  m_cond0Category(cond0Cat),
91  m_cond1Category(cond1Cat),
92  m_cond0Index(cond0Index),
93  m_cond1Index(cond1index)
94 
95 {
96 
99  m_condChipNr = -1;
100 
101  // there are in fact two objects
102  int nObjects = nrObjects();
103 
104  if (nObjects> 0) {
105  m_objectType.resize(nObjects);
106  }
107 }
108 
109 // copy constructor
111  : L1GtCondition(cp.m_condName)
112 {
113  copy(cp);
114 }
115 
116 // destructor
118 {
119  // empty now
120 }
121 
122 // assign operator
124 {
125 
126  copy(cp);
127  return *this;
128 }
129 
130 // set the category of the two sub-conditions
132  const L1GtConditionCategory& condCateg) {
133 
134  m_cond0Category = condCateg;
135 }
136 
138  const L1GtConditionCategory& condCateg) {
139 
140  m_cond1Category = condCateg;
141 }
142 
143 
144 // set the index of the two sub-conditions in the cor* vector from menu
145 void L1GtCorrelationTemplate::setCond0Index(const int& condIndex) {
146  m_cond0Index = condIndex;
147 }
148 
149 void L1GtCorrelationTemplate::setCond1Index(const int& condIndex) {
150  m_cond1Index = condIndex;
151 }
152 
153 
154 // set the correlation parameters of the condition
156  const CorrelationParameter& corrParameter) {
157 
158  m_correlationParameter = corrParameter;
159 
160 }
161 
162 void L1GtCorrelationTemplate::print(std::ostream& myCout) const
163 {
164 
165  myCout << "\n L1GtCorrelationTemplate print..." << std::endl;
166 
167  L1GtCondition::print(myCout);
168 
169  myCout << "\n First sub-condition category: " << m_cond0Category << std::endl;
170  myCout << " Second sub-condition category: " << m_cond1Category << std::endl;
171 
172  myCout << "\n First sub-condition index: " << m_cond0Index << std::endl;
173  myCout << " Second sub-condition index: " << m_cond1Index << std::endl;
174 
175  myCout << "\n Correlation parameters " << "[ hex ]" << std::endl;
176 
177 
178  myCout << " deltaEtaRange = "
179  << std::hex << m_correlationParameter.deltaEtaRange << std::endl;
180  myCout << " deltaPhiRange = "
181  << std::hex << m_correlationParameter.deltaPhiRange << std::endl;
182  myCout << " deltaPhiMaxbits = "
183  << std::hex << m_correlationParameter.deltaPhiMaxbits << std::endl;
184 
185  // reset to decimal output
186  myCout << std::dec << std::endl;
187 }
188 
190 {
191 
192  m_condName = cp.condName();
194  m_condType = cp.condType();
195  m_objectType = cp.objectType();
196  m_condGEq = cp.condGEq();
197  m_condChipNr = cp.condChipNr();
198 
201  m_cond0Index = cp.cond0Index();
202  m_cond1Index = cp.cond1Index();
203 
205 
206 }
207 
208 // output stream operator
209 std::ostream& operator<<(std::ostream& os, const L1GtCorrelationTemplate& result)
210 {
211  result.print(os);
212  return os;
213 
214 }
215 
216 
217 
const int nrObjects() const
get number of trigger objects
void setCond1Category(const L1GtConditionCategory &)
L1GtConditionCategory m_cond0Category
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)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
virtual void print(std::ostream &myCout) const
print condition
L1GtConditionType m_condType
the type of the condition (1s, etc)
const L1GtConditionCategory cond1Category() const
void setCond0Category(const L1GtConditionCategory &)
L1GtCorrelationTemplate & operator=(const L1GtCorrelationTemplate &)
assign operator
L1GtConditionCategory m_condCategory
the category of the condition
void setCorrelationParameter(const CorrelationParameter &corrParameter)
const L1GtConditionType & condType() const
get / set the type of the condition (1s, etc)
Definition: L1GtCondition.h:79
tuple result
Definition: query.py:137
void copy(const L1GtCorrelationTemplate &cp)
copy function for copy constructor and operator=
L1GtConditionCategory
condition categories
std::string m_condName
the name of the condition
const L1GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
virtual ~L1GtCorrelationTemplate()
destructor
const L1GtConditionCategory & condCategory() const
get / set the category of the condition
Definition: L1GtCondition.h:68
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
virtual void print(std::ostream &myCout) const
print the condition
L1GtConditionCategory m_cond1Category
bool m_condGEq
the operator used for the condition (&gt;=, =): true for &gt;=
const bool condGEq() const
get / set condition GEq flag
const CorrelationParameter * correlationParameter() const
get / set correlation parameters
int m_condChipNr
condition is located on condition chip m_condChipNr
CorrelationParameter m_correlationParameter