ROOT logo
//
// Class AliRsnCutRange
//
// General implementation of cuts which check a value inside a range.
// This range can be defined by two integers or two doubles.
// A user-friendly enumeration allows to define what is checked.
//
// authors: Martin Vala (martin.vala@cern.ch)
//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
//

#ifndef ALIRSNCUTPID_H
#define ALIRSNCUTPID_H

#include "AliPID.h"
#include "AliRsnCut.h"

class AliRsnDaughter;

class AliRsnCutPID : public AliRsnCut {
public:

   enum EDetector {
      kITS,
      kTPC,
      kTRD,
      kTOF,
      kHMPID,
      kDetectors
   };

   AliRsnCutPID();
   AliRsnCutPID(const char *name, AliPID::EParticleType pid, Double_t probMin = 0.0, Bool_t perfectPID = kFALSE);
   virtual ~AliRsnCutPID() {;};

   void           SetDefault(Bool_t yn = kTRUE) {fUseDefault = yn;}
   void           SetPrior(Int_t i, Double_t value) {if (i >= 0 && i < AliPID::kSPECIES) fPrior[i] = value;}
   void           SetPerfect(Bool_t yn = kTRUE) {fPerfect = yn;}

   void           IncludeDetector(EDetector det, Double_t threshold = 0., Bool_t goAbove = kTRUE);
   void           ExcludeDetector(EDetector det) {if (CheckBounds(det)) fUseDetector[det] = kFALSE;}

   Bool_t         ComputeWeights(AliRsnDaughter *daughter);
   Int_t          RealisticPID(AliRsnDaughter *const daughter, Double_t &prob);
   Int_t          PerfectPID(AliRsnDaughter *const daughter);
   Double_t       GetWeight(Int_t i) const {if (i >= 0 && i < AliPID::kSPECIES) return fWeight[i]; return 0.0;}

   virtual Bool_t IsSelected(TObject *object);

protected:

   Bool_t   CheckBounds(EDetector det) const {return (det >= kITS && det < kDetectors);}
   Bool_t   CheckThreshold(EDetector det, Double_t value) const;

   Double_t              fPrior[AliPID::kSPECIES];        // prior probability
   Double_t              fWeight[AliPID::kSPECIES];       // PID weights used for combinations

   Bool_t                fPerfect;                        // choice to use perfect PID
   Bool_t                fUseDefault;                     // choice to use default combined PID weights (or customized)
   Bool_t                fUseDetector[kDetectors];        // flag to include/exclude each single detector
   Double_t              fPtThreshold[kDetectors];        // pT threshold above/below which a detector is considered
   Double_t              fGoAboveThreshold[kDetectors];   // to choose if detector is used balow or above threshold

   ClassDef(AliRsnCutPID, 1)
};

#endif
 AliRsnCutPID.h:1
 AliRsnCutPID.h:2
 AliRsnCutPID.h:3
 AliRsnCutPID.h:4
 AliRsnCutPID.h:5
 AliRsnCutPID.h:6
 AliRsnCutPID.h:7
 AliRsnCutPID.h:8
 AliRsnCutPID.h:9
 AliRsnCutPID.h:10
 AliRsnCutPID.h:11
 AliRsnCutPID.h:12
 AliRsnCutPID.h:13
 AliRsnCutPID.h:14
 AliRsnCutPID.h:15
 AliRsnCutPID.h:16
 AliRsnCutPID.h:17
 AliRsnCutPID.h:18
 AliRsnCutPID.h:19
 AliRsnCutPID.h:20
 AliRsnCutPID.h:21
 AliRsnCutPID.h:22
 AliRsnCutPID.h:23
 AliRsnCutPID.h:24
 AliRsnCutPID.h:25
 AliRsnCutPID.h:26
 AliRsnCutPID.h:27
 AliRsnCutPID.h:28
 AliRsnCutPID.h:29
 AliRsnCutPID.h:30
 AliRsnCutPID.h:31
 AliRsnCutPID.h:32
 AliRsnCutPID.h:33
 AliRsnCutPID.h:34
 AliRsnCutPID.h:35
 AliRsnCutPID.h:36
 AliRsnCutPID.h:37
 AliRsnCutPID.h:38
 AliRsnCutPID.h:39
 AliRsnCutPID.h:40
 AliRsnCutPID.h:41
 AliRsnCutPID.h:42
 AliRsnCutPID.h:43
 AliRsnCutPID.h:44
 AliRsnCutPID.h:45
 AliRsnCutPID.h:46
 AliRsnCutPID.h:47
 AliRsnCutPID.h:48
 AliRsnCutPID.h:49
 AliRsnCutPID.h:50
 AliRsnCutPID.h:51
 AliRsnCutPID.h:52
 AliRsnCutPID.h:53
 AliRsnCutPID.h:54
 AliRsnCutPID.h:55
 AliRsnCutPID.h:56
 AliRsnCutPID.h:57
 AliRsnCutPID.h:58
 AliRsnCutPID.h:59
 AliRsnCutPID.h:60
 AliRsnCutPID.h:61
 AliRsnCutPID.h:62
 AliRsnCutPID.h:63
 AliRsnCutPID.h:64
 AliRsnCutPID.h:65
 AliRsnCutPID.h:66
 AliRsnCutPID.h:67