]>
Commit | Line | Data |
---|---|---|
ffb1ee30 | 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; | |
51a0ce25 | 33 | class AliTRDPIDReference; |
ffb1ee30 | 34 | class AliTRDPIDResponse : public TObject { |
e0de37e9 | 35 | public: |
36 | enum ETRDPIDResponseStatus { | |
9006fe9c | 37 | kIsOwner = BIT(14) |
e0de37e9 | 38 | }; |
39 | enum ETRDPIDResponseDef { | |
40 | kNlayer = 6 | |
41 | ,kNPBins = 6 | |
42 | }; | |
43 | enum ETRDPIDMethod { | |
44 | kNN = 0, | |
45 | kLQ2D = 1, | |
46 | kLQ1D = 2 | |
47 | }; | |
48 | enum ETRDNslices { | |
49 | kNslicesLQ1D = 1, | |
50 | kNslicesLQ2D = 2, | |
51 | kNslicesNN = 7 | |
52 | }; | |
53 | AliTRDPIDResponse(); | |
54 | AliTRDPIDResponse(const AliTRDPIDResponse &ref); | |
51a0ce25 | 55 | AliTRDPIDResponse& operator=(const AliTRDPIDResponse &ref); |
e0de37e9 | 56 | ~AliTRDPIDResponse(); |
57 | ||
58 | ETRDPIDMethod GetPIDmethod() const { return fPIDmethod;} | |
51a0ce25 | 59 | 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; |
e0de37e9 | 60 | inline ETRDNslices GetNumberOfSlices() const; |
61 | ||
62 | Bool_t IsOwner() const {return TestBit(kIsOwner);} | |
63 | ||
64 | void SetOwner(); | |
65 | void SetPIDmethod(ETRDPIDMethod m) {fPIDmethod=m;} | |
66 | void SetGainNormalisationFactor(Double_t gainFactor) { fGainNormalisationFactor = gainFactor; } | |
ffb1ee30 | 67 | |
51a0ce25 | 68 | Bool_t Load(const Char_t *filename = NULL, const Char_t *refName = "RefTRDLQ1D"); |
69 | Bool_t Load(const AliTRDPIDReference *ref) { fkPIDReference = ref; return kTRUE; } | |
e0de37e9 | 70 | |
71 | private: | |
51a0ce25 | 72 | Bool_t CookdEdx(Int_t nSlice, const Double_t * const in, Double_t *out) const; |
e0de37e9 | 73 | Double_t GetProbabilitySingleLayer(Int_t species, Double_t plocal, Double_t dEdx) const; |
74 | ||
51a0ce25 | 75 | const AliTRDPIDReference *fkPIDReference; // PID References |
e0de37e9 | 76 | Double_t fGainNormalisationFactor; // Gain normalisation factor |
77 | ETRDPIDMethod fPIDmethod; // PID method selector | |
78 | ||
79 | ClassDef(AliTRDPIDResponse, 3) // Tool for TRD PID | |
ffb1ee30 | 80 | }; |
ffb1ee30 | 81 | |
e0de37e9 | 82 | AliTRDPIDResponse::ETRDNslices AliTRDPIDResponse::GetNumberOfSlices() const { |
83 | // Get the current number of slices | |
84 | ETRDNslices slices = kNslicesLQ1D; | |
85 | switch(fPIDmethod){ | |
86 | case kLQ1D: slices = kNslicesLQ1D; break; | |
87 | case kLQ2D: slices = kNslicesLQ2D; break; | |
88 | case kNN: slices = kNslicesNN; break; | |
89 | }; | |
90 | return slices; | |
91 | } | |
92 | #endif |