Updating AOD filter
[u/mrichter/AliRoot.git] / STEER / AliTRDPIDResponse.h
CommitLineData
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
31class TObjArray;
32class AliVTrack;
33class AliTRDPIDResponse : public TObject {
e0de37e9 34 public:
35 enum ETRDPIDResponseStatus {
9006fe9c 36 kIsOwner = BIT(14)
e0de37e9 37 };
38 enum ETRDPIDResponseDef {
39 kNlayer = 6
40 ,kNPBins = 6
41 };
42 enum ETRDPIDMethod {
43 kNN = 0,
44 kLQ2D = 1,
45 kLQ1D = 2
46 };
47 enum ETRDNslices {
48 kNslicesLQ1D = 1,
49 kNslicesLQ2D = 2,
50 kNslicesNN = 7
51 };
52 AliTRDPIDResponse();
53 AliTRDPIDResponse(const AliTRDPIDResponse &ref);
54 AliTRDPIDResponse& operator=(const AliTRDPIDResponse &);
55 ~AliTRDPIDResponse();
56
57 ETRDPIDMethod GetPIDmethod() const { return fPIDmethod;}
58 Bool_t GetResponse(Int_t n, Double_t *dedx, Float_t *p, Double_t prob[AliPID::kSPECIES], Bool_t kNorm=kTRUE) const;
59 inline ETRDNslices GetNumberOfSlices() const;
60
61 Bool_t IsOwner() const {return TestBit(kIsOwner);}
62
63 void SetOwner();
64 void SetPIDmethod(ETRDPIDMethod m) {fPIDmethod=m;}
65 void SetGainNormalisationFactor(Double_t gainFactor) { fGainNormalisationFactor = gainFactor; }
ffb1ee30 66
e0de37e9 67 Bool_t Load(const Char_t *filename = NULL);
68 Bool_t Load(const TObjArray *histos);
69
70 private:
71 Bool_t CookdEdx(Int_t nSlice, Double_t *in, Double_t *out) const;
72 Int_t GetLowerMomentumBin(Double_t p) const;
73 Double_t GetProbabilitySingleLayer(Int_t species, Double_t plocal, Double_t dEdx) const;
74
75 static const Double_t fgkPBins[kNPBins];
76 TObjArray *fReferences; // Container for reference distributions
77 Int_t fMapRefHists[AliPID::kSPECIES][kNPBins];
78 // Map for the position of a given historgam in the container
79 Double_t fGainNormalisationFactor; // Gain normalisation factor
80 ETRDPIDMethod fPIDmethod; // PID method selector
81
82 ClassDef(AliTRDPIDResponse, 3) // Tool for TRD PID
ffb1ee30 83};
ffb1ee30 84
e0de37e9 85AliTRDPIDResponse::ETRDNslices AliTRDPIDResponse::GetNumberOfSlices() const {
86 // Get the current number of slices
87 ETRDNslices slices = kNslicesLQ1D;
88 switch(fPIDmethod){
89 case kLQ1D: slices = kNslicesLQ1D; break;
90 case kLQ2D: slices = kNslicesLQ2D; break;
91 case kNN: slices = kNslicesNN; break;
92 };
93 return slices;
94}
95#endif