14 fCoordTransformer = trafo;
18 fDriftLoss = driftLoss;
21 for (
int sector=0; sector<24; sector++) {
23 fUnitVec[sector].x = fCoordTransformer->GetSectorSin(sector);
24 if (sector+1>12) fUnitVec[sector].x = -1 * fUnitVec[sector].x;
25 fUnitVec[sector].y = fCoordTransformer->GetSectorCos(sector);
51 double cosl = 1 / (sqrt( 1 + (
double) track->tanl*track->tanl));
54 if ( cosl==0 )
return 0;
57 double tPhi0 = track->psi + track->q * track->getPara()->bFieldPolarity * pi/2;
58 if ( tPhi0 > 2*pi ) tPhi0 = tPhi0 - 2*pi;
59 else if ( tPhi0 < 0. ) tPhi0 = tPhi0 + 2*pi;
61 double x0 = track->r0 * cos(track->phi0);
62 double y0 = track->r0 * sin(track->phi0);
63 double rr = track->pt / ( bFactor *track->getPara()->bField );
64 double xc = x0 - rr * cos(tPhi0);
65 double yc = y0 - rr * sin(tPhi0);
74 ihit = (
FtfHit *)ihit->nextTrackHit) {
78 if (ihit->flags)
continue;
87 tangent.x = (ihit->y - yc)/rr;
88 tangent.y = -(ihit->x - xc)/rr;
93 double cosCrossing = fabs(tangent.x * fUnitVec[ihit->sector-1].x + tangent.y * fUnitVec[ihit->sector-1].y);
96 if (ihit->row<14) padLength = padLengthInnerSector;
97 else padLength = padLengthOuterSector;
100 if ( cosCrossing==0 )
continue;
101 double dx = padLength / (cosCrossing * cosl);
105 double scaleDrift = 1 - fabs(ihit->z) * fDriftLoss/100;
112 if (ihit->row<14) deScale = 5.0345021e-9;
113 else deScale = 1.4234702e-8;
115 fDedxArray[nPointsInArray] = ihit->q * deScale / ( dx * scaleDrift );
125 sort( fDedxArray, fDedxArray+nPointsInArray );
128 int cLow = (int) floor(nPointsInArray * fCutLow);
129 int cHigh = (int) floor(nPointsInArray * fCutHigh);
134 for (
int i=cLow; i<cHigh; i++) {
136 track->dedx += fDedxArray[i];
139 if (track->nDedx>0) track->dedx = track->dedx/track->nDedx;