20 using namespace dttmaxenums;
25 rh(rh_), idWire(rh.wireId()), lr(rh.lrSide()) {
38 if (time < 0. || time > 415.) {
40 cout <<
" *** WARNING time = " <<
time << endl;
54 for (vector<DTRecHit1D>::const_iterator
hit=hits.begin();
hit!=hits.end();
73 for(vector<InfoLayer*>::const_iterator ilay =
theInfoLayers.begin();
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") {
157 else if((type ==
"LLR" &&
theSegDir == R) ||
163 else if((type ==
"LRR" &&
theSegDir == R) ||
174 theTMaxes[cGroup] =
new TMax(t,cGroup,type,sigma,t0Factor,hSubGroup);
175 if(
debug)
cout <<
"tmax123 " << t <<
" " << type << endl;
177 if(layersIn == 7 || layersIn == 10) {
182 if((
theSegType ==
"LRLR" && type ==
"LRR" && x1 > x4) ||
183 (
theSegType ==
"RLRL" && type ==
"RLL" && x1 < x4)) {
188 else if((type ==
"LLR" &&
theSegDir == R && (fabs(x2-x4)<delta) && x1 < x2) ||
189 (type ==
"RRL" &&
theSegDir ==
L && (fabs(x2-x4)<delta) && x1 > x2)) {
194 else if((type ==
"LLL" &&
theSegDir == R && (fabs(x2-x4)<delta) && x1 < x2) ||
195 (type ==
"RRR" &&
theSegDir ==
L && (fabs(x2-x4)<delta) && x1 > x2)) {
200 else if((type ==
"LLL" &&
theSegDir ==
L && (fabs(x2-x4)<delta)) ||
201 (type ==
"RRR" &&
theSegDir == R && (fabs(x2-x4)<delta))) {
203 t = -1.5*t2+t1+t4/2.;
206 else if((type ==
"LRL" &&
theSegDir ==
L && (fabs(x2-x4)<delta)) ||
207 (type ==
"RLR" &&
theSegDir == R && (fabs(x2-x4)<delta))) {
212 else if((type ==
"LRL" &&
theSegDir == R && (fabs(x1-x4)<(halfCell+delta))) ||
213 (type ==
"RLR" &&
theSegDir ==
L && (fabs(x1-x4)<(halfCell+delta)))) {
215 t = 3./4.*t2+t1/2.+t4/4.;
219 else if((type ==
"LRR" &&
theSegDir == R && x1 < x4 && (fabs(x1-x4)<(halfCell+delta)))||
220 (type ==
"RLL" &&
theSegDir ==
L && x1 > x4 && (fabs(x1-x4)<(halfCell+delta)))) {
222 t = 3./4.*t2+t1/2.-t4/4.;
231 theTMaxes[cGroup] =
new TMax(t,cGroup,type,sigma,t0Factor,hSubGroup);
232 if(
debug)
cout <<
"tmax124 " << t <<
" " << t0Factor <<
" " << type << endl;
234 if(layersIn == 8 || layersIn == 10) {
239 if((type ==
"LLR" && x1 > x4 &&
theSegType ==
"LRLR") ||
240 (type ==
"RRL" && x1 < x4 &&
theSegType ==
"RLRL")) {
245 else if((type ==
"LLR" && x1 < x4 && (fabs(x1-x4)<(halfCell+delta))) ||
246 (type ==
"RRL" && x1 > x4 && (fabs(x1-x4)<(halfCell+delta)))) {
248 t = 3./4.*t3+t4/2.-t1/4.;
252 else if((type ==
"LRR" &&
theSegDir == R && x1 < x4 && (fabs(x1-x3)<delta)) ||
253 (type ==
"RLL" &&
theSegDir ==
L && x1 > x4 &&(fabs(x1-x3)<delta))) {
258 else if((type ==
"LRL" &&
theSegDir == R && (fabs(x1-x3)<delta)) ||
259 (type ==
"RLR" &&
theSegDir ==
L && (fabs(x1-x3)<delta))) {
264 else if((type ==
"LRL" &&
theSegDir ==
L && (fabs(x1-x3)<(2.*halfCell+delta))) ||
265 (type ==
"RLR" &&
theSegDir == R && (fabs(x1-x3)<(2.*halfCell+delta)))) {
267 t = 3./4.*t3+t4/2.+t1/4.;
271 else if((type ==
"LLL" &&
theSegDir ==
L && x1 > x4 && (fabs(x1-x3)<delta)) ||
272 (type ==
"RRR" &&
theSegDir == R && x1 < x4 && (fabs(x1-x3)<delta))) {
277 else if((type ==
"LLL" &&
theSegDir == R && (fabs(x1-x3)<delta)) ||
278 (type ==
"RRR" &&
theSegDir ==
L && (fabs(x1-x3)<delta))) {
280 t = -1.5*t3+t4+t1/2.;
288 theTMaxes[cGroup] =
new TMax(t,cGroup,type,sigma,t0Factor,hSubGroup);
289 if(
debug)
cout <<
"tmax134 " << t <<
" " << t0Factor <<
" " << type << endl;
291 if((layersIn == 9 || layersIn == 10) && (fabs(x2-x4)<delta)) {
296 if((type ==
"LRL" ) ||
302 else if((type ==
"LRR" &&
theSegDir == R) ||
308 else if((type ==
"LLR" &&
theSegDir == R) ||
319 theTMaxes[cGroup] =
new TMax(t,cGroup,type,sigma,t0Factor,hSubGroup);
320 if(
debug)
cout <<
"tmax234 " << t <<
" " << type << endl;
328 vector<const TMax*>
v;
329 if(idWire.
layer()==1) {
334 else if(idWire.
layer()==2) {
339 else if(idWire.
layer()==3) {
355 vector<const TMax*>
v;
371 for (vector<InfoLayer*>::const_iterator ilay =
theInfoLayers.begin();
376 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
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)
InfoLayer(DTRecHit1D rh_, const DTSuperLayer &isl, GlobalVector dir, GlobalPoint pos, DTTTrigBaseSync *sync)
DTLayerId layerId() const
Return the corresponding LayerId.
std::vector< TMax * > theTMaxes
std::vector< InfoLayer * > theInfoLayers