AliRsnCutBetheBloch::AliRsnCutBetheBloch() :
AliRsnCut(),
fCorrect(kTRUE),
- fMass(1.0),
- fMIP(50.0)
+ fMIP(50.0),
+ fType(AliPID::kUnknown)
{
//
// Default constructor.
fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
}
-//_________________________________________________________________________________________________
-AliRsnCutBetheBloch::AliRsnCutBetheBloch
-(const char *name, Double_t fractionRange, Double_t mass, Double_t mip, Bool_t correct) :
- AliRsnCut(name, -fractionRange, fractionRange),
- fCorrect(correct),
- fMass(mass),
- fMIP(mip)
-{
-//
-// Main constructor.
-// the cut range is the relative fraction of the value:
-// BB*(1-fraction) < TPC < BB*(1+fraction)
-// which means:
-// -fraction < (TPC - BB)/BB < fraction
-//
-
- fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
-}
-
//_________________________________________________________________________________________________
AliRsnCutBetheBloch::AliRsnCutBetheBloch
(const char *name, Double_t fractionRange, AliPID::EParticleType type, Double_t mip, Bool_t correct) :
AliRsnCut(name, -fractionRange, fractionRange),
fCorrect(correct),
- fMass(0.0),
- fMIP(mip)
+ fMIP(mip),
+ fType(type)
{
//
// Main constructor.
// -fraction < (TPC - BB)/BB < fraction
//
- SetMass(type);
fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
}
// The value is computed in MIP units, multiplied by 50 to have it in energy.
//
- Double_t betaGamma = track->P() / fMass;
+ AliPID pid;
+ Double_t mass = pid.ParticleMass(fType);
+
+ Double_t betaGamma = track->P() / mass;
Double_t beta = betaGamma / TMath::Sqrt(1.0 + betaGamma * betaGamma);
Double_t aa = TMath::Power(beta, fConst[3]);
Double_t bb = TMath::Power(1.0 / betaGamma, fConst[4]);
return kTRUE;
}
+ // if the required PID of the track is not the same as the
+ // reference of the cut, the cut is automatically skipped
+ if (track->RequiredPID() != fType) return kTRUE;
+
// retrieve the TPC signal
AliVParticle *vpart = track->GetRef();
AliESDtrack *esd = dynamic_cast<AliESDtrack*>(vpart);