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