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 //*-- Author: Gines Martinez & Yves Schutz (SUBATECH)
21 //*-- Compleetely redesigned by Dmitri Peressounko (SUBATECH & RRC KI) March 2001
22 /////////////////////////////////////////////////////////////////////////////////////
23 // Wrapping class for reconstruction. Allows to produce reconstruction from
24 // different steps: from previously produced hits,sdigits, etc. Each new reconstruction
25 // flow (e.g. digits, made from them RecPoints,
26 // subsequently made RecParticles) are distinguished by the title of created branches. One can
27 // use this title as a comment, see use case below.
28 // Thanks to getters, one can set
29 // parameters to reconstruction briks. The full set of parameters is saved in the
30 // corresponding branch: e.g. parameters of clusterizer are stored in branch
31 // TreeR::AliEMCALClusterizer with the same title as the branch containing the RecPoints. // TTree does not support overwriting, therefore one can not produce several
32 // branches with the same names and titles - use different titles.
36 // root [0] AliEMCALReconstructioner * r = new AliEMCALReconstructioner("galice.root")
37 // // Set the header file
38 // root [1] r->ExecuteTask()
39 // // Make full chain of reconstruction
41 // // One can specify the title for each branch
42 // root [2] r->SetBranchFileName("RecPoints","RecPoints1") ;
44 // // One can change parameters of reconstruction algorithms
45 // root [3] r->GetClusterizer()->SetEmcLocalMaxCut(0.02)
47 // // One can specify the starting point of the reconstruction and title of all
48 // // branches produced in this pass
49 // root [4] r->StartFrom("AliEMCALClusterizer","Local max cut 0.02")
50 // // means that will use already generated Digits and produce only RecPoints,
51 // // and RecParticles
53 // // And finally one can call ExecuteTask() with the following options
54 // root [5] r->ExecuteTask("debug all timing")
55 // // deb - prints the numbers of RecPoints and RecParticles
56 // // deb all - prints in addition list of RecPoints and RecParticles
57 // // timing - prints benchmarking results
58 ///////////////////////////////////////////////////////////////////////////////////////////////////
60 // --- ROOT system ---
62 // --- Standard library ---
64 // --- AliRoot header files ---
66 #include "AliESDCaloTrack.h"
67 #include "AliEMCALReconstructioner.h"
68 #include "AliEMCALClusterizerv1.h"
69 #include "AliEMCALPIDv1.h"
70 #include "AliEMCALGetter.h"
72 ClassImp(AliEMCALReconstructioner)
74 //____________________________________________________________________________
75 AliEMCALReconstructioner::AliEMCALReconstructioner():TTask("AliEMCALReconstructioner","")
81 fIsInitialized = kFALSE ;
85 //____________________________________________________________________________
86 AliEMCALReconstructioner::AliEMCALReconstructioner(const char* evFoldName,const char * branchName):
87 TTask("AliEMCALReconstructioner",evFoldName)
91 AliEMCALGetter::Instance(evFoldName) ;
93 fRecPointBranch=branchName ;
94 Info("ctor", "Creating Clusterizer") ;
95 fClusterizer = new AliEMCALClusterizerv1(evFoldName, GetTitle());
98 fRecPartBranch=branchName ;
99 Info("ctor", "Creating PID") ;
100 fPID = new AliEMCALPIDv1(evFoldName, GetTitle());
103 fIsInitialized = kTRUE ;
105 //____________________________________________________________________________
106 void AliEMCALReconstructioner::Exec(Option_t *opt)
108 //check, if the names of branches, which should be made coincide with already
115 //____________________________________________________________________________
116 void AliEMCALReconstructioner:: Clusters2Tracks(Int_t ievent, AliESD *event)
118 // Convert EMCAL reconstructed particles into ESD object for event# ievent.
119 // ESD object is returned as an argument event
121 if(!fIsInitialized) Init() ;
123 fClusterizer->SetEventRange(ievent,ievent);
124 fClusterizer->ExecuteTask();
126 fPID ->SetEventRange(ievent,ievent);
127 fPID ->ExecuteTask();
129 AliEMCALGetter *gime = AliEMCALGetter::Instance();
130 TClonesArray *recParticles = gime->RecParticles();
131 Int_t nOfRecParticles = recParticles->GetEntries();
132 for (Int_t recpart=0; recpart<nOfRecParticles; recpart++) {
133 AliESDCaloTrack *ct = new AliESDCaloTrack((AliEMCALRecParticle*)recParticles->At(recpart));
134 event->AddCaloTrack(ct);
138 //____________________________________________________________________________
139 void AliEMCALReconstructioner::Init()
141 // initiliaze Reconstructioner if necessary: we can not do this in default constructor
145 fRecPointBranch="Default" ;
146 fClusterizer = new AliEMCALClusterizerv1(GetTitle(),fRecPointBranch.Data());
149 fRecPartBranch="Default";
150 fPID = new AliEMCALPIDv1(GetTitle(),fRecPartBranch.Data()) ;
153 fIsInitialized = kTRUE ;
157 //____________________________________________________________________________
158 AliEMCALReconstructioner::~AliEMCALReconstructioner()
160 // Delete data members if any
163 //____________________________________________________________________________
164 void AliEMCALReconstructioner::Print()const {
165 // Print reconstructioner data
168 message = "-----------------AliEMCALReconstructioner---------------\n" ;
169 message += " Reconstruction of the header file %s\n" ;
170 message += " with the following modules:\n" ;
172 if(fClusterizer->IsActive()){
173 message += " (+) %s to branch %s\n" ;
176 if(fPID->IsActive()){
177 message += " (+) %s to branch %s\n" ;
179 Info("Print", message.Data(),
181 fClusterizer->GetName(), fRecPointBranch.Data(),
182 fPID->GetName(), fRecPartBranch.Data() ) ;