+ if (bestDigitIndex>-1) {
+ const AliPHOSDigit * digit = phosLoader->Digit(digitList[bestDigitIndex]);
+ if (digit==0) return -12345;
+ }
+
+ // Get the list of primary tracks producing this digit
+ // and find which track has more track energy.
+ //Int_t nPrimary = digit->GetNprimary();
+ //TParticle *track = 0;
+ //Double_t energyEM = 0;
+ //Double_t energyHadron = 0;
+ //Int_t trackEM = -1;
+ //Int_t trackHadron = -1;
+ //for (Int_t iPrim=0; iPrim<nPrimary; iPrim++) {
+ // Int_t iPrimary = digit->GetPrimary(iPrim+1);
+ // if (iPrimary == -1 || TMath::Abs(iPrimary)>10000000)
+ // continue ; //PH 10000000 is the shift of the track
+ // //PH indexes in the underlying event
+ // track = gime->Primary(iPrimary);
+ // Int_t pdgCode = track->GetPdgCode();
+ // Double_t energy = track->Energy();
+ // if (pdgCode==22 || TMath::Abs(pdgCode)==11) {
+ // if (energy > energyEM) {
+ // energyEM = energy;
+ // trackEM = iPrimary;
+ // }
+ // }
+ // else {
+ // if (energy > energyHadron) {
+ // energyHadron = energy;
+ // trackHadron = iPrimary;
+ // }
+ // }
+ //}
+ // Preferences are given to electromagnetic tracks
+ //if (trackEM != -1) return trackEM; // track is gamma or e+-
+ //if (trackHadron != -1) return trackHadron; // track is hadron
+ //return -12345; // no track found :(