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 }
std::vector< double > gx_
std::vector< double > ex_
ostream & operator<<(ostream &s, const HcalTBEventPosition &htbep)
void setChamberHits(char chamberch, const std::vector< double > &xvec, const std::vector< double > &yvec)
double hfTableX() const
Get the X position (mm) of the HF table (if present in this run)
std::vector< double > dx_
std::vector< double > by_
double hfTableY() const
Get the Y position (mm) of the HF table (if present in this run)
std::vector< double > hy_
void setHBHEtableCoords(double eta, double phi)
std::vector< double > fy_
std::vector< double > cx_
std::vector< double > hx_
double hbheTablePhi() const
Get the phi (not iphi) position of the HB/HE/HO table (if present in this run)
std::vector< double > ey_
double hfTableV() const
Get the V position of the HF table (if present in this run)
std::vector< double > dy_
std::vector< double > bx_
std::vector< double > ax_
void setHFtableCoords(double x, double y, double v)
float x
std::vector< double > cy_
HcalTBEventPosition()
Null constructor.
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...
std::vector< double > gy_
std::vector< double > fx_
std::vector< double > ay_
double hbheTableEta() const
Get the eta (not ieta) position of the HB/HE/HO table (if present in this run)