+
+//_________________________________________________________________________
+void AliESDpid::SetPIDForTracking(AliESDtrack *esdtr) const
+{
+ // assign mass for tracking
+ //
+
+ // in principle AliPIDCombined could be used to also set priors
+ //AliPIDCombined pidProb;
+ //pidProb.SetDetectorMask(kDetTPC); // use only TPC information, couls also be changed
+ //pidProb.SetSelectedSpecies(AliPID::kSPECIESC); // number of species to use
+ //pidProb.SetDefaultTPCPriors(); // load default priors
+
+ Double_t prob[AliPID::kSPECIESC]={0.};
+ EDetPidStatus pidStatus=ComputePIDProbability(kTPC, esdtr, AliPID::kSPECIESC, prob);
+ // check if a valid signal was found, otherwise return pion mass
+ if (pidStatus!=kDetPidOk) {
+ esdtr->SetPIDForTracking(AliPID::kPion);
+ return;
+ }
+
+ // or with AliPIDCombined
+ // pidProb.ComputeProbabilities(esdtr, this, p);
+
+ // find max probability
+ Float_t max=0.;
+ Int_t pid=-1;
+ for (Int_t i=0; i<AliPID::kSPECIESC; ++i) if (prob[i]>max) {pid=i; max=prob[i];}
+
+ //int pid = AliPID::kPion; // this should be substituted by real most probable TPC pid (e,mu -> pion) or poin if no PID possible
+
+ //
+ if (pid>AliPID::kSPECIESC-1) pid = AliPID::kPion;
+ //
+ esdtr->SetPIDForTracking( pid );
+ //
+}
+
+
+//_________________________________________________________________________
+void AliESDpid::MakePIDForTracking(AliESDEvent *event) const
+{
+ // assign masses using for tracking
+ Int_t nTrk=event->GetNumberOfTracks();
+ for (Int_t iTrk=nTrk; iTrk--;) {
+ AliESDtrack *track = event->GetTrack(iTrk);
+ SetPIDForTracking(track);
+ }
+
+}