CMS 3D CMS Logo

CorrelationTemplate.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 
29 // forward declarations
30 
31 // constructors
32 // default
33 
35  : GlobalCondition()
36 {
37 
40  m_condChipNr = -1;
41 
42  // there are in fact two objects
43  int nObjects = nrObjects();
44 
45  if (nObjects > 0) {
46  m_objectType.reserve(nObjects);
47  }
48 
51  m_cond0Index = -1;
52  m_cond1Index = -1;
53 
54 }
55 
56 // from condition name
58  : GlobalCondition(cName)
59 {
60 
63  m_condChipNr = -1;
64 
65  // there are in fact two objects
66  int nObjects = nrObjects();
67 
68  if (nObjects > 0) {
69  m_objectType.reserve(nObjects);
70  }
71 
74  m_cond0Index = -1;
75  m_cond1Index = -1;
76 
77 }
78 
79 // from condition name, the category of first sub-condition, the category of the
80 // second sub-condition, the index of first sub-condition in the cor* vector,
81 // the index of second sub-condition in the cor* vector
83  const l1t::GtConditionCategory& cond0Cat,
84  const l1t::GtConditionCategory& cond1Cat,
85  const int cond0Index,
86  const int cond1index) :
87  GlobalCondition(cName),
88  m_cond0Category(cond0Cat),
89  m_cond1Category(cond1Cat),
90  m_cond0Index(cond0Index),
91  m_cond1Index(cond1index)
92 
93 {
94 
97  m_condChipNr = -1;
98 
99  // there are in fact two objects
100  int nObjects = nrObjects();
101 
102  if (nObjects> 0) {
103  m_objectType.resize(nObjects);
104  }
105 }
106 
107 // copy constructor
110 {
111  copy(cp);
112 }
113 
114 // destructor
116 {
117  // empty now
118 }
119 
120 // assign operator
122 {
123 
124  copy(cp);
125  return *this;
126 }
127 
128 // set the category of the two sub-conditions
130  const l1t::GtConditionCategory& condCateg) {
131 
132  m_cond0Category = condCateg;
133 }
134 
136  const l1t::GtConditionCategory& condCateg) {
137 
138  m_cond1Category = condCateg;
139 }
140 
141 
142 // set the index of the two sub-conditions in the cor* vector from menu
143 void CorrelationTemplate::setCond0Index(const int& condIndex) {
144  m_cond0Index = condIndex;
145 }
146 
147 void CorrelationTemplate::setCond1Index(const int& condIndex) {
148  m_cond1Index = condIndex;
149 }
150 
151 
152 // set the correlation parameters of the condition
154  const CorrelationParameter& corrParameter) {
155 
156  m_correlationParameter = corrParameter;
157 
158 }
159 
160 void CorrelationTemplate::print(std::ostream& myCout) const
161 {
162 
163  myCout << "\n CorrelationTemplate print..." << std::endl;
164 
165  GlobalCondition::print(myCout);
166 
167  myCout << "\n First sub-condition category: " << m_cond0Category << std::endl;
168  myCout << " Second sub-condition category: " << m_cond1Category << std::endl;
169 
170  myCout << "\n First sub-condition index: " << m_cond0Index << std::endl;
171  myCout << " Second sub-condition index: " << m_cond1Index << std::endl;
172 
173  myCout << "\n Correlation parameters " << "[ hex ]" << std::endl;
174 
175  myCout << " Cut Type: " << m_correlationParameter.corrCutType << std::endl;
176  myCout << " minEtaCutValue = " << std::dec << m_correlationParameter.minEtaCutValue << std::endl;
177  myCout << " maxEtaCutValue = " << std::dec << m_correlationParameter.maxEtaCutValue << std::endl;
178  myCout << " precEtaCut = " << std::dec << m_correlationParameter.precEtaCut << std::endl;
179  myCout << " minPhiCutValue = " << std::dec << m_correlationParameter.minPhiCutValue << std::endl;
180  myCout << " maxPhiCutValue = " << std::dec << m_correlationParameter.maxPhiCutValue << std::endl;
181  myCout << " precPhiCut = " << std::dec << m_correlationParameter.precPhiCut << std::endl;
182  myCout << " minDRCutValue = " << std::dec << m_correlationParameter.minDRCutValue << std::endl;
183  myCout << " maxDRCutValue = " << std::dec << m_correlationParameter.maxDRCutValue << std::endl;
184  myCout << " precDRCut = " << std::dec << m_correlationParameter.precDRCut << std::endl;
185  myCout << " minMassCutValue = " << std::dec << m_correlationParameter.minMassCutValue<< std::endl;
186  myCout << " maxMassCutValue = " << std::dec << m_correlationParameter.maxMassCutValue<< std::endl;
187  myCout << " precMassCut = " << std::dec << m_correlationParameter.precMassCut << std::endl;
188  myCout << " minTBPTCutValue = " << std::dec << m_correlationParameter.minTBPTCutValue<< std::endl;
189  myCout << " maxTBPTCutValue = " << std::dec << m_correlationParameter.maxTBPTCutValue<< std::endl;
190  myCout << " precTBPTCut = " << std::dec << m_correlationParameter.precTBPTCut << std::endl;
191 
192  myCout << " chargeCorrelation = " << std::dec << m_correlationParameter.chargeCorrelation << std::endl;
193 
194  // reset to decimal output
195  myCout << std::dec << std::endl;
196 }
197 
199 {
200 
201  m_condName = cp.condName();
203  m_condType = cp.condType();
204  m_objectType = cp.objectType();
205  m_condGEq = cp.condGEq();
206  m_condChipNr = cp.condChipNr();
207 
210  m_cond0Index = cp.cond0Index();
211  m_cond1Index = cp.cond1Index();
212 
214 
215 }
216 
217 // output stream operator
218 std::ostream& operator<<(std::ostream& os, const CorrelationTemplate& result)
219 {
220  result.print(os);
221  return os;
222 
223 }
const int nrObjects() const
get number of trigger objects
void setCond0Index(const int &)
CorrelationParameter m_correlationParameter
const l1t::GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
void setCorrelationParameter(const CorrelationParameter &corrParameter)
bool m_condGEq
the operator used for the condition (>=, =): true for >=
const bool condGEq() const
get / set condition GEq flag
friend std::ostream & operator<<(std::ostream &, const CorrelationTemplate &)
output stream operator
const l1t::GtConditionCategory & condCategory() const
get / set the category of the condition
const l1t::GtConditionType & condType() const
get / set the type of the condition (1s, etc)
GtConditionCategory
condition categories
const l1t::GtConditionCategory cond1Category() const
~CorrelationTemplate() override
destructor
const std::vector< l1t::GlobalObject > & objectType() const
get / set the trigger object type(s) in the condition
void copy(const CorrelationTemplate &cp)
copy function for copy constructor and operator=
void setCond1Category(const l1t::GtConditionCategory &)
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
void print(std::ostream &myCout) const override
print the condition
const int cond1Index() const
std::string m_condName
the name of the condition
const int & condChipNr() const
get / set the condition-chip number the condition is located on
int m_condChipNr
condition is located on condition chip m_condChipNr
l1t::GtConditionCategory m_condCategory
the category of the condition
const std::string & condName() const
get / set condition name
l1t::GtConditionCategory m_cond1Category
l1t::GtConditionCategory m_cond0Category
virtual void print(std::ostream &myCout) const
print condition
void setCond0Category(const l1t::GtConditionCategory &)
const CorrelationParameter * correlationParameter() const
get / set correlation parameters
typedef for correlation parameters
std::vector< l1t::GlobalObject > m_objectType
the trigger object type(s)
CorrelationTemplate & operator=(const CorrelationTemplate &)
assign operator
l1t::GtConditionType m_condType
the type of the condition (1s, etc)
void setCond1Index(const int &)