CMS 3D CMS Logo

HcalTBEventPosition.cc
Go to the documentation of this file.
2 #include <cstdio>
3 
4 using namespace std;
5 
7  : hfTableX_(-1e24),
8  hfTableY_(-1e24),
9  hfTableV_(-1e24),
10  hbheTableEta_(-1000),
11  hbheTablePhi_(-1000),
12  ax_(),
13  ay_(),
14  bx_(),
15  by_(),
16  cx_(),
17  cy_(),
18  dx_(),
19  dy_(),
20  ex_(),
21  ey_(),
22  fx_(),
23  fy_(),
24  gx_(),
25  gy_(),
26  hx_(),
27  hy_() {}
28 
29 void HcalTBEventPosition::getChamberHits(char chamberch, vector<double>& xvec, vector<double>& yvec) const {
30  switch (chamberch) {
31  case 'A':
32  xvec = ax_;
33  yvec = ay_;
34  break;
35  case 'B':
36  xvec = bx_;
37  yvec = by_;
38  break;
39  case 'C':
40  xvec = cx_;
41  yvec = cy_;
42  break;
43  case 'D':
44  xvec = dx_;
45  yvec = dy_;
46  break;
47  case 'E':
48  xvec = ex_;
49  yvec = ey_;
50  break;
51  case 'F':
52  xvec = fx_;
53  yvec = fy_;
54  break;
55  case 'G':
56  xvec = gx_;
57  yvec = gy_;
58  break;
59  case 'H':
60  xvec = hx_;
61  yvec = hy_;
62  break;
63  default:
64  cerr << "Unrecognized chamber character " << chamberch << endl;
65  return;
66  }
67 }
68 
69 void HcalTBEventPosition::setChamberHits(char chamberch, const vector<double>& xvec, const vector<double>& yvec) {
70  switch (chamberch) {
71  case 'A':
72  ax_ = xvec;
73  ay_ = yvec;
74  break;
75  case 'B':
76  bx_ = xvec;
77  by_ = yvec;
78  break;
79  case 'C':
80  cx_ = xvec;
81  cy_ = yvec;
82  break;
83  case 'D':
84  dx_ = xvec;
85  dy_ = yvec;
86  break;
87  case 'E':
88  ex_ = xvec;
89  ey_ = yvec;
90  break;
91  case 'F':
92  fx_ = xvec;
93  fy_ = yvec;
94  break;
95  case 'G':
96  gx_ = xvec;
97  gy_ = yvec;
98  break;
99  case 'H':
100  hx_ = xvec;
101  hy_ = yvec;
102  break;
103  default:
104  cerr << "Unrecognized chamber character " << chamberch << endl;
105  return;
106  }
107 }
108 
109 void HcalTBEventPosition::setHFtableCoords(double x, double y, double v) {
110  hfTableX_ = x;
111  hfTableY_ = y;
112  hfTableV_ = v;
113 }
114 
116  hbheTableEta_ = eta;
117  hbheTablePhi_ = phi;
118 }
119 
120 ostream& operator<<(ostream& s, const HcalTBEventPosition& htbep) {
121  s << "HF Table (X,Y,V) = (" << htbep.hfTableX() << "," << htbep.hfTableY() << "," << htbep.hfTableV() << ")"
122  << std::endl;
123  s << "HB/HE Table (eta,phi) = (" << htbep.hbheTableEta() << "," << htbep.hbheTablePhi() << ")" << std::endl;
124 
125  vector<double> xvec, yvec;
126  vector<double>::const_iterator j;
127 
128  htbep.getChamberHits('A', xvec, yvec);
129 
130  s << "WC Ax: ";
131  for (j = xvec.begin(); j != xvec.end(); j++) {
132  if (j != xvec.begin())
133  s << ", ";
134  s << *j;
135  }
136  s << endl;
137 
138  s << "WC Ay: ";
139  for (j = yvec.begin(); j != yvec.end(); j++) {
140  if (j != yvec.begin())
141  s << ", ";
142  s << *j;
143  }
144  s << endl;
145 
146  htbep.getChamberHits('B', xvec, yvec);
147 
148  s << "WC Bx: ";
149  for (j = xvec.begin(); j != xvec.end(); j++) {
150  if (j != xvec.begin())
151  s << ", ";
152  s << *j;
153  }
154  s << endl;
155 
156  s << "WC By: ";
157  for (j = yvec.begin(); j != yvec.end(); j++) {
158  if (j != yvec.begin())
159  s << ", ";
160  s << *j;
161  }
162  s << endl;
163 
164  htbep.getChamberHits('C', xvec, yvec);
165 
166  s << "WC Cx: ";
167  for (j = xvec.begin(); j != xvec.end(); j++) {
168  if (j != xvec.begin())
169  s << ", ";
170  s << *j;
171  }
172  s << endl;
173 
174  s << "WC Cy: ";
175  for (j = yvec.begin(); j != yvec.end(); j++) {
176  if (j != yvec.begin())
177  s << ", ";
178  s << *j;
179  }
180  s << endl;
181 
182  htbep.getChamberHits('D', xvec, yvec);
183 
184  s << "WC Dx: ";
185  for (j = xvec.begin(); j != xvec.end(); j++) {
186  if (j != xvec.begin())
187  s << ", ";
188  s << *j;
189  }
190  s << endl;
191 
192  s << "WC Dy: ";
193  for (j = yvec.begin(); j != yvec.end(); j++) {
194  if (j != yvec.begin())
195  s << ", ";
196  s << *j;
197  }
198  s << endl;
199 
200  htbep.getChamberHits('E', xvec, yvec);
201 
202  s << "WC Ex: ";
203  for (j = xvec.begin(); j != xvec.end(); j++) {
204  if (j != xvec.begin())
205  s << ", ";
206  s << *j;
207  }
208  s << endl;
209 
210  s << "WC Ey: ";
211  for (j = yvec.begin(); j != yvec.end(); j++) {
212  if (j != yvec.begin())
213  s << ", ";
214  s << *j;
215  }
216  s << endl;
217 
218  htbep.getChamberHits('F', xvec, yvec);
219 
220  s << "WC Fx: ";
221  for (j = xvec.begin(); j != xvec.end(); j++) {
222  if (j != xvec.begin())
223  s << ", ";
224  s << *j;
225  }
226  s << endl;
227 
228  s << "WC Fy: ";
229  for (j = yvec.begin(); j != yvec.end(); j++) {
230  if (j != yvec.begin())
231  s << ", ";
232  s << *j;
233  }
234  s << endl;
235 
236  htbep.getChamberHits('G', xvec, yvec);
237 
238  s << "WC Gx: ";
239  for (j = xvec.begin(); j != xvec.end(); j++) {
240  if (j != xvec.begin())
241  s << ", ";
242  s << *j;
243  }
244  s << endl;
245 
246  s << "WC Gy: ";
247  for (j = yvec.begin(); j != yvec.end(); j++) {
248  if (j != yvec.begin())
249  s << ", ";
250  s << *j;
251  }
252  s << endl;
253 
254  htbep.getChamberHits('H', xvec, yvec);
255 
256  s << "WC Hx: ";
257  for (j = xvec.begin(); j != xvec.end(); j++) {
258  if (j != xvec.begin())
259  s << ", ";
260  s << *j;
261  }
262  s << endl;
263 
264  s << "WC Hy: ";
265  for (j = yvec.begin(); j != yvec.end(); j++) {
266  if (j != yvec.begin())
267  s << ", ";
268  s << *j;
269  }
270  s << endl;
271 
272  return s;
273 }
HcalTBEventPosition::setHBHEtableCoords
void setHBHEtableCoords(double eta, double phi)
Definition: HcalTBEventPosition.cc:115
HcalTBEventPosition
Definition: HcalTBEventPosition.h:18
DDAxes::y
HcalTBEventPosition::gx_
std::vector< double > gx_
Definition: HcalTBEventPosition.h:51
HcalTBEventPosition::HcalTBEventPosition
HcalTBEventPosition()
Null constructor.
Definition: HcalTBEventPosition.cc:6
HcalTBEventPosition::gy_
std::vector< double > gy_
Definition: HcalTBEventPosition.h:51
HcalTBEventPosition::hbheTableEta
double hbheTableEta() const
Get the eta (not ieta) position of the HB/HE/HO table (if present in this run)
Definition: HcalTBEventPosition.h:30
DDAxes::x
findQualityFiles.v
v
Definition: findQualityFiles.py:179
HcalTBEventPosition::hfTableX
double hfTableX() const
Get the X position (mm) of the HF table (if present in this run)
Definition: HcalTBEventPosition.h:24
HcalTBEventPosition::hfTableX_
double hfTableX_
Definition: HcalTBEventPosition.h:48
HcalTBEventPosition::hx_
std::vector< double > hx_
Definition: HcalTBEventPosition.h:51
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HcalTBEventPosition::ex_
std::vector< double > ex_
Definition: HcalTBEventPosition.h:51
HcalTBEventPosition::dx_
std::vector< double > dx_
Definition: HcalTBEventPosition.h:51
HcalTBEventPosition::by_
std::vector< double > by_
Definition: HcalTBEventPosition.h:51
PVValHelper::eta
Definition: PVValidationHelpers.h:70
HcalTBEventPosition::ay_
std::vector< double > ay_
Definition: HcalTBEventPosition.h:51
HcalTBEventPosition::ey_
std::vector< double > ey_
Definition: HcalTBEventPosition.h:51
HcalTBEventPosition::hy_
std::vector< double > hy_
Definition: HcalTBEventPosition.h:51
operator<<
ostream & operator<<(ostream &s, const HcalTBEventPosition &htbep)
Definition: HcalTBEventPosition.cc:120
HcalTBEventPosition::setChamberHits
void setChamberHits(char chamberch, const std::vector< double > &xvec, const std::vector< double > &yvec)
Definition: HcalTBEventPosition.cc:69
HcalTBEventPosition::getChamberHits
void getChamberHits(char chamberch, std::vector< double > &xvec, std::vector< double > &yvec) const
Get the wire chamber hits for the specified chamber For HB/HE/HO running, chambers A,...
Definition: HcalTBEventPosition.cc:29
HcalTBEventPosition::hfTableV
double hfTableV() const
Get the V position of the HF table (if present in this run)
Definition: HcalTBEventPosition.h:28
PVValHelper::phi
Definition: PVValidationHelpers.h:69
HcalTBEventPosition::cx_
std::vector< double > cx_
Definition: HcalTBEventPosition.h:51
HcalTBEventPosition::cy_
std::vector< double > cy_
Definition: HcalTBEventPosition.h:51
HcalTBEventPosition::hbheTablePhi_
double hbheTablePhi_
Definition: HcalTBEventPosition.h:49
HcalTBEventPosition::hbheTableEta_
double hbheTableEta_
Definition: HcalTBEventPosition.h:49
HcalTBEventPosition::fx_
std::vector< double > fx_
Definition: HcalTBEventPosition.h:51
DDAxes::phi
HcalTBEventPosition::ax_
std::vector< double > ax_
Definition: HcalTBEventPosition.h:51
HcalTBEventPosition::hbheTablePhi
double hbheTablePhi() const
Get the phi (not iphi) position of the HB/HE/HO table (if present in this run)
Definition: HcalTBEventPosition.h:32
HcalTBEventPosition::bx_
std::vector< double > bx_
Definition: HcalTBEventPosition.h:51
std
Definition: JetResolutionObject.h:76
HcalTBEventPosition::setHFtableCoords
void setHFtableCoords(double x, double y, double v)
Definition: HcalTBEventPosition.cc:109
genVertex_cff.x
x
Definition: genVertex_cff.py:12
HcalTBEventPosition.h
HcalTBEventPosition::hfTableY_
double hfTableY_
Definition: HcalTBEventPosition.h:48
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
HcalTBEventPosition::hfTableV_
double hfTableV_
Definition: HcalTBEventPosition.h:48
HcalTBEventPosition::fy_
std::vector< double > fy_
Definition: HcalTBEventPosition.h:51
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
HcalTBEventPosition::dy_
std::vector< double > dy_
Definition: HcalTBEventPosition.h:51
HcalTBEventPosition::hfTableY
double hfTableY() const
Get the Y position (mm) of the HF table (if present in this run)
Definition: HcalTBEventPosition.h:26