CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
30  void HcalTBEventPosition::getChamberHits ( char chamberch,
31  vector<double>& xvec,
32  vector<double>& yvec ) const {
33  switch (chamberch) {
34  case 'A': xvec = ax_; yvec = ay_; break;
35  case 'B': xvec = bx_; yvec = by_; break;
36  case 'C': xvec = cx_; yvec = cy_; break;
37  case 'D': xvec = dx_; yvec = dy_; break;
38  case 'E': xvec = ex_; yvec = ey_; break;
39  case 'F': xvec = fx_; yvec = fy_; break;
40  case 'G': xvec = gx_; yvec = gy_; break;
41  case 'H': xvec = hx_; yvec = hy_; break;
42  default:
43  cerr << "Unrecognized chamber character " << chamberch << endl;
44  return;
45  }
46  }
47 
48  void HcalTBEventPosition::setChamberHits ( char chamberch,
49  const vector<double>& xvec,
50  const vector<double>& yvec ) {
51  switch (chamberch) {
52  case 'A': ax_ = xvec; ay_ = yvec; break;
53  case 'B': bx_ = xvec; by_ = yvec; break;
54  case 'C': cx_ = xvec; cy_ = yvec; break;
55  case 'D': dx_ = xvec; dy_ = yvec; break;
56  case 'E': ex_ = xvec; ey_ = yvec; break;
57  case 'F': fx_ = xvec; fy_ = yvec; break;
58  case 'G': gx_ = xvec; gy_ = yvec; break;
59  case 'H': hx_ = xvec; hy_ = yvec; break;
60  default:
61  cerr << "Unrecognized chamber character " << chamberch << endl;
62  return;
63  }
64  }
65 
66  void HcalTBEventPosition::setHFtableCoords( double x, double y, double v ) {
67  hfTableX_ = x;
68  hfTableY_ = y;
69  hfTableV_ = v;
70  }
71 
75  }
76 
77  ostream& operator<<(ostream& s, const HcalTBEventPosition& htbep) {
78  s << "HF Table (X,Y,V) = (" << htbep.hfTableX() << "," << htbep.hfTableY() << "," << htbep.hfTableV() << ")" << std::endl;
79  s << "HB/HE Table (eta,phi) = (" << htbep.hbheTableEta() << "," << htbep.hbheTablePhi() << ")" << std::endl;
80 
81  vector<double> xvec, yvec;
82  vector<double>::const_iterator j;
83 
84  htbep.getChamberHits('A', xvec, yvec);
85 
86  s << "WC Ax: ";
87  for (j=xvec.begin(); j!=xvec.end(); j++) {
88  if (j!=xvec.begin()) s << ", ";
89  s << *j;
90  }
91  s << endl;
92 
93  s << "WC Ay: ";
94  for (j=yvec.begin(); j!=yvec.end(); j++) {
95  if (j!=yvec.begin()) s << ", ";
96  s << *j;
97  }
98  s << endl;
99 
100  htbep.getChamberHits('B', xvec, yvec);
101 
102  s << "WC Bx: ";
103  for (j=xvec.begin(); j!=xvec.end(); j++) {
104  if (j!=xvec.begin()) s << ", ";
105  s << *j;
106  }
107  s << endl;
108 
109  s << "WC By: ";
110  for (j=yvec.begin(); j!=yvec.end(); j++) {
111  if (j!=yvec.begin()) s << ", ";
112  s << *j;
113  }
114  s << endl;
115 
116  htbep.getChamberHits('C', xvec, yvec);
117 
118  s << "WC Cx: ";
119  for (j=xvec.begin(); j!=xvec.end(); j++) {
120  if (j!=xvec.begin()) s << ", ";
121  s << *j;
122  }
123  s << endl;
124 
125  s << "WC Cy: ";
126  for (j=yvec.begin(); j!=yvec.end(); j++) {
127  if (j!=yvec.begin()) s << ", ";
128  s << *j;
129  }
130  s << endl;
131 
132  htbep.getChamberHits('D', xvec, yvec);
133 
134  s << "WC Dx: ";
135  for (j=xvec.begin(); j!=xvec.end(); j++) {
136  if (j!=xvec.begin()) s << ", ";
137  s << *j;
138  }
139  s << endl;
140 
141  s << "WC Dy: ";
142  for (j=yvec.begin(); j!=yvec.end(); j++) {
143  if (j!=yvec.begin()) s << ", ";
144  s << *j;
145  }
146  s << endl;
147 
148  htbep.getChamberHits('E', xvec, yvec);
149 
150  s << "WC Ex: ";
151  for (j=xvec.begin(); j!=xvec.end(); j++) {
152  if (j!=xvec.begin()) s << ", ";
153  s << *j;
154  }
155  s << endl;
156 
157  s << "WC Ey: ";
158  for (j=yvec.begin(); j!=yvec.end(); j++) {
159  if (j!=yvec.begin()) s << ", ";
160  s << *j;
161  }
162  s << endl;
163 
164  htbep.getChamberHits('F', xvec, yvec);
165 
166  s << "WC Fx: ";
167  for (j=xvec.begin(); j!=xvec.end(); j++) {
168  if (j!=xvec.begin()) s << ", ";
169  s << *j;
170  }
171  s << endl;
172 
173  s << "WC Fy: ";
174  for (j=yvec.begin(); j!=yvec.end(); j++) {
175  if (j!=yvec.begin()) s << ", ";
176  s << *j;
177  }
178  s << endl;
179 
180  htbep.getChamberHits('G', xvec, yvec);
181 
182  s << "WC Gx: ";
183  for (j=xvec.begin(); j!=xvec.end(); j++) {
184  if (j!=xvec.begin()) s << ", ";
185  s << *j;
186  }
187  s << endl;
188 
189  s << "WC Gy: ";
190  for (j=yvec.begin(); j!=yvec.end(); j++) {
191  if (j!=yvec.begin()) s << ", ";
192  s << *j;
193  }
194  s << endl;
195 
196  htbep.getChamberHits('H', xvec, yvec);
197 
198  s << "WC Hx: ";
199  for (j=xvec.begin(); j!=xvec.end(); j++) {
200  if (j!=xvec.begin()) s << ", ";
201  s << *j;
202  }
203  s << endl;
204 
205  s << "WC Hy: ";
206  for (j=yvec.begin(); j!=yvec.end(); j++) {
207  if (j!=yvec.begin()) s << ", ";
208  s << *j;
209  }
210  s << endl;
211 
212  return s;
213  }
std::vector< double > gx_
std::vector< double > ex_
void setChamberHits(char chamberch, const std::vector< double > &xvec, const std::vector< double > &yvec)
std::vector< double > dx_
std::vector< double > by_
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
std::vector< double > hy_
double hfTableY() const
Get the Y position (mm) of the HF table (if present in this run)
void setHBHEtableCoords(double eta, double phi)
T x() const
Cartesian x coordinate.
std::vector< double > fy_
std::vector< double > cx_
std::vector< double > hx_
int j
Definition: DBlmapReader.cc:9
double hfTableV() const
Get the V position of the HF table (if present in this run)
std::vector< double > ey_
std::vector< double > dy_
Geom::Phi< T > phi() const
double hbheTableEta() const
Get the eta (not ieta) position of the HB/HE/HO table (if present in this run)
std::vector< double > bx_
std::vector< double > ax_
void setHFtableCoords(double x, double y, double v)
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 > cy_
HcalTBEventPosition()
Null constructor.
double hbheTablePhi() const
Get the phi (not iphi) position of the HB/HE/HO table (if present in this run)
std::vector< double > gy_
std::vector< double > fx_
std::vector< double > ay_
double hfTableX() const
Get the X position (mm) of the HF table (if present in this run)