fCalT0DetValue = fCalT0Det->GetValue(det);
// Shift needed to define Z-position relative to middle of chamber
- Int_t pla = fGeo->GetPlane(det);
- Int_t cha = fGeo->GetChamber(det);
- fPadPlane = fGeo->GetPadPlane(pla,cha);
+ Int_t layer = fGeo->GetLayer(det);
+ Int_t stack = fGeo->GetStack(det);
+ fPadPlane = fGeo->GetPadPlane(layer,stack);
fZShiftIdeal = 0.5 * (fPadPlane->GetRow0() + fPadPlane->GetRowEnd());
// Get the current transformation matrix
// apply ExB correction to the Y-position
// and move to the Z-position relative to the middle of the chamber
posLocal[0] = -xLocal;
- posLocal[1] = (fPadPlane->GetColPos(col) - (x[0] + 0.5) * colSize) - driftLength * exbCorr;
+ posLocal[1] = (fPadPlane->GetColPos(col) + (0.5 - x[0]) * colSize) - driftLength * exbCorr;
posLocal[2] = (fPadPlane->GetRowPos(row) - 0.5 * rowSize) - fZShiftIdeal;
// Go to tracking coordinates
x[5] = rowSize*rowSize / 12.0;
i[2] = TMath::Nint(timeT0Cal);
- // A.Bercuci for TRD tracking calibration awareness
- out = (i[2] < 0 || i[2] > Int_t(3.5*fSamplingFrequency/vdrift)) ? kTRUE : kFALSE;
+ // For TRD tracking calibration awareness
+ out = ((i[2] < 0) || (i[2] > Int_t(3.5 * fSamplingFrequency/vdrift))) ? kTRUE : kFALSE;
return kTRUE;
c->SetY(clusterXYZ[1]);
c->SetZ(clusterXYZ[2]);
c->SetLocalTimeBin(((Char_t) clusterRCT[2]));
- c->SetInChamber(!out);
+ c->SetInChamber(!out);
+
}