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, subsequently made TrackSegments,
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::AliPHOSClusterizer 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] AliPHOSReconstructioner * r = new AliPHOSReconstructioner("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("AliPHOSClusterizer","Local max cut 0.02")
50 // // means that will use already generated Digits and produce only RecPoints,
51 // // TS 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 produced SDigits, Digits etc.
56 // // deb all - prints in addition list of made SDigits, digits etc.
57 // // timing - prints benchmarking results
58 ///////////////////////////////////////////////////////////////////////////////////////////////////
60 // --- ROOT system ---
62 #include "TClonesArray.h"
67 // --- Standard library ---
69 // --- AliRoot header files ---
71 #include "AliRunLoader.h"
72 #include "AliPHOSReconstructioner.h"
73 #include "AliPHOSClusterizerv1.h"
74 #include "AliPHOSDigitizer.h"
75 #include "AliPHOSSDigitizer.h"
76 #include "AliPHOSTrackSegmentMakerv1.h"
77 #include "AliPHOSPIDv1.h"
78 #include "AliPHOSFastRecParticle.h"
79 #include "AliPHOSCpvRecPoint.h"
80 #include "AliPHOSLoader.h"
82 ClassImp(AliPHOSReconstructioner)
84 //____________________________________________________________________________
85 AliPHOSReconstructioner::AliPHOSReconstructioner():TTask("AliPHOSReconstructioner","")
94 fIsInitialized = kFALSE ;
98 //____________________________________________________________________________
99 AliPHOSReconstructioner::AliPHOSReconstructioner(const char* evFoldName,const char * branchName):
100 TTask("AliPHOSReconstructioner",evFoldName)
103 AliRunLoader* rl = AliRunLoader::GetRunLoader(evFoldName);
106 Fatal("AliPHOSReconstructioner","Can not get Run Loader from folder %s.",evFoldName);
108 if (rl->GetAliRun() == 0x0)
113 gAlice = rl->GetAliRun();
116 AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(rl->GetLoader("PHOSLoader"));
119 Error("AliPHOSReconstructioner","Can not get PHOS Loader");
123 TString galicefn = rl->GetFileName();
124 TString method("AliPHOSReconstructioner::AliPHOSReconstructioner(");
125 method = (((method + evFoldName)+",")+branchName)+"): ";
127 fSDigitsBranch= branchName;
129 //P.Skowronski remark
130 // Tasks has default fixed names
131 // other tasks can be added, even runtime
132 // with arbitrary name. See AliDataLoader::
134 cout<<method<<"\n\nCreating SDigitizer\n";
135 fSDigitizer = new AliPHOSSDigitizer(galicefn,GetTitle());
137 gime->PostSDigitizer(fSDigitizer);
139 fDigitsBranch=branchName ;
141 cout<<method<<"\n\nCreating Digitizer\n";
142 fDigitizer = new AliPHOSDigitizer(galicefn,GetTitle()) ;
144 gime->PostDigitizer(fDigitizer);
146 fRecPointBranch=branchName ;
148 cout<<method<<"Creating Clusterizer\n";
149 fClusterizer = new AliPHOSClusterizerv1(galicefn,GetTitle());
151 gime->PostReconstructioner(fClusterizer);
153 fTSBranch=branchName ;
154 fTSMaker = new AliPHOSTrackSegmentMakerv1(galicefn,GetTitle());
156 gime->PostTracker(fTSMaker);
159 fRecPartBranch=branchName ;
161 cout<<method<<"Creating PID\n";
162 fPID = new AliPHOSPIDv1(galicefn,GetTitle());
164 cout<<"\nFINISHED \n\n"<<method;
166 fIsInitialized = kTRUE ;
168 //____________________________________________________________________________
169 void AliPHOSReconstructioner::Exec(Option_t *option)
171 //chesk, if the names of branches, which should be made conicide with already
176 //____________________________________________________________________________
177 void AliPHOSReconstructioner::Init()
179 // initiliaze Reconstructioner if necessary: we can not do this in default constructor
184 fSDigitsBranch="Default" ;
185 fSDigitizer = new AliPHOSSDigitizer(GetTitle(),fSDigitsBranch.Data()) ;
188 fDigitsBranch="Default" ;
189 fDigitizer = new AliPHOSDigitizer(GetTitle(),fDigitsBranch.Data());
192 fRecPointBranch="Default" ;
193 fClusterizer = new AliPHOSClusterizerv1(GetTitle(),fRecPointBranch.Data());
196 fTSBranch="Default" ;
197 fTSMaker = new AliPHOSTrackSegmentMakerv1(GetTitle(),fTSBranch.Data());
201 fRecPartBranch="Default";
202 fPID = new AliPHOSPIDv1(GetTitle(),fRecPartBranch.Data()) ;
205 fIsInitialized = kTRUE ;
209 //____________________________________________________________________________
210 AliPHOSReconstructioner::~AliPHOSReconstructioner()
212 // Delete data members if any
215 void AliPHOSReconstructioner::Print(Option_t * option)const {
216 // Print reconstructioner data
219 message = "-----------------AliPHOSReconstructioner---------------\n" ;
220 message += " Reconstruction of the header file %s\n" ;
221 message += " with the following modules:\n" ;
223 if(fSDigitizer->IsActive()){
224 message += " (+) %s to branch %s\n" ;
226 if(fDigitizer->IsActive()){
227 message += " (+) %s to branch %s\n" ;
230 if(fClusterizer->IsActive()){
231 message += " (+) %s to branch %s\n" ;
234 if(fTSMaker->IsActive()){
235 message += " (+) %s to branch %s\n" ;
238 if(fPID->IsActive()){
239 message += " (+) %s to branch %s\n" ;
241 Info("Print", message.Data(),
243 fSDigitizer->GetName(), fSDigitsBranch.Data(),
244 fDigitizer->GetName(), fDigitsBranch.Data() ,
245 fClusterizer->GetName(), fRecPointBranch.Data(),
246 fTSMaker->GetName(), fTSBranch.Data() ,
247 fPID->GetName(), fRecPartBranch.Data() ) ;