Constructor.
53 for (vector<DTRecHit1D>::const_iterator
hit =
hits.begin();
hit !=
hits.end(); ++
hit) {
56 InfoLayer* layInfo =
new InfoLayer((*
hit), isl, dir, pos, sync);
57 int ilay = layInfo->idWire.layer();
72 if ((*ilay) ==
nullptr) {
79 else if (lOrR == Right)
89 layersIn += (*ilay)->idWire.layer();
103 if (layersIn <= 8 || layersIn == 10) {
107 if (layersIn <= 7 || layersIn >= 9) {
111 if (layersIn == 6 || layersIn >= 8) {
124 float halfCell = 2.1;
126 unsigned t0Factor = 99;
131 cout <<
"t1, t2, t3, t4: " << t1 <<
" " << t2 <<
" " << t3 <<
" " << t4 << endl;
132 cout <<
"x1, x2, x3, x4: " << x1 <<
" " << x2 <<
" " << x3 <<
" " << x4 << endl;
136 unsigned hSubGroup = 99;
137 if (t1 == 0. || t2 == 0. || t3 == 0. || t4 == 0.)
139 else if (t1 <= 5. || t2 <= 5. || t3 <= 5. || t4 <= 5.)
141 else if (t1 <= 10. || t2 <= 10. || t3 <= 10. || t4 <= 10.)
143 else if (t1 <= 20. || t2 <= 20. || t3 <= 20. || t4 <= 20.)
145 else if (t1 <= 50. || t2 <= 50. || t3 <= 50. || t4 <= 50.)
148 if ((layersIn == 6 || layersIn == 10) && (fabs(x1 - x3) < delta)) {
152 if (type ==
"LRL" || type ==
"RLR") {
154 t = (t1 +
t3) / 2. + t2;
158 t = (t3 -
t1) / 2. + t2;
162 t = (t1 -
t3) / 2. + t2;
169 theTMaxes[cGroup] =
new TMax(t, cGroup, type, sigma, t0Factor, hSubGroup);
171 cout <<
"tmax123 " << t <<
" " << type << endl;
173 if (layersIn == 7 || layersIn == 10) {
178 if ((
theSegType ==
"LRLR" && type ==
"LRR" && x1 > x4) || (
theSegType ==
"RLRL" && type ==
"RLL" && x1 < x4)) {
180 t = 1.5 * t2 + t1 - t4 / 2.;
182 }
else if ((type ==
"LLR" &&
theSegDir == R && (fabs(x2 - x4) < delta) && x1 < x2) ||
183 (type ==
"RRL" &&
theSegDir ==
L && (fabs(x2 - x4) < delta) && x1 > x2)) {
185 t = 1.5 * t2 - t1 + t4 / 2.;
187 }
else if ((type ==
"LLL" &&
theSegDir == R && (fabs(x2 - x4) < delta) && x1 < x2) ||
188 (type ==
"RRR" &&
theSegDir ==
L && (fabs(x2 - x4) < delta) && x1 > x2)) {
190 t = 1.5 * t2 - t1 - t4 / 2.;
192 }
else if ((type ==
"LLL" &&
theSegDir ==
L && (fabs(x2 - x4) < delta)) ||
193 (type ==
"RRR" &&
theSegDir == R && (fabs(x2 - x4) < delta))) {
195 t = -1.5 * t2 + t1 + t4 / 2.;
197 }
else if ((type ==
"LRL" &&
theSegDir ==
L && (fabs(x2 - x4) < delta)) ||
198 (type ==
"RLR" &&
theSegDir == R && (fabs(x2 - x4) < delta))) {
200 t = 1.5 * t2 + t1 + t4 / 2.;
202 }
else if ((type ==
"LRL" &&
theSegDir == R && (fabs(x1 - x4) < (halfCell + delta))) ||
203 (type ==
"RLR" &&
theSegDir ==
L && (fabs(x1 - x4) < (halfCell + delta)))) {
205 t = 3. / 4. * t2 + t1 / 2. + t4 / 4.;
208 }
else if ((type ==
"LRR" &&
theSegDir == R && x1 < x4 && (fabs(x1 - x4) < (halfCell + delta))) ||
209 (type ==
"RLL" &&
theSegDir ==
L && x1 > x4 && (fabs(x1 - x4) < (halfCell + delta)))) {
211 t = 3. / 4. * t2 + t1 / 2. - t4 / 4.;
219 theTMaxes[cGroup] =
new TMax(t, cGroup, type, sigma, t0Factor, hSubGroup);
221 cout <<
"tmax124 " << t <<
" " << t0Factor <<
" " << type << endl;
223 if (layersIn == 8 || layersIn == 10) {
228 if ((type ==
"LLR" && x1 > x4 &&
theSegType ==
"LRLR") || (type ==
"RRL" && x1 < x4 &&
theSegType ==
"RLRL")) {
230 t = 1.5 * t3 + t4 - t1 / 2.;
232 }
else if ((type ==
"LLR" && x1 < x4 && (fabs(x1 - x4) < (halfCell + delta))) ||
233 (type ==
"RRL" && x1 > x4 && (fabs(x1 - x4) < (halfCell + delta)))) {
235 t = 3. / 4. * t3 + t4 / 2. - t1 / 4.;
238 }
else if ((type ==
"LRR" &&
theSegDir == R && x1 < x4 && (fabs(x1 - x3) < delta)) ||
239 (type ==
"RLL" &&
theSegDir ==
L && x1 > x4 && (fabs(x1 - x3) < delta))) {
241 t = 1.5 * t3 - t4 + t1 / 2.;
243 }
else if ((type ==
"LRL" &&
theSegDir == R && (fabs(x1 - x3) < delta)) ||
244 (type ==
"RLR" &&
theSegDir ==
L && (fabs(x1 - x3) < delta))) {
246 t = 1.5 * t3 + t4 + t1 / 2.;
248 }
else if ((type ==
"LRL" &&
theSegDir ==
L && (fabs(x1 - x3) < (2. * halfCell + delta))) ||
249 (type ==
"RLR" &&
theSegDir == R && (fabs(x1 - x3) < (2. * halfCell + delta)))) {
251 t = 3. / 4. * t3 + t4 / 2. + t1 / 4.;
254 }
else if ((type ==
"LLL" &&
theSegDir ==
L && x1 > x4 && (fabs(x1 - x3) < delta)) ||
255 (type ==
"RRR" &&
theSegDir == R && x1 < x4 && (fabs(x1 - x3) < delta))) {
257 t = 1.5 * t3 - t4 - t1 / 2.;
259 }
else if ((type ==
"LLL" &&
theSegDir == R && (fabs(x1 - x3) < delta)) ||
260 (type ==
"RRR" &&
theSegDir ==
L && (fabs(x1 - x3) < delta))) {
262 t = -1.5 * t3 + t4 + t1 / 2.;
269 theTMaxes[cGroup] =
new TMax(t, cGroup, type, sigma, t0Factor, hSubGroup);
271 cout <<
"tmax134 " << t <<
" " << t0Factor <<
" " << type << endl;
273 if ((layersIn == 9 || layersIn == 10) && (fabs(x2 - x4) < delta)) {
276 ((type += theSegType[1]) += theSegType[2]) += theSegType[3];
278 if ((type ==
"LRL") || (type ==
"RLR")) {
280 t = (t2 + t4) / 2. + t3;
284 t = (t2 - t4) / 2. + t3;
288 t = (t4 -
t2) / 2. + t3;
295 theTMaxes[cGroup] =
new TMax(t, cGroup, type, sigma, t0Factor, hSubGroup);
297 cout <<
"tmax234 " << t <<
" " << type << endl;
DTCellSide
Which side of the DT cell.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
InfoLayer *& getInfoLayer(int layer)
std::vector< TMax * > theTMaxes
std::vector< InfoLayer * > theInfoLayers