1 #ifndef ALITRDCALPIDLQ_H
2 #define ALITRDCALPIDLQ_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 ////////////////////////////////////////////////////////////////////////////
11 // PID distributions for the LQ method //
14 // Alex Bercuci <A.Bercuci@gsi.de> //
16 ////////////////////////////////////////////////////////////////////////////
18 #ifndef ALITRDCALPID_H
19 #include "AliTRDCalPID.h"
25 class AliTRDCalPIDLQ : public AliTRDCalPID
29 kNLength = 4 // No of bins for tracklet length discretization
30 ,kNN2LQtransition = 4 // index of NN slices where first LQ slice ends
33 AliTRDCalPIDLQ(const Text_t *name, const Text_t *title);
34 virtual ~AliTRDCalPIDLQ(){};
36 inline static Bool_t CookdEdx(const Float_t * const dedx, Double_t *x, Bool_t k2D=kTRUE);
37 TObject* GetModel(Int_t ip, Int_t iType, Int_t slices) const;
38 static Double_t GetLength(Int_t il) { return (il<0 || il>=kNLength) ? -1. : fgTrackSegLength[il]; }
39 inline static Int_t GetModelID(Int_t mom, Int_t spec, Int_t slices=1);
40 static Int_t GetNrefs();
41 Double_t GetProbability(Int_t spec, Float_t mom
42 , const Float_t * const dedx
43 , Float_t length, Int_t slices) const;
44 Bool_t LoadReferences(Char_t* refFile);
46 static Float_t fgTrackSegLength[kNLength]; // Track segment lengths
49 AliTRDCalPIDLQ(const AliTRDCalPIDLQ& pd);
50 AliTRDCalPIDLQ& operator=(const AliTRDCalPIDLQ &c);
53 ClassDef(AliTRDCalPIDLQ, 2) // LQ PID reference manager
56 //_________________________________________________________________________
57 inline Bool_t AliTRDCalPIDLQ::CookdEdx(const Float_t * const dedx, Double_t *x, Bool_t k2D)
59 // Convert NN dEdx slices to the representation used by LQ
62 for(Int_t islice=AliTRDCalPID::kNSlicesNN; islice--;){
64 if(k2D) jslice = islice>kNN2LQtransition;
65 x[jslice]+=dedx[islice];
68 // check data integrity
69 if(x[0]<1.e-30) return kFALSE;
70 if(k2D && x[1]<1.e-30) return kFALSE;
72 x[0] = TMath::Log(x[0]);
73 x[1] = k2D ? TMath::Log(x[1]) : 0.;
77 //_________________________________________________________________________
78 inline Int_t AliTRDCalPIDLQ::GetModelID(Int_t mom, Int_t spec, Int_t ii)
80 // Returns the ID of the PDF distribution
81 // 5 species * 11 momentum ranges * 2 slices
83 Int_t n(GetNrefs()>>1);
84 return (ii-1)*n + (spec * AliTRDCalPID::kNMom + mom);