]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/Cal/AliTRDCalPIDLQ.h
bootstrap pdf before usage
[u/mrichter/AliRoot.git] / TRD / Cal / AliTRDCalPIDLQ.h
CommitLineData
44dbae42 1#ifndef ALITRDCALPIDLQ_H
2#define ALITRDCALPIDLQ_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
9////////////////////////////////////////////////////////////////////////////
10// //
11// PID distributions for the LQ method //
12// //
13// Author: //
14// Alex Bercuci <A.Bercuci@gsi.de> //
15// //
16////////////////////////////////////////////////////////////////////////////
17
9ded305e 18#ifndef ALITRDCALPID_H
44dbae42 19#include "AliTRDCalPID.h"
9ded305e 20#endif
21#ifndef ROOT_TMath
22#include "TMath.h"
23#endif
44dbae42 24
25class AliTRDCalPIDLQ : public AliTRDCalPID
26{
9ded305e 27public:
28 enum ETRDCalPIDLQ {
29 kNLength = 4 // No of bins for tracklet length discretization
30 ,kNN2LQtransition = 4 // index of NN slices where first LQ slice ends
44dbae42 31 };
32
33 AliTRDCalPIDLQ();
34 AliTRDCalPIDLQ(const Text_t *name, const Text_t *title);
9ded305e 35 virtual ~AliTRDCalPIDLQ(){};
44dbae42 36
9ded305e 37 inline static Bool_t CookdEdx(const Float_t * const dedx, Double_t *x);
38 TObject* GetModel(Int_t ip, Int_t iType, Int_t iPlane) const;
39 static Double_t GetLength(Int_t il) { return (il<0 || il>=kNLength) ? -1. : fgTrackSegLength[il]; }
40 inline static Int_t GetModelID(Int_t mom, Int_t spec, Int_t ii=-1);
41 Double_t GetProbability(Int_t spec, Float_t mom
1fcc78b7 42 , const Float_t * const dedx
44dbae42 43 , Float_t length, Int_t plane) const;
9ded305e 44 Bool_t LoadReferences(Char_t* refFile);
44dbae42 45
9ded305e 46protected:
2e32a5ae 47 static Float_t fgTrackSegLength[kNLength]; // Track segment lengths
48
9ded305e 49private:
44dbae42 50 AliTRDCalPIDLQ(const AliTRDCalPIDLQ& pd);
51 AliTRDCalPIDLQ& operator=(const AliTRDCalPIDLQ &c);
9ded305e 52 void Init();
44dbae42 53
2e32a5ae 54 ClassDef(AliTRDCalPIDLQ, 2) // LQ PID reference manager
44dbae42 55};
9ded305e 56
57//_________________________________________________________________________
58inline Int_t AliTRDCalPIDLQ::GetModelID(Int_t mom, Int_t spec, Int_t /*ii*/)
59{
60// Returns the ID of the PDF distribution
61// 5 species * 11 momentum ranges
62
63 return spec * AliTRDCalPID::kNMom + mom;
64}
65
66//_________________________________________________________________________
67inline Bool_t AliTRDCalPIDLQ::CookdEdx(const Float_t * const dedx, Double_t *x)
68{
69// Convert NN dEdx slices to the representation used by LQ
70
71 x[0]=0.;x[1]=0.;
72 for(Int_t islice=AliTRDCalPID::kNSlicesNN; islice--;){
73 Int_t jslice = islice>kNN2LQtransition;
74 x[jslice]+=dedx[islice];
75 }
76
77 // check data integrity
78 if(x[0]<1.e-30) return kFALSE;
79 if(x[1]<1.e-30) return kFALSE;
80
81 x[0] = TMath::Log(x[0]);
82 x[1] = TMath::Log(x[1]);
83 return kTRUE;
84}
85
44dbae42 86#endif
87