CMS 3D CMS Logo

CorrelationWithOverlapRemovalTemplate.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 three objects
43  int nObjects = nrObjects();
44 
45  if (nObjects > 0) {
46  m_objectType.reserve(nObjects);
47  }
48 
52  m_cond0Index = -1;
53  m_cond1Index = -1;
54  m_cond2Index = -1;
55 
56 }
57 
58 // from condition name
60  : GlobalCondition(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 
77  m_cond0Index = -1;
78  m_cond1Index = -1;
79  m_cond2Index = -1;
80 
81 }
82 
83 // from condition name, the category of first sub-condition, the category of the
84 // second sub-condition, the index of first sub-condition in the cor* vector,
85 // the index of second sub-condition in the cor* vector
87  const l1t::GtConditionCategory& cond0Cat,
88  const l1t::GtConditionCategory& cond1Cat,
89  const l1t::GtConditionCategory& cond2Cat,
90  const int cond0Index,
91  const int cond1index,
92  const int cond2index) :
93  GlobalCondition(cName),
94  m_cond0Category(cond0Cat),
95  m_cond1Category(cond1Cat),
96  m_cond2Category(cond2Cat),
97  m_cond0Index(cond0Index),
98  m_cond1Index(cond1index),
99  m_cond2Index(cond2index)
100 
101 {
102 
105  m_condChipNr = -1;
106 
107  // there are in fact two objects
108  int nObjects = nrObjects();
109 
110  if (nObjects> 0) {
111  m_objectType.resize(nObjects);
112  }
113 }
114 
115 // copy constructor
118 {
119  copy(cp);
120 }
121 
122 // destructor
124 {
125  // empty now
126 }
127 
128 // assign operator
130 {
131 
132  copy(cp);
133  return *this;
134 }
135 
136 // set the category of the two sub-conditions
138  const l1t::GtConditionCategory& condCateg) {
139 
140  m_cond0Category = condCateg;
141 }
142 
144  const l1t::GtConditionCategory& condCateg) {
145 
146  m_cond1Category = condCateg;
147 }
148 
150  const l1t::GtConditionCategory& condCateg) {
151 
152  m_cond2Category = condCateg;
153 }
154 
155 
156 // set the index of the two sub-conditions in the cor* vector from menu
158  m_cond0Index = condIndex;
159 }
160 
162  m_cond1Index = condIndex;
163 }
164 
166  m_cond2Index = condIndex;
167 }
168 
169 
170 // set the correlation parameters of the condition
172  const CorrelationWithOverlapRemovalParameter& corrParameter) {
173 
174  m_correlationParameter = corrParameter;
175 
176 }
177 
178 void CorrelationWithOverlapRemovalTemplate::print(std::ostream& myCout) const
179 {
180 
181  myCout << "\n CorrelationWithOverlapRemovalTemplate print..." << std::endl;
182 
183  GlobalCondition::print(myCout);
184 
185  myCout << "\n First sub-condition category: " << m_cond0Category << std::endl;
186  myCout << " Second sub-condition category: " << m_cond1Category << std::endl;
187  myCout << " Third sub-condition category: " << m_cond2Category << std::endl;
188 
189  myCout << "\n First sub-condition index: " << m_cond0Index << std::endl;
190  myCout << " Second sub-condition index: " << m_cond1Index << std::endl;
191  myCout << " Third sub-condition index: " << m_cond2Index << std::endl;
192 
193  myCout << "\n CorrelationWithOverlapRemoval parameters " << "[ hex ]" << std::endl;
194 
195  myCout << " Cut Type: " << m_correlationParameter.corrCutType << std::endl;
196  myCout << " minEtaCutValue = " << std::dec << m_correlationParameter.minEtaCutValue << std::endl;
197  myCout << " maxEtaCutValue = " << std::dec << m_correlationParameter.maxEtaCutValue << std::endl;
198  myCout << " precEtaCut = " << std::dec << m_correlationParameter.precEtaCut << std::endl;
199  myCout << " minPhiCutValue = " << std::dec << m_correlationParameter.minPhiCutValue << std::endl;
200  myCout << " maxPhiCutValue = " << std::dec << m_correlationParameter.maxPhiCutValue << std::endl;
201  myCout << " precPhiCut = " << std::dec << m_correlationParameter.precPhiCut << std::endl;
202  myCout << " minDRCutValue = " << std::dec << m_correlationParameter.minDRCutValue << std::endl;
203  myCout << " maxDRCutValue = " << std::dec << m_correlationParameter.maxDRCutValue << std::endl;
204  myCout << " precDRCut = " << std::dec << m_correlationParameter.precDRCut << std::endl;
205  myCout << " minMassCutValue = " << std::dec << m_correlationParameter.minMassCutValue<< std::endl;
206  myCout << " maxMassCutValue = " << std::dec << m_correlationParameter.maxMassCutValue<< std::endl;
207  myCout << " precMassCut = " << std::dec << m_correlationParameter.precMassCut << std::endl;
208  myCout << " minOverlapRemovalEtaCutValue = " << std::dec << m_correlationParameter.minOverlapRemovalEtaCutValue << std::endl;
209  myCout << " maxOverlapRemovalEtaCutValue = " << std::dec << m_correlationParameter.maxOverlapRemovalEtaCutValue << std::endl;
210  myCout << " precOverlapRemovalEtaCut = " << std::dec << m_correlationParameter.precOverlapRemovalEtaCut << std::endl;
211  myCout << " minOverlapRemovalPhiCutValue = " << std::dec << m_correlationParameter.minOverlapRemovalPhiCutValue << std::endl;
212  myCout << " maxOverlapRemovalPhiCutValue = " << std::dec << m_correlationParameter.maxOverlapRemovalPhiCutValue << std::endl;
213  myCout << " precOverlapRemovalPhiCut = " << std::dec << m_correlationParameter.precOverlapRemovalPhiCut << std::endl;
214  myCout << " minOverlapRemovalDRCutValue = " << std::dec << m_correlationParameter.minOverlapRemovalDRCutValue << std::endl;
215  myCout << " maxOverlapRemovalDRCutValue = " << std::dec << m_correlationParameter.maxOverlapRemovalDRCutValue << std::endl;
216  myCout << " precOverlapRemovalDRCut = " << std::dec << m_correlationParameter.precOverlapRemovalDRCut << std::endl;
217 
218  myCout << " chargeCorrelation = " << std::dec << m_correlationParameter.chargeCorrelation << std::endl;
219 
220  // reset to decimal output
221  myCout << std::dec << std::endl;
222 }
223 
225 {
226 
227  m_condName = cp.condName();
229  m_condType = cp.condType();
230  m_objectType = cp.objectType();
231  m_condGEq = cp.condGEq();
232  m_condChipNr = cp.condChipNr();
233 
237  m_cond0Index = cp.cond0Index();
238  m_cond1Index = cp.cond1Index();
239  m_cond2Index = cp.cond2Index();
240 
242 
243 }
244 
245 // output stream operator
246 std::ostream& operator<<(std::ostream& os, const CorrelationWithOverlapRemovalTemplate& result)
247 {
248  result.print(os);
249  return os;
250 
251 }
252 
253 
254 
const int nrObjects() const
get number of trigger objects
friend std::ostream & operator<<(std::ostream &, const CorrelationWithOverlapRemovalTemplate &)
output stream operator
const l1t::GtConditionCategory cond1Category() const
bool m_condGEq
the operator used for the condition (>=, =): true for >=
void print(std::ostream &myCout) const override
print the condition
const bool condGEq() const
get / set condition GEq flag
const l1t::GtConditionCategory & condCategory() const
get / set the category of the condition
CorrelationWithOverlapRemovalTemplate & operator=(const CorrelationWithOverlapRemovalTemplate &)
assign operator
const l1t::GtConditionType & condType() const
get / set the type of the condition (1s, etc)
void setCorrelationWithOverlapRemovalParameter(const CorrelationWithOverlapRemovalParameter &corrParameter)
GtConditionCategory
condition categories
void setCond0Category(const l1t::GtConditionCategory &)
const std::vector< l1t::GlobalObject > & objectType() const
get / set the trigger object type(s) in the condition
CorrelationWithOverlapRemovalParameter m_correlationParameter
std::string m_condName
the name of the condition
const int & condChipNr() const
get / set the condition-chip number the condition is located on
const l1t::GtConditionCategory cond0Category() const
get / set the category of the thre sub-conditions
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
void setCond2Category(const l1t::GtConditionCategory &)
virtual void print(std::ostream &myCout) const
print condition
const CorrelationWithOverlapRemovalParameter * correlationParameter() const
get / set correlation parameters
void copy(const CorrelationWithOverlapRemovalTemplate &cp)
copy function for copy constructor and operator=
const l1t::GtConditionCategory cond2Category() const
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
void setCond1Category(const l1t::GtConditionCategory &)
std::vector< l1t::GlobalObject > m_objectType
the trigger object type(s)
l1t::GtConditionType m_condType
the type of the condition (1s, etc)