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"
35 ClassImp(AliEMCALReconstructor)
37 //____________________________________________________________________________
38 AliEMCALReconstructor::AliEMCALReconstructor() : fDebug(kFALSE)
45 //____________________________________________________________________________
46 AliEMCALReconstructor::~AliEMCALReconstructor()
51 //____________________________________________________________________________
52 void AliEMCALReconstructor::Reconstruct(AliRunLoader* runLoader) const
54 // method called by AliReconstruction;
55 // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
56 // segment maker needs access to the AliESD object to retrieve the tracks reconstructed by
57 // the global tracking.
59 TString headerFile(runLoader->GetFileName()) ;
60 TString branchName(runLoader->GetEventFolder()->GetName() ) ;
62 AliEMCALClusterizerv1 clu(headerFile, branchName);
63 clu.SetEventRange(0, -1) ; // do all the events
65 clu.ExecuteTask("deb all") ;
71 //____________________________________________________________________________
72 void AliEMCALReconstructor::FillESD(AliRunLoader* runLoader, AliESD* esd) const
74 // Called by AliReconstruct after Reconstruct() and global tracking and vertxing
75 //Creates the tracksegments and Recparticles
77 Int_t eventNumber = runLoader->GetEventNumber() ;
79 TString headerFile(runLoader->GetFileName()) ;
80 TString branchName(runLoader->GetEventFolder()->GetName()) ;
82 AliEMCALPIDv1 pid(headerFile, branchName);
85 // do current event; the loop over events is done by AliReconstruction::Run()
86 pid.SetEventRange(eventNumber, eventNumber) ;
88 pid.ExecuteTask("deb all") ;
92 // Creates AliESDtrack from AliEMCALRecParticles
93 AliEMCALGetter::Instance()->Event(eventNumber, "P") ;
94 TClonesArray *recParticles = AliEMCALGetter::Instance()->RecParticles();
95 Int_t nOfRecParticles = recParticles->GetEntries();
96 esd->SetNumberOfEMCALParticles(nOfRecParticles) ;
97 esd->SetFirstEMCALParticle(esd->GetNumberOfTracks()) ;
98 for (Int_t recpart = 0 ; recpart < nOfRecParticles ; recpart++) {
99 AliEMCALRecParticle * rp = dynamic_cast<AliEMCALRecParticle*>(recParticles->At(recpart));
102 AliESDtrack * et = new AliESDtrack() ;
103 // fills the ESDtrack
105 for (Int_t ixyz=0; ixyz<3; ixyz++)
106 xyz[ixyz] = rp->GetPos()[ixyz];
107 et->SetEMCALposition(xyz) ;
108 et->SetEMCALsignal (rp->Energy()) ;
109 et->SetEMCALpid (rp->GetPID()) ;
110 // add the track to the esd object