]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEV0pid.h
Fixes for the TPC PID electron selection and the contamination
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEV0pid.h
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 // Utility class for V0 PID
17 // Provides smaples of electrons, pions and protons
18 // More information can be found in the implementation file
19 //
20 #ifndef ALIHFEV0PID_H
21 #define ALIHFEV0PID_H
22
23 #ifndef ROOT_TObject
24 #include <TObject.h>
25 #endif
26
27 class TObjArray;
28 class TList;
29 class TString;
30
31 class AliESDv0;
32 class AliESDtrack;
33 class AliKFParticle;
34 class AliKFVertex;
35 class AliVEvent;
36 class AliVTrack;
37
38 class AliHFEV0cuts;
39 class AliHFEcollection;
40
41 class AliHFEV0pid : public TObject{
42   public:
43   enum{ // Reconstructed V0
44     kUndef = 0,
45       kRecoGamma = 1,
46       kRecoK0s = 2,
47       kRecoPhi = 3,
48       kRecoLambda = 4
49       
50     };
51     enum{ // Identified Daughter particles
52       kRecoElectron = 0,
53         kRecoPionK0 = 1,
54         kRecoPionL = 2,
55         kRecoKaon = 3,
56         kRecoProton = 4
57         };
58     AliHFEV0pid();
59     ~AliHFEV0pid();
60
61     void  Process(AliVEvent * const inputEvent);
62     Int_t ProcessV0(TObject *v0);
63     void  Flush();
64
65     void  InitQA();
66     TList *GetListOfQAhistograms();
67
68     TObjArray *GetListOfElectrons() const { return fElectrons; }
69     TObjArray *GetListOfPionsK0() const { return fPionsK0; }
70     TObjArray *GetListOfPionsL() const { return fPionsL; }
71     TObjArray *GetListOfKaons() const { return fKaons; }
72     TObjArray *GetListOfProtons() const { return fProtons; }
73
74     Bool_t   IsAODanalysis() const { return TestBit(kAODanalysis); }
75     Bool_t   IsESDanalysis() const { return !TestBit(kAODanalysis); }
76     void     SetAODanalysis(Bool_t isAOD = kTRUE) { SetBit(kAODanalysis, isAOD); };
77     void     SetESDanalysis(Bool_t isESD = kTRUE) { SetBit(kAODanalysis, !isESD); }; 
78
79  protected:
80     enum{
81       kAODanalysis = BIT(14)
82         };
83     
84     Bool_t IsGammaConv(TObject *v0);
85     Bool_t IsK0s(TObject *v0);
86     Bool_t IsPhi(TObject *v0);
87     Bool_t IsLambda(TObject *v0);        
88     TList *GetV0pidQA(); 
89
90  private:
91     class AliHFEV0pidTrackIndex{
92     public:
93       AliHFEV0pidTrackIndex();
94       ~AliHFEV0pidTrackIndex();
95       void Init(Int_t capacity);
96       void Add(Int_t index, Int_t species);
97       Bool_t Find(Int_t index) const;
98       Bool_t Find(Int_t index, Int_t species) const;
99       Int_t GetNumberOfElectrons() const { return fNElectrons; };
100       Int_t GetNumberOfPionsK0() const { return fNPionsK0; };
101       Int_t GetNumberOfPionsL() const { return fNPionsL; };
102       Int_t GetNumberOfKaons() const { return fNKaons; };
103       Int_t GetNumberOfProtons() const { return fNProtons; };
104       void Flush();
105       
106     private:
107       AliHFEV0pidTrackIndex(const AliHFEV0pidTrackIndex &ref);
108       AliHFEV0pidTrackIndex &operator=(const AliHFEV0pidTrackIndex &ref);
109       Int_t fNElectrons;        // Number of identified electrons
110       Int_t fNPionsK0;          // Number of identified pions from K0s
111       Int_t fNPionsL;           // Lumber of identified pions from Lambda
112       Int_t fNKaons;            // Number of identified kaons
113       Int_t fNProtons;          // Number of identified protons
114       Int_t *fIndexElectron;    // Indices of identified electrons
115       Int_t *fIndexPionK0;      // Indices of identified pions from K0s
116       Int_t *fIndexPionL;       // Indices of identified pions from Lambda
117       Int_t *fIndexKaon;        // Indices of identified kaons
118       Int_t *fIndexProton;      // Indices of identified protons
119     };
120     AliHFEV0pid(const AliHFEV0pid &ref);
121     AliHFEV0pid&operator=(const AliHFEV0pid &ref);
122     
123     AliVEvent   *fInputEvent;        // Input Event
124     AliKFVertex *fPrimaryVertex;     // Primary Vertex
125     TObjArray   *fElectrons;         // List of Electron tracks coming from Conversions
126     TObjArray   *fPionsK0;           // List of Pion tracks coming from K0
127     TObjArray   *fPionsL;            // List of Pion tracks coming from L
128     TObjArray   *fKaons;             // List of Kaon tracks from Phi decay
129     TObjArray   *fProtons;           // List of Proton Tracks coming from Lambdas
130
131     TObjArray   *fGammas;            // for MC purposes - list of found gammas
132     TObjArray   *fK0s;               // for MC purposes - list of found K0s
133     TObjArray   *fLambdas;           // for MC purposes - list of found lambdas
134     TObjArray   *fAntiLambdas;       // for MC purposes - list of found anti lambdas
135
136     AliHFEV0pidTrackIndex *fIndices; // Container for Track indices
137     AliHFEcollection *fQA;           // Collection of QA histograms
138     AliHFEV0cuts     *fV0cuts;       // separate class for studying and applying the V0 cuts
139     TList       *fOutput;            // collection list
140
141     ClassDef(AliHFEV0pid, 1)          // V0 PID Class
142
143 };
144
145 #endif