- for(Int_t iSeeder(nSeeders); iSeeder--;){
- for (Int_t iSeed = 0; iSeed < nSeeder[iSeeder]; iSeed++) {
- Int_t currentIndexESD = idxESD[iSeeder][index[iSeeder][iSeed]];
- // Get the seeds in sorted sequence
- AliESDtrack *seed = event->GetTrack(currentIndexESD);
- Float_t p4 = seed->GetC(seed->GetBz());
-
- // Check the seed status
- ULong_t status(seed->GetStatus()); Bool_t kTPC(kTRUE);
- if ((status & AliESDtrack::kTRDout) != 0) continue;
- if (status & AliESDtrack::kTPCout){
- AliDebug(2, Form("Found TPC seed @ idx[%4d] Sxy=%f[cm].", currentIndexESD, TMath::Sqrt(quality[iSeeder][index[iSeeder][iSeed]])));
- // set steering parameters for TPC
- //fkRecoParam->SetTrackParam(kTPC);
- } else {
- if (status & AliESDtrack::kITSout){
- // rotate
- Float_t globalToTracking = AliTRDgeometry::GetAlpha()*(Int_t(seed->GetAlpha()/AliTRDgeometry::GetAlpha()) + (seed->GetAlpha()>0. ? 0.5 : -0.5));
- AliDebug(2, Form("Found ITS seed @ idx[%4d] Sxy=%f[cm] alpha=%7.2f[deg] g2T=%7.2f[deg]", currentIndexESD, TMath::Sqrt(quality[iSeeder][index[iSeeder][iSeed]]), seed->GetAlpha()*TMath::RadToDeg(), globalToTracking*TMath::RadToDeg()));
- if(!seed->Rotate(globalToTracking)){
- AliDebug(1, Form("ITS seed @ idx[%4d] failed rotation of alpha=%7.2f[deg] g2T=%7.2f[deg].", currentIndexESD, seed->GetAlpha()*TMath::RadToDeg(), globalToTracking*TMath::RadToDeg()));
- continue;
- }
- kTPC=kFALSE;
- // set steering parameters for ITS
- //fkRecoParam->SetTrackParam(kITS);
- } else {
- AliDebug(1, Form("Bad seed[%4d] ITSin[%c] ITSout[%c] TPCin[%c] TPCout[%c].", currentIndexESD,
- (status&AliESDtrack::kITSin)?'y':'n', (status&AliESDtrack::kITSout)?'y':'n', (status&AliESDtrack::kTPCin)?'y':'n', (status&AliESDtrack::kTPCout)?'y':'n'));
- continue;
- }
- }
-
- // Propagate to the entrance in the TRD mother volume
- track.~AliTRDtrackV1();
- new(&track) AliTRDtrackV1(*seed);
- if(AliTRDgeometry::GetXtrdBeg() > (AliTRDReconstructor::GetMaxStep() + track.GetX()) && !PropagateToX(track, AliTRDgeometry::GetXtrdBeg(), AliTRDReconstructor::GetMaxStep())){
- //seed->UpdateTrackParams(&track, AliESDtrack::kTRDStop);
- continue;
- }
- if(!AdjustSector(&track)){
- //seed->UpdateTrackParams(&track, AliESDtrack::kTRDStop);
- continue;
- }
- if(TMath::Abs(track.GetSnp()) > AliTRDReconstructor::GetMaxSnp()) {
- //seed->UpdateTrackParams(&track, AliESDtrack::kTRDStop);
- continue;
- }
- AliDebug(2, Form("Propagate %s seed[%4d] ESDidx[%4d].", seeder[iSeeder], iSeed, currentIndexESD));
- nGoodSeeds[iSeeder]++;
- // store track status at TRD entrance
- seed->UpdateTrackParams(&track, AliESDtrack::kTRDbackup);
-
- // prepare track and do propagation in the TRD
- track.SetReconstructor(fkReconstructor);
- track.SetKink(Bool_t(seed->GetKinkIndex(0)));
- track.SetPrimary(status & AliESDtrack::kTPCin);
- track.SetNonTPCseeded(!kTPC);
- expectedClr = FollowBackProlongation(track);
+ for (Int_t iSeed = 0; iSeed < nSeeds; iSeed++) {
+
+ // Get the seeds in sorted sequence
+ AliESDtrack *seed = event->GetTrack(index[iSeed]);
+ Float_t p4 = seed->GetC(seed->GetBz());
+
+ // Check the seed status
+ ULong_t status = seed->GetStatus();
+ if ((status & AliESDtrack::kTRDout) != 0) continue;
+ if ((status & AliESDtrack::kTPCout)){
+ AliDebug(3, Form("Prolongate seed[%2d] which is TPC.", iSeed));
+ // set steering parameters for TPC
+ //fkRecoParam->SetTrackParam(kTPC);
+/* } else {
+ if ((status & AliESDtrack::kITSout)){
+ AliDebug(3, Form("Prolongate seed[%2d] which is ITS.", iSeed));
+ // set steering parameters for ITS
+ //fkRecoParam->SetTrackParam(kITS);
+ // rotate
+ Float_t globalToTracking = AliTRDgeometry::GetAlpha()*(Int_t(seed->GetAlpha()/AliTRDgeometry::GetAlpha()) + (seed->GetAlpha()>0. ? 0.5 : -0.5));
+ if(!seed->Rotate(globalToTracking)) continue;
+ } else continue;*/
+ } else continue;
+
+ // Propagate to the entrance in the TRD mother volume
+ track.~AliTRDtrackV1();
+ new(&track) AliTRDtrackV1(*seed);
+ if(AliTRDgeometry::GetXtrdBeg() > (AliTRDReconstructor::GetMaxStep() + track.GetX()) && !PropagateToX(track, AliTRDgeometry::GetXtrdBeg(), AliTRDReconstructor::GetMaxStep())){
+ seed->UpdateTrackParams(&track, AliESDtrack::kTRDStop);
+ continue;
+ }
+ if(!AdjustSector(&track)){
+ seed->UpdateTrackParams(&track, AliESDtrack::kTRDStop);
+ continue;
+ }
+ if(TMath::Abs(track.GetSnp()) > AliTRDReconstructor::GetMaxSnp()) {
+ seed->UpdateTrackParams(&track, AliESDtrack::kTRDStop);
+ continue;
+ }
+ nTPCseeds++;
+ AliDebug(2, Form("TRD propagate TPC seed[%d] = %d.", iSeed, index[iSeed]));
+ // store track status at TRD entrance
+ seed->UpdateTrackParams(&track, AliESDtrack::kTRDbackup);
+
+ // prepare track and do propagation in the TRD
+ track.SetReconstructor(fkReconstructor);
+ track.SetKink(Bool_t(seed->GetKinkIndex(0)));
+ track.SetPrimary(status & AliESDtrack::kTPCin);
+ expectedClr = FollowBackProlongation(track);
+ // check if track entered the TRD fiducial volume
+ if(track.GetTrackIn()){
+ seed->UpdateTrackParams(&track, AliESDtrack::kTRDin);
+ nTRDseeds++;
+ }
+ // check if track was stopped in the TRD
+ if (expectedClr<0){
+ seed->UpdateTrackParams(&track, AliESDtrack::kTRDStop);
+ continue;
+ } else {
+ nFound++;
+ // compute PID
+ track.CookPID();
+ //compute MC label
+ track.CookLabel(1. - AliTRDReconstructor::GetLabelFraction());
+ // update calibration references using this track
+ if(calibra->GetHisto2d()) calibra->UpdateHistogramsV1(&track);