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 "AliRawReaderFile.h"
36 ClassImp(AliEMCALReconstructor)
38 //____________________________________________________________________________
39 AliEMCALReconstructor::AliEMCALReconstructor() : fDebug(kFALSE)
46 //____________________________________________________________________________
47 AliEMCALReconstructor::~AliEMCALReconstructor()
52 //____________________________________________________________________________
53 void AliEMCALReconstructor::Reconstruct(AliRunLoader* runLoader) const
55 // method called by AliReconstruction;
56 // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
57 // segment maker needs access to the AliESD object to retrieve the tracks reconstructed by
58 // the global tracking.
60 TString headerFile(runLoader->GetFileName()) ;
61 TString branchName(runLoader->GetEventFolder()->GetName() ) ;
63 AliEMCALClusterizerv1 clu(headerFile, branchName);
64 clu.SetEventRange(0, -1) ; // do all the events
66 clu.ExecuteTask("deb all") ;
72 //____________________________________________________________________________
73 void AliEMCALReconstructor::Reconstruct(AliRunLoader* runLoader, AliRawReaderFile* rawreader) const
75 // method called by AliReconstruction;
76 // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
77 // segment maker needs access to the AliESD object to retrieve the tracks reconstructed by
78 // the global tracking.
79 // Here we reconstruct from Raw Data
82 TString headerFile(runLoader->GetFileName()) ;
83 TString branchName(runLoader->GetEventFolder()->GetName()) ;
85 AliEMCALClusterizerv1 clu(headerFile, branchName);
86 clu.SetEventRange(0, -1) ; // do all the events
88 clu.ExecuteTask("deb all") ;
94 //____________________________________________________________________________
95 void AliEMCALReconstructor::FillESD(AliRunLoader* runLoader, AliESD* esd) const
97 // Called by AliReconstruct after Reconstruct() and global tracking and vertxing
98 //Creates the tracksegments and Recparticles
100 Int_t eventNumber = runLoader->GetEventNumber() ;
102 TString headerFile(runLoader->GetFileName()) ;
103 TString branchName(runLoader->GetEventFolder()->GetName()) ;
105 AliEMCALPIDv1 pid(headerFile, branchName);
108 // do current event; the loop over events is done by AliReconstruction::Run()
109 pid.SetEventRange(eventNumber, eventNumber) ;
111 pid.ExecuteTask("deb all") ;
113 pid.ExecuteTask("") ;
115 // Creates AliESDtrack from AliEMCALRecParticles
116 AliEMCALGetter::Instance()->Event(eventNumber, "P") ;
117 TClonesArray *recParticles = AliEMCALGetter::Instance()->RecParticles();
118 Int_t nOfRecParticles = recParticles->GetEntries();
119 esd->SetNumberOfEMCALParticles(nOfRecParticles) ;
120 esd->SetFirstEMCALParticle(esd->GetNumberOfTracks()) ;
121 for (Int_t recpart = 0 ; recpart < nOfRecParticles ; recpart++) {
122 AliEMCALRecParticle * rp = dynamic_cast<AliEMCALRecParticle*>(recParticles->At(recpart));
125 AliESDtrack * et = new AliESDtrack() ;
126 // fills the ESDtrack
128 for (Int_t ixyz=0; ixyz<3; ixyz++)
129 xyz[ixyz] = rp->GetPos()[ixyz];
130 et->SetEMCALposition(xyz) ;
131 et->SetEMCALsignal (rp->Energy()) ;
132 et->SetEMCALpid (rp->GetPID()) ;
133 // add the track to the esd object