1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *GetEntriesFast(
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 **************************************************************************/
17 //_________________________________________________________________________
18 // Base class for analysis algorithms
19 //-- Author: Gustavo Conesa (LNF-INFN)
20 //_________________________________________________________________________
23 // --- ROOT system ---
24 #include <TClonesArray.h>
25 #include <Riostream.h>
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"
38 // #include "AliStack.h"
39 // #include "AliHeader.h"
40 // #include "AliGenEventHeader.h"
42 ClassImp(AliAnaPartCorrBaseClass)
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)
54 fReader = new AliCaloTrackReader();
55 fCaloPID = new AliCaloPID();
56 fFidCut = new AliFidutialCut();
57 fIC = new AliIsolationCut();
59 //Initialize parameters
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)
78 //_________________________________________________________________________
79 AliAnaPartCorrBaseClass & AliAnaPartCorrBaseClass::operator = (const AliAnaPartCorrBaseClass & abc)
81 // assignment operator
83 if(this == &abc) return *this;
84 ((TObject *)this)->operator=(abc);
86 fDataMC = abc.fDataMC;
88 fRecalculateCaloPID = abc.fRecalculateCaloPID ;
89 fCheckCaloPID = abc. fCheckCaloPID ;
90 fCheckFidCut = abc.fCheckFidCut ;
92 fReader = abc.fReader ;
94 fAODBranch = new TClonesArray(*abc.fAODBranch) ;
95 fAODCaloClusters = new TClonesArray(*abc.fAODCaloClusters) ;
96 fAODCaloCells = new AliAODCaloCells(*abc.fAODCaloCells) ;
101 fCaloPID = abc.fCaloPID;
102 fFidCut = abc.fFidCut;
110 //____________________________________________________________________________
111 AliAnaPartCorrBaseClass::~AliAnaPartCorrBaseClass()
113 // Remove all pointers except analysis output pointers.
116 fAODBranch->Clear() ;
120 if(fAODCaloClusters){
121 fAODCaloClusters->Clear() ;
122 delete fAODCaloClusters ;
126 fAODCaloCells->Clear() ;
127 delete fAODCaloCells ;
130 if(fReader) delete fReader ;
131 if(fCaloPID) delete fCaloPID ;
132 if(fFidCut) delete fFidCut ;
134 if(fNMS) delete fNMS ;
138 //____________________________________________________________________________
139 void AliAnaPartCorrBaseClass::AddAODCaloCluster(AliAODCaloCluster calo) {
140 //Put AOD calo cluster in the CaloClusters array
142 Int_t i = fAODCaloClusters->GetEntriesFast();
143 new((*fAODCaloClusters)[i]) AliAODCaloCluster(calo);
147 //____________________________________________________________________________
148 void AliAnaPartCorrBaseClass::AddAODParticleCorrelation(AliAODParticleCorrelation pc) {
149 //Put AOD calo cluster in the AODParticleCorrelation array
151 Int_t i = fAODBranch->GetEntriesFast();
152 new((*fAODBranch)[i]) AliAODParticleCorrelation(pc);
156 //___________________________________________________
157 void AliAnaPartCorrBaseClass::ConnectAODCaloClusters() {
158 //Recover the list of AODCaloClusters
160 fAODCaloClusters = fReader->GetAOD()->GetCaloClusters();
164 //___________________________________________________
165 void AliAnaPartCorrBaseClass::ConnectAODPHOSCells() {
166 //Recover the list of PHOS AODCaloCells
168 fAODCaloCells = fReader->GetAOD()->GetPHOSCells();
172 //___________________________________________________
173 void AliAnaPartCorrBaseClass::ConnectAODEMCALCells() {
174 //Recover the list of EMCAL AODCaloCells
176 fAODCaloCells = fReader->GetAOD()->GetEMCALCells();
180 //__________________________________________________
181 TClonesArray * AliAnaPartCorrBaseClass::GetAODCTS() const {
182 //Get list of tracks from reader
184 return fReader->GetAODCTS();
188 //__________________________________________________
189 TClonesArray * AliAnaPartCorrBaseClass::GetAODPHOS() const {
190 //Get list of PHOS calo clusters from reader
192 return fReader->GetAODPHOS();
197 //__________________________________________________
198 TClonesArray * AliAnaPartCorrBaseClass::GetAODEMCAL() const {
199 //Get list of emcal caloclusters from reader
201 return fReader->GetAODEMCAL();
205 //__________________________________________________
206 TNamed * AliAnaPartCorrBaseClass::GetPHOSCells() const {
207 //Get list of PHOS calo cells (ESD or AOD) from reader
209 return fReader->GetPHOSCells();
214 //__________________________________________________
215 TNamed * AliAnaPartCorrBaseClass::GetEMCALCells() const {
216 //Get list of emcal calo cells (ESD or AOD) from reader
218 return fReader->GetEMCALCells();
222 //__________________________________________________
223 AliStack * AliAnaPartCorrBaseClass::GetMCStack() const {
224 //Get stack pointer from reader
226 return fReader->GetStack();
229 //__________________________________________________
230 AliHeader * AliAnaPartCorrBaseClass::GetMCHeader() const {
231 //Get header pointer from reader
233 return fReader->GetHeader();
237 //__________________________________________________
238 AliGenEventHeader * AliAnaPartCorrBaseClass::GetMCGenEventHeader() const {
239 //Get GenEventHeader pointer from reader
241 return fReader->GetGenEventHeader();
246 void AliAnaPartCorrBaseClass::InitParameters()
248 //Initialize the parameters of the analysis.
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
257 fCaloPID = new AliCaloPID ;
258 fFidCut = new AliFidutialCut;
259 fIC = new AliIsolationCut;
260 fNMS = new AliNeutralMesonSelection;