18 using namespace dttmaxenums;
23 rh(rh_), idWire(rh.wireId()), lr(rh.lrSide()) {
36 if (time < 0. || time > 415.) {
38 cout <<
" *** WARNING time = " <<
time << endl;
52 for (vector<DTRecHit1D>::const_iterator
hit=hits.begin();
hit!=hits.end();
71 for(vector<InfoLayer*>::const_iterator ilay =
theInfoLayers.begin();
87 layersIn += (*ilay)->idWire.layer();
101 if(layersIn <= 8 || layersIn == 10) {
105 if(layersIn <= 7 || layersIn >= 9) {
109 if(layersIn == 6 || layersIn >= 8) {
122 float halfCell = 2.1;
124 unsigned t0Factor = 99;
129 cout <<
"t1, t2, t3, t4: " << t1 <<
" " << t2 <<
" " << t3 <<
" " << t4 << endl;
130 cout <<
"x1, x2, x3, x4: " << x1 <<
" " << x2 <<
" " << x3 <<
" " << x4 << endl;
134 unsigned hSubGroup = 99;
135 if(t1 == 0. || t2 == 0. || t3 == 0. || t4 == 0.)
137 else if(t1<=5. || t2<=5. || t3<=5. || t4<=5.)
139 else if(t1<=10. || t2<=10. || t3<=10. || t4<=10.)
141 else if(t1<=20. || t2<=20. || t3<=20. || t4<=20.)
143 else if(t1<=50. || t2<=50. || t3<=50. || t4<=50.)
146 if((layersIn == 6 || layersIn == 10) && (fabs(x1-x3)<delta)) {
150 if(type ==
"LRL" || type ==
"RLR") {
155 else if((type ==
"LLR" &&
theSegDir == R) ||
161 else if((type ==
"LRR" &&
theSegDir == R) ||
172 theTMaxes[cGroup] =
new TMax(t,cGroup,type,sigma,t0Factor,hSubGroup);
173 if(
debug)
cout <<
"tmax123 " << t <<
" " << type << endl;
175 if(layersIn == 7 || layersIn == 10) {
180 if((
theSegType ==
"LRLR" && type ==
"LRR" && x1 > x4) ||
181 (
theSegType ==
"RLRL" && type ==
"RLL" && x1 < x4)) {
186 else if((type ==
"LLR" &&
theSegDir == R && (fabs(x2-x4)<delta) && x1 < x2) ||
187 (type ==
"RRL" &&
theSegDir ==
L && (fabs(x2-x4)<delta) && x1 > x2)) {
192 else if((type ==
"LLL" &&
theSegDir == R && (fabs(x2-x4)<delta) && x1 < x2) ||
193 (type ==
"RRR" &&
theSegDir ==
L && (fabs(x2-x4)<delta) && x1 > x2)) {
198 else if((type ==
"LLL" &&
theSegDir ==
L && (fabs(x2-x4)<delta)) ||
199 (type ==
"RRR" &&
theSegDir == R && (fabs(x2-x4)<delta))) {
201 t = -1.5*t2+t1+t4/2.;
204 else if((type ==
"LRL" &&
theSegDir ==
L && (fabs(x2-x4)<delta)) ||
205 (type ==
"RLR" &&
theSegDir == R && (fabs(x2-x4)<delta))) {
210 else if((type ==
"LRL" &&
theSegDir == R && (fabs(x1-x4)<(halfCell+delta))) ||
211 (type ==
"RLR" &&
theSegDir ==
L && (fabs(x1-x4)<(halfCell+delta)))) {
213 t = 3./4.*t2+t1/2.+t4/4.;
217 else if((type ==
"LRR" &&
theSegDir == R && x1 < x4 && (fabs(x1-x4)<(halfCell+delta)))||
218 (type ==
"RLL" &&
theSegDir ==
L && x1 > x4 && (fabs(x1-x4)<(halfCell+delta)))) {
220 t = 3./4.*t2+t1/2.-t4/4.;
229 theTMaxes[cGroup] =
new TMax(t,cGroup,type,sigma,t0Factor,hSubGroup);
230 if(
debug)
cout <<
"tmax124 " << t <<
" " << t0Factor <<
" " << type << endl;
232 if(layersIn == 8 || layersIn == 10) {
237 if((type ==
"LLR" && x1 > x4 &&
theSegType ==
"LRLR") ||
238 (type ==
"RRL" && x1 < x4 &&
theSegType ==
"RLRL")) {
243 else if((type ==
"LLR" && x1 < x4 && (fabs(x1-x4)<(halfCell+delta))) ||
244 (type ==
"RRL" && x1 > x4 && (fabs(x1-x4)<(halfCell+delta)))) {
246 t = 3./4.*t3+t4/2.-t1/4.;
250 else if((type ==
"LRR" &&
theSegDir == R && x1 < x4 && (fabs(x1-x3)<delta)) ||
251 (type ==
"RLL" &&
theSegDir ==
L && x1 > x4 &&(fabs(x1-x3)<delta))) {
256 else if((type ==
"LRL" &&
theSegDir == R && (fabs(x1-x3)<delta)) ||
257 (type ==
"RLR" &&
theSegDir ==
L && (fabs(x1-x3)<delta))) {
262 else if((type ==
"LRL" &&
theSegDir ==
L && (fabs(x1-x3)<(2.*halfCell+delta))) ||
263 (type ==
"RLR" &&
theSegDir == R && (fabs(x1-x3)<(2.*halfCell+delta)))) {
265 t = 3./4.*t3+t4/2.+t1/4.;
269 else if((type ==
"LLL" &&
theSegDir ==
L && x1 > x4 && (fabs(x1-x3)<delta)) ||
270 (type ==
"RRR" &&
theSegDir == R && x1 < x4 && (fabs(x1-x3)<delta))) {
275 else if((type ==
"LLL" &&
theSegDir == R && (fabs(x1-x3)<delta)) ||
276 (type ==
"RRR" &&
theSegDir ==
L && (fabs(x1-x3)<delta))) {
278 t = -1.5*t3+t4+t1/2.;
286 theTMaxes[cGroup] =
new TMax(t,cGroup,type,sigma,t0Factor,hSubGroup);
287 if(
debug)
cout <<
"tmax134 " << t <<
" " << t0Factor <<
" " << type << endl;
289 if((layersIn == 9 || layersIn == 10) && (fabs(x2-x4)<delta)) {
294 if((type ==
"LRL" ) ||
300 else if((type ==
"LRR" &&
theSegDir == R) ||
306 else if((type ==
"LLR" &&
theSegDir == R) ||
317 theTMaxes[cGroup] =
new TMax(t,cGroup,type,sigma,t0Factor,hSubGroup);
318 if(
debug)
cout <<
"tmax234 " << t <<
" " << type << endl;
326 vector<const TMax*>
v;
327 if(idWire.
layer()==1) {
332 else if(idWire.
layer()==2) {
337 else if(idWire.
layer()==3) {
353 vector<const TMax*>
v;
369 for (vector<InfoLayer*>::const_iterator ilay =
theInfoLayers.begin();
374 for (vector<TMax*>::const_iterator iTmax =
theTMaxes.begin();
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
double offset(const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globalPos)
Information on each of the four TMax values in a SL.
DTCellSide
Which side of the DT cell.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
int layer() const
Return the layer number.
virtual ~DTTMax()
Destructor.
std::vector< const TMax * > getTMax(const DTWireId &idWire)
Geom::Theta< T > theta() const
const DTTopology & specificTopology() const
auto const T2 &decltype(t1.eta()) t2
Cos< T >::type cos(const T &t)
float digiTime() const
Return the time (ns) of the digi used to build the rechit.
const DTLayer * layer(DTLayerId id) const
Return the layer corresponding to the given id.
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
int wire() const
Return the wire number.
InfoLayer *& getInfoLayer(int layer)
DTLayerId layerId() const
Return the corresponding LayerId.
std::vector< TMax * > theTMaxes
InfoLayer(const DTRecHit1D &rh_, const DTSuperLayer &isl, GlobalVector dir, GlobalPoint pos, DTTTrigBaseSync *sync)
std::vector< InfoLayer * > theInfoLayers