]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/STEERBase/AliTRDPIDResponse.h
- Reshuffling of the particle codes in AliPID. Now the light nuclei are between the
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliTRDPIDResponse.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 // PID Response class for the TRD detector
17 // Based on 1D Likelihood approach
18 // For further information see implementation file
19 //
20 #ifndef ALITRDPIDRESPONSE_H
21 #define ALITRDPIDRESPONSE_H
22
23 #ifndef ROOT_TObject
24 #include <TObject.h>
25 #endif
26
27 #ifndef ALIPID_H
28 #include "AliPID.h"
29 #endif
30
31 class TObjArray;
32 class AliVTrack;
33 class AliTRDPIDResponseObject;
34
35 class AliTRDPIDResponse : public TObject {
36   public:
37     enum ETRDPIDResponseStatus {
38       kIsOwner = BIT(14)
39     };
40     enum ETRDPIDResponseDef {
41         kNlayer = 6
42         ,kNPBins = 6
43     };
44     enum ETRDPIDMethod {
45         kNN   = 0,
46         kLQ2D = 1,
47         kLQ1D = 2
48     };
49     enum ETRDPIDNMethod {
50         kNMethod=3
51     };
52     enum ETRDNslices {
53         kNslicesLQ1D = 1,
54       kNslicesLQ2D = 2,
55       kNslicesNN = 7
56     };
57     AliTRDPIDResponse();
58     AliTRDPIDResponse(const AliTRDPIDResponse &ref);
59     AliTRDPIDResponse& operator=(const AliTRDPIDResponse &ref);
60     ~AliTRDPIDResponse();
61     
62     ETRDPIDMethod     GetPIDmethod() const { return fPIDmethod;}
63     Bool_t    GetResponse(Int_t n, const Double_t * const dedx, const Float_t * const p, Double_t prob[AliPID::kSPECIES], Bool_t kNorm=kTRUE) const;
64     inline ETRDNslices  GetNumberOfSlices() const;
65     
66     Bool_t    IsOwner() const {return TestBit(kIsOwner);}
67     
68     void      SetOwner();
69     void      SetPIDmethod(ETRDPIDMethod m) {fPIDmethod=m;}
70     void      SetGainNormalisationFactor(Double_t gainFactor) { fGainNormalisationFactor = gainFactor; }
71
72     Bool_t SetPIDResponseObject(const AliTRDPIDResponseObject * obj);
73     
74     Bool_t    Load(const Char_t *filename = NULL);
75   
76     Bool_t    IdentifiedAsElectron(Int_t nTracklets, const Double_t *like, Double_t p, Double_t level) const;
77   
78   private:
79     Bool_t    CookdEdx(Int_t nSlice, const Double_t * const in, Double_t *out) const;
80     Double_t  GetProbabilitySingleLayer(Int_t species, Double_t plocal, Double_t *dEdx) const;
81     
82     const AliTRDPIDResponseObject *fkPIDResponseObject;   // PID References and Params
83     Double_t  fGainNormalisationFactor;         // Gain normalisation factor
84     ETRDPIDMethod   fPIDmethod;                 // PID method selector
85       
86   
87   ClassDef(AliTRDPIDResponse, 3)    // Tool for TRD PID
88 };
89
90 AliTRDPIDResponse::ETRDNslices AliTRDPIDResponse::GetNumberOfSlices() const {
91   // Get the current number of slices
92   ETRDNslices slices = kNslicesLQ1D;
93   switch(fPIDmethod){
94     case kLQ1D: slices = kNslicesLQ1D; break;
95     case kLQ2D: slices = kNslicesLQ2D; break;
96     case kNN:   slices = kNslicesNN; break;
97   };
98   return slices;
99 }
100 #endif
101