]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/AliAnaPartCorrBaseClass.cxx
bugfix: correctly handle steering events in order to avoid warning 'Data source compo...
[u/mrichter/AliRoot.git] / PWG4 / AliAnaPartCorrBaseClass.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 * *
76518957 7 * Permission to use, copy, modify and distribute this software and its *GetEntriesFast(
d92b41ad 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
d92b41ad 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"
c90ac396 32#include "AliAnaPartCorrBaseClass.h"
d92b41ad 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
c90ac396 42ClassImp(AliAnaPartCorrBaseClass)
d92b41ad 43
44
45//_______________________________________________
c90ac396 46 AliAnaPartCorrBaseClass::AliAnaPartCorrBaseClass() :
d92b41ad 47 TObject(), fDataMC(0), fDebug(0), fCheckFidCut(0),
2cc4014d 48 fCheckCaloPID(0), fRecalculateCaloPID(0), fMinPt(0), fMaxPt(0),
49 fReader(0x0), fAODBranch(0x0), fAODCaloClusters(0x0), fAODCaloCells(0x0),
d92b41ad 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//___________________________________________________________
c90ac396 64AliAnaPartCorrBaseClass::AliAnaPartCorrBaseClass(const AliAnaPartCorrBaseClass & abc) :
d92b41ad 65 TObject(), fDataMC(abc.fDataMC), fDebug(abc.fDebug),
66 fCheckFidCut(abc.fCheckFidCut), fCheckCaloPID(abc. fCheckCaloPID),
2cc4014d 67 fRecalculateCaloPID(abc.fRecalculateCaloPID),
68 fMinPt(abc.fMinPt), fMaxPt(abc.fMaxPt), fReader(abc.fReader),
d92b41ad 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//_________________________________________________________________________
c90ac396 79AliAnaPartCorrBaseClass & AliAnaPartCorrBaseClass::operator = (const AliAnaPartCorrBaseClass & abc)
d92b41ad 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
2cc4014d 98 fMinPt = abc.fMinPt;
99 fMaxPt = abc.fMaxPt;
100
d92b41ad 101 fCaloPID = abc.fCaloPID;
102 fFidCut = abc.fFidCut;
103 fIC = abc.fIC;
104 fNMS = abc.fNMS;
105
106 return *this;
107
108}
109
110//____________________________________________________________________________
c90ac396 111AliAnaPartCorrBaseClass::~AliAnaPartCorrBaseClass()
d92b41ad 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//____________________________________________________________________________
c90ac396 139void AliAnaPartCorrBaseClass::AddAODCaloCluster(AliAODCaloCluster calo) {
d92b41ad 140 //Put AOD calo cluster in the CaloClusters array
141
76518957 142 Int_t i = fAODCaloClusters->GetEntriesFast();
d92b41ad 143 new((*fAODCaloClusters)[i]) AliAODCaloCluster(calo);
144
145}
146
147//____________________________________________________________________________
c90ac396 148void AliAnaPartCorrBaseClass::AddAODParticleCorrelation(AliAODParticleCorrelation pc) {
d92b41ad 149 //Put AOD calo cluster in the AODParticleCorrelation array
150
76518957 151 Int_t i = fAODBranch->GetEntriesFast();
d92b41ad 152 new((*fAODBranch)[i]) AliAODParticleCorrelation(pc);
153
154}
155
156//___________________________________________________
c90ac396 157void AliAnaPartCorrBaseClass::ConnectAODCaloClusters() {
d92b41ad 158 //Recover the list of AODCaloClusters
159
160 fAODCaloClusters = fReader->GetAOD()->GetCaloClusters();
161
162}
163
164//___________________________________________________
c90ac396 165void AliAnaPartCorrBaseClass::ConnectAODPHOSCells() {
d92b41ad 166 //Recover the list of PHOS AODCaloCells
167
168 fAODCaloCells = fReader->GetAOD()->GetPHOSCells();
169
170}
171
172//___________________________________________________
c90ac396 173void AliAnaPartCorrBaseClass::ConnectAODEMCALCells() {
d92b41ad 174 //Recover the list of EMCAL AODCaloCells
175
176 fAODCaloCells = fReader->GetAOD()->GetEMCALCells();
177
178}
179
180//__________________________________________________
c90ac396 181TClonesArray * AliAnaPartCorrBaseClass::GetAODCTS() const {
d92b41ad 182 //Get list of tracks from reader
183
184 return fReader->GetAODCTS();
185
186}
187
188//__________________________________________________
c90ac396 189TClonesArray * AliAnaPartCorrBaseClass::GetAODPHOS() const {
d92b41ad 190 //Get list of PHOS calo clusters from reader
191
192 return fReader->GetAODPHOS();
193
194}
195
196
197//__________________________________________________
c90ac396 198TClonesArray * AliAnaPartCorrBaseClass::GetAODEMCAL() const {
d92b41ad 199 //Get list of emcal caloclusters from reader
200
201 return fReader->GetAODEMCAL();
202
203}
204
205//__________________________________________________
c90ac396 206TNamed * AliAnaPartCorrBaseClass::GetPHOSCells() const {
d92b41ad 207 //Get list of PHOS calo cells (ESD or AOD) from reader
208
209 return fReader->GetPHOSCells();
210
211}
212
213
214//__________________________________________________
c90ac396 215TNamed * AliAnaPartCorrBaseClass::GetEMCALCells() const {
d92b41ad 216 //Get list of emcal calo cells (ESD or AOD) from reader
217
218 return fReader->GetEMCALCells();
219
220}
221
222//__________________________________________________
c90ac396 223AliStack * AliAnaPartCorrBaseClass::GetMCStack() const {
d92b41ad 224 //Get stack pointer from reader
225
226 return fReader->GetStack();
227
228}
229//__________________________________________________
c90ac396 230AliHeader * AliAnaPartCorrBaseClass::GetMCHeader() const {
d92b41ad 231 //Get header pointer from reader
232
233 return fReader->GetHeader();
234
235}
236
237//__________________________________________________
c90ac396 238AliGenEventHeader * AliAnaPartCorrBaseClass::GetMCGenEventHeader() const {
d92b41ad 239 //Get GenEventHeader pointer from reader
240
241 return fReader->GetGenEventHeader();
242
243}
244
245
c90ac396 246void AliAnaPartCorrBaseClass::InitParameters()
d92b41ad 247{
248 //Initialize the parameters of the analysis.
249 fDataMC = kFALSE;
250 fDebug = -1;
251 fCheckCaloPID = kTRUE ;
252 fCheckFidCut = kFALSE ;
253 fRecalculateCaloPID = kFALSE ;
c90ac396 254 fMinPt = 0.2 ; //Min pt in particle analysis
d92b41ad 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