]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/RESONANCES/AliRsnCutPIDNSigma.cxx
Added new class for D0 daughter cuts (Massimo)
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCutPIDNSigma.cxx
index 9eb63e2ec0afb1b3f263f4abfb5611a5dac87bca..6ebb745e3ea06f82c6a9de1b5067cc543d884bbd 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "AliRsnCutPIDNSigma.h"
 
-ClassImp(AliRsnCutPIDNSigma::AliRsnPIDRange)
 ClassImp(AliRsnCutPIDNSigma)
 
 //_________________________________________________________________________________________________
@@ -30,11 +29,11 @@ AliRsnCutPIDNSigma::AliRsnCutPIDNSigma() :
    AliRsnCut("cut", AliRsnTarget::kDaughter),
    fSpecies(AliPID::kUnknown),
    fDetector(kDetectors),
-   fRejectUnmatched(kFALSE),
+   fRejectUnmatched(kTRUE),
    fTrackNSigma(0.0),
    fTrackMom(0.0),
    fMyPID(0x0),
-   fRanges("AliRsnCutPIDNSigma::AliRsnPIDRange", 0)
+   fRanges("AliRsnPIDRange", 0)
 {
 //
 // Main constructor.
@@ -47,11 +46,11 @@ AliRsnCutPIDNSigma::AliRsnCutPIDNSigma
    AliRsnCut(name, AliRsnTarget::kDaughter),
    fSpecies(species),
    fDetector(det),
-   fRejectUnmatched(kFALSE),
+   fRejectUnmatched(kTRUE),
    fTrackNSigma(0.0),
    fTrackMom(0.0),
    fMyPID(0x0),
-   fRanges("AliRsnCutPIDNSigma::AliRsnPIDRange", 0)
+   fRanges("AliRsnPIDRange", 0)
 {
 //
 // Main constructor.
@@ -217,3 +216,80 @@ void AliRsnCutPIDNSigma::Print(const Option_t *) const
    AliInfo(Form("--> match criteria: %s", match));
    AliInfo(Form("--> momentum range: %s", mom));
 }
+
+//_________________________________________________________________________________________________
+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;
+}
+//_________________________________________________________________________________________________
+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;
+}
+
+//_________________________________________________________________________________________________
+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;
+}
+
+//_________________________________________________________________________________________________
+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;
+   }
+}
+
+//_________________________________________________________________________________________________
+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);
+}
+
+//_________________________________________________________________________________________________
+void AliRsnCutPIDNSigma::SinglePIDRange(Double_t nsigma)
+{
+//
+// Clear all slots and sets a unique one
+//
+
+   fRanges.Delete();
+
+   new (fRanges[0]) AliRsnPIDRange(nsigma, 0.0, 1E20);
+}