AliITSUTrackerGlo::AliITSUTrackerGlo(AliITSUReconstructor* rec)
: fReconstructor(rec)
,fITS(0)
+ ,fMatLUT(0)
,fCurrESDtrack(0)
,fCurrESDtrMClb(kDummyLabel)
,fCurrMass(kPionMass)
,fCurrLayer(0)
,fTrackPhaseID(-1)
,fCurrPassID(-1)
+ ,fUseMatLUT(kFALSE)
#ifdef _ITSU_TUNING_MODE_
,fCHistoArrCorr(0)
,fCHistoArrFake(0)
delete[] fLayerCandidates;
if (fWorkHyp) fWorkHyp->SetTPCSeed(0); // this hypothesis does not own the seed
delete fWorkHyp;
+ delete fMatLUT;
//
#ifdef _ITSU_TUNING_MODE_
if (fCHistoArrCorr || fCHistoArrFake) {
fITS = rec->GetITSInterface();
fNLrActive = fITS->GetNLayersActive();
fWorkHyp = new AliITSUTrackHyp(fNLrActive);
+ // create material lookup table
+ const int kNTest = 1000;
+ const double kStepsPerCM=5;
+ fMatLUT = new AliITSUMatLUT(fITS->GetRMin(),fITS->GetRMax(),Nint(kStepsPerCM*(fITS->GetRMax()-fITS->GetRMin())));
+ double zmn = 1e6;
+ for (int ilr=fITS->GetNLayers();ilr--;) {
+ AliITSURecoLayer* lr = fITS->GetLayer(ilr);
+ if (zmn>Abs(lr->GetZMin())) zmn = Abs(lr->GetZMin());
+ if (zmn>Abs(lr->GetZMax())) zmn = Abs(lr->GetZMax());
+ }
+ fMatLUT->FillData(kNTest,-zmn,zmn);
//
if (fLayerMaxCandidates<1) fLayerMaxCandidates = 1000;
fLayerCandidates = new AliITSUSeed*[fLayerMaxCandidates];
fSeedsPool.ExpandCreateFast(1000); // RS TOCHECK
fFreeSeedsID.Set(1000);
fESDIndex.Set(1000);
-
//
}
fNTracksESD = esdEv->GetNumberOfTracks();
AliInfo(Form("Will try to find prolongations for %d tracks",fNTracksESD));
int nTrackCond = AliITSUReconstructor::GetRecoParam()->GetNTrackingConditions();
+ fUseMatLUT = AliITSUReconstructor::GetRecoParam()->GetUseMatLUT(fTrackPhaseID);
if (nTrackCond<1) {
if (!fDefTrackConds.GetEntriesFast()) {
AliInfo("No tracking conditions found in recoparams, creating default one requesting all layers hit");
}
AliLog::SetClassDebugLevel("AliITSUTrackerGlo",dbg ? 10:0);
*/
- AliDebug(1,Form("Processing track %d(esd%d) | M=%.3f Pt=%.3f | MCLabel: %d",itr,trID,fCurrESDtrack->GetMass(kTRUE),fCurrESDtrack->Pt(),fCurrESDtrMClb));//RS
+#ifdef _ITSU_DEBUG_
+ AliDebug(1,Form("Processing track %d(esd%d) | M=%.3f Pt=%.3f | MCLabel: %d",itr,trID,fCurrESDtrack->GetMassForTracking(kTRUE),fCurrESDtrack->Pt(),fCurrESDtrMClb));//RS
+#endif
FindTrack(fCurrESDtrack, trID);
}
//
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>+2) {
AliInfo(Form("SeedsPool: %d, BookedUpTo: %d, free: %d",fSeedsPool.GetSize(),fSeedsPool.GetEntriesFast(),fNFreeSeeds));
fHypStore.Print();
}
+#endif
FinalizeHypotheses();
#ifdef _ITSU_TUNING_MODE_
CheckClusterUsage(); //!!RS
//
SetTrackingPhase(kPropBack);
fNTracksESD = esdEv->GetNumberOfTracks();
+ fUseMatLUT = AliITSUReconstructor::GetRecoParam()->GetUseMatLUT(fTrackPhaseID);
+#ifdef _ITSU_DEBUG_
AliDebug(1,Form("Will propagate back %d tracks",fNTracksESD));
+#endif
//
double bz0 = GetBz();
Double_t xyzTrk[3],xyzVtx[3]={GetX(),GetY(),GetZ()};
AliITSUTrackHyp dummyTr;
const double kWatchStep=10.; // for larger steps watch arc vs segment difference
- Double_t times[AliPID::kSPECIES];
+ Double_t times[AliPID::kSPECIESC];
//
for (int itr=0;itr<fNTracksESD;itr++) {
fCurrESDtrack = esdEv->GetTrack(itr);
{
double dxs = xyzTrk[0] - xyzVtx[0];
double dys = xyzTrk[1] - xyzVtx[1];
- double dzs = xyzTrk[2] - xyzVtx[2];
+ // double dzs = xyzTrk[2] - xyzVtx[2];
// RS: for large segment steps d use approximation of cicrular arc s by
// s = 2R*asin(d/2R) = d/p asin(p) \approx d/p (p + 1/6 p^3) = d (1+1/6 p^2)
// where R is the track radius, p = d/2R = 2C*d (C is the abs curvature)
double fcarc = 1.+crv*crv*dst/6.;
dst *= fcarc*fcarc;
}
- dst += dzs*dzs;
+ // RS: temporary hack since we don't have SPD vertex:
+ // dst += dzs*dzs;
+ dst *= 1+fCurrESDtrack->GetTgl()*fCurrESDtrack->GetTgl();
dst = Sqrt(dst);
}
//
dummyTr.AliExternalTrackParam::operator=(*fCurrESDtrack);
dummyTr.StartTimeIntegral();
dummyTr.AddTimeStep(dst);
- dummyTr.GetIntegratedTimes(times);
+ dummyTr.GetIntegratedTimes(times,AliPID::kSPECIESC);
fCurrESDtrack->SetIntegratedTimes(times);
fCurrESDtrack->SetIntegratedLength(dummyTr.GetIntegratedLength());
continue;
UpdateESDTrack(fCurrHyp,AliESDtrack::kITSout);
}
else {
+#ifdef _ITSU_DEBUG_
AliDebug(2,Form("Refit Failed for track %d | ESDtrack#%d (MClb:%d)",itr,fCurrESDtrack->GetID(),fCurrESDtrMClb));
+#endif
//fCurrHyp->AliExternalTrackParam::Print();
//fCurrHyp->GetWinner()->Print();
}
AliCodeTimerAuto("",0);
//
SetTrackingPhase(kRefitInw);
+ fUseMatLUT = AliITSUReconstructor::GetRecoParam()->GetUseMatLUT(fTrackPhaseID);
fNTracksESD = esdEv->GetNumberOfTracks();
// AliLog::SetClassDebugLevel("AliITSUTrackerGlo",10);
AliDebug(1,Form("Will refit inward %d tracks",fNTracksESD));
+ // Bool_t uselogMS = AliExternalTrackParam::GetUseLogTermMS();
+ // AliExternalTrackParam::SetUseLogTermMS(kTRUE);
//
for (int itr=0;itr<fNTracksESD;itr++) {
fCurrESDtrack = esdEv->GetTrack(itr);
if ( trStat & AliESDtrack::kITSrefit ) continue; // already done
if ( (trStat & AliESDtrack::kTPCout) && !(trStat & AliESDtrack::kTPCrefit) ) continue;
//
- fCurrHyp = GetTrackHyp(itr);
- fCurrHyp->AliExternalTrackParam::operator=(*fCurrESDtrack); // fetch current ESDtrack kinematics
+ fCurrHyp = GetTrackHyp(itr);
fCurrMass = fCurrHyp->GetMass();
+ *fCurrHyp = *fCurrESDtrack; // fetch current ESDtrack kinematics
//
int nclFit = 0;
+ // fCurrHyp->ResetCovariance(1000); // in case we want to do SA refit
double chi2 = RefitTrack(fCurrHyp,fITS->GetRMin(),nclFit);
if (chi2>0) { // propagate up to inside radius of the beam pipe
int ndf = nclFit*2-5;
UpdateESDTrack(fCurrHyp,AliESDtrack::kITSrefit);
}
else {
+#ifdef _ITSU_DEBUG_
AliDebug(2,Form("Refit Failed for track %d |ESDtrack#%d (MClb:%d)",itr,fCurrESDtrack->GetID(),fCurrESDtrMClb));
+#endif
}
}
+ // AliExternalTrackParam::SetUseLogTermMS(uselogMS);
//
AliInfo(Form("%d ITSrefit in %d ITSout in %d ITSin tracks for %d tried TPC seeds out of %d ESD tracks\n",
fCountITSrefit,fCountITSout,fCountITSin,fCountProlongationTrials,fNTracksESD));
fCurrHyp = fWorkHyp;
fCurrHyp->InitFrom(hypTr);
//
- AliITSURecoSens *hitSens[AliITSURecoSens::kNNeighbors+1];
+ AliITSURecoSens *hitSens[AliITSURecoLayer::kNNeighbors+1];
//
int ilaUp = fNLrActive; // previous active layer really checked (some may be excluded!)
//
}
seedUC.ResetFMatrix(); // reset the matrix for propagation to next layer
// go till next active layer
+#ifdef _ITSU_DEBUG_
AliDebug(2,Form("working on Lr:%d Seed:%d of %d for esdID=%d (MClb:%d) | pT=%.3f",ila,isd,nSeedsUp,esdID,fCurrESDtrMClb,seedUC.Pt()));
+#endif
if (!TransportToLayer(&seedUC, fITS->GetLrIDActive(ilaUp), fITS->GetLrIDActive(ila)) ) { // external seed already prolonged
//
+#ifdef _ITSU_DEBUG_
AliDebug(2,Form("Transport failed | esdID=%d (MClb:%d)",esdID,fCurrESDtrMClb));
+#endif
// Check if the seed satisfies to track definition
if (NeedToKill(&seedUC,kTransportFailed) && seedU) KillSeed(seedU,kTRUE);
continue; // RS TODO: decide what to do with tracks stopped on higher layers w/o killing
int nsens = fCurrLayer->FindSensors(&fTrImpData[kTrPhi0], hitSens, mcquest); // find detectors which may be hit by the track
*/
int nsens = fCurrLayer->FindSensors(&fTrImpData[kTrPhi0], hitSens); // find detectors which may be hit by the track
+#ifdef _ITSU_DEBUG_
AliDebug(2,Form("Will check %d sensors on lr:%d | esdID=%d (MClb:%d)",nsens,ila,esdID,fCurrESDtrMClb));
+#endif
//
seedUC.SetLr(ila);
//
// since the transport matrix should be defined in this frame.
double xs; // X in the TF of current seed, corresponding to intersection with sensor plane
if (!seedT.GetTrackingXAtXAlpha(sens->GetXTF(),sens->GetPhiTF(),bz, xs)) {
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>2) {
printf("Failed on GetTrackingXAtXAlpha: X=%.4f alp=%.3f\n",sens->GetXTF(),sens->GetPhiTF());
seedT.Print("etp");
}
+#endif
continue;
}
if (xs<seedT.GetX()) {
if (!PropagateSeed(&seedT,xs,fCurrMass)) continue;
}
else { // some low precision tracks may hit the sensor plane outside of the layer radius
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>2) {
if (!seedT.ContainsFake()) {
printf("WRONG PROP on L%d, sens%d of %d: %.4f > %.4f\n",ila,isn,nsens,xs,seedT.GetX());
seedT.Print("etp");
}
}
+#endif
if (!seedT.PropagateParamOnlyTo(xs,bz)) continue;
}
// if (!seedT.PropagateToX(xs,bz)) continue;
}
if (fNCandidatesAdded) ValidateAllowedCandidates(ila,maxNCandidates);
// ((TObjArray*)fCurrHyp->GetLayerSeeds(ila))->Sort();
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>2) { //RS
printf(">>> All hypotheses on lr %d: \n",ila);
for (int ih=0;ih<fCurrHyp->GetNSeeds(ila);ih++) {printf(" #%3d ",ih); fCurrHyp->GetSeed(ila,ih)->Print();}
}
+#endif
//
/*
for (int ih=0;ih<fCurrHyp->GetNSeeds(ila);ih++) {
}
//
SaveReducedHypothesesTree(hypTr);
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>1) {
printf("\nSaved hypotheses for esdTrack %d (MCLab:%d)\n",esdID,fCurrESDtrMClb);
hypTr->Print("l");
}
+#endif
fCurrHyp = 0;
// AliLog::SetClassDebugLevel("AliITSUTrackerGlo",0);
//
//
fCountProlongationTrials++;
//
- fCurrMass = esdTr->GetMass();
- if (fCurrMass<kPionMass*0.9) fCurrMass = kPionMass; // don't trust to mu, e identification from TPCin
+ fCurrMass = esdTr->GetMassForTracking();
//
hyp = new AliITSUTrackHyp(fNLrActive);
hyp->SetESDTrack(esdTr);
hyp->SetMass(fCurrMass);
hyp->SetTPCSeed( new AliExternalTrackParam(*esdTr) );
SetTrackHyp(hyp,esdID);
-
+ Bool_t lut = fUseMatLUT; // for propagation from TPC use TGeo material budget always
+ fUseMatLUT = kFALSE;
if (!TransportToLayer(hyp->GetTPCSeed(),fITS->GetNLayers(), fITS->GetLrIDActive(fNLrActive-1), fITS->GetRITSTPCRef())) hyp->SetSkip(); // propagate to outer R of ITS
+ fUseMatLUT = lut;
//
return hyp;
// TO DO
//
return kFALSE;
}
+#ifdef _ITSU_DEBUG_
AliDebug(2,Form("go in dir=%d to R=%.4f(X:%.4f)",dir,lrTo->GetR(-dir), xToGo));
+#endif
if (!PropagateSeed(seed,xToGo,fCurrMass,100, kFALSE )) {
//printf("FailHere2: %f %f %d\n",xts,xToGo,dir);
//seed->Print("etp");
// seed->Print("etp");
return kFALSE;
}
+#ifdef _ITSU_DEBUG_
AliDebug(2,Form("go in dir=%d to R=%.4f(X:%.4f)",dir,lrTo->GetR(-dir), xToGo));
+#endif
if (!PropagateSeed(seed,xToGo,fCurrMass,100, kFALSE )) {
//printf("FailHere2: %f %f %d\n",xts,xToGo,dir);
//seed->Print("etp");
}
if ( (dir>0&&xToGo>xStop) || (dir<0&&xToGo<xStop) ) xToGo = xStop;
//
+#ifdef _ITSU_DEBUG_
AliDebug(2,Form("go in dir=%d to R=%.4f(X:%.4f)",dir,lrTo->GetR(-dir), xToGo));
+#endif
if (!PropagateSeed(seed,xToGo,fCurrMass,100, kFALSE )) {
//printf("FailHere2: %f %f %d\n",xts,xToGo,dir);
//seed->Print("etp");
double xToGo = lr->GetR(dir);
if (check) { // do we need to track till the surface of the current layer ?
double curR2 = seed->GetX()*seed->GetX() + seed->GetY()*seed->GetY(); // current radius
+#ifdef _ITSU_DEBUG_
AliDebug(3,Form(" dir:%d Cur: %e Tgt: %e",dir,Sqrt(curR2),xToGo));
+#endif
if (dir>0) { if (curR2-xToGo*xToGo>-fgkToler) return kTRUE; } // on the surface or outside of the layer
else if (dir<0) { if (xToGo*xToGo-curR2>-fgkToler) return kTRUE; } // on the surface or outside of the layer
}
if (dir>0) { if (curR2-xToGo*xToGo>-fgkToler) return kTRUE; } // on the surface or outside of the layer
else if (dir<0) { if (xToGo*xToGo-curR2>-fgkToler) return kTRUE; } // on the surface or outside of the layer
}
+#ifdef _ITSU_DEBUG_
AliDebug(2,Form(" dir=%d : from R=%.4f -> R=%.4f",dir,Sqrt(seed->GetX()*seed->GetX() + seed->GetY()*seed->GetY()), xToGo));
+#endif
if (!seed->GetXatLabR(xToGo,xToGo,GetBz(),dir)) return kFALSE;
// go via layer to its boundary, applying material correction.
if (!PropagateSeed(seed,xToGo,fCurrMass, lr->GetMaxStep())) return kFALSE;
if (TMath::Abs(cl->GetX())>kTolerX) { // if due to the misalingment X is large, propagate track only
if (!track->PropagateParamOnlyTo(track->GetX()+cl->GetX(),GetBz())) {
//
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>2 && goodCl && !track->ContainsFake()) {
AliDebug(2,Form("Lost good cl on L:%d failed propagation. |ESDtrack#%d (MClb:%d)",lr,fCurrESDtrack->GetID(),fCurrESDtrMClb));
track->Print("etp");
cl->Print();
}
+#endif
return kStopSearchOnSensor; // propagation failed, seedT is intact
}
}
fCurrTrackCond->GetNSigmaRoadY(lr)*fCurrTrackCond->GetNSigmaRoadY(lr); // RS TOOPTIMIZE
if (dy2>tol2) { // the clusters are sorted in Z(col) then in Y(row).
//
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>2 && goodCl && !track->ContainsFake()) {
AliDebug(2,Form("Lost good cl: dy2=%e > tol2=%e |ESDtrack#%d (MClb:%d)",dy2,tol2,fCurrESDtrack->GetID(),fCurrESDtrMClb));
track->Print("etp");
cl->Print();
PrintSeedClusters(track);
}
+#endif
// clusters are sorted in increasing Y and the loop goes from last (highers Y) to 1st.
// if the track has too large y for this cluster (dy<0) it will be so for all other clusters of the sensor
if (dy<0) return kStopSearchOnSensor; // No chance that other cluster of this sensor will match (all Y's will be even larger)
tol2 = (track->GetSigmaZ2() + AliITSUReconstructor::GetRecoParam()->GetSigmaZ2(lr))*
fCurrTrackCond->GetNSigmaRoadZ(lr)*fCurrTrackCond->GetNSigmaRoadZ(lr); // RS TOOPTIMIZE
if (dz2>tol2) {
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>2 && goodCl && !track->ContainsFake()) {
AliDebug(2,Form("Lost good cl on L:%d : dz2=%e > tol2=%e |ESDtrack#%d (MClb:%d)",lr,dz2,tol2,fCurrESDtrack->GetID(),fCurrESDtrMClb));
track->Print("etp");
cl->Print();
PrintSeedClusters(track);
}
+#endif
return kClusterNotMatching; // Other clusters may match
}
//
double chi2 = track->GetPredictedChi2(p,cov);
//
if (chi2>fCurrTrackCond->GetMaxTr2ClChi2(lr)) {
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>2 && goodCl && !track->ContainsFake()) {
AliDebug(2,Form("Lost good cl on L:%d : Chi2=%e > Chi2Max=%e |dy: %+.3e dz: %+.3e |ESDtrack#%d (MClb:%d)\n",
lr,chi2,fCurrTrackCond->GetMaxTr2ClChi2(lr),dy,dz,fCurrESDtrack->GetID(),fCurrESDtrMClb));
cl->Print("");
PrintSeedClusters(track);
}
+#endif
return kClusterNotMatching;
}
//
track = NewSeedFromPool(track); // input track will be reused, use its clone for updates
if (!track->Update()) {
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>2 && goodCl && !track->ContainsFake()) {
AliDebug(2,Form("Lost good cluster on L:%d : failed to update",lr));
track->Print("etp");
cl->Print("");
PrintSeedClusters(track);
}
+#endif
MarkSeedFree(track);
return kClusterNotMatching;
}
track->SetLrClusterID(lr,clID);
//
if (track->GetChi2GloNrm()>fCurrTrackCond->GetMaxChi2GloNrm(lr)) {
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>2 && goodCl && !track->ContainsFake()) {
AliDebug(2,Form("Lost good cl on L:%d : Chi2Glo=%e > Chi2Max=%e |dy: %+.3e dz: %+.3e |ESDtrack#%d (MClb:%d)\n",
lr,track->GetChi2GloNrm(),fCurrTrackCond->GetMaxChi2GloNrm(lr),dy,dz,fCurrESDtrack->GetID(),fCurrESDtrMClb));
cl->Print("");
PrintSeedClusters(track);
}
+#endif
MarkSeedFree(track);
return kClusterNotMatching;
}
//
track->SetFake(!goodCl);
//
+#ifdef _ITSU_DEBUG_
AliDebug(2,Form("AddCl(%d) Cl%d lr:%d: dY:%+8.4f dZ:%+8.4f (MC: %5d %5d %5d) |Chi2=%f(%c)| ",
goodCl,clID,lr,dy,dz2,cl->GetLabel(0),cl->GetLabel(1),cl->GetLabel(2), chi2, track->IsFake() ? '-':'+'));
+#endif
//
AddSeedBranch(track);
//
const Double_t kEpsilon = 1e-5;
Double_t xpos = seed->GetX();
Int_t dir = (xpos<xToGo) ? 1:-1;
- Double_t xyz0[3],xyz1[3],param[7];
+ Double_t xyz0[3],xyz1[3];
//
Bool_t updTime = dir>0 && seed->IsStartedTimeIntegral();
if (matCorr || updTime) seed->GetXYZ(xyz1); //starting global position
xyz0[2]=xyz1[2];
seed->GetXYZ(xyz1); // // global pos at the end of step
if (matCorr) {
- MeanMaterialBudget(xyz0,xyz1,param);
- Double_t xrho=param[0]*param[4], xx0=param[1];
+ Double_t xrho,xx0;
+ ds = GetMaterialBudget(xyz0,xyz1,xx0,xrho);
if (dir>0) xrho = -xrho; // outward should be negative
if (!seed->ApplyMaterialCorrection(xx0,xrho,mass,kFALSE)) {AliInfo("Fail2"); seed->Print("etp"); return kFALSE;}
- ds = param[4];
}
else { // matCorr is not requested but time integral is
double d0 = xyz1[0]-xyz0[0];
const Double_t kEpsilon = 1e-5;
Double_t xpos = seed->GetX();
Int_t dir = (xpos<xToGo) ? 1:-1;
- Double_t xyz0[3],xyz1[3],param[7];
+ Double_t xyz0[3],xyz1[3];
//
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>1) {
AliDebug(2,Form("Before Propagate to X=%f with M=%.3f MaxStep=%.4f MatCorr=%d",xToGo,mass,maxStep,matCorr));
seed->AliExternalTrackParam::Print();
}
+#endif
Bool_t updTime = dir>0 && seed->IsStartedTimeIntegral();
if (matCorr || updTime) seed->GetXYZ(xyz1); //starting global position
while ( (xToGo-xpos)*dir > kEpsilon){
seed->GetXYZ(xyz1); // // global pos at the end of step
//
if (matCorr) {
- MeanMaterialBudget(xyz0,xyz1,param);
- Double_t xrho=param[0]*param[4], xx0=param[1];
+ Double_t xrho,xx0;
+ ds = GetMaterialBudget(xyz0,xyz1,xx0,xrho);
if (dir>0) xrho = -xrho; // outward should be negative
if (!seed->CorrectForMeanMaterial(xx0,xrho,mass)) return kFALSE;
- ds = param[4];
}
else { // matCorr is not requested but time integral is
double d0 = xyz1[0]-xyz0[0];
//
xpos = seed->GetX();
}
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>1) {
AliDebug(2,Form("After Propagate to X=%f",xToGo));
seed->AliExternalTrackParam::Print();
}
+#endif
return kTRUE;
}
continue;
}
//
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>1) { //------------------------ DEBUG -------------------
AliInfo(Form("Shared cl#%4d on Lr:%d: Hyp%3d/Q:%6.3f vs Hyp%3d/Q:%6.3f",
clID,lrID,idH-1,winner->GetQualityVar(),refID-1,winnerC->GetQualityVar()));
} while ((sd=(AliITSUSeed*)sd->GetParent()));
printf("|\n");
} //-------------------------------------------------- DEBUG -------------------
+#endif
//
if (winner->GetQualityVar()<winnerC->GetQualityVar()) { // current tracks is better then competitor track
FlagSeedClusters(winnerC,kFALSE,refID); // unflag cluster usage by loser
// set fakes cluster info
{
UShort_t clfake = 0;
+ Int_t clSplit = 0;
AliITSUSeed* sd = win;
+ int ip=0;
do {
- if (sd->IsFake()) clfake |= 0x1<<sd->GetLayerID();
+ int lr, clID = sd->GetLrCluster(lr);
+ if (sd->IsFake()) clfake |= 0x1<<lr;
+ if (clID>=0) {
+ esdTr->SetITSModuleIndex(ip++, sd->GetLrClusterID());
+ AliITSUClusterPix *cl = (AliITSUClusterPix*)fITS->GetLayerActive(lr)->GetCluster(clID);
+#ifdef _ITSU_TUNING_MODE_
+ if (cl->IsSplit()) clSplit |= 0x1<<lr;
+#endif
+ }
} while ((sd=(AliITSUSeed*)sd->GetParent()));
//
// RS: Temporary set special flag for tracks from the afterburner
if (fCurrPassID>0) clfake |= 0x1<<7;
//
esdTr->SetITSSharedMap(clfake);
+ esdTr->SetITSModuleIndex(10,clSplit);
}
// TEMPORARY: store iteration id
esdTr->SetITSModuleIndex(11,fCurrPassID);
}
//
esdTr->SetITSLabel(hyp->GetITSLabel());
- // transfer module indices
+ // transfer chip indices
// TODO
}
//______________________________________________________________________________
-Double_t AliITSUTrackerGlo::RefitTrack(AliExternalTrackParam* trc, Double_t rDest, Int_t &nclFit, Int_t stopCond)
+Double_t AliITSUTrackerGlo::RefitTrack(AliITSUTrackHyp* trc, Double_t rDest, Int_t &nclFit, Int_t stopCond)
{
// refit track till radius rDest. The cluster,mass info is taken from fCurrHyp (and its winner seed)
// if stopCond<0 : propagate till last cluster then stop
lrStart = fITS->FindFirstLayerID(rCurr,dir);
lrStop = fITS->FindLastLayerID(rDest,dir); // lr id before which we have to stop
//
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>2) {
printf("Refit %d: Lr:%d (%f) -> Lr:%d (%f)\n",dir,lrStart,rCurr, lrStop,rDest);
printf("Before refit: "); trc->Print();
}
+#endif
if (lrStop<0 || lrStart<0) AliFatal(Form("Failed to find start(%d) or last(%d) layers. Track from %.3f to %.3f",lrStart,lrStop,rCurr,rDest));
//
Int_t clInfo[2*AliITSUAux::kMaxLayers];
Int_t nCl = fCurrHyp->FetchClusterInfo(clInfo);
fCurrMass = fCurrHyp->GetMass();
- AliExternalTrackParam tmpTr(*trc);
+ AliITSUTrackHyp tmpTr(*(AliKalmanTrack*)trc);
double chi2 = 0;
int iclLr[2],nclLr;
nclFit = 0;
//
- int lrStop1 = lrStop+1;
+ int lrStop1 = lrStop+dir;
for (int ilr=lrStart;ilr!=lrStop1;ilr+=dir) {
AliITSURecoLayer* lr = fITS->GetLayer(ilr);
if ( dir*(rCurr-lr->GetR(dir))>0) continue; // this layer is already passed
AliITSUClusterPix* clus = (AliITSUClusterPix*)lr->GetCluster(iclLr[icl]);
AliITSURecoSens* sens = lr->GetSensorFromID(clus->GetVolumeId());
if (!tmpTr.Rotate(sens->GetPhiTF())) {
+#ifdef _ITSU_DEBUG_
AliESDtrack* trESD = fCurrHyp->GetESDTrack();
AliDebug(2,Form("Failed on rotate to %f | ESDtrack#%d (MClb:%d)",sens->GetPhiTF(),trESD->GetID(),trESD->GetTPCLabel()));
+#endif
return -1;
}
//
double xClus = sens->GetXTF()+clus->GetX();
if (!transportedToLayer) {
if (ilr!=lrStart && !TransportToLayerX(&tmpTr,lrStart,ilr,xClus)) {
+#ifdef _ITSU_DEBUG_
AliESDtrack* trESD = fCurrHyp->GetESDTrack();
AliDebug(2,Form("Failed to transport %d -> %d | ESDtrack#%d (MClb:%d)\n",lrStart,ilr,trESD->GetID(),trESD->GetTPCLabel()));
+#endif
return -1; // go to the entrance to the layer
}
lrStart = ilr;
transportedToLayer = kTRUE;
}
//
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>1) {
AliDebug(2,Form("Propagate to cl:%d on lr %d Need to go %.4f -> %.4f",icl,ilrA,tmpTr.GetX(),xClus));
}
+#endif
//
if (!PropagateSeed(&tmpTr,xClus,fCurrMass)) {
+#ifdef _ITSU_DEBUG_
AliESDtrack* trESD = fCurrHyp->GetESDTrack();
AliDebug(2,Form("Failed on propagate to %f (dir=%d) | ESDtrack#%d (MClb:%d)",xClus,dir,trESD->GetID(),trESD->GetTPCLabel()));
+#endif
return -1;
}
//
#endif
//
if ( !tmpTr.Update(p,cov) ) {
+#ifdef _ITSU_DEBUG_
AliESDtrack* trESD = fCurrHyp->GetESDTrack();
AliDebug(2,Form("Failed on Update | ESDtrack#%d (MClb:%d)",trESD->GetID(),trESD->GetTPCLabel()));
+#endif
return -1;
}
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>1) {
printf("AfterRefit: "); tmpTr.Print();
}
+#endif
if (++nclFit==nCl && stopCond<0) {
- *trc = tmpTr;
+ *trc = (AliKalmanTrack&)tmpTr;
return chi2; // it was requested to not propagate after last update
}
}
//
if (lrStart!=lrStop) {
if (!TransportToLayer(&tmpTr,lrStart,lrStop)) {
+#ifdef _ITSU_DEBUG_
AliDebug(1,Form("Failed on TransportToLayer %d->%d | ESDtrack#%d (MClb:%d), X=%f",lrStart,lrStop,fCurrESDtrack->GetID(),fCurrESDtrMClb,tmpTr.GetX()));
+#endif
return (stopCond>0) ? -chi2 : chi2; // rDest was obligatory
}
if (!GoToExitFromLayer(&tmpTr,fITS->GetLayer(lrStop),dir)) {
+#ifdef _ITSU_DEBUG_
AliDebug(1,Form("Failed on GoToExitFromLayer %d | ESDtrack#%d (MClb:%d), X=%f",lrStop,fCurrESDtrack->GetID(),fCurrESDtrMClb,tmpTr.GetX()));
+#endif
return (stopCond>0) ? -chi2 : chi2; // rDest was obligatory
}
}
if (!tmpTr.GetXatLabR(rDest,rDest,GetBz(),0) || !PropagateSeed(&tmpTr,rDest,fCurrMass, 100, kFALSE)) {
return (stopCond>0) ? -chi2 : chi2; // rDest was obligatory
}
- *trc=tmpTr;
+ *trc = (AliKalmanTrack&)tmpTr;
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>2) {
printf("After refit (now at lr %d): ",lrStop); trc->Print();
}
+#endif
return chi2;
}
// check seed backward propagation chi2 and matching to TPC
double bz0 = GetBz();
double rDest = fITS->GetRITSTPCRef(); // reference radius for comparison
- static AliExternalTrackParam trback;
- trback = *seed;
+ AliITSUTrackHyp trback;
+ trback.AliExternalTrackParam::operator=(*seed);
trback.ResetCovariance(10000);
int nclFit = 0;
double chi2sa = RefitTrack(&trback,rDest,nclFit,1);
// relate to TPC track at outer layer
AliExternalTrackParam* tpcSeed = fCurrHyp->GetTPCSeed();
if (!trback.Rotate(tpcSeed->GetAlpha()) || !trback.PropagateParamOnlyTo(tpcSeed->GetX(),bz0)) {
+#ifdef _ITSU_DEBUG_
if (AliDebugLevelClass()>+1 && !seed->ContainsFake()) {
AliInfo(Form("Failed to propagate seed to TPC track @ X:%.3f Alpha:%.3f",tpcSeed->GetX(),tpcSeed->GetAlpha()));
seed->Print("etp");
trback.Print();
}
+#endif
return kFALSE;
}
double chi2Match = trback.GetPredictedChi2(tpcSeed)/5;
void AliITSUTrackerGlo::CheckClusterUsage()
{
// check cluster usage info
+ printf("ClusterUsage at pass %d\n",fCurrPassID);
for (int ilr=0;ilr<fNLrActive;ilr++) {
AliITSURecoLayer* lr = fITS->GetLayerActive(ilr);
int ncl = lr->GetNClusters();