- fTrackHypothesys.Expand(nentr);
- Int_t ntrk=0;
- for (fPass=0; fPass<2; fPass++) {
- Int_t &constraint=fConstraint[fPass]; if (constraint<0) continue;
- for (Int_t i=0; i<nentr; i++) {
- fCurrentEsdTrack = i;
- AliITStrackV2 *t=(AliITStrackV2*)itsTracks.UncheckedAt(i);
- if (t==0) continue; //this track has been already tracked
- Int_t tpcLabel=t->GetLabel(); //save the TPC track label
-
- ResetTrackToFollow(*t);
- ResetBestTrack();
-
- for (FollowProlongation(); fI<kMaxLayer; fI++) {
- while (TakeNextProlongation()) {
- FollowProlongation();
- }
- }
-
- CompressTrackHypothesys(fCurrentEsdTrack,5); //MI change
-
- /*
- if (fBestTrack.GetNumberOfClusters() == 0) continue;
-
- if (fConstraint[fPass]) {
- ResetTrackToFollow(*t);
- if (!RefitAt(3.7, &fTrackToFollow, &fBestTrack)) continue;
- ResetBestTrack();
- }
-
- fBestTrack.SetLabel(tpcLabel);
- fBestTrack.CookdEdx();
- CookLabel(&fBestTrack,0.); //For comparison only
- fBestTrack.UpdateESDtrack(AliESDtrack::kITSin);
- //UseClusters(&fBestTrack);
- delete itsTracks.RemoveAt(i);
- ntrk++;
- */
- AliITStrackV2 * besttrack = GetBestHypothesys(fCurrentEsdTrack,t);
- if (!besttrack) continue;
- besttrack->SetLabel(tpcLabel);
- besttrack->CookdEdx();
- CookLabel(besttrack,0.); //For comparison only
- besttrack->UpdateESDtrack(AliESDtrack::kITSin);
- delete itsTracks.RemoveAt(i);
- ntrk++;
-
- }
- }
- itsTracks.Delete();
- //
- Int_t entries = fTrackHypothesys.GetEntriesFast();
- for (Int_t ientry=0;ientry<entries;ientry++){
- TObjArray * array =(TObjArray*)fTrackHypothesys.UncheckedAt(ientry);
- if (array) array->Delete();
- delete fTrackHypothesys.RemoveAt(ientry);
- }
-
- fTrackHypothesys.Delete();
- Info("Clusters2Tracks","Number of prolonged tracks: %d\n",ntrk);
-
- return 0;
-}
-
-Int_t AliITStrackerV2::Clusters2Tracks(TTree *tpcTree, TTree *itsTree) {
- //--------------------------------------------------------------------
- // This functions reconstructs ITS tracks
- // The clusters must be already loaded !
- //--------------------------------------------------------------------
- Int_t nentr=0; TObjArray itsTracks(15000);
-
- Warning("Clusters2Tracks(TTree *, TTree *)",
- "Will be removed soon ! Use Clusters2Tracks(AliESD *) instead.");
-
- {/* Read TPC tracks */
- AliTPCtrack *itrack=new AliTPCtrack;
- TBranch *branch=tpcTree->GetBranch("tracks");
- if (!branch) {
- Error("Clusters2Tracks","Can't get the branch !");
- return 1;
- }
- tpcTree->SetBranchAddress("tracks",&itrack);
- nentr=(Int_t)tpcTree->GetEntries();
-
- Info("Clusters2Tracks","Number of TPC tracks: %d\n",nentr);
-
- for (Int_t i=0; i<nentr; i++) {
- tpcTree->GetEvent(i);
- AliITStrackV2 *t=0;
- try {
- t=new AliITStrackV2(*itrack);
- } catch (const Char_t *msg) {
- Warning("Clusters2Tracks",msg);
- delete t;
- continue;
- }
- if (TMath::Abs(t->GetD())>4) {
- delete t;
- continue;
- }
-
- if (CorrectForDeadZoneMaterial(t)!=0) {
- Warning("Clusters2Tracks",
- "failed to correct for the material in the dead zone !\n");
- delete t;
- continue;
- }
-
- itsTracks.AddLast(t);
- }
- delete itrack;
- }
- itsTracks.Sort();
- nentr=itsTracks.GetEntriesFast();
-
-
- AliITStrackV2 *otrack=&fBestTrack;
- TBranch *branch=itsTree->GetBranch("tracks");
- if (!branch) itsTree->Branch("tracks","AliITStrackV2",&otrack,32000,3);
- else branch->SetAddress(&otrack);