Int_t GetLayerID() const {return UnpackLayer(fClID);}
Int_t GetClusterID() const {return UnpackCluster(fClID);}
Bool_t HasClusterOnLayer(Int_t lr) const {return fHitsPattern&(0x1<<lr);}
+ Bool_t HasCluster() const {return IsCluster(fClID);}
Int_t GetNLayersHit() const {return NumberOfBitsSet(fHitsPattern);}
+ Int_t GetNClusters() const;
+ Int_t GetClusterIndex(Int_t ind) const;
UShort_t GetHitsPattern() const {return fHitsPattern;}
Float_t GetChi2Cl() const {return fChi2Cl;}
Float_t GetChi2Glo() const {return fChi2Glo;}
//
protected:
//
- Double_t fFMatrix[kNFElem]; // matrix of propagation from prev layer (non-trivial elements)
- Double_t fKMatrix[kNKElem]; // Gain matrix non-trivial elements (note: standard MBF formula uses I-K*H)
- Double_t fRMatrix[kNRElem]; // rotation matrix non-trivial elements
- Double_t fCovIYZ[3]; // inverted matrix of propagation + meas errors = [Hi * Pi|i-1 * Hi^T + Ri]^-1
- Double_t fResid[2]; // residuals vector
UShort_t fHitsPattern; // bit pattern of hits
UShort_t fNChildren; // number of children (prolongations)
UInt_t fClID; // packed cluster info (see AliITSUAux::PackCluster)
Float_t fChi2Glo; // current chi2 global (sum of track-cluster chi2's on layers with hit)
Float_t fChi2Cl; // track-cluster chi2 (if >0) or penalty for missing cluster (if < 0)
Float_t fChi2Penalty; // total penalty (e.g. for missing clusters)
+ Double_t fFMatrix[kNFElem]; // matrix of propagation from prev layer (non-trivial elements)
+ Double_t fKMatrix[kNKElem]; // Gain matrix non-trivial elements (note: standard MBF formula uses I-K*H)
+ Double_t fRMatrix[kNRElem]; // rotation matrix non-trivial elements
+ Double_t fCovIYZ[3]; // inverted matrix of propagation + meas errors = [Hi * Pi|i-1 * Hi^T + Ri]^-1
+ Double_t fResid[2]; // residuals vector
TObject* fParent; // parent track (in higher tree hierarchy)
ClassDef(AliITSUSeed,1)
return par;
}
+//__________________________________________________________________
+inline Int_t AliITSUSeed::GetNClusters() const
+{
+ // count number of clusters (some layers may have >1 hit)
+ int ncl = 0;
+ const AliITSUSeed* seed = this;
+ while(seed) {
+ if (seed->HasCluster()) ncl++;
+ seed = (AliITSUSeed*)seed->GetParent();
+ }
+ return ncl;
+ //
+}
+
#endif
{
//
//
+ SetTrackingPhase(kClus2Tracks);
ResetSeedsPool();
- fTrackPhase = kClus2Tracks;
int nTrESD = esdEv->GetNumberOfTracks();
AliInfo(Form("Will try to find prolongations for %d tracks",nTrESD));
AliITSUReconstructor::GetRecoParam()->Print();
//
// Do outward fits in ITS
//
- fTrackPhase = kPropBack;
+ SetTrackingPhase(kPropBack);
int nTrESD = esdEv->GetNumberOfTracks();
- AliInfo(Form("Will fit %d tracks",nTrESD));
+ AliInfo(Form("Will propagate back %d tracks",nTrESD));
//
double bz0 = GetBz();
Double_t xyzTrk[3],xyzVtx[3]={GetX(),GetY(),GetZ()};
if (RefitTrack(currTr,fITS->GetRMax())) { // propagate to exit from the ITS/TPC screen
UpdateESDTrack(currTr,AliESDtrack::kITSout);
}
+ else {
+ AliInfo(Form("Refit Failed for track %d",itr));
+ }
//
}
//
}
//_________________________________________________________________________
-Int_t AliITSUTrackerGlo::RefitInward(AliESDEvent * /*event*/)
+Int_t AliITSUTrackerGlo::RefitInward(AliESDEvent *esdEv)
{
//
- // To be implemented
+ // refit the tracks inward, using current cov.matrix
+ //
+ SetTrackingPhase(kRefitInw);
+ Int_t nTrESD = esdEv->GetNumberOfTracks();
+ AliInfo(Form("Will refit inward %d tracks",nTrESD));
+ AliITSUTrackHyp *currTr=0;
+ //
+ for (int itr=0;itr<nTrESD;itr++) {
+ AliESDtrack *esdTr = esdEv->GetTrack(itr);
+ // Start time integral and add distance from current position to vertex
+ UInt_t trStat = esdTr->GetStatus();
+ if ( !(trStat & AliESDtrack::kITSout) ) continue;
+ if ( trStat & AliESDtrack::kITSrefit ) continue; // already done
+ if ( (trStat & AliESDtrack::kTPCout) && !(trStat & AliESDtrack::kTPCrefit) ) continue;
+ //
+ currTr = GetTrackHyp(itr);
+ currTr->AliExternalTrackParam::operator=(*esdTr); // fetch current ESDtrack kinematics
+ if (RefitTrack(currTr,fITS->GetRMin())) { // propagate up to inside radius of the beam pipe
+ UpdateESDTrack(currTr,AliESDtrack::kITSrefit);
+ }
+ else {
+ AliInfo(Form("Refit Failed for track %d",itr));
+ }
+ }
//
-
- Info("RefitInward","To be implemented");
return 0;
}
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
+ // AliInfo(Form(" dir:%d Cur: %e Tgt: %e",dir,Sqrt(curR2),xToGo));
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 (!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;
+ //
return kTRUE;
//
}
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;
+ //
return kTRUE;
//
}
if (!lr->IsActive() || fClInfo[ilrA2=(ilrA<<1)]<0) continue;
//
if (ilr!=lrStart && !TransportToLayer(&tmpTr,lrStart,ilr)) {
- printf("Failed to transport %d -> %d\n",lrStart,ilr);
+ AliInfo(Form("Failed to transport %d -> %d\n",lrStart,ilr));
return kFALSE; // go to the entrance to the layer
}
lrStart = ilr;
for (int icl=0;icl<nclLr;icl++) {
AliITSUClusterPix* clus = (AliITSUClusterPix*)lr->GetCluster(iclLr[icl]);
AliITSURecoSens* sens = lr->GetSensorFromID(clus->GetVolumeId());
- if (!tmpTr.Rotate(sens->GetPhiTF())) return kFALSE;
- printf("Refit cl:%d on lr %d Need to go %.4f -> %.4f\n",icl,ilrA,tmpTr.GetX(),sens->GetXTF()+clus->GetX());
- if (!PropagateSeed(&tmpTr,sens->GetXTF()+clus->GetX(),fCurrMass)) return kFALSE;
- if (!tmpTr.Update(clus)) return kFALSE;
- printf("AfterRefit: "); tmpTr.AliExternalTrackParam::Print();
+ if (!tmpTr.Rotate(sens->GetPhiTF())) {
+ AliInfo(Form("Failed on rotate to %f",sens->GetPhiTF()));
+ return kFALSE;
+ }
+ //printf("Refit cl:%d on lr %d Need to go %.4f -> %.4f\n",icl,ilrA,tmpTr.GetX(),sens->GetXTF()+clus->GetX());
+ if (!PropagateSeed(&tmpTr,sens->GetXTF()+clus->GetX(),fCurrMass)) {
+ AliInfo(Form("Failed on propagate to %f",sens->GetXTF()+clus->GetX()));
+ return kFALSE;
+ }
+ if (!tmpTr.Update(clus)) {
+ AliInfo(Form("Failed on Update"));
+ return kFALSE;
+ }
+ //printf("AfterRefit: "); tmpTr.AliExternalTrackParam::Print();
if (stopAtLastCl && ++clCount==ncl) return kTRUE; // it was requested to not propagate after last update
}
//
// Still, try to go as close as possible to rDest.
//
if (lrStart!=lrStop) {
- printf("Going to last layer %d -> %d\n",lrStart,lrStop);
- if (!TransportToLayer(&tmpTr,lrStart,lrStop)) return kTRUE;
- if (!GoToExitFromLayer(&tmpTr,fITS->GetLayer(lrStop),dir)) return kFALSE; // go till the exit from layer
+ //printf("Going to last layer %d -> %d\n",lrStart,lrStop);
+ if (!TransportToLayer(&tmpTr,lrStart,lrStop)) {
+ AliInfo(Form("Failed on TransportToLayer %d->%d",lrStart,lrStop));
+ return kTRUE;
+ }
+ if (!GoToExitFromLayer(&tmpTr,fITS->GetLayer(lrStop),dir)) {
+ AliFatal(Form("Failed on GoToExitFromLayer %d",lrStop));
+ return kTRUE; // go till the exit from layer
+ }
//
- printf("On exit from last layer\n");
+ //printf("On exit from last layer\n");
tmpTr.AliExternalTrackParam::Print();
// go to the destination radius
if (!tmpTr.GetXatLabR(rDest,rDest,GetBz(),dir)) return kTRUE;
Bool_t InitHypothesis(AliESDtrack *esdTr, Int_t esdID);
Bool_t TransportToLayer(AliITSUSeed* seed, Int_t lFrom, Int_t lTo);
Bool_t TransportToLayer(AliExternalTrackParam* seed, Int_t lFrom, Int_t lTo);
- Bool_t GoToExitFromLayer(AliITSUSeed* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kFALSE);
- Bool_t GoToExitFromLayer(AliExternalTrackParam* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kFALSE);
+ Bool_t GoToExitFromLayer(AliITSUSeed* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kTRUE);
+ Bool_t GoToExitFromLayer(AliExternalTrackParam* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kTRUE);
Bool_t GoToEntranceToLayer(AliITSUSeed* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kFALSE);
Bool_t GoToEntranceToLayer(AliExternalTrackParam* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kFALSE);
Bool_t PropagateSeed(AliITSUSeed *seed, Double_t xToGo, Double_t mass, Double_t maxStep=1.0, Bool_t matCorr=kTRUE);
Bool_t PropagateSeed(AliExternalTrackParam *seed, Double_t xToGo, Double_t mass, Double_t maxStep=1.0, Bool_t matCorr=kTRUE);
Bool_t RefitTrack(AliITSUTrackHyp* trc, Double_t r, Bool_t stopAtLastCl=kFALSE);
+ Int_t GetTrackingPhase() const {return fTrackPhase;}
+
//
void KillSeed(AliITSUSeed* seed, Bool_t branch=kFALSE);
Bool_t NeedToKill(AliITSUSeed* seed, Int_t flag);
void FinalizeHypotheses();
void UpdateESDTrack(AliITSUTrackHyp* hyp,Int_t flag);
void CookMCLabel(AliITSUTrackHyp* hyp);
+ void SetTrackingPhase(Int_t p) {fTrackPhase = p;}
//
protected:
TObject*& NextFreeSeed();