]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/AliAnaBaseClass.cxx
New more general analysis implemention for particle identification and correlation...
[u/mrichter/AliRoot.git] / PWG4 / AliAnaBaseClass.cxx
CommitLineData
d92b41ad 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/* $Id: $ */
16
17/* History of cvs commits:
18 *
19 * $Log$
20 *
21 */
22//_________________________________________________________________________
23// Base class for analysis algorithms
24//-- Author: Gustavo Conesa (LNF-INFN)
25//_________________________________________________________________________
26
27
28// --- ROOT system ---
29#include <TClonesArray.h>
30#include <Riostream.h>
31
32//---- AliRoot system ----
33#include "AliAODParticleCorrelation.h"
34#include "AliAODCaloCluster.h"
35#include "AliAODCaloCells.h"
36#include "AliAODTrack.h"
37#include "AliAnaBaseClass.h"
38#include "AliCaloTrackReader.h"
39#include "AliFidutialCut.h"
40#include "AliIsolationCut.h"
41#include "AliNeutralMesonSelection.h"
42#include "AliLog.h"
43// #include "AliStack.h"
44// #include "AliHeader.h"
45// #include "AliGenEventHeader.h"
46
47ClassImp(AliAnaBaseClass)
48
49
50//_______________________________________________
51 AliAnaBaseClass::AliAnaBaseClass() :
52 TObject(), fDataMC(0), fDebug(0), fCheckFidCut(0),
53 fCheckCaloPID(0), fRecalculateCaloPID(0), fReader(0x0),
54 fAODBranch(0x0), fAODCaloClusters(0x0), fAODCaloCells(0x0),
55 fCaloPID(0x0), fFidCut(0x0), fIC(0x0),fNMS(0x0)
56{
57 //Default Ctor
58
59 fReader = new AliCaloTrackReader();
60 fCaloPID = new AliCaloPID();
61 fFidCut = new AliFidutialCut();
62 fIC = new AliIsolationCut();
63
64 //Initialize parameters
65 InitParameters();
66}
67
68//___________________________________________________________
69AliAnaBaseClass::AliAnaBaseClass(const AliAnaBaseClass & abc) :
70 TObject(), fDataMC(abc.fDataMC), fDebug(abc.fDebug),
71 fCheckFidCut(abc.fCheckFidCut), fCheckCaloPID(abc. fCheckCaloPID),
72 fRecalculateCaloPID(abc.fRecalculateCaloPID),fReader(abc.fReader),
73 fAODBranch(new TClonesArray(*abc.fAODBranch)),
74 fAODCaloClusters(new TClonesArray(*abc.fAODCaloClusters)),
75 fAODCaloCells(new AliAODCaloCells(*abc.fAODCaloCells)),
76 fCaloPID(abc.fCaloPID), fFidCut(abc.fFidCut), fIC(abc.fIC),fNMS(abc.fNMS)
77{
78 // cpy ctor
79
80}
81
82//_________________________________________________________________________
83AliAnaBaseClass & AliAnaBaseClass::operator = (const AliAnaBaseClass & abc)
84{
85 // assignment operator
86
87 if(this == &abc) return *this;
88 ((TObject *)this)->operator=(abc);
89
90 fDataMC = abc.fDataMC;
91 fDebug = abc.fDebug ;
92 fRecalculateCaloPID = abc.fRecalculateCaloPID ;
93 fCheckCaloPID = abc. fCheckCaloPID ;
94 fCheckFidCut = abc.fCheckFidCut ;
95
96 fReader = abc.fReader ;
97
98 fAODBranch = new TClonesArray(*abc.fAODBranch) ;
99 fAODCaloClusters = new TClonesArray(*abc.fAODCaloClusters) ;
100 fAODCaloCells = new AliAODCaloCells(*abc.fAODCaloCells) ;
101
102 fCaloPID = abc.fCaloPID;
103 fFidCut = abc.fFidCut;
104 fIC = abc.fIC;
105 fNMS = abc.fNMS;
106
107 return *this;
108
109}
110
111//____________________________________________________________________________
112AliAnaBaseClass::~AliAnaBaseClass()
113{
114 // Remove all pointers except analysis output pointers.
115
116 if(fAODBranch){
117 fAODBranch->Clear() ;
118 delete fAODBranch ;
119 }
120
121 if(fAODCaloClusters){
122 fAODCaloClusters->Clear() ;
123 delete fAODCaloClusters ;
124 }
125
126 if(fAODCaloCells){
127 fAODCaloCells->Clear() ;
128 delete fAODCaloCells ;
129 }
130
131 if(fReader) delete fReader ;
132 if(fCaloPID) delete fCaloPID ;
133 if(fFidCut) delete fFidCut ;
134 if(fIC) delete fIC ;
135 if(fNMS) delete fNMS ;
136
137}
138
139//____________________________________________________________________________
140void AliAnaBaseClass::AddAODCaloCluster(AliAODCaloCluster calo) {
141 //Put AOD calo cluster in the CaloClusters array
142
143 Int_t i = fAODCaloClusters->GetEntries();
144 new((*fAODCaloClusters)[i]) AliAODCaloCluster(calo);
145
146}
147
148//____________________________________________________________________________
149void AliAnaBaseClass::AddAODParticleCorrelation(AliAODParticleCorrelation pc) {
150 //Put AOD calo cluster in the AODParticleCorrelation array
151
152 Int_t i = fAODBranch->GetEntries();
153 new((*fAODBranch)[i]) AliAODParticleCorrelation(pc);
154
155}
156
157//___________________________________________________
158void AliAnaBaseClass::ConnectAODCaloClusters() {
159 //Recover the list of AODCaloClusters
160
161 fAODCaloClusters = fReader->GetAOD()->GetCaloClusters();
162
163}
164
165//___________________________________________________
166void AliAnaBaseClass::ConnectAODPHOSCells() {
167 //Recover the list of PHOS AODCaloCells
168
169 fAODCaloCells = fReader->GetAOD()->GetPHOSCells();
170
171}
172
173//___________________________________________________
174void AliAnaBaseClass::ConnectAODEMCALCells() {
175 //Recover the list of EMCAL AODCaloCells
176
177 fAODCaloCells = fReader->GetAOD()->GetEMCALCells();
178
179}
180
181//__________________________________________________
182TClonesArray * AliAnaBaseClass::GetAODCTS() const {
183 //Get list of tracks from reader
184
185 return fReader->GetAODCTS();
186
187}
188
189//__________________________________________________
190TClonesArray * AliAnaBaseClass::GetAODPHOS() const {
191 //Get list of PHOS calo clusters from reader
192
193 return fReader->GetAODPHOS();
194
195}
196
197
198//__________________________________________________
199TClonesArray * AliAnaBaseClass::GetAODEMCAL() const {
200 //Get list of emcal caloclusters from reader
201
202 return fReader->GetAODEMCAL();
203
204}
205
206//__________________________________________________
207TNamed * AliAnaBaseClass::GetPHOSCells() const {
208 //Get list of PHOS calo cells (ESD or AOD) from reader
209
210 return fReader->GetPHOSCells();
211
212}
213
214
215//__________________________________________________
216TNamed * AliAnaBaseClass::GetEMCALCells() const {
217 //Get list of emcal calo cells (ESD or AOD) from reader
218
219 return fReader->GetEMCALCells();
220
221}
222
223//__________________________________________________
224AliStack * AliAnaBaseClass::GetMCStack() const {
225 //Get stack pointer from reader
226
227 return fReader->GetStack();
228
229}
230//__________________________________________________
231AliHeader * AliAnaBaseClass::GetMCHeader() const {
232 //Get header pointer from reader
233
234 return fReader->GetHeader();
235
236}
237
238//__________________________________________________
239AliGenEventHeader * AliAnaBaseClass::GetMCGenEventHeader() const {
240 //Get GenEventHeader pointer from reader
241
242 return fReader->GetGenEventHeader();
243
244}
245
246
247void AliAnaBaseClass::InitParameters()
248{
249 //Initialize the parameters of the analysis.
250 fDataMC = kFALSE;
251 fDebug = -1;
252 fCheckCaloPID = kTRUE ;
253 fCheckFidCut = kFALSE ;
254 fRecalculateCaloPID = kFALSE ;
255 fMinPt = 2. ; //Min pt in particle analysis
256 fMaxPt = 300. ; //Max pt in particle analysis
257
258 fCaloPID = new AliCaloPID ;
259 fFidCut = new AliFidutialCut;
260 fIC = new AliIsolationCut;
261 fNMS = new AliNeutralMesonSelection;
262
263}
264