1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 // Does PID either on a x% electron efficiency basis or on dE/dx
18 // For more information please check the implementation file
20 #ifndef ALIHFEPIDTRD_H
21 #define ALIHFEPIDTRD_H
23 #ifndef ALIHFEPIDBASE_H
24 #include "AliHFEpidBase.h"
28 class AliAODMCParticle;
30 class AliHFEcollection;
32 class AliOADBContainer;
35 class AliTRDPIDResponse;
39 class AliHFEpidTRD : public AliHFEpidBase{
49 kHistTRDlikeBefore = 0,
50 kHistTRDlikeAfter = 1,
51 kHistTRDthresholds = 2,
54 kHistOverallSpecies = 5
57 AliHFEpidTRD(const Char_t *name);
58 AliHFEpidTRD(const AliHFEpidTRD &ref);
59 AliHFEpidTRD& operator=(const AliHFEpidTRD &ref);
60 virtual ~AliHFEpidTRD();
62 virtual Bool_t InitializePID(Int_t run);
63 virtual Bool_t Initialize1D(Int_t run);
64 //virtual Bool_t Initialize2D(Int_t run);
65 virtual Int_t IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const;
66 virtual Int_t IsSelected1D(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const;
67 virtual Int_t IsSelectedTRDPID(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const;
69 Double_t GetTRDSignalV1(const AliESDtrack *track, Float_t truncation = 0.7) const;
70 Double_t GetTRDSignalV2(const AliESDtrack *track, Float_t trucation = 0.7) const;
72 Bool_t IsCalculateTRDSignals() const { return TestBit(kTRDsignals); }
73 Bool_t IsRenormalizeElPi() const { return TestBit(kTRDrenormalize); }
74 void SelectCutOnTheFly(Bool_t onFly = kTRUE) { if(onFly) SetBit(kSelectCutOnTheFly, kTRUE); else SetBit(kSelectCutOnTheFly, kFALSE);}
75 void SetOADBThresholds(AliOADBContainer *cont) { fOADBThresholds = cont; }
76 void SetTotalChargeInSlice0() { fTotalChargeInSlice0 = kTRUE; }
77 void SetTRDOldPIDMethod() { fTRDOldPIDMethod = kTRUE; }
78 void SetTRD2DPID() { fTRD2DPID = kTRUE; }
79 void SetRenormalizeElPi(Bool_t doRenorm = kTRUE) { if(doRenorm) SetBit(kTRDrenormalize, kTRUE); else SetBit(kTRDrenormalize, kFALSE);}
80 void SetElectronEfficiency(Double_t electronEfficiency) { fElectronEfficiency = electronEfficiency; }
81 void SetNTracklets(Int_t nTracklets) { fNTracklets = nTracklets; }
82 void SetCutNTracklets(Int_t nTracklets, Bool_t exact = kTRUE) {
83 fCutNTracklets = nTracklets;
84 if(exact) SetBit(kExactTrackletCut, kTRUE);
85 else SetBit(kExactTrackletCut, kFALSE);
87 void SetMinP(Double_t p) { fMinP = p; }
88 void CalculateTRDSignals(Bool_t docalc) { SetBit(kTRDsignals, docalc); }
90 Double_t GetElectronLikelihood(const AliVTrack *track, AliHFEpidObject::AnalysisType_t anaType) const;
91 Int_t GetNTracklets() const { return fNTracklets; }
92 void GetTRDmomenta(const AliVTrack *track, Double_t *mom) const;
93 Double_t GetP(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
94 Double_t GetTRDthresholds(Double_t p) const;
95 Double_t GetTRDthresholds(Double_t p, UInt_t nTracklets) const;
96 Double_t GetChargeLayer(const AliVParticle *track, UInt_t layer, AliHFEpidObject::AnalysisType_t anatype) const;
99 kTRDsignals = BIT(16),
100 kThresholdsInitialized = BIT(17),
101 kTRDrenormalize = BIT(18),
102 kSelectCutOnTheFly = BIT(19),
103 kExactTrackletCut = BIT(20)
105 void Copy(TObject &ref) const;
106 Bool_t InitParamsFromOADB(Int_t run);
107 void RenormalizeElPi(const Double_t * const likein, Double_t * const likeout) const;
110 AliOADBContainer *fOADBThresholds; // OADBContainer with thresholds
111 Double_t fMinP; // Minimum momentum above which TRD PID is applied
112 Int_t fNTracklets; // Select cut for the number of tracklets
113 Int_t fCutNTracklets; // Cut track based on the number of tracklets
114 Int_t fRunNumber; // Run number
115 Double_t fElectronEfficiency; // Cut on electron efficiency
116 Double_t fThreshParams[kThreshParams]; // Threshold parametrisation
117 Bool_t fTotalChargeInSlice0; // Flag for foreward/backward compatibility for the TRD total charge
118 Bool_t fTRDOldPIDMethod; // Flag for old 1D PID method
119 Bool_t fTRD2DPID; // Flag for 2D PID
120 ClassDef(AliHFEpidTRD, 1) // TRD electron ID class