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), fReader(0x0),
54 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),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)
82 //_________________________________________________________________________
83 AliAnaBaseClass & AliAnaBaseClass::operator = (const AliAnaBaseClass & abc)
85 // assignment operator
87 if(this == &abc) return *this;
88 ((TObject *)this)->operator=(abc);
90 fDataMC = abc.fDataMC;
92 fRecalculateCaloPID = abc.fRecalculateCaloPID ;
93 fCheckCaloPID = abc. fCheckCaloPID ;
94 fCheckFidCut = abc.fCheckFidCut ;
96 fReader = abc.fReader ;
98 fAODBranch = new TClonesArray(*abc.fAODBranch) ;
99 fAODCaloClusters = new TClonesArray(*abc.fAODCaloClusters) ;
100 fAODCaloCells = new AliAODCaloCells(*abc.fAODCaloCells) ;
102 fCaloPID = abc.fCaloPID;
103 fFidCut = abc.fFidCut;
111 //____________________________________________________________________________
112 AliAnaBaseClass::~AliAnaBaseClass()
114 // Remove all pointers except analysis output pointers.
117 fAODBranch->Clear() ;
121 if(fAODCaloClusters){
122 fAODCaloClusters->Clear() ;
123 delete fAODCaloClusters ;
127 fAODCaloCells->Clear() ;
128 delete fAODCaloCells ;
131 if(fReader) delete fReader ;
132 if(fCaloPID) delete fCaloPID ;
133 if(fFidCut) delete fFidCut ;
135 if(fNMS) delete fNMS ;
139 //____________________________________________________________________________
140 void AliAnaBaseClass::AddAODCaloCluster(AliAODCaloCluster calo) {
141 //Put AOD calo cluster in the CaloClusters array
143 Int_t i = fAODCaloClusters->GetEntries();
144 new((*fAODCaloClusters)[i]) AliAODCaloCluster(calo);
148 //____________________________________________________________________________
149 void AliAnaBaseClass::AddAODParticleCorrelation(AliAODParticleCorrelation pc) {
150 //Put AOD calo cluster in the AODParticleCorrelation array
152 Int_t i = fAODBranch->GetEntries();
153 new((*fAODBranch)[i]) AliAODParticleCorrelation(pc);
157 //___________________________________________________
158 void AliAnaBaseClass::ConnectAODCaloClusters() {
159 //Recover the list of AODCaloClusters
161 fAODCaloClusters = fReader->GetAOD()->GetCaloClusters();
165 //___________________________________________________
166 void AliAnaBaseClass::ConnectAODPHOSCells() {
167 //Recover the list of PHOS AODCaloCells
169 fAODCaloCells = fReader->GetAOD()->GetPHOSCells();
173 //___________________________________________________
174 void AliAnaBaseClass::ConnectAODEMCALCells() {
175 //Recover the list of EMCAL AODCaloCells
177 fAODCaloCells = fReader->GetAOD()->GetEMCALCells();
181 //__________________________________________________
182 TClonesArray * AliAnaBaseClass::GetAODCTS() const {
183 //Get list of tracks from reader
185 return fReader->GetAODCTS();
189 //__________________________________________________
190 TClonesArray * AliAnaBaseClass::GetAODPHOS() const {
191 //Get list of PHOS calo clusters from reader
193 return fReader->GetAODPHOS();
198 //__________________________________________________
199 TClonesArray * AliAnaBaseClass::GetAODEMCAL() const {
200 //Get list of emcal caloclusters from reader
202 return fReader->GetAODEMCAL();
206 //__________________________________________________
207 TNamed * AliAnaBaseClass::GetPHOSCells() const {
208 //Get list of PHOS calo cells (ESD or AOD) from reader
210 return fReader->GetPHOSCells();
215 //__________________________________________________
216 TNamed * AliAnaBaseClass::GetEMCALCells() const {
217 //Get list of emcal calo cells (ESD or AOD) from reader
219 return fReader->GetEMCALCells();
223 //__________________________________________________
224 AliStack * AliAnaBaseClass::GetMCStack() const {
225 //Get stack pointer from reader
227 return fReader->GetStack();
230 //__________________________________________________
231 AliHeader * AliAnaBaseClass::GetMCHeader() const {
232 //Get header pointer from reader
234 return fReader->GetHeader();
238 //__________________________________________________
239 AliGenEventHeader * AliAnaBaseClass::GetMCGenEventHeader() const {
240 //Get GenEventHeader pointer from reader
242 return fReader->GetGenEventHeader();
247 void AliAnaBaseClass::InitParameters()
249 //Initialize the parameters of the analysis.
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
258 fCaloPID = new AliCaloPID ;
259 fFidCut = new AliFidutialCut;
260 fIC = new AliIsolationCut;
261 fNMS = new AliNeutralMesonSelection;