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 //_________________________________________________________________________
18 // Base class for reading data: MonteCarlo, ESD or AOD, of PHOS EMCAL and
19 // Central Barrel Tracking detectors (CTS).
20 // Not all MC particles/tracks/clusters are kept, some kinematical/fidutial restrictions are done.
21 // Mother class of : AliCaloTrackESDReader: Fills ESD data in 3 TClonesArrays (PHOS, EMCAL, CTS)
22 // : AliCaloTrackMCReader: Fills Kinematics data in 3 TClonesArrays (PHOS, EMCAL, CTS)
23 // : AliCaloTrackAODReader: Fills AOD data in 3 TClonesArrays (PHOS, EMCAL, CTS)
25 //-- Author: Gustavo Conesa (LNF-INFN)
26 //////////////////////////////////////////////////////////////////////////////
29 // --- ROOT system ---
31 #include <TLorentzVector.h>
34 //---- ANALYSIS system ----
35 #include "AliCaloTrackReader.h"
38 #include "AliHeader.h"
39 #include "AliGenEventHeader.h"
41 ClassImp(AliCaloTrackReader)
44 //____________________________________________________________________________
45 AliCaloTrackReader::AliCaloTrackReader() :
46 TObject(), fDataType(0), fDebug(0), fFidutialCut(0x0),
47 fCTSPtMin(0), fEMCALPtMin(0),fPHOSPtMin(0),
48 fAODCTS(0x0), fAODEMCAL(0x0), fAODPHOS(0x0),
49 fEMCALCells(0x0), fPHOSCells(0x0),
50 fESD(0x0), fAOD(0x0),fMC(0x0),
51 fFillCTS(0),fFillEMCAL(0),fFillPHOS(0),
52 fFillEMCALCells(0),fFillPHOSCells(0)
56 //Initialize parameters
60 //____________________________________________________________________________
61 AliCaloTrackReader::AliCaloTrackReader(const AliCaloTrackReader & g) :
62 TObject(g), fDataType(g.fDataType), fDebug(g.fDebug),fFidutialCut(g.fFidutialCut),
63 fCTSPtMin(g.fCTSPtMin), fEMCALPtMin(g.fEMCALPtMin),fPHOSPtMin(g.fPHOSPtMin),
64 fAODCTS(new TClonesArray(*g.fAODCTS)),
65 fAODEMCAL(new TClonesArray(*g.fAODEMCAL)),
66 fAODPHOS(new TClonesArray(*g.fAODPHOS)),
67 fEMCALCells(new TNamed(*g.fEMCALCells)),
68 fPHOSCells(new TNamed(*g.fPHOSCells)),
69 fESD(g.fESD), fAOD(g.fAOD), fMC(g.fMC),
70 fFillCTS(g.fFillCTS),fFillEMCAL(g.fFillEMCAL),fFillPHOS(g.fFillPHOS),
71 fFillEMCALCells(g.fFillEMCALCells),fFillPHOSCells(g.fFillPHOSCells)
77 //_________________________________________________________________________
78 AliCaloTrackReader & AliCaloTrackReader::operator = (const AliCaloTrackReader & source)
80 // assignment operator
82 if(&source == this) return *this;
84 fDataType = source.fDataType ;
85 fDebug = source.fDebug ;
87 fFidutialCut = source.fFidutialCut;
89 fCTSPtMin = source.fCTSPtMin ;
90 fEMCALPtMin = source.fEMCALPtMin ;
91 fPHOSPtMin = source.fPHOSPtMin ;
93 fAODCTS = new TClonesArray(*source.fAODCTS) ;
94 fAODEMCAL = new TClonesArray(*source.fAODEMCAL) ;
95 fAODPHOS = new TClonesArray(*source.fAODPHOS) ;
96 fEMCALCells = new TNamed(*source.fEMCALCells) ;
97 fPHOSCells = new TNamed(*source.fPHOSCells) ;
103 fFillCTS = source.fFillCTS;
104 fFillEMCAL = source.fFillEMCAL;
105 fFillPHOS = source.fFillPHOS;
106 fFillEMCALCells = source.fFillEMCALCells;
107 fFillPHOSCells = source.fFillPHOSCells;
113 //_________________________________
114 AliCaloTrackReader::~AliCaloTrackReader() {
117 if(fFidutialCut) delete fFidutialCut ;
135 fEMCALCells->Clear() ;
140 fPHOSCells->Clear() ;
144 if(fESD) delete fESD ;
145 if(fAOD) delete fAOD ;
149 //____________________________________________________________________________
150 AliStack* AliCaloTrackReader::GetStack() const {
151 //Return pointer to stack
155 printf("stack is not available");
160 //____________________________________________________________________________
161 AliHeader* AliCaloTrackReader::GetHeader() const {
162 //Return pointer to header
164 return fMC->Header();
166 printf("header is not available");
170 //____________________________________________________________________________
171 AliGenEventHeader* AliCaloTrackReader::GetGenEventHeader() const {
172 //Return pointer to Generated event header
174 return fMC->GenEventHeader();
176 printf("GenEventHeader is not available");
181 //_______________________________________________________________
182 void AliCaloTrackReader::InitParameters()
185 //Initialize the parameters of the analysis.
195 fFillEMCALCells = kFALSE;
196 fFillPHOSCells = kFALSE;
198 fFidutialCut = new AliFidutialCut();
203 //________________________________________________________________
204 void AliCaloTrackReader::Print(const Option_t * opt) const
207 //Print some relevant parameters set for the analysis
211 printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
212 printf("Data type : %d\n", fDataType) ;
213 printf("CTS Min pT : %2.1f GeV/c\n", fCTSPtMin) ;
214 printf("EMCAL Min pT : %2.1f GeV/c\n", fEMCALPtMin) ;
215 printf("PHOS Min pT : %2.1f GeV/c\n", fPHOSPtMin) ;
216 printf("Use CTS = %d\n", fFillCTS) ;
217 printf("Use EMCAL = %d\n", fFillEMCAL) ;
218 printf("Use PHOS = %d\n", fFillPHOS) ;
219 printf("Use EMCAL Cells = %d\n", fFillEMCALCells) ;
220 printf("Use PHOS Cells = %d\n", fFillPHOSCells) ;
224 //___________________________________________________
225 void AliCaloTrackReader::FillInputEvent() {
226 //Fill the input lists that are needed, called by the analysis maker.
228 if(fFillCTS) FillInputCTS();
229 if(fFillEMCAL) FillInputEMCAL();
230 if(fFillPHOS) FillInputPHOS();
231 if(fFillEMCALCells) FillInputEMCALCells();
232 if(fFillPHOSCells) FillInputPHOSCells();
236 //__________________________________________________
237 void AliCaloTrackReader::ResetLists() {
238 // Reset lists, called by the analysis maker
240 if(fAODCTS) fAODCTS -> Clear();
241 if(fAODEMCAL) fAODEMCAL -> Clear();
242 if(fAODPHOS) fAODPHOS -> Clear();
243 if(fEMCALCells) fEMCALCells -> Clear();
244 if(fPHOSCells) fPHOSCells -> Clear();