Constructor.
54 for (vector<DTRecHit1D>::const_iterator
hit = hits.begin();
hit != hits.end(); ++
hit) {
57 InfoLayer* layInfo =
new InfoLayer((*
hit), isl, dir, pos, sync);
58 int ilay = layInfo->idWire.layer();
73 if ((*ilay) ==
nullptr) {
80 else if (lOrR == Right)
90 layersIn += (*ilay)->idWire.layer();
104 if (layersIn <= 8 || layersIn == 10) {
108 if (layersIn <= 7 || layersIn >= 9) {
112 if (layersIn == 6 || layersIn >= 8) {
125 float halfCell = 2.1;
127 unsigned t0Factor = 99;
132 cout <<
"t1, t2, t3, t4: " << t1 <<
" " << t2 <<
" " << t3 <<
" " << t4 << endl;
133 cout <<
"x1, x2, x3, x4: " << x1 <<
" " << x2 <<
" " << x3 <<
" " << x4 << endl;
137 unsigned hSubGroup = 99;
138 if (t1 == 0. || t2 == 0. || t3 == 0. || t4 == 0.)
140 else if (t1 <= 5. || t2 <= 5. || t3 <= 5. || t4 <= 5.)
142 else if (t1 <= 10. || t2 <= 10. || t3 <= 10. || t4 <= 10.)
144 else if (t1 <= 20. || t2 <= 20. || t3 <= 20. || t4 <= 20.)
146 else if (t1 <= 50. || t2 <= 50. || t3 <= 50. || t4 <= 50.)
149 if ((layersIn == 6 || layersIn == 10) && (fabs(x1 - x3) < delta)) {
153 if (type ==
"LRL" || type ==
"RLR") {
155 t = (t1 + t3) / 2. + t2;
159 t = (t3 - t1) / 2. + t2;
163 t = (t1 - t3) / 2. + t2;
170 theTMaxes[cGroup] =
new TMax(t, cGroup, type, sigma, t0Factor, hSubGroup);
172 cout <<
"tmax123 " << t <<
" " << type << endl;
174 if (layersIn == 7 || layersIn == 10) {
179 if ((
theSegType ==
"LRLR" && type ==
"LRR" && x1 > x4) || (
theSegType ==
"RLRL" && type ==
"RLL" && x1 < x4)) {
181 t = 1.5 * t2 + t1 - t4 / 2.;
183 }
else if ((type ==
"LLR" &&
theSegDir == R && (fabs(x2 - x4) < delta) && x1 < x2) ||
184 (type ==
"RRL" &&
theSegDir ==
L && (fabs(x2 - x4) < delta) && x1 > x2)) {
186 t = 1.5 * t2 - t1 + t4 / 2.;
188 }
else if ((type ==
"LLL" &&
theSegDir == R && (fabs(x2 - x4) < delta) && x1 < x2) ||
189 (type ==
"RRR" &&
theSegDir ==
L && (fabs(x2 - x4) < delta) && x1 > x2)) {
191 t = 1.5 * t2 - t1 - t4 / 2.;
193 }
else if ((type ==
"LLL" &&
theSegDir ==
L && (fabs(x2 - x4) < delta)) ||
194 (type ==
"RRR" &&
theSegDir == R && (fabs(x2 - x4) < delta))) {
196 t = -1.5 * t2 + t1 + t4 / 2.;
198 }
else if ((type ==
"LRL" &&
theSegDir ==
L && (fabs(x2 - x4) < delta)) ||
199 (type ==
"RLR" &&
theSegDir == R && (fabs(x2 - x4) < delta))) {
201 t = 1.5 * t2 + t1 + t4 / 2.;
203 }
else if ((type ==
"LRL" &&
theSegDir == R && (fabs(x1 - x4) < (halfCell + delta))) ||
204 (type ==
"RLR" &&
theSegDir ==
L && (fabs(x1 - x4) < (halfCell + delta)))) {
206 t = 3. / 4. * t2 + t1 / 2. + t4 / 4.;
209 }
else if ((type ==
"LRR" &&
theSegDir == R && x1 < x4 && (fabs(x1 - x4) < (halfCell + delta))) ||
210 (type ==
"RLL" &&
theSegDir ==
L && x1 > x4 && (fabs(x1 - x4) < (halfCell + delta)))) {
212 t = 3. / 4. * t2 + t1 / 2. - t4 / 4.;
220 theTMaxes[cGroup] =
new TMax(t, cGroup, type, sigma, t0Factor, hSubGroup);
222 cout <<
"tmax124 " << t <<
" " << t0Factor <<
" " << type << endl;
224 if (layersIn == 8 || layersIn == 10) {
229 if ((type ==
"LLR" && x1 > x4 &&
theSegType ==
"LRLR") || (type ==
"RRL" && x1 < x4 &&
theSegType ==
"RLRL")) {
231 t = 1.5 * t3 + t4 - t1 / 2.;
233 }
else if ((type ==
"LLR" && x1 < x4 && (fabs(x1 - x4) < (halfCell + delta))) ||
234 (type ==
"RRL" && x1 > x4 && (fabs(x1 - x4) < (halfCell + delta)))) {
236 t = 3. / 4. * t3 + t4 / 2. - t1 / 4.;
239 }
else if ((type ==
"LRR" &&
theSegDir == R && x1 < x4 && (fabs(x1 - x3) < delta)) ||
240 (type ==
"RLL" &&
theSegDir ==
L && x1 > x4 && (fabs(x1 - x3) < delta))) {
242 t = 1.5 * t3 - t4 + t1 / 2.;
244 }
else if ((type ==
"LRL" &&
theSegDir == R && (fabs(x1 - x3) < delta)) ||
245 (type ==
"RLR" &&
theSegDir ==
L && (fabs(x1 - x3) < delta))) {
247 t = 1.5 * t3 + t4 + t1 / 2.;
249 }
else if ((type ==
"LRL" &&
theSegDir ==
L && (fabs(x1 - x3) < (2. * halfCell + delta))) ||
250 (type ==
"RLR" &&
theSegDir == R && (fabs(x1 - x3) < (2. * halfCell + delta)))) {
252 t = 3. / 4. * t3 + t4 / 2. + t1 / 4.;
255 }
else if ((type ==
"LLL" &&
theSegDir ==
L && x1 > x4 && (fabs(x1 - x3) < delta)) ||
256 (type ==
"RRR" &&
theSegDir == R && x1 < x4 && (fabs(x1 - x3) < delta))) {
258 t = 1.5 * t3 - t4 - t1 / 2.;
260 }
else if ((type ==
"LLL" &&
theSegDir == R && (fabs(x1 - x3) < delta)) ||
261 (type ==
"RRR" &&
theSegDir ==
L && (fabs(x1 - x3) < delta))) {
263 t = -1.5 * t3 + t4 + t1 / 2.;
270 theTMaxes[cGroup] =
new TMax(t, cGroup, type, sigma, t0Factor, hSubGroup);
272 cout <<
"tmax134 " << t <<
" " << t0Factor <<
" " << type << endl;
274 if ((layersIn == 9 || layersIn == 10) && (fabs(x2 - x4) < delta)) {
277 ((type += theSegType[1]) += theSegType[2]) += theSegType[3];
279 if ((type ==
"LRL") || (type ==
"RLR")) {
281 t = (t2 + t4) / 2. + t3;
285 t = (t2 - t4) / 2. + t3;
289 t = (t4 - t2) / 2. + t3;
296 theTMaxes[cGroup] =
new TMax(t, cGroup, type, sigma, t0Factor, hSubGroup);
298 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