#include "AliTRDcalibDB.h"
#include "AliTRDcluster.h"
#include "AliTRDtracker.h"
+#include "AliTRDtrackerV1.h"
ClassImp(AliTRDseed)
-Int_t AliTRDseed::fgTimeBins = 0;
-
//_____________________________________________________________________________
AliTRDseed::AliTRDseed()
:TObject()
Int_t out[200];
Int_t nlab = 0;
- for (Int_t i = 0; i < fgTimeBins+1; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
if (!fClusters[i]) continue;
for (Int_t ilab = 0; ilab < 3; ilab++) {
if (fClusters[i]->GetLabel(ilab) >= 0) {
// Use clusters
//
- for (Int_t i = 0; i < fgTimeBins+1; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
if (!fClusters[i]) continue;
if (!(fClusters[i]->IsUsed())) fClusters[i]->Use();
}
fN = 0;
fN2 = 0;
- for (Int_t i = 0; i < fgTimeBins; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins(); i++) {
yres[i] = 10000.0;
if (!fClusters[i]) continue;
if(!fClusters[i]->IsInChamber()) continue;
// with maximal number of accepted clusters
//
fNChange = 1;
- for (Int_t i = 0; i < fgTimeBins; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins(); i++) {
cumul[i][0] = counts[0];
cumul[i][1] = counts[1];
if (TMath::Abs(fZ[i]-zouts[0]) < 2) counts[0]++;
if (TMath::Abs(fZ[i]-zouts[2]) < 2) counts[1]++;
}
Int_t maxcount = 0;
- for (Int_t i = 0; i < fgTimeBins; i++) {
- Int_t after = cumul[fgTimeBins][0] - cumul[i][0];
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins(); i++) {
+ 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;
}
- after = cumul[fgTimeBins-1][1] - cumul[i][1];
+ after = cumul[AliTRDtrackerV1::GetNTimeBins()-1][1] - cumul[i][1];
before = cumul[i][0];
if (after + before > maxcount) {
maxcount = after + before;
}
- for (Int_t i = 0; i < fgTimeBins+1; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
if (i > breaktime) allowedz[i] = mbefore ? zouts[2] : zouts[0];
if (i <= breaktime) allowedz[i] = (!mbefore) ? zouts[2] : zouts[0];
}
- if (((allowedz[0] > allowedz[fgTimeBins]) && (fZref[1] < 0)) ||
- ((allowedz[0] < allowedz[fgTimeBins]) && (fZref[1] > 0))) {
+ if (((allowedz[0] > allowedz[AliTRDtrackerV1::GetNTimeBins()]) && (fZref[1] < 0)) ||
+ ((allowedz[0] < allowedz[AliTRDtrackerV1::GetNTimeBins()]) && (fZref[1] > 0))) {
//
// Tracklet z-direction not in correspondance with track z direction
//
fNChange = 0;
- for (Int_t i = 0; i < fgTimeBins+1; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
allowedz[i] = zouts[0]; // Only longest taken
}
}
//
// Cross pad -row tracklet - take the step change into account
//
- for (Int_t i = 0; i < fgTimeBins+1; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
if (!fClusters[i]) continue;
if(!fClusters[i]->IsInChamber()) continue;
if (TMath::Abs(fZ[i] - allowedz[i]) > 2) continue;
Double_t yres2[knTimebins];
Double_t mean;
Double_t sigma;
- for (Int_t i = 0; i < fgTimeBins+1; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
if (!fClusters[i]) continue;
if(!fClusters[i]->IsInChamber()) continue;
if (TMath::Abs(fZ[i] - allowedz[i]) > 2) continue;
fMeanz = 0;
fMPads = 0;
- for (Int_t i = 0; i < fgTimeBins+1; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
fUsable[i] = kFALSE;
if (!fClusters[i]) continue;
fYfitR[1] = (sumw * sumwxy - sumwx * sumwy) / det;
fSigmaY2 = 0;
- for (Int_t i = 0; i < fgTimeBins+1; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
if (!fUsable[i]) continue;
Float_t delta = yres[i] - fYfitR[0] - fYfitR[1] * fX[i];
fSigmaY2 += delta*delta;
//
fNUsed = 0;
- for (Int_t i = 0; i < fgTimeBins; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins(); i++) {
if (!fClusters[i]) continue;
if(!fUsable[i]) continue;
if ((fClusters[i]->IsUsed())) fNUsed++;
if (!cseed[iLayer].IsOK()) continue;
Double_t tilt = cseed[iLayer].fTilt;
- for (Int_t itime = 0; itime < fgTimeBins+1; itime++) {
+ for (Int_t itime = 0; itime < AliTRDtrackerV1::GetNTimeBins()+1; itime++) {
if (!cseed[iLayer].fUsable[itime]) continue;
// x relative to the midle chamber
Float_t GetCC() const { return fCC; }
Float_t GetChi2() const { return fChi2; }
Float_t GetChi2Z() const { return fChi2Z; }
- Int_t GetNTimeBins() const { return fgTimeBins; }
void SetTilt(Float_t tilt) { fTilt = tilt; }
void SetCC(Float_t cc) { fCC = cc; }
void SetChi2(Float_t chi2) { fChi2 = chi2; }
void SetChi2Z(Float_t chi2z) { fChi2Z = chi2z; }
- static void SetNTimeBins(Int_t nTB) { fgTimeBins = nTB; }
protected:
void Copy(TObject &o) const;
- static Int_t fgTimeBins; // Local copy of the total number of TB
Float_t fTilt; // Tilting angle
Float_t fPadLength; // Pad length
Float_t fX0; // X0 position
Float_t clength = (/*.5 * */AliTRDgeometry::AmThick() + AliTRDgeometry::DrThick());
AliTRDcluster *cluster = 0x0;
- for(int ic=0; ic<fgTimeBins; ic++){
+ for(int ic=0; ic<AliTRDtrackerV1::GetNTimeBins(); ic++){
if(!(cluster = fClusters[ic])) continue;
Float_t x = cluster->GetX();
clusters.SetOwner(kTRUE);
AliTRDcluster *cc = 0x0;
Int_t det=-1, ncl, ncls = 0;
- for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+ for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
if(!(layer = chamber->GetTB(iTime))) continue;
if(!(ncl = Int_t(*layer))) continue;
for(int ic=0; ic<ncl; ic++){
// start seed update
for (Int_t iter = 0; iter < niter; iter++) {
ncl = 0;
- for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+ for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
if(!(layer = chamber->GetTB(iTime))) continue;
if(!Int_t(*layer)) continue;
if(ncl>1){
// calculate length of the time bin (calibration aware)
Int_t irp = 0; Float_t x[2]; Int_t tb[2];
- for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+ for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
if(!fClusters[iTime]) continue;
x[irp] = fClusters[iTime]->GetX();
tb[irp] = iTime;
fdX = (x[1] - x[0]) / (tb[0] - tb[1]);
// update X0 from the clusters (calibration/alignment aware)
- for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+ for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
if(!(layer = chamber->GetTB(iTime))) continue;
if(!layer->IsT0()) continue;
if(fClusters[iTime]){
fX0 = fClusters[iTime]->GetX();
break;
} else { // we have to infere the position of the anode wire from the other clusters
- for (Int_t jTime = iTime+1; jTime < fgTimeBins; jTime++) {
+ for (Int_t jTime = iTime+1; jTime < AliTRDtrackerV1::GetNTimeBins(); jTime++) {
if(!fClusters[jTime]) continue;
fX0 = fClusters[jTime]->GetX() + fdX * (jTime - iTime);
}
// TODO
// update x reference positions (calibration/alignment aware)
- for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+ for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
if(!fClusters[iTime]) continue;
fX[iTime] = fClusters[iTime]->GetX() - fX0;
}
// Do cluster projection
AliTRDchamberTimeBin *layer = 0x0;
Int_t nYclusters = 0; Bool_t kEXIT = kFALSE;
- for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+ for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
if(!(layer = chamber->GetTB(iTime))) continue;
if(!Int_t(*layer)) continue;
// Select only one cluster/TimeBin
Int_t lastCluster = 0;
fN2 = 0;
- for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+ for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
ncl = tboundary[iTime] - lastCluster;
if(!ncl) continue;
Int_t iptr = lastCluster;
}
// number of minimum numbers of clusters expected for the tracklet
- Int_t kClmin = Int_t(AliTRDReconstructor::RecoParam()->GetFindableClusters()*fgTimeBins);
+ Int_t kClmin = Int_t(AliTRDReconstructor::RecoParam()->GetFindableClusters()*AliTRDtrackerV1::GetNTimeBins());
if (fN2 < kClmin){
AliWarning(Form("Not enough clusters to fit the tracklet %d [%d].", fN2, kClmin));
fN2 = 0;
// update used clusters
fNUsed = 0;
- for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+ for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
if(!fClusters[iTime]) continue;
if((fClusters[iTime]->IsUsed())) fNUsed++;
}
zout[2*knTimebins];//
fN = 0;
- for (Int_t iTime = 0; iTime < fgTimeBins; iTime++) {
+ for (Int_t iTime = 0; iTime < AliTRDtrackerV1::GetNTimeBins(); iTime++) {
if (!fClusters[iTime]) continue;
if (!fClusters[iTime]->IsInChamber()) continue;
yres[iTime] = fY[iTime] - fYref[0] - (fYref[1] + anglecor) * fX[iTime] + fTilt * (fZ[iTime] - fZref[0]);
}
// calculate pad row boundary crosses
- Int_t kClmin = Int_t(AliTRDReconstructor::RecoParam()->GetFindableClusters()*fgTimeBins);
+ Int_t kClmin = Int_t(AliTRDReconstructor::RecoParam()->GetFindableClusters()*AliTRDtrackerV1::GetNTimeBins());
Int_t nz = AliMathBase::Freq(fN, zint, zout, kFALSE);
fZProb = zout[0];
if(nz <= 1) zout[3] = 0;
fMPads = 0;
fMeanz = 0.;
// we will use only the clusters which are in the detector range
- for(int iTime=0; iTime<fgTimeBins; iTime++){
+ for(int iTime=0; iTime<AliTRDtrackerV1::GetNTimeBins(); iTime++){
fUsable[iTime] = kFALSE;
if (!fClusters[iTime]) continue;
npads = fClusters[iTime]->GetNPads();
fYfitR[1] = (sumw * sumwxy - sumwx * sumwy) / det;
fSigmaY2 = 0;
- for (Int_t i = 0; i < fgTimeBins+1; i++) {
+ for (Int_t i = 0; i < AliTRDtrackerV1::GetNTimeBins()+1; i++) {
if (!fUsable[i]) continue;
Float_t delta = yres[i] - fYfitR[0] - fYfitR[1] * fX[i];
fSigmaY2 += delta*delta;
// Printing the seedstatus
//
- AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
- Int_t nTimeBins = cal->GetNumberOfTimeBins();
-
printf("Seed status :\n");
printf(" fTilt = %f\n", fTilt);
printf(" fPadLength = %f\n", fPadLength);
printf(" fX0 = %f\n", fX0);
- for(int ic=0; ic<nTimeBins; ic++) {
+ for(int ic=0; ic<AliTRDtrackerV1::GetNTimeBins(); ic++) {
const Char_t *isUsable = fUsable[ic]?"Yes":"No";
printf(" %d X[%f] Y[%f] Z[%f] Indexes[%d] clusters[%p] usable[%s]\n"
, ic
0.0786, 0.0786, 0.0579, 0.0579, 0.0474,
0.0474, 0.0408, 0.0335, 0.0335, 0.0335
};
+Int_t AliTRDtrackerV1::fgNTimeBins = 0;
TTreeSRedirector *AliTRDtrackerV1::fgDebugStreamer = 0x0;
AliRieman* AliTRDtrackerV1::fgRieman = 0x0;
TLinearFitter* AliTRDtrackerV1::fgTiltedRieman = 0x0;
,fClusters(0x0)
,fTracklets(0x0)
,fTracks(0x0)
- ,fTimeBinsPerPlane(0)
,fSieveSeeding(0)
{
//
if (!AliTRDcalibDB::Instance()) {
AliFatal("Could not get calibration object");
}
- fTimeBinsPerPlane = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
+ fgNTimeBins = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
- for (Int_t isector = 0; isector < AliTRDgeometry::kNsect; isector++) new(&fTrSec[isector]) AliTRDtrackingSector(fGeom, isector, fTimeBinsPerPlane);
+ for (Int_t isector = 0; isector < AliTRDgeometry::kNsect; isector++) new(&fTrSec[isector]) AliTRDtrackingSector(fGeom, isector);
if(AliTRDReconstructor::StreamLevel() > 1){
TDirectory *savedir = gDirectory;
Int_t found = 0; // number of tracks found
Float_t foundMin = 20.0;
- AliTRDseed::SetNTimeBins(fTimeBinsPerPlane);
Int_t nSeed = event->GetNumberOfTracks();
if(!nSeed){
// run stand alone tracking
if(!(chamber = fTrSec[sector].GetChamber(stack, iplane))) continue;
- if(chamber->GetNClusters() < fTimeBinsPerPlane*AliTRDReconstructor::AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
+ if(chamber->GetNClusters() < fgNTimeBins*AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
x = chamber->GetX();
if(!tracklet.AttachClustersIter(chamber, 1000.)) continue;
tracklet.Init(&t);
- if(tracklet.GetN() < fTimeBinsPerPlane * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
+ if(tracklet.GetN() < fgNTimeBins * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
break;
}
// Make backup of the track until is gold
// TO DO update quality check of the track.
// consider comparison with fTimeBinsRange
- Float_t ratio0 = tracklet.GetN() / Float_t(fTimeBinsPerPlane);
+ Float_t ratio0 = tracklet.GetN() / Float_t(fgNTimeBins);
//Float_t ratio1 = Float_t(t.GetNumberOfClusters()+1) / Float_t(t.GetNExpected()+1);
//printf("tracklet.GetChi2() %f [< 18.0]\n", tracklet.GetChi2());
//printf("ratio0 %f [> 0.8]\n", ratio0);
// debug level 5
//
- AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
- Int_t nTimeBins = cal->GetNumberOfTimeBins();
-
TLinearFitter *fitter = GetTiltedRiemanFitterConstraint();
fitter->StoreData(kTRUE);
fitter->ClearPoints();
Int_t nPoints = 0;
for(Int_t ipl = 0; ipl < AliTRDgeometry::kNplan; ipl++){
if(!tracklets[ipl].IsOK()) continue;
- for(Int_t itb = 0; itb < nTimeBins; itb++){
+ for(Int_t itb = 0; itb < fgNTimeBins; itb++){
if(!tracklets[ipl].IsUsable(itb)) continue;
x = tracklets[ipl].GetX(itb) + tracklets[ipl].GetX0();
y = tracklets[ipl].GetY(itb);
//
// debug level 5
//
-
- AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
- Int_t nTimeBins = cal->GetNumberOfTimeBins();
-
TLinearFitter *fitter = GetTiltedRiemanFitter();
fitter->StoreData(kTRUE);
fitter->ClearPoints();
if(!tracklets[ipl].IsOK()) continue;
dzMean += tracklets[ipl].GetZfitR(1);
dzcounter++;
- for(Int_t itb = 0; itb < nTimeBins; itb++){
+ for(Int_t itb = 0; itb < fgNTimeBins; itb++){
if (!tracklets[ipl].IsUsable(itb)) continue;
x = tracklets[ipl].GetX(itb) + tracklets[ipl].GetX0();
y = tracklets[ipl].GetY(itb);
nChambers = 0;
for(int iplane=0; iplane<AliTRDgeometry::kNplan; iplane++){
if(!(chamber = stack[iplane])) continue;
- if(chamber->GetNClusters() < fTimeBinsPerPlane * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
+ if(chamber->GetNClusters() < fgNTimeBins * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
nChambers++;
//AliInfo(Form("sector %d stack %d plane %d clusters %d", sector, istack, iplane, chamber->GetNClusters()));
}
nlayers++;
// Cooking label
- for (Int_t itime = 0; itime < fTimeBinsPerPlane; itime++) {
+ for (Int_t itime = 0; itime < fgNTimeBins; itime++) {
if(!sseed[jseed].IsUsable(itime)) continue;
naccepted++;
Int_t tindex = 0, ilab = 0;
AliTRDtrackingChamber *chamber = 0x0;
for(int iplane=0; iplane<kNPlanes; iplane++){
if(!(chamber = stack[iplane])) continue;
- chamberQ[iplane] = (chamber = stack[iplane]) ? chamber->GetQuality(fTimeBinsPerPlane) : 0.;
+ chamberQ[iplane] = (chamber = stack[iplane]) ? chamber->GetQuality() : 0.;
}
Double_t tconfig[kNConfigs];
// (date). They have to be checked to assure consistency of estimation.
//
- AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
- Int_t nTimeBins = cal->GetNumberOfTimeBins();
// ratio of the total number of clusters/track which are expected to be found by the tracker.
Float_t fgFindable = AliTRDReconstructor::RecoParam()->GetFindableClusters();
Double_t likechi2y = 0.0000000001;
if (chi2[1] < 0.5) likechi2y += TMath::Exp(-TMath::Sqrt(chi2[1]) * 7.73);
Double_t likechi2z = TMath::Exp(-chi2[0] * 0.088) / TMath::Exp(-chi2[0] * 0.019);
- Int_t enc = Int_t(fgFindable*4.*nTimeBins); // Expected Number Of Clusters, normally 72
+ Int_t enc = Int_t(fgFindable*4.*fgNTimeBins); // Expected Number Of Clusters, normally 72
Double_t likeN = TMath::Exp(-(enc - nclusters) * 0.19);
Double_t like = likea * likechi2y * likechi2z * likeN;
}
-//___________________________________________________________________
-void AliTRDtrackerV1::GetMeanCLStack(AliTRDtrackingChamber *chamber, Int_t *planes, Double_t *params)
-{
- //
- // Determines the Mean number of clusters per layer.
- // Needed to determine good Seeding Layers
- //
- // Parameters:
- // - Array of AliTRDchamberTimeBins
- // - Container for the params
- //
- // Detailed description
- //
- // Two Iterations:
- // In the first Iteration the mean is calculted using all layers.
- // After this, all layers outside the 1-sigma-region are rejected.
- // Then the mean value and the standard-deviation are calculted a second
- // time in order to select all layers in the 1-sigma-region as good-candidates.
- //
-
- Float_t mean = 0, stdev = 0;
- Double_t ncl[kNTimeBins*kNSeedPlanes], mcl[kNTimeBins*kNSeedPlanes];
- Int_t position = 0;
- memset(ncl, 0, sizeof(Int_t)*kNTimeBins*kNSeedPlanes);
- memset(mcl, 0, sizeof(Int_t)*kNTimeBins*kNSeedPlanes);
- Int_t nused = 0;
- AliTRDchamberTimeBin *layers = chamber->GetTB(0);
- for(Int_t ipl = 0; ipl < kNSeedPlanes; ipl++){
- for(Int_t ils = 0; ils < fTimeBinsPerPlane; ils++){
- position = planes[ipl]*fTimeBinsPerPlane + ils;
- ncl[ipl * fTimeBinsPerPlane + ils] = layers[position].GetNClusters();
- nused = 0;
- for(Int_t icl = 0; icl < ncl[ipl * fTimeBinsPerPlane + ils]; icl++)
- if((layers[position].GetCluster(icl))->IsUsed()) nused++;
- ncl[ipl * fTimeBinsPerPlane + ils] -= nused;
- }
- }
- // Declaration of quartils:
- //Double_t qvals[3] = {0.0, 0.0, 0.0};
- //Double_t qprop[3] = {0.16667, 0.5, 0.83333};
- // Iterations
- Int_t counter;
- Double_t *array;
- Int_t *limit;
- Int_t nLayers = fTimeBinsPerPlane * kNSeedPlanes;
- for(Int_t iter = 0; iter < 2; iter++){
- array = (iter == 0) ? &ncl[0] : &mcl[0];
- limit = (iter == 0) ? &nLayers : &counter;
- counter = 0;
- if(iter == 1){
- for(Int_t i = 0; i < fTimeBinsPerPlane *kNSeedPlanes; i++){
- if((ncl[i] > mean + stdev) || (ncl[i] < mean - stdev)) continue; // Outside 1-sigma region
-// if((ncl[i] > qvals[2]) || (ncl[i] < qvals[0])) continue; // Outside 1-sigma region
- if(ncl[i] == 0) continue; // 0-Layers also rejected
- mcl[counter] = ncl[i];
- counter++;
- }
- }
- if(*limit == 0) break;
- printf("Limit = %d\n", *limit);
- //using quartils instead of mean and RMS
-// TMath::Quantiles(*limit,3,array,qvals,qprop,kFALSE);
- mean = TMath::Median(*limit, array, 0x0);
- stdev = TMath::RMS(*limit, array);
- }
-// printf("Quantiles: 0.16667 = %3.3f, 0.5 = %3.3f, 0.83333 = %3.3f\n", qvals[0],qvals[1],qvals[2]);
-// memcpy(params,qvals,sizeof(Double_t)*3);
- params[1] = (Double_t)TMath::Nint(mean);
- params[0] = (Double_t)TMath::Nint(mean - stdev);
- params[2] = (Double_t)TMath::Nint(mean + stdev);
-
-}
-
-//___________________________________________________________________
-Int_t AliTRDtrackerV1::GetSeedingLayers(AliTRDtrackingChamber *chamber, Double_t *params)
-{
- //
- // Algorithm to find optimal seeding layer
- // Layers inside one sigma region (given by Quantiles) are sorted
- // according to their difference.
- // All layers outside are sorted according t
- //
- // Parameters:
- // - Array of AliTRDchamberTimeBins (in the current plane !!!)
- // - Container for the Indices of the seeding Layer candidates
- //
- // Output:
- // - Number of Layers inside the 1-sigma-region
- //
- // The optimal seeding layer should contain the mean number of
- // custers in the layers in one chamber.
- //
-
- //printf("Params: %3.3f, %3.3f, %3.3f\n", params[0], params[1], params[2]);
- const Int_t kMaxClustersLayer = AliTRDchamberTimeBin::kMaxClustersLayer;
- Int_t ncl[kNTimeBins], indices[kNTimeBins], bins[kMaxClustersLayer];
- memset(ncl, 0, sizeof(Int_t)*kNTimeBins);
- memset(indices, 0, sizeof(Int_t)*kNTimeBins);
- memset(bins, 0, sizeof(Int_t)*kMaxClustersLayer);
-
- AliTRDchamberTimeBin *layers = chamber->GetTB(0);
- Int_t nused = 0;
- for(Int_t ils = 0; ils < fTimeBinsPerPlane; ils++){
- ncl[ils] = layers[ils].GetNClusters();
- nused = 0;
- for(Int_t icl = 0; icl < ncl[ils]; icl++)
- if((layers[ils].GetCluster(icl))->IsUsed()) nused++;
- ncl[ils] -= nused;
- }
-
- Float_t mean = params[1];
- for(Int_t ils = 0; ils < fTimeBinsPerPlane; ils++){
- memmove(indices + bins[ncl[ils]+1] + 1, indices + bins[ncl[ils]+1], sizeof(Int_t)*(fTimeBinsPerPlane - ils));
- indices[bins[ncl[ils]+1]] = ils;
- for(Int_t i = ncl[ils]+1; i < kMaxClustersLayer; i++)
- bins[i]++;
- }
-
- //for(Int_t i = 0; i < nTimeBins; i++) printf("Bin %d = %d\n", i, bins[i]);
- Int_t sbin = -1;
- Int_t nElements;
- Int_t position = 0;
- TRandom *r = new TRandom();
- Int_t iter = 0;
- while(1){
- while(sbin < (Int_t)params[0] || sbin > (Int_t)params[2]){
- // Randomly selecting one bin
- sbin = (Int_t)r->Poisson(mean);
- }
- printf("Bin = %d\n",sbin);
- //Randomly selecting one Layer in the bin
- nElements = bins[sbin + 1] - bins[sbin];
- printf("nElements = %d\n", nElements);
- if(iter == 5){
- position = (Int_t)(gRandom->Rndm()*(fTimeBinsPerPlane-1));
- break;
- }
- else if(nElements==0){
- iter++;
- continue;
- }
- position = (Int_t)(gRandom->Rndm()*(nElements-1)) + bins[sbin];
- break;
- }
- delete r;
- return indices[position];
-}
-
-//____________________________________________________________________
-AliTRDcluster *AliTRDtrackerV1::FindSeedingCluster(AliTRDtrackingChamber *chamber, AliTRDseedV1* reference) const
-{
- //
- // Finds a seeding Cluster for the extrapolation chamber.
- //
- // The seeding cluster should be as close as possible to the assumed
- // track which is represented by a Rieman fit.
- // Therefore the selecting criterion is the minimum distance between
- // the best fitting cluster and the Reference which is derived from
- // the AliTRDseed. Because all layers are assumed to be equally good
- // a linear search is performed.
- //
- // Imput parameters: - layers: array of AliTRDchamberTimeBins (in one chamber!!!)
- // - sfit: the reference
- //
- // Output: - the best seeding cluster
- //
-
-
- // distances as squared distances
- Int_t index = 0;
- Float_t ypos = 0.0, zpos = 0.0, distance = 0.0, nearestDistance =100000.0;
- ypos = reference->GetYref(0);
- zpos = reference->GetZref(0);
- AliTRDcluster *currentBest = 0x0, *temp = 0x0;
- AliTRDchamberTimeBin *layers = chamber->GetTB(0);
- for(Int_t ils = 0; ils < fTimeBinsPerPlane; ils++){
- // Reference positions
-// ypos = reference->GetYat(layers[ils].GetX());
-// zpos = reference->GetZat(layers[ils].GetX());
- index = layers[ils].SearchNearestCluster(ypos, zpos, AliTRDReconstructor::RecoParam()->GetRoad2y(), AliTRDReconstructor::RecoParam()->GetRoad2z());
- if(index == -1) continue;
- temp = layers[ils].GetCluster(index);
- if(!temp) continue;
- distance = (temp->GetY() - ypos) * (temp->GetY() - ypos) + (temp->GetZ() - zpos) * (temp->GetZ() - zpos);
- if(distance < nearestDistance){
- nearestDistance = distance;
- currentBest = temp;
- }
- }
- return currentBest;
-}
-
//____________________________________________________________________
void AliTRDtrackerV1::GetSeedingConfig(Int_t iconfig, Int_t planes[4])
static TTreeSRedirector* DebugStreamer() {return fgDebugStreamer;}
AliCluster* GetCluster(Int_t index) const;
static void GetExtrapolationConfig(Int_t iconfig, Int_t planes[2]);
+ static const Int_t GetNTimeBins() {return fgNTimeBins;}
static void GetSeedingConfig(Int_t iconfig, Int_t planes[4]);
static TLinearFitter *GetTiltedRiemanFitter();
static TLinearFitter *GetTiltedRiemanFitterConstraint();
Int_t Clusters2TracksSM(Int_t sector, AliESDEvent *esd);
Int_t Clusters2TracksStack(AliTRDtrackingChamber **stack, TClonesArray *esdTrackList);
void CookLabel(AliKalmanTrack *pt, Float_t wrong) const;
- AliTRDcluster* FindSeedingCluster(AliTRDtrackingChamber *chamber, AliTRDseedV1 *sfit) const;
- Int_t GetSeedingLayers(AliTRDtrackingChamber *chamber, Double_t *params);
- void GetMeanCLStack(AliTRDtrackingChamber *chamber, Int_t *planes, Double_t *params);
AliTRDseedV1* GetTracklet(AliTRDtrackV1 *trk, Int_t plane, Int_t &idx);
Bool_t GetTrackPoint(Int_t index, AliTrackPoint &p) const;
Int_t MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *sseed, Int_t *ipar);
TClonesArray *fClusters; // List of clusters
TClonesArray *fTracklets; // List of tracklets
TClonesArray *fTracks; // List of tracks
- Int_t fTimeBinsPerPlane; // Timebins per plane in track prolongation
// should go to the recoParam
static const Double_t fgkMaxChi2; // Max increment in track chi2
static const Double_t fgkMaxStep; // Maximal step for tracking
// stand alone tracking
- static Double_t fgTopologicQA[kNConfigs]; // Topologic quality
+ static Double_t fgTopologicQA[kNConfigs]; // Topologic quality
Double_t fTrackQuality[kMaxTracksStack]; // Track quality
Int_t fSeedLayer[kMaxTracksStack]; // Seed layer
Int_t fSieveSeeding; //! Seeding iterator
- static TLinearFitter *fgTiltedRieman; // Fitter for the tilted Rieman fit without vertex constriant
- static TLinearFitter *fgTiltedRiemanConstrained; // Fitter for the tilted Rieman fit with vertex constraint
- static AliRieman *fgRieman; // Fitter for the untilted Rieman fit
- static TTreeSRedirector *fgDebugStreamer; //!Debug streamer
+ static Int_t fgNTimeBins; // Timebins per plane in track prolongation
+ static TLinearFitter *fgTiltedRieman; // Fitter for the tilted Rieman fit without vertex constriant
+ static TLinearFitter *fgTiltedRiemanConstrained; // Fitter for the tilted Rieman fit with vertex constraint
+ static AliRieman *fgRieman; // Fitter for the untilted Rieman fit
+ static TTreeSRedirector *fgDebugStreamer; //!Debug streamer
ClassDef(AliTRDtrackerV1, 2) // TRD tracker development class
}
//_______________________________________________________
-Double_t AliTRDtrackingChamber::GetQuality(Int_t timeBins)
+Double_t AliTRDtrackingChamber::GetQuality()
{
//
// Calculate chamber quality for seeding.
// calculate the deviation of the mean number of clusters from the
// closest integer values
- Float_t nclMed = float(ncl-nused)/timeBins;
+ Float_t nclMed = float(ncl-nused)/AliTRDtrackerV1::GetNTimeBins();
Int_t ncli = Int_t(nclMed);
Float_t nclDev = TMath::Abs(nclMed - TMath::Max(ncli, 1));
nclDev -= (nclDev>.5) && ncli ? 1. : 0.;
void Clear(const Option_t *opt = 0x0);
Int_t GetDetector() const {return fDetector;}
Int_t GetNClusters() const;
- Double_t GetQuality(Int_t ntb);
+ Double_t GetQuality();
AliTRDchamberTimeBin *GetSeedingLayer(AliTRDgeometry *geo);
Float_t GetX() const {return fX0;}
AliTRDchamberTimeBin* GetTB(int tb) {return tb >= 0 && tb < kNTimeBins ? &fTB[tb] : 0x0;}
//_____________________________________________________________________________
AliTRDtrackingSector::AliTRDtrackingSector()
- :fTimeBinsPerPlane(0)
- ,fSector(-1)
+ :fSector(-1)
,fN(0)
,fGeom(0x0)
{
}
//_____________________________________________________________________________
-AliTRDtrackingSector::AliTRDtrackingSector(AliTRDgeometry *geo, Int_t gs, Int_t tb)
- :fTimeBinsPerPlane(tb)
- ,fSector(gs)
+AliTRDtrackingSector::AliTRDtrackingSector(AliTRDgeometry *geo, Int_t gs)
+ :fSector(gs)
,fN(0)
,fGeom(geo)
{
//_____________________________________________________________________________
AliTRDtrackingSector::AliTRDtrackingSector(const AliTRDtrackingSector &/*t*/)
- :fTimeBinsPerPlane(0)
- ,fSector(-1)
+ :fSector(-1)
,fN(0)
,fGeom(0x0)
{
};
AliTRDtrackingSector();
- AliTRDtrackingSector(AliTRDgeometry* geo, Int_t gs, Int_t tbs);
+ AliTRDtrackingSector(AliTRDgeometry* geo, Int_t gs);
AliTRDtrackingSector(const AliTRDtrackingSector &/*t*/);
virtual ~AliTRDtrackingSector();
AliTRDtrackingChamber* GetChamber(Int_t stack, Int_t plane, Bool_t build = kFALSE);
AliTRDtrackingChamber** GetStack(Int_t stack);
Int_t GetSector() const {return fSector;}
+
void Init();
+ void Print(Option_t *opt = 0x0);
void SetGeometry(AliTRDgeometry *geo) {fGeom = geo;}
- // temporary ... some of this functions are obsolete
- void Print(Option_t *opt = 0x0);
-// void MapTimeBinLayers();
-// Int_t Find(Double_t x) const;
-// void InsertLayer(AliTRDchamberTimeBin *pl);
-// Int_t CookTimeBinIndex(Int_t plane, Int_t localTB) const;
-
private:
- UChar_t fTimeBinsPerPlane; // no. of time bins
Char_t fSector; // Sector# in AliTRDgeometry
UChar_t fN; // Total number of chambers allocated
Char_t fIndex[kNChambersSector]; // indexes of allocated chambers
AliTRDgeometry *fGeom; // Geometry
AliTRDtrackingChamber *fChamber[kNChambersSector];// chambers
AliTRDtrackingChamber *fStack[kNplane]; //! temporary holding one stack
+
ClassDef(AliTRDtrackingSector, 1) // TRD tracker container for one sector
};