Cleanup the code. Fix memory leak. Now inherit from AliAnalysisTaskSE (Antoine, Phili...
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEpidQA.h
CommitLineData
27de2dfb 1#ifndef ALIHFEPIDQA_H
2#define ALIHFEPIDQA_H
3
70da6c5a 4/**************************************************************************
5* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6* *
7* Author: The ALICE Off-line Project. *
8* Contributors are mentioned in the code where appropriate. *
9* *
10* Permission to use, copy, modify and distribute this software and its *
11* documentation strictly for non-commercial purposes is hereby granted *
12* without fee, provided that the above copyright notice appears in all *
13* copies and that both the copyright notice and this permission notice *
14* appear in the supporting documentation. The authors make no claims *
15* about the suitability of this software for any purpose. It is *
16* provided "as is" without express or implied warranty. *
17**************************************************************************/
27de2dfb 18
19/* $Id$ */
20
70da6c5a 21//
22// Class for PID QA
23// Several studies done on clean samples of electrons, pions and kaons
24// coming from V0 PID
25// More information can be found in the implementation file
26//
70da6c5a 27#ifndef ROOT_TObject
28#include <TObject.h>
29#endif
30
31class TList;
32class TObjArray;
faee3b18 33class TPDGCode;
34class TParticle;
35class TFile;
36class TMultiLayerPerceptron;
70da6c5a 37
38class AliAODTrack;
39class AliESDtrack;
70da6c5a 40class AliMCEvent;
70da6c5a 41class AliVEvent;
42class AliESDpid;
faee3b18 43class AliExternalTrackParam;
44class AliLog;
45
70da6c5a 46class AliHFEV0pidMC;
faee3b18 47class AliHFEcollection;
48class AliHFEtrdPIDqa;
49class AliHFEV0pid;
50class AliHFEpidTRD;
51
70da6c5a 52
53class AliHFEpidQA : public TObject{
54 public:
55 AliHFEpidQA();
56 ~AliHFEpidQA();
faee3b18 57 AliHFEpidQA(const AliHFEpidQA &ref);
58 AliHFEpidQA &operator=(const AliHFEpidQA &ref);
59 virtual void Copy(TObject &o) const;
70da6c5a 60
61 void Init();
faee3b18 62 void Process();
70da6c5a 63
64 TList *GetOutput();
65 TList *GetV0pidQA();
66 TList *GetV0pidMC();
67
68 Bool_t HasV0pidQA() const { return TestBit(kV0pidQA); };
69 Bool_t HasRecalculateTRDpid() const { return TestBit(kRecalculateTRDpid); };
70
faee3b18 71 void SetEvent(AliVEvent* const ev) { fEvent = ev; };
70da6c5a 72 void SetMCEvent(AliMCEvent * const mc) { fMC = mc; };
73 void SetV0pidQA(Bool_t v0pidQA = kTRUE) { SetBit(kV0pidQA, v0pidQA); };
74 void SetRecalculateTRDpid(Bool_t recal = kTRUE) { SetBit(kRecalculateTRDpid, recal); };
75
faee3b18 76 void SetESDpid(AliESDpid* const pid) { fESDpid = pid; }
77 Float_t TOFbeta(AliESDtrack* const track) const;
78
79 void CheckEvent();
80 void SetNNref(TFile *f) { fNNref = f; };
81
82 AliHFEtrdPIDqa *GetTRDQA() const { return fTRDpidQA; }
70da6c5a 83
84 protected:
85 enum{
86 kV0pidQA = BIT(14),
87 kRecalculateTRDpid = BIT(15)
88 };
89 enum{ // detectors for histogram names
90 kITS = 0,
91 kTPC = 1,
92 kTRD = 2,
faee3b18 93 kTOF = 3
70da6c5a 94 };
95
3a72645a 96 TObjArray *MakeTrackList(const TObjArray *tracks) const;
97 TObjArray *MakeCleanListElectrons(const TObjArray *tracks) const;
98
99 void MakePurity(const TObjArray *tracks, Int_t species);
100 TObjArray *MakeCleanListForTRD(const TObjArray * const track, Int_t species);
101 void FillElectronLikelihoods(const TObjArray * const particles, Int_t species);
102 void FillPIDresponse(const TObjArray * const particles, Int_t species);
103 void FillIllumination(const TObjArray *const particles, Int_t species);
faee3b18 104 void FillTPCinfo(AliESDtrack * const track, Int_t species);
70da6c5a 105 void RecalculateTRDpid(AliESDtrack *track, Double_t *pidProbs) const;
106 void RecalculateTRDpid(AliAODTrack *track, Double_t *pidProbs) const;
3a72645a 107 void CheckTenderV0pid(const TObjArray * const particles, Int_t species);
faee3b18 108 Int_t GetTenderV0pid(AliESDtrack * const track);
109
110 Double_t TRDlikeTracklet(Int_t layer, AliESDtrack * const track, Double_t *likelihood);
6555e2ad 111 Int_t TRDmomBin(Double_t p) const;
70da6c5a 112
faee3b18 113 protected:
3a72645a 114 Int_t GetMaxPID(const Double_t *pidProbs) const;
faee3b18 115 Int_t GetPDG(Int_t index);
116
70da6c5a 117 private:
faee3b18 118 AliVEvent *fEvent; // event pointer
70da6c5a 119 AliMCEvent *fMC; // MC Event
120 AliHFEV0pid *fV0pid; // V0 PID
121 AliHFEV0pidMC *fV0pidMC; // V0 MC PID
faee3b18 122 AliHFEtrdPIDqa *fTRDpidQA; //! TRD PID QA object
70da6c5a 123 AliHFEcollection *fOutput; // Output container
faee3b18 124 AliESDpid *fESDpid; // ESD PID object
125 private:
126 TFile *fNNref; // reference file for NN pid
127 TMultiLayerPerceptron *fNet[11]; // reference networks
70da6c5a 128
129 ClassDef(AliHFEpidQA, 1) // PID QA tool
130};
131#endif