]> git.uio.no Git - u/mrichter/AliRoot.git/blob - CORRFW/AliCFTrackCutPid.h
moving class
[u/mrichter/AliRoot.git] / CORRFW / AliCFTrackCutPid.h
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 //
17 // author : A. Mastroserio
18 //
19
20 #ifndef ALICFTRACKCUTPID_H
21 #define ALICFTRACKCUTPID_H
22
23 #include "AliCFCutBase.h"
24 #include "AliPID.h"
25 #include "AliESDtrack.h"
26 #include <TString.h>
27 #include <TObject.h>
28 #include <TH1F.h>
29 #include <TF1.h>
30 //__________________________________________________________________________________
31 // CUT ON TRACK PID
32 //__________________________________________________________________________________
33 class AliESDtrack;
34
35 class AliCFTrackCutPid : public AliCFCutBase
36 {
37   public :
38     AliCFTrackCutPid() ;
39   AliCFTrackCutPid(const Char_t* name, const Char_t* title) ;
40   AliCFTrackCutPid(const AliCFTrackCutPid& c) ;
41   AliCFTrackCutPid& operator=(const AliCFTrackCutPid& c) ;
42   
43   virtual ~AliCFTrackCutPid();
44   
45   enum EDetType {kITS = 0, kTPC, kTRD,  kTOF, kHMPID=4, kNoDet=-11};
46   enum EDetNum {kNdets=5};
47   enum ENoId {kCheckProb = -10, kCheckResp = -11, kDetRestr = -12};
48   
49   // Setters 
50   
51   void SetDetectors(TString dets);                            
52   void SetPriors(Double_t r[AliPID::kSPECIES]);                    
53   void SetProbabilityCut(Double_t cut) {fCut=cut;}                  
54   void SetParticleType(Int_t iType, Bool_t tocombine) {fgParticleType=iType; fgIsComb=tocombine;} 
55   void SetMinDiffResp(Bool_t check, Double_t mindiff) {fCheckResponse=check; fMinDiffResponse=mindiff;}  
56   void SetMinDiffProb(Bool_t check, Double_t mindiff) {fCheckSelection=check; fMinDiffProbability=mindiff;} 
57   void SetPriorFunctions(TF1 *func[AliPID::kSPECIES]);
58   void SetANDstatus(TString dets);
59   void SetDetectorProbabilityRestriction(TString det, Int_t iPart, Double_t upperprob); 
60   void SetHistogramAxis(Int_t nbins, Double_t xmin, Double_t xmax) {fNbins=nbins; fXmin = xmin; fXmax = xmax;}
61   
62   //loads the track detector responses and the track status
63   void TrackInfo(const AliESDtrack *pTrk,ULong_t status[kNdets+1], Double_t pid[kNdets+1][AliPID::kSPECIES]) const;  
64   
65   //identifies the track
66   Int_t Identify(Double_t pid[AliPID::kSPECIES]) const;
67   
68   //identifies the track filling the QA histograms                                                          
69   Int_t IdentifyQA(const Double_t pid[AliPID::kSPECIES],Int_t idets) const;
70   
71   //returns the track identification number  
72   Int_t GetID(ULong_t status[kNdets+1], Double_t pid[kNdets+1][AliPID::kSPECIES]) const;  
73   
74   //main 
75   virtual Bool_t IsSelected(TObject *track); 
76   Bool_t IsSelected(TList* /*list*/) {return kTRUE;}  
77   //histos are added to a list
78   void AddQAHistograms(TList *qalist);
79   
80   
81  private:
82   void SetPPriors(AliESDtrack *pTrk);                          
83   ULong_t StatusForAND(ULong_t status[kNdets+1]) const; //
84   void InitialiseHisto();
85   void DefineHistograms();   //histo booking  
86   Bool_t Check(const Double_t *p, Int_t iPsel, Double_t minDiff) const;
87   void CombPID(ULong_t status[kNdets+1],Double_t pid[kNdets+1][AliPID::kSPECIES],Double_t *combpid) const;
88   
89   Double_t fCut;                                            //probability cut
90   Double_t fMinDiffResponse;                                // minimum difference between detector resposes
91   Double_t fMinDiffProbability;                             // minimum difference between probability values
92   Int_t fgParticleType;                                     // requested particle type
93   Bool_t fgIsComb;                                          // flag for the combined pid
94   Bool_t fCheckResponse;                                    // flag to check the minimum difference of det responsess
95   Bool_t fCheckSelection;                                   // flag to check the minimum difference of probabilities
96   Bool_t fIsPpriors;                                        //flag for momentum dependent priors
97   Bool_t fIsDetAND;                                         //flag for AND with multiple detectors
98   Double_t fXmin;                                           //x min QA histo
99   Double_t fXmax;                                           //x max QA histo
100   Int_t fNbins;                                             //n bins QA histo 
101   Int_t fDetRestr;                                          //id of the detector for the restriction
102   Int_t fiPartRestr;                                        //id of the particle for the restriction
103   Double_t fDetProbRestr;                                   //probability restriction value
104
105   Double_t fPriors[AliPID::kSPECIES];                       //a priori concentrations
106   TF1 *fPriorsFunc[AliPID::kSPECIES];                       //momentum dependent priors
107   Bool_t fDets[kNdets];                                     //boolean(s) corresponding to the chosen detector(s) 
108   Bool_t fDetsInAnd[kNdets];                                //detector to be in AND for the combined PID
109   TH1F *fhResp[kNdets][AliPID::kSPECIES];                   //QA histo
110   TH1F *fhProb[kNdets][AliPID::kSPECIES];                   //QA histo
111   TH1F *fhCombResp[AliPID::kSPECIES];                       //QA histo
112   TH1F *fhCombProb[AliPID::kSPECIES];                       //QA histo
113   
114   ClassDef(AliCFTrackCutPid,1);
115 };
116 #endif
117