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:
24 //_________________________________________________________________________
25 // Base class for reading data: MonteCarlo, ESD or AOD, of PHOS EMCAL and
26 // Central Barrel Tracking detectors (CTS).
27 // Not all MC particles/tracks/clusters are kept, some kinematical/fidutial restrictions are done.
28 // Mother class of : AliCaloTrackESDReader: Fills ESD data in 3 TClonesArrays (PHOS, EMCAL, CTS)
29 // : AliCaloTrackMCReader: Fills Kinematics data in 3 TClonesArrays (PHOS, EMCAL, CTS)
30 // : AliCaloTrackAODReader: Fills AOD data in 3 TClonesArrays (PHOS, EMCAL, CTS)
32 //-- Author: Gustavo Conesa (LNF-INFN)
33 //////////////////////////////////////////////////////////////////////////////
36 // --- ROOT system ---
38 #include <TLorentzVector.h>
41 //---- ANALYSIS system ----
42 #include "AliCaloTrackReader.h"
45 #include "AliHeader.h"
46 #include "AliGenEventHeader.h"
48 ClassImp(AliCaloTrackReader)
51 //____________________________________________________________________________
52 AliCaloTrackReader::AliCaloTrackReader() :
53 TObject(), fDataType(0), fDebug(0), fFidutialCut(0x0),
54 fCTSPtMin(0), fEMCALPtMin(0),fPHOSPtMin(0),
55 fAODCTS(0x0), fAODEMCAL(0x0), fAODPHOS(0x0),
56 fEMCALCells(0x0), fPHOSCells(0x0),
57 fESD(0x0), fAOD(0x0),fMC(0x0),
58 fFillCTS(0),fFillEMCAL(0),fFillPHOS(0),
59 fFillEMCALCells(0),fFillPHOSCells(0)
63 //Initialize parameters
67 //____________________________________________________________________________
68 AliCaloTrackReader::AliCaloTrackReader(const AliCaloTrackReader & g) :
69 TObject(g), fDataType(g.fDataType), fDebug(g.fDebug),fFidutialCut(g.fFidutialCut),
70 fCTSPtMin(g.fCTSPtMin), fEMCALPtMin(g.fEMCALPtMin),fPHOSPtMin(g.fPHOSPtMin),
71 fAODCTS(new TClonesArray(*g.fAODCTS)),
72 fAODEMCAL(new TClonesArray(*g.fAODEMCAL)),
73 fAODPHOS(new TClonesArray(*g.fAODPHOS)),
74 fEMCALCells(new TNamed(*g.fEMCALCells)),
75 fPHOSCells(new TNamed(*g.fPHOSCells)),
76 fESD(g.fESD), fAOD(g.fAOD), fMC(g.fMC),
77 fFillCTS(g.fFillCTS),fFillEMCAL(g.fFillEMCAL),fFillPHOS(g.fFillPHOS),
78 fFillEMCALCells(g.fFillEMCALCells),fFillPHOSCells(g.fFillPHOSCells)
84 //_________________________________________________________________________
85 AliCaloTrackReader & AliCaloTrackReader::operator = (const AliCaloTrackReader & source)
87 // assignment operator
89 if(&source == this) return *this;
91 fDataType = source.fDataType ;
92 fDebug = source.fDebug ;
94 fFidutialCut = source.fFidutialCut;
96 fCTSPtMin = source.fCTSPtMin ;
97 fEMCALPtMin = source.fEMCALPtMin ;
98 fPHOSPtMin = source.fPHOSPtMin ;
100 fAODCTS = new TClonesArray(*source.fAODCTS) ;
101 fAODEMCAL = new TClonesArray(*source.fAODEMCAL) ;
102 fAODPHOS = new TClonesArray(*source.fAODPHOS) ;
103 fEMCALCells = new TNamed(*source.fEMCALCells) ;
104 fPHOSCells = new TNamed(*source.fPHOSCells) ;
110 fFillCTS = source.fFillCTS;
111 fFillEMCAL = source.fFillEMCAL;
112 fFillPHOS = source.fFillPHOS;
113 fFillEMCALCells = source.fFillEMCALCells;
114 fFillPHOSCells = source.fFillPHOSCells;
120 //_________________________________
121 AliCaloTrackReader::~AliCaloTrackReader() {
124 if(fFidutialCut) delete fFidutialCut ;
142 fEMCALCells->Clear() ;
147 fPHOSCells->Clear() ;
151 if(fESD) delete fESD ;
152 if(fAOD) delete fAOD ;
156 //____________________________________________________________________________
157 AliStack* AliCaloTrackReader::GetStack() const {
158 //Return pointer to stack
162 printf("stack is not available");
167 //____________________________________________________________________________
168 AliHeader* AliCaloTrackReader::GetHeader() const {
169 //Return pointer to header
171 return fMC->Header();
173 printf("header is not available");
177 //____________________________________________________________________________
178 AliGenEventHeader* AliCaloTrackReader::GetGenEventHeader() const {
179 //Return pointer to Generated event header
181 return fMC->GenEventHeader();
183 printf("GenEventHeader is not available");
188 //_______________________________________________________________
189 void AliCaloTrackReader::InitParameters()
192 //Initialize the parameters of the analysis.
202 fFillEMCALCells = kFALSE;
203 fFillPHOSCells = kFALSE;
205 fFidutialCut = new AliFidutialCut();
210 //________________________________________________________________
211 void AliCaloTrackReader::Print(const Option_t * opt) const
214 //Print some relevant parameters set for the analysis
218 printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
219 printf("Data type : %d\n", fDataType) ;
220 printf("CTS Min pT : %2.1f GeV/c\n", fCTSPtMin) ;
221 printf("EMCAL Min pT : %2.1f GeV/c\n", fEMCALPtMin) ;
222 printf("PHOS Min pT : %2.1f GeV/c\n", fPHOSPtMin) ;
223 printf("Use CTS = %d\n", fFillCTS) ;
224 printf("Use EMCAL = %d\n", fFillEMCAL) ;
225 printf("Use PHOS = %d\n", fFillPHOS) ;
226 printf("Use EMCAL Cells = %d\n", fFillEMCALCells) ;
227 printf("Use PHOS Cells = %d\n", fFillPHOSCells) ;
231 //___________________________________________________
232 void AliCaloTrackReader::FillInputEvent() {
233 //Fill the input lists that are needed, called by the analysis maker.
235 if(fFillCTS) FillInputCTS();
236 if(fFillEMCAL) FillInputEMCAL();
237 if(fFillPHOS) FillInputPHOS();
238 if(fFillEMCALCells) FillInputEMCALCells();
239 if(fFillPHOSCells) FillInputPHOSCells();
243 //__________________________________________________
244 void AliCaloTrackReader::ResetLists() {
245 // Reset lists, called by the analysis maker
247 if(fAODCTS) fAODCTS -> Clear();
248 if(fAODEMCAL) fAODEMCAL -> Clear();
249 if(fAODPHOS) fAODPHOS -> Clear();
250 if(fEMCALCells) fEMCALCells -> Clear();
251 if(fPHOSCells) fPHOSCells -> Clear();