#include "AliESDtrack.h"
#include "AliRsnCut.h"
+#include "AliRsnPIDRange.h"
class AliVTrack;
class AliPIDResponse;
kTOF,
kDetectors
};
-
- //
- // This allows to define several intervals
- //
- class AliRsnPIDRange : public TObject {
- public:
-
- AliRsnPIDRange(Double_t nsigma, Double_t pmin, Double_t pmax)
- : fPMin(pmin), fPMax(pmax), fNSigmaCut(nsigma) { }
-
- Double_t &PMin() {return fPMin;}
- Double_t &PMax() {return fPMax;}
- Double_t &NSigmaCut() {return fNSigmaCut;}
-
- Bool_t IsInRange(Double_t mom) {return (mom >= fPMin && mom <= fPMax);}
- Bool_t CutPass(Double_t nsigma) {return (nsigma <= fNSigmaCut);}
-
- private:
-
- Double_t fPMin; // lower bound of momentum range
- Double_t fPMax; // upper bound of momentum range
- Double_t fNSigmaCut; // cut in number of sigmas
-
- ClassDef(AliRsnCutPIDNSigma::AliRsnPIDRange,1)
- };
-
AliRsnCutPIDNSigma();
AliRsnCutPIDNSigma(const char *name, AliPID::EParticleType species, EDetector det);
AliRsnCutPIDNSigma(const AliRsnCutPIDNSigma ©);
ClassDef(AliRsnCutPIDNSigma, 1)
};
-inline Bool_t AliRsnCutPIDNSigma::MatchITS(const AliVTrack *vtrack) const
-{
-//
-// Checks if the track has the status flags required for an ITS standalone track
-//
-
- if ((vtrack->GetStatus() & AliESDtrack::kITSin) == 0) return kFALSE;
- if ((vtrack->GetStatus() & AliESDtrack::kITSpid) == 0) return kFALSE;
-
- return kTRUE;
-}
-
-inline Bool_t AliRsnCutPIDNSigma::MatchTPC(const AliVTrack *vtrack) const
-{
-//
-// Checks if the track has the status flags required for a TPC track
-//
-
- if ((vtrack->GetStatus() & AliESDtrack::kTPCin) == 0) return kFALSE;
-
- return kTRUE;
-}
-
-inline Bool_t AliRsnCutPIDNSigma::MatchTOF(const AliVTrack *vtrack) const
-{
-//
-// Checks if the track has the status flags required for an ITS standalone track
-//
-
- if ((vtrack->GetStatus() & AliESDtrack::kTOFout) == 0) return kFALSE;
- if ((vtrack->GetStatus() & AliESDtrack::kTIME) == 0) return kFALSE;
-
- return kTRUE;
-}
-
-inline Bool_t AliRsnCutPIDNSigma::MatchDetector(const AliVTrack *vtrack) const
-{
-//
-// Checks if the track has matched the required detector.
-// If no valid detector is specified, kFALSE is always returned.
-//
-
- switch (fDetector) {
- case kITS: return MatchITS(vtrack);
- case kTPC: return MatchTPC(vtrack);
- case kTOF: return MatchTOF(vtrack);
- default : return kFALSE;
- }
-}
-
-inline void AliRsnCutPIDNSigma::AddPIDRange(Double_t nsigma, Double_t pmin, Double_t pmax)
-{
-//
-// Add a new slot for checking PID
-//
-
- Int_t n = fRanges.GetEntries();
-
- new (fRanges[n]) AliRsnPIDRange(nsigma, pmin, pmax);
-}
-
-inline void AliRsnCutPIDNSigma::SinglePIDRange(Double_t nsigma)
-{
-//
-// Clear all slots and sets a unique one
-//
-
- fRanges.Delete();
-
- new (fRanges[0]) AliRsnPIDRange(nsigma, 0.0, 1E20);
-}
-
#endif