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 *
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 /* History of cvs commits:
22 //_________________________________________________________________________
23 // Base class for analysis algorithms
24 //-- Author: Gustavo Conesa (LNF-INFN)
25 //_________________________________________________________________________
28 // --- ROOT system ---
29 #include <TClonesArray.h>
30 #include <Riostream.h>
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"
43 // #include "AliStack.h"
44 // #include "AliHeader.h"
45 // #include "AliGenEventHeader.h"
47 ClassImp(AliAnaBaseClass)
50 //_______________________________________________
51 AliAnaBaseClass::AliAnaBaseClass() :
52 TObject(), fDataMC(0), fDebug(0), fCheckFidCut(0),
53 fCheckCaloPID(0), fRecalculateCaloPID(0), fMinPt(0), fMaxPt(0),
54 fReader(0x0), fAODBranch(0x0), fAODCaloClusters(0x0), fAODCaloCells(0x0),
55 fCaloPID(0x0), fFidCut(0x0), fIC(0x0),fNMS(0x0)
59 fReader = new AliCaloTrackReader();
60 fCaloPID = new AliCaloPID();
61 fFidCut = new AliFidutialCut();
62 fIC = new AliIsolationCut();
64 //Initialize parameters
68 //___________________________________________________________
69 AliAnaBaseClass::AliAnaBaseClass(const AliAnaBaseClass & abc) :
70 TObject(), fDataMC(abc.fDataMC), fDebug(abc.fDebug),
71 fCheckFidCut(abc.fCheckFidCut), fCheckCaloPID(abc. fCheckCaloPID),
72 fRecalculateCaloPID(abc.fRecalculateCaloPID),
73 fMinPt(abc.fMinPt), fMaxPt(abc.fMaxPt), fReader(abc.fReader),
74 fAODBranch(new TClonesArray(*abc.fAODBranch)),
75 fAODCaloClusters(new TClonesArray(*abc.fAODCaloClusters)),
76 fAODCaloCells(new AliAODCaloCells(*abc.fAODCaloCells)),
77 fCaloPID(abc.fCaloPID), fFidCut(abc.fFidCut), fIC(abc.fIC),fNMS(abc.fNMS)
83 //_________________________________________________________________________
84 AliAnaBaseClass & AliAnaBaseClass::operator = (const AliAnaBaseClass & abc)
86 // assignment operator
88 if(this == &abc) return *this;
89 ((TObject *)this)->operator=(abc);
91 fDataMC = abc.fDataMC;
93 fRecalculateCaloPID = abc.fRecalculateCaloPID ;
94 fCheckCaloPID = abc. fCheckCaloPID ;
95 fCheckFidCut = abc.fCheckFidCut ;
97 fReader = abc.fReader ;
99 fAODBranch = new TClonesArray(*abc.fAODBranch) ;
100 fAODCaloClusters = new TClonesArray(*abc.fAODCaloClusters) ;
101 fAODCaloCells = new AliAODCaloCells(*abc.fAODCaloCells) ;
106 fCaloPID = abc.fCaloPID;
107 fFidCut = abc.fFidCut;
115 //____________________________________________________________________________
116 AliAnaBaseClass::~AliAnaBaseClass()
118 // Remove all pointers except analysis output pointers.
121 fAODBranch->Clear() ;
125 if(fAODCaloClusters){
126 fAODCaloClusters->Clear() ;
127 delete fAODCaloClusters ;
131 fAODCaloCells->Clear() ;
132 delete fAODCaloCells ;
135 if(fReader) delete fReader ;
136 if(fCaloPID) delete fCaloPID ;
137 if(fFidCut) delete fFidCut ;
139 if(fNMS) delete fNMS ;
143 //____________________________________________________________________________
144 void AliAnaBaseClass::AddAODCaloCluster(AliAODCaloCluster calo) {
145 //Put AOD calo cluster in the CaloClusters array
147 Int_t i = fAODCaloClusters->GetEntries();
148 new((*fAODCaloClusters)[i]) AliAODCaloCluster(calo);
152 //____________________________________________________________________________
153 void AliAnaBaseClass::AddAODParticleCorrelation(AliAODParticleCorrelation pc) {
154 //Put AOD calo cluster in the AODParticleCorrelation array
156 Int_t i = fAODBranch->GetEntries();
157 new((*fAODBranch)[i]) AliAODParticleCorrelation(pc);
161 //___________________________________________________
162 void AliAnaBaseClass::ConnectAODCaloClusters() {
163 //Recover the list of AODCaloClusters
165 fAODCaloClusters = fReader->GetAOD()->GetCaloClusters();
169 //___________________________________________________
170 void AliAnaBaseClass::ConnectAODPHOSCells() {
171 //Recover the list of PHOS AODCaloCells
173 fAODCaloCells = fReader->GetAOD()->GetPHOSCells();
177 //___________________________________________________
178 void AliAnaBaseClass::ConnectAODEMCALCells() {
179 //Recover the list of EMCAL AODCaloCells
181 fAODCaloCells = fReader->GetAOD()->GetEMCALCells();
185 //__________________________________________________
186 TClonesArray * AliAnaBaseClass::GetAODCTS() const {
187 //Get list of tracks from reader
189 return fReader->GetAODCTS();
193 //__________________________________________________
194 TClonesArray * AliAnaBaseClass::GetAODPHOS() const {
195 //Get list of PHOS calo clusters from reader
197 return fReader->GetAODPHOS();
202 //__________________________________________________
203 TClonesArray * AliAnaBaseClass::GetAODEMCAL() const {
204 //Get list of emcal caloclusters from reader
206 return fReader->GetAODEMCAL();
210 //__________________________________________________
211 TNamed * AliAnaBaseClass::GetPHOSCells() const {
212 //Get list of PHOS calo cells (ESD or AOD) from reader
214 return fReader->GetPHOSCells();
219 //__________________________________________________
220 TNamed * AliAnaBaseClass::GetEMCALCells() const {
221 //Get list of emcal calo cells (ESD or AOD) from reader
223 return fReader->GetEMCALCells();
227 //__________________________________________________
228 AliStack * AliAnaBaseClass::GetMCStack() const {
229 //Get stack pointer from reader
231 return fReader->GetStack();
234 //__________________________________________________
235 AliHeader * AliAnaBaseClass::GetMCHeader() const {
236 //Get header pointer from reader
238 return fReader->GetHeader();
242 //__________________________________________________
243 AliGenEventHeader * AliAnaBaseClass::GetMCGenEventHeader() const {
244 //Get GenEventHeader pointer from reader
246 return fReader->GetGenEventHeader();
251 void AliAnaBaseClass::InitParameters()
253 //Initialize the parameters of the analysis.
256 fCheckCaloPID = kTRUE ;
257 fCheckFidCut = kFALSE ;
258 fRecalculateCaloPID = kFALSE ;
259 fMinPt = 2. ; //Min pt in particle analysis
260 fMaxPt = 300. ; //Max pt in particle analysis
262 fCaloPID = new AliCaloPID ;
263 fFidCut = new AliFidutialCut;
264 fIC = new AliIsolationCut;
265 fNMS = new AliNeutralMesonSelection;