]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/Cal/AliTRDCalPIDLQ.h
New 2-dim PID methods by Alexandru
[u/mrichter/AliRoot.git] / TRD / Cal / AliTRDCalPIDLQ.h
1 #ifndef ALITRDCALPIDLQ_H
2 #define ALITRDCALPIDLQ_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ///////////////////////////////////////////////////////////////////////////////
9 //                                                                           //
10 // Container for the distributions of dE/dx and the time bin of the          //
11 // max. cluster for electrons and pions                                      //
12 //                                                                           //
13 // Author:                                                                   //
14 //   Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de>                    //
15 //                                                                           //
16 ///////////////////////////////////////////////////////////////////////////////
17
18 #ifndef ROOT_TNamed
19 #include <TNamed.h>
20 #endif
21
22 class TH1;
23 class TObjArray;
24 class AliTRDCalPIDLQRef;
25
26 class AliTRDCalPIDLQ : public TNamed {
27
28  friend class AliTRDCalPIDLQRef;
29
30  public:
31
32   AliTRDCalPIDLQ();
33   AliTRDCalPIDLQ(const Text_t *name, const Text_t *title);
34   AliTRDCalPIDLQ(const AliTRDCalPIDLQ& pd);
35   virtual        ~AliTRDCalPIDLQ();
36   AliTRDCalPIDLQ &operator=(const AliTRDCalPIDLQ &c);
37
38   virtual void Copy(TObject &c) const;
39
40   Bool_t       ReadReferences(Char_t *responseFile);
41   void         SetMeanChargeRatio(Double_t ratio)     { fMeanChargeRatio = ratio;  }
42
43   Double_t     GetMeanChargeRatio() const             { return fMeanChargeRatio;   }
44   Double_t     GetMomentum(Int_t ip) const            { return (ip<0 || ip>=fNMom)    ? -1. : fTrackMomentum[ip];  }
45   Double_t     GetLength(Int_t il) const              { return (il<0 || il>=fNLength) ? -1. : fTrackSegLength[il]; }
46   //Double_t   GetMean(Int_t iType, Int_t ip) const;
47   //Double_t   GetNormalization(Int_t iType, Int_t ip) const;
48
49   TH1*         GetHistogram(Int_t iType, Int_t ip/*, Int_t il*/) const;
50   TH1*         GetHistogramT(Int_t iType, Int_t ip) const;
51
52   Double_t     GetProbability(Int_t spec, Double_t mom, Double_t *dedx, Double_t length) const;
53   Double_t     GetProbabilityT(Int_t spec, Double_t mom, Int_t timbin) const;
54   //Int_t      GetNbins() const                       { return fNbins;   }
55   //Double_t   GetBinSize() const                     { return fBinSize; }
56   Bool_t       WriteReferences(Char_t *File="TRDPIDHistograms.root", Char_t *dir =".");
57
58  protected:
59
60   void         Init();
61   void         CleanUp();
62
63   inline Int_t GetHistID(Int_t part, Int_t mom/*, Int_t length=0*/) const { return part*fNMom + mom; }
64   void         SaveMaxTimeBin(const Int_t mom, const char *fn);
65                                 
66  protected:
67
68   static  Char_t    *fpartName[5];     //! Names of particle species
69   static  Char_t    *fpartSymb[5];     //! Symbols of particle species  
70   Int_t              fNMom;            //  Number of momenta
71   Int_t              fNLength;         //  Number of track segment length intervals
72
73   Double_t          *fTrackMomentum;   //[fNMom]    Track momenta for which response functions are available
74   Double_t          *fTrackSegLength;  //[fNLength] Track segment lengths for which response functions are available
75   Int_t              fNTimeBins;       //  Number of time bins
76
77   Double_t           fMeanChargeRatio; //  Ratio of mean charge from real Det. to prob. dist.
78   Int_t              fNbins;           //  Number of energy bins
79   Double_t           fBinSize;         //  Size of energy bin
80
81   TObjArray         *fHistdEdx;        //  Prob. of dEdx for 5 particles and for several momenta
82   TObjArray         *fHistTimeBin;     //  Prob. of max time bin for 5 particles and for several momenta
83
84  private:
85
86   TH1               *h1MaxTB[2];      //!
87   AliTRDCalPIDLQRef *fEstimator;      //!
88         
89   ClassDef(AliTRDCalPIDLQ, 2)         //   The TRD PID response container class
90
91 };
92
93 #endif
94