]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/STEERBase/AliTRDPIDResponse.h
- fast TRD PID implementation with muon constraints (Daniel Lohner)
[u/mrichter/AliRoot.git] / STEER / STEERBase / 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;
db0e2c5f 33class AliTRDPIDResponseObject;
34
ffb1ee30 35class AliTRDPIDResponse : public TObject {
e0de37e9 36 public:
37 enum ETRDPIDResponseStatus {
9006fe9c 38 kIsOwner = BIT(14)
e0de37e9 39 };
40 enum ETRDPIDResponseDef {
db0e2c5f 41 kNlayer = 6
239fe91c 42 ,kNPBins = 6
e0de37e9 43 };
44 enum ETRDPIDMethod {
f2762b1c 45 kNN = 0,
46 kLQ2D = 1,
47 kLQ1D = 2
e0de37e9 48 };
db0e2c5f 49 enum ETRDPIDNMethod {
50 kNMethod=3
51 };
e0de37e9 52 enum ETRDNslices {
f2762b1c 53 kNslicesLQ1D = 1,
239fe91c 54 kNslicesLQ2D = 2,
55 kNslicesNN = 7
e0de37e9 56 };
57 AliTRDPIDResponse();
58 AliTRDPIDResponse(const AliTRDPIDResponse &ref);
51a0ce25 59 AliTRDPIDResponse& operator=(const AliTRDPIDResponse &ref);
e0de37e9 60 ~AliTRDPIDResponse();
61
239fe91c 62 Int_t GetResponse(Int_t n, const Double_t * const dedx, const Float_t * const p, Double_t prob[AliPID::kSPECIES],ETRDPIDMethod PIDmethod=kLQ1D, Bool_t kNorm=kTRUE) const;
bd58d4b9 63 inline ETRDNslices GetNumberOfSlices(ETRDPIDMethod PIDmethod=kLQ1D) const;
e0de37e9 64
65 Bool_t IsOwner() const {return TestBit(kIsOwner);}
66
67 void SetOwner();
e0de37e9 68 void SetGainNormalisationFactor(Double_t gainFactor) { fGainNormalisationFactor = gainFactor; }
ffb1ee30 69
f2762b1c 70 Bool_t SetPIDResponseObject(const AliTRDPIDResponseObject * obj);
71
db0e2c5f 72 Bool_t Load(const Char_t *filename = NULL);
e0de37e9 73
bd58d4b9 74 Bool_t IdentifiedAsElectron(Int_t nTracklets, const Double_t *like, Double_t p, Double_t level,Double_t centrality=-1,ETRDPIDMethod PIDmethod=kLQ1D) const;
ea235c90 75
e0de37e9 76 private:
bd58d4b9 77 Bool_t CookdEdx(Int_t nSlice, const Double_t * const in, Double_t *out,ETRDPIDMethod PIDmethod=kLQ1D) const;
78 Double_t GetProbabilitySingleLayer(Int_t species, Double_t plocal, Double_t *dEdx,ETRDPIDMethod PIDmethod=kLQ1D) const;
e0de37e9 79
db0e2c5f 80 const AliTRDPIDResponseObject *fkPIDResponseObject; // PID References and Params
ea235c90 81 Double_t fGainNormalisationFactor; // Gain normalisation factor
ea235c90 82
e0de37e9 83
84 ClassDef(AliTRDPIDResponse, 3) // Tool for TRD PID
ffb1ee30 85};
ffb1ee30 86
bd58d4b9 87AliTRDPIDResponse::ETRDNslices AliTRDPIDResponse::GetNumberOfSlices(ETRDPIDMethod PIDmethod) const {
e0de37e9 88 // Get the current number of slices
89 ETRDNslices slices = kNslicesLQ1D;
bd58d4b9 90 switch(PIDmethod){
e0de37e9 91 case kLQ1D: slices = kNslicesLQ1D; break;
92 case kLQ2D: slices = kNslicesLQ2D; break;
93 case kNN: slices = kNslicesNN; break;
94 };
95 return slices;
96}
97#endif
db0e2c5f 98