Line data Source code
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 : class AliTRDdEdxParams;
35 : class TH2;
36 : class TH2D;
37 :
38 : class AliTRDPIDResponse : public TObject {
39 : public:
40 : enum ETRDPIDResponseStatus {
41 : kIsOwner = BIT(14)
42 : };
43 : enum ETRDPIDResponseDef {
44 : kNlayer = 6
45 : ,kNPBins = 6
46 : };
47 : enum ETRDPIDMethod {
48 : kNN = 0,
49 : kLQ2D = 1,
50 : kLQ1D = 2,
51 : kLQ3D = 3,
52 : kLQ7D = 4
53 : };
54 : enum ETRDPIDNMethod {
55 : kNMethod=5
56 : };
57 : enum ETRDNslices {
58 : kNslicesLQ1D = 1,
59 : kNslicesLQ2D = 2,
60 : kNslicesNN = 7,
61 : kNslicesLQ3D = 3,
62 : kNslicesLQ7D = 7
63 : };
64 : enum ETRDNsliceQ0 {
65 : kNsliceQ0LQ1D = 1,
66 : kNsliceQ0LQ2D = 4,
67 : kNsliceQ0NN = 1,
68 : kNsliceQ0LQ3D = 3,
69 : kNsliceQ0LQ7D = 1
70 : };
71 :
72 : AliTRDPIDResponse();
73 : AliTRDPIDResponse(const AliTRDPIDResponse &ref);
74 : AliTRDPIDResponse& operator=(const AliTRDPIDResponse &ref);
75 : ~AliTRDPIDResponse();
76 :
77 : Double_t GetNumberOfSigmas(const AliVTrack *track, AliPID::EParticleType type, Bool_t fCorrectEta) const;
78 : Double_t GetSignalDelta(const AliVTrack *track, AliPID::EParticleType type, Bool_t ratio=kFALSE, Bool_t fCorrectEta=kFALSE, Double_t *info=0x0) const;
79 :
80 : static Double_t MeandEdx(const Double_t * xx, const Float_t * par);
81 : static Double_t MeanTR(const Double_t * xx, const Float_t * par);
82 : static Double_t MeandEdxTR(const Double_t * xx, const Float_t * par);
83 : static Double_t ResolutiondEdxTR(const Double_t * xx, const Float_t * par);
84 :
85 : Int_t GetResponse(Int_t n, const Double_t * const dedx, const Float_t * const p, Double_t prob[AliPID::kSPECIES],ETRDPIDMethod PIDmethod=kLQ1D, Bool_t kNorm=kTRUE) const;
86 : inline ETRDNslices GetNumberOfSlices(ETRDPIDMethod PIDmethod=kLQ1D) const;
87 :
88 20 : Bool_t IsOwner() const {return TestBit(kIsOwner);}
89 :
90 : void SetOwner();
91 0 : void SetGainNormalisationFactor(Double_t gainFactor) { fGainNormalisationFactor = gainFactor; }
92 :
93 : Bool_t SetPIDResponseObject(const AliTRDPIDResponseObject * obj);
94 : Bool_t SetdEdxParams(const AliTRDdEdxParams * par);
95 :
96 : // eta correction map
97 0 : TH2D* GetEtaCorrMap(Int_t n) const { return fhEtaCorr[n]; };
98 : Bool_t SetEtaCorrMap(Int_t n, TH2D* hMapn);
99 :
100 :
101 : Bool_t Load(const Char_t *filename = NULL);
102 :
103 : Bool_t IdentifiedAsElectron(Int_t nTracklets, const Double_t *like, Double_t p, Double_t level,Double_t centrality=-1,ETRDPIDMethod PIDmethod=kLQ1D) const;
104 :
105 : Double_t GetEtaCorrection(const AliVTrack *track, Double_t bg) const;
106 0 : void SetMagField(Double_t mf) { fMagField=mf; }
107 :
108 : private:
109 : Bool_t CookdEdx(Int_t nSlice, const Double_t * const in, Double_t *out,ETRDPIDMethod PIDmethod=kLQ1D) const;
110 : Double_t GetProbabilitySingleLayer(Int_t species, Double_t plocal, Double_t *dEdx,ETRDPIDMethod PIDmethod=kLQ1D) const;
111 :
112 : const AliTRDPIDResponseObject *fkPIDResponseObject; //! PID References and Params
113 : const AliTRDdEdxParams * fkTRDdEdxParams; //! parametrisation for truncated mean
114 : Double_t fGainNormalisationFactor; //! Gain normalisation factor
115 : Bool_t fCorrectEta; //! switch for eta correction
116 : TH2D* fhEtaCorr[1]; //! Map for TRD eta correction
117 : Double_t fMagField; //! Magnetic field
118 :
119 2860 : ClassDef(AliTRDPIDResponse, 6) // Tool for TRD PID
120 : };
121 :
122 : AliTRDPIDResponse::ETRDNslices AliTRDPIDResponse::GetNumberOfSlices(ETRDPIDMethod PIDmethod) const {
123 : // Get the current number of slices
124 : ETRDNslices slices = kNslicesLQ1D;
125 312 : switch(PIDmethod){
126 104 : case kLQ1D: slices = kNslicesLQ1D; break;
127 0 : case kLQ2D: slices = kNslicesLQ2D; break;
128 0 : case kNN: slices = kNslicesNN; break;
129 0 : case kLQ3D: slices = kNslicesLQ3D; break;
130 0 : case kLQ7D: slices = kNslicesLQ7D; break;
131 : };
132 104 : return slices;
133 : }
134 : #endif
135 :
|