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 ---
29 #include "AliEMCALReconstructor.h"
32 #include "AliRunLoader.h"
33 #include "AliEMCALLoader.h"
34 #include "AliEMCALClusterizerv1.h"
35 #include "AliEMCALRecPoint.h"
36 #include "AliRawReaderFile.h"
38 ClassImp(AliEMCALReconstructor)
40 //____________________________________________________________________________
41 AliEMCALReconstructor::AliEMCALReconstructor() : fDebug(kFALSE)
48 //____________________________________________________________________________
49 AliEMCALReconstructor::~AliEMCALReconstructor()
54 //____________________________________________________________________________
55 void AliEMCALReconstructor::Reconstruct(AliRunLoader* runLoader) const
57 // method called by AliReconstruction;
58 // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
59 // segment maker needs access to the AliESD object to retrieve the tracks reconstructed by
60 // the global tracking.
62 TString headerFile(runLoader->GetFileName()) ;
63 TString branchName(runLoader->GetEventFolder()->GetName() ) ;
65 AliEMCALClusterizerv1 clu(headerFile, branchName);
66 clu.SetEventRange(0, -1) ; // do all the events
68 clu.ExecuteTask("deb all") ;
74 //____________________________________________________________________________
75 void AliEMCALReconstructor::Reconstruct(AliRunLoader* runLoader, AliRawReader* rawreader) const
77 // method called by AliReconstruction;
78 // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
79 // segment maker needs access to the AliESD object to retrieve the tracks reconstructed by
80 // the global tracking.
81 // Here we reconstruct from Raw Data
84 TString headerFile(runLoader->GetFileName()) ;
85 TString branchName(runLoader->GetEventFolder()->GetName()) ;
87 AliEMCALClusterizerv1 clu(headerFile, branchName);
88 clu.SetEventRange(0, -1) ; // do all the events
90 clu.ExecuteTask("deb all") ;
96 //____________________________________________________________________________
97 void AliEMCALReconstructor::FillESD(AliRunLoader* runLoader, AliESD* esd) const
99 // Called by AliReconstruct after Reconstruct() and global tracking and vertxing
101 Int_t eventNumber = runLoader->GetEventNumber() ;
103 TString headerFile(runLoader->GetFileName()) ;
104 TString branchName(runLoader->GetEventFolder()->GetName()) ;
106 // PID is not implemented. Skipping for now
107 //AliEMCALPIDv1 pid(headerFile, branchName);
109 // do current event; the loop over events is done by AliReconstruction::Run()
111 pid.SetEventRange(eventNumber, eventNumber) ;
113 pid.ExecuteTask("deb all") ;
115 pid.ExecuteTask("") ;
118 // Creates AliESDtrack from AliEMCALRecPoints
119 AliRunLoader *rl = AliRunLoader::GetRunLoader();
120 AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>(rl->GetDetectorLoader("EMCAL"));
122 rl->GetEvent(eventNumber);
123 TObjArray *clusters = emcalLoader->RecPoints();
124 Int_t nClusters = clusters->GetEntries();
125 esd->SetNumberOfEMCALParticles(nClusters) ;
126 esd->SetFirstEMCALParticle(esd->GetNumberOfTracks()) ;
127 for (Int_t iClust = 0 ; iClust < nClusters ; iClust++) {
128 const AliEMCALRecPoint * clust = emcalLoader->RecPoint(iClust);
131 AliESDtrack * et = new AliESDtrack() ;
132 // fills the ESDtrack
135 clust->GetGlobalPosition(gpos);
136 for (Int_t ixyz=0; ixyz<3; ixyz++)
137 xyz[ixyz] = gpos[ixyz];
138 et->SetEMCALposition(xyz) ;
139 et->SetEMCALsignal (clust->GetEnergy()) ;
140 // add the track to the esd object