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