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  char str[180];
79 
80  snprintf (str,180, "HF Table (X,Y,V) = (%f,%f,%f)\n",
81  htbep.hfTableX(),htbep.hfTableY(),htbep.hfTableV());
82  s << str;
83 
84  snprintf (str, 180, "HB/HE Table (eta,phi) = (%f,%f)\n",
85  htbep.hbheTableEta(),htbep.hbheTablePhi());
86  s << str;
87 
88  vector<double> xvec, yvec;
89  vector<double>::const_iterator j;
90 
91  htbep.getChamberHits('A', xvec, yvec);
92 
93  s << "WC Ax: ";
94  for (j=xvec.begin(); j!=xvec.end(); j++) {
95  if (j!=xvec.begin()) s << ", ";
96  s << *j;
97  }
98  s << endl;
99 
100  s << "WC Ay: ";
101  for (j=yvec.begin(); j!=yvec.end(); j++) {
102  if (j!=yvec.begin()) s << ", ";
103  s << *j;
104  }
105  s << endl;
106 
107  htbep.getChamberHits('B', xvec, yvec);
108 
109  s << "WC Bx: ";
110  for (j=xvec.begin(); j!=xvec.end(); j++) {
111  if (j!=xvec.begin()) s << ", ";
112  s << *j;
113  }
114  s << endl;
115 
116  s << "WC By: ";
117  for (j=yvec.begin(); j!=yvec.end(); j++) {
118  if (j!=yvec.begin()) s << ", ";
119  s << *j;
120  }
121  s << endl;
122 
123  htbep.getChamberHits('C', xvec, yvec);
124 
125  s << "WC Cx: ";
126  for (j=xvec.begin(); j!=xvec.end(); j++) {
127  if (j!=xvec.begin()) s << ", ";
128  s << *j;
129  }
130  s << endl;
131 
132  s << "WC Cy: ";
133  for (j=yvec.begin(); j!=yvec.end(); j++) {
134  if (j!=yvec.begin()) s << ", ";
135  s << *j;
136  }
137  s << endl;
138 
139  htbep.getChamberHits('D', xvec, yvec);
140 
141  s << "WC Dx: ";
142  for (j=xvec.begin(); j!=xvec.end(); j++) {
143  if (j!=xvec.begin()) s << ", ";
144  s << *j;
145  }
146  s << endl;
147 
148  s << "WC Dy: ";
149  for (j=yvec.begin(); j!=yvec.end(); j++) {
150  if (j!=yvec.begin()) s << ", ";
151  s << *j;
152  }
153  s << endl;
154 
155  htbep.getChamberHits('E', xvec, yvec);
156 
157  s << "WC Ex: ";
158  for (j=xvec.begin(); j!=xvec.end(); j++) {
159  if (j!=xvec.begin()) s << ", ";
160  s << *j;
161  }
162  s << endl;
163 
164  s << "WC Ey: ";
165  for (j=yvec.begin(); j!=yvec.end(); j++) {
166  if (j!=yvec.begin()) s << ", ";
167  s << *j;
168  }
169  s << endl;
170 
171  htbep.getChamberHits('F', xvec, yvec);
172 
173  s << "WC Fx: ";
174  for (j=xvec.begin(); j!=xvec.end(); j++) {
175  if (j!=xvec.begin()) s << ", ";
176  s << *j;
177  }
178  s << endl;
179 
180  s << "WC Fy: ";
181  for (j=yvec.begin(); j!=yvec.end(); j++) {
182  if (j!=yvec.begin()) s << ", ";
183  s << *j;
184  }
185  s << endl;
186 
187  htbep.getChamberHits('G', xvec, yvec);
188 
189  s << "WC Gx: ";
190  for (j=xvec.begin(); j!=xvec.end(); j++) {
191  if (j!=xvec.begin()) s << ", ";
192  s << *j;
193  }
194  s << endl;
195 
196  s << "WC Gy: ";
197  for (j=yvec.begin(); j!=yvec.end(); j++) {
198  if (j!=yvec.begin()) s << ", ";
199  s << *j;
200  }
201  s << endl;
202 
203  htbep.getChamberHits('H', xvec, yvec);
204 
205  s << "WC Hx: ";
206  for (j=xvec.begin(); j!=xvec.end(); j++) {
207  if (j!=xvec.begin()) s << ", ";
208  s << *j;
209  }
210  s << endl;
211 
212  s << "WC Hy: ";
213  for (j=yvec.begin(); j!=yvec.end(); j++) {
214  if (j!=yvec.begin()) s << ", ";
215  s << *j;
216  }
217  s << endl;
218 
219  return s;
220  }
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:187
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)