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