1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // PID Response class for the TRD detector
17 // Based on 1D Likelihood approach
18 // For further information see implementation file
20 #ifndef ALITRDPIDRESPONSE_H
21 #define ALITRDPIDRESPONSE_H
33 class AliTRDPIDResponse : public TObject {
35 enum ETRDPIDResponseStatus {
38 enum ETRDPIDResponseDef {
53 AliTRDPIDResponse(const AliTRDPIDResponse &ref);
54 AliTRDPIDResponse& operator=(const AliTRDPIDResponse &);
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;
61 Bool_t IsOwner() const {return TestBit(kIsOwner);}
64 void SetPIDmethod(ETRDPIDMethod m) {fPIDmethod=m;}
65 void SetGainNormalisationFactor(Double_t gainFactor) { fGainNormalisationFactor = gainFactor; }
67 Bool_t Load(const Char_t *filename = NULL);
68 Bool_t Load(const TObjArray *histos);
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;
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
82 ClassDef(AliTRDPIDResponse, 3) // Tool for TRD PID
85 AliTRDPIDResponse::ETRDNslices AliTRDPIDResponse::GetNumberOfSlices() const {
86 // Get the current number of slices
87 ETRDNslices slices = kNslicesLQ1D;
89 case kLQ1D: slices = kNslicesLQ1D; break;
90 case kLQ2D: slices = kNslicesLQ2D; break;
91 case kNN: slices = kNslicesNN; break;