#include "AliMathBase.h"
#include "AliTRDseed.h"
-#include "AliTRDcalibDB.h"
#include "AliTRDcluster.h"
#include "AliTRDtracker.h"
#include "AliTRDtrackerV1.h"
fY[i] = 0; // y position
fZ[i] = 0; // z position
fIndexes[i] = 0; // Indexes
- fClusters[i] = 0x0; // Clusters
+ fClusters[i] = NULL; // Clusters
fUsable[i] = 0; // Indication - usable cluster
}
fY[i] = 0; // Y position
fZ[i] = 0; // Z position
fIndexes[i] = 0; // Indexes
- fClusters[i] = 0x0; // Clusters
+ fClusters[i] = NULL; // Clusters
fUsable[i] = kFALSE;
}
const Int_t kClmin = 5;
const Float_t kmaxtan = 2;
-
if (TMath::Abs(fYref[1]) > kmaxtan){
//printf("Exit: Abs(fYref[1]) = %3.3f, kmaxtan = %3.3f\n", TMath::Abs(fYref[1]), kmaxtan);
return; // Track inclined too much
yres[i] = 10000.0;
if (!fClusters[i]) continue;
if(!fClusters[i]->IsInChamber()) continue;
- //yres[i] = fY[i] - fYref[0] - (fYref[1] + anglecor) * fX[i] - fTilt*(fZ[i] - fZref[0]); // Residual y
- yres[i] = fY[i] - (fYref[0] + fX[i] * fYref[1]) - fTilt*(fZ[i] - (fZref[0] + fX[i]*fZref[1])); // Residual y
-
- //printf("dy[%2d]=%6.2f\n", i, yres[i]);
+ // Residual y
+ //yres[i] = fY[i] - fYref[0] - (fYref[1] + anglecor) * fX[i] + fTilt*(fZ[i] - fZref[0]);
+ yres[i] = fY[i] - fTilt*(fZ[i] - (fZref[0] - fX[i]*fZref[1]));
zints[fN] = Int_t(fZ[i]);
fN++;
}
Int_t cumul[knTimebins][2];
Int_t counts[2] = { 0, 0 };
- // Find the break time allowing one chage on pad-rows
- // with maximal number of accepted clusters
if (zouts[3] >= 3) {
+
+ //
+ // Find the break time allowing one chage on pad-rows
+ // with maximal number of accepted clusters
+ //
fNChange = 1;
for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins(); i++) {
cumul[i][0] = counts[0];
}
Int_t maxcount = 0;
for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins(); i++) {
- Int_t after = counts[0]- cumul[i][0];
+ Int_t after = cumul[AliTRDtrackerV1::GetNTimeBins()][0] - cumul[i][0];
Int_t before = cumul[i][1];
if (after + before > maxcount) {
- maxcount = after + before;
- breaktime = i;
- mbefore = kFALSE;
+ maxcount = after + before;
+ breaktime = i;
+ mbefore = kFALSE;
}
- after = counts[1] - cumul[i][1];
+ after = cumul[AliTRDtrackerV1::GetNTimeBins()-1][1] - cumul[i][1];
before = cumul[i][0];
if (after + before > maxcount) {
- maxcount = after + before;
- breaktime = i;
- mbefore = kTRUE;
+ maxcount = after + before;
+ breaktime = i;
+ mbefore = kTRUE;
}
}
+
breaktime -= 1;
+
}
for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
// Tracklet z-direction not in correspondance with track z direction
//
fNChange = 0;
- // Only longest taken
- for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) allowedz[i] = zouts[0];
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
+ allowedz[i] = zouts[0]; // Only longest taken
+ }
}
-/* if (fNChange > 0) {
+ if (fNChange > 0) {
//
// Cross pad -row tracklet - take the step change into account
//
if(!fClusters[i]->IsInChamber()) continue;
if (TMath::Abs(fZ[i] - allowedz[i]) > 2) continue;
// Residual y
- yres[i] = fY[i] - fYref[0] - (fYref[1] + anglecor) * fX[i] + fTilt*(fZ[i] - fZref[0]);
- printf("dy[%2d]=%6.2f\n", i, yres[i]);
- if (TMath::Abs(fZ[i] - fZProb) < 2.) continue;
- // correction for pad row change
- if (fZ[i] > fZProb) yres[i] += fTilt * fPadLength;
- if (fZ[i] < fZProb) yres[i] -= fTilt * fPadLength;
- printf("z[%7.2f] zp[%7.2f] yres[%6.2f]\n", fZ[i], fZProb, yres[i]);
+ //yres[i] = fY[i] - fYref[0] - (fYref[1] + anglecor) * fX[i] /*+ fTilt*(fZ[i] - fZref[0])*/;
+ yres[i] = fY[i] - fTilt*(fZ[i] - (fZref[0] - fX[i]*fZref[1]));
+/* if (TMath::Abs(fZ[i] - fZProb) > 2) {
+ if (fZ[i] > fZProb) yres[i] += fTilt * fPadLength;
+ if (fZ[i] < fZProb) yres[i] -= fTilt * fPadLength;
+ }*/
}
- }*/
+ }
Double_t yres2[knTimebins];
Double_t mean;
fUsable[i] = kFALSE;
if (!fClusters[i]) continue;
if (!fClusters[i]->IsInChamber()) continue;
- if (TMath::Abs(fZ[i] - allowedz[i]) > 2){fClusters[i] = 0x0; continue;}
- if (TMath::Abs(yres[i] - mean) > 4.0 * sigma){fClusters[i] = 0x0; continue;}
+ if (TMath::Abs(fZ[i] - allowedz[i]) > 2){fClusters[i] = NULL; continue;}
+ if (TMath::Abs(yres[i] - mean) > 4.0 * sigma){fClusters[i] = NULL; continue;}
fUsable[i] = kTRUE;
fN2++;
fMPads += fClusters[i]->GetNPads();
fZfitR[1] = (sumw * sumwxz - sumwx * sumwz) / det;
fZfit[0] = (sumwx2 * sumwz - sumwx * sumwxz) / det;
fZfit[1] = (sumw * sumwxz - sumwx * sumwz) / det;
- fYfitR[0] += fYref[0] + correction;
- fYfitR[1] += fYref[1];
+// fYfitR[0] += fYref[0] + correction;
+// fYfitR[1] += fYref[1];
fYfit[0] = fYfitR[0];
- fYfit[1] = fYfitR[1];
+ fYfit[1] = -fYfitR[1];
//printf("y0 = %7.3f tgy = %7.3f z0 = %7.3f tgz = %7.3f \n", fYfitR[0], fYfitR[1], fZfitR[0], fZfitR[1]);
if (-params[2]*params[0] + params[1]*params[1] + 1 > 0) {
Double_t rm1 = params[0] / TMath::Sqrt(-params[2]*params[0] + params[1]*params[1] + 1);
if (1.0/(rm1*rm1) - (x-x0) * (x-x0) > 0.0) {
- Double_t res = (x - x0) / TMath::Sqrt(1.0 / (rm1*rm1) - (x-x0)*(x-x0));
+ Double_t res = (x - x0) / TMath::Sqrt((1./rm1-(x-x0))*(1./rm1+(x-x0)));
if (params[0] < 0) res *= -1.0;
dy = res;
}