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 **************************************************************************/
18 //_________________________________________________________________________
20 //*-- Yves Schutz (SUBATECH)
21 // Reconstruction class. Redesigned from the old AliReconstructionner class and
22 // derived from STEER/AliReconstructor.
24 // --- ROOT system ---
26 // --- Standard library ---
28 // --- AliRoot header files ---
30 #include "AliEMCALReconstructor.h"
31 #include "AliEMCALClusterizerv1.h"
32 #include "AliEMCALPIDv1.h"
33 #include "AliEMCALGetter.h"
34 #include "AliEMCALTracker.h"
35 #include "AliRawReaderFile.h"
37 ClassImp(AliEMCALReconstructor)
39 //____________________________________________________________________________
40 AliEMCALReconstructor::AliEMCALReconstructor() : fDebug(kFALSE)
47 //____________________________________________________________________________
48 AliEMCALReconstructor::~AliEMCALReconstructor()
53 //____________________________________________________________________________
54 void AliEMCALReconstructor::Reconstruct(AliRunLoader* runLoader) const
56 // method called by AliReconstruction;
57 // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
58 // segment maker needs access to the AliESD object to retrieve the tracks reconstructed by
59 // the global tracking.
61 TString headerFile(runLoader->GetFileName()) ;
62 TString branchName(runLoader->GetEventFolder()->GetName() ) ;
64 AliEMCALClusterizerv1 clu(headerFile, branchName);
65 clu.SetEventRange(0, -1) ; // do all the events
67 clu.ExecuteTask("deb all") ;
73 //____________________________________________________________________________
74 void AliEMCALReconstructor::Reconstruct(AliRunLoader* runLoader, AliRawReaderFile* rawreader) const
76 // method called by AliReconstruction;
77 // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
78 // segment maker needs access to the AliESD object to retrieve the tracks reconstructed by
79 // the global tracking.
80 // Here we reconstruct from Raw Data
83 TString headerFile(runLoader->GetFileName()) ;
84 TString branchName(runLoader->GetEventFolder()->GetName()) ;
86 AliEMCALClusterizerv1 clu(headerFile, branchName);
87 clu.SetEventRange(0, -1) ; // do all the events
89 clu.ExecuteTask("deb all") ;
95 //____________________________________________________________________________
96 void AliEMCALReconstructor::FillESD(AliRunLoader* runLoader, AliESD* esd) const
98 // Called by AliReconstruct after Reconstruct() and global tracking and vertxing
99 //Creates the tracksegments and Recparticles
101 Int_t eventNumber = runLoader->GetEventNumber() ;
103 // Creates AliESDtrack from AliEMCALRecParticles
104 AliEMCALGetter::Instance()->Event(eventNumber, "P") ;
105 TClonesArray *recParticles = AliEMCALGetter::Instance()->RecParticles();
106 Int_t nOfRecParticles = recParticles->GetEntries();
107 esd->SetNumberOfEMCALParticles(nOfRecParticles) ;
108 esd->SetFirstEMCALParticle(esd->GetNumberOfTracks()) ;
109 for (Int_t recpart = 0 ; recpart < nOfRecParticles ; recpart++) {
110 AliEMCALRecParticle * rp = dynamic_cast<AliEMCALRecParticle*>(recParticles->At(recpart));
113 AliESDtrack * et = new AliESDtrack() ;
114 // fills the ESDtrack
116 for (Int_t ixyz=0; ixyz<3; ixyz++)
117 xyz[ixyz] = rp->GetPos()[ixyz];
118 et->SetEMCALposition(xyz) ;
119 et->SetEMCALsignal (rp->Energy()) ;
120 et->SetEMCALpid (rp->GetPID()) ;
121 // add the track to the esd object
127 AliTracker* AliEMCALReconstructor::CreateTracker(AliRunLoader* runLoader) const
129 // creates the EMCAL tracker
130 if (!runLoader) return NULL;
131 return new AliEMCALTracker(runLoader);