]>
Commit | Line | Data |
---|---|---|
d15a28e7 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
b2a60966 | 16 | /* $Id$ */ |
17 | ||
d15a28e7 | 18 | //_________________________________________________________________________ |
a3dfe79c | 19 | //*-- |
7acf6008 | 20 | //*-- Author: Gines Martinez & Yves Schutz (SUBATECH) |
f1aeaf5d | 21 | //*-- Compleetely redesigned by Dmitri Peressounko (SUBATECH & RRC KI) March 2001 |
7acf6008 | 22 | ///////////////////////////////////////////////////////////////////////////////////// |
9a6ec61a | 23 | // Wrapping class for reconstruction. Allows to produce reconstruction from |
24 | // different steps: from previously produced hits,sdigits, etc. Each new reconstruction | |
a4e98857 | 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 | |
21cd0c07 | 31 | // TreeR::AliPHOSClusterizer with the same title as the branch containing the RecPoints. // TTree does not support overwriting, therefore one can not produce several |
9a6ec61a | 32 | // branches with the same names and titles - use different titles. |
33 | // | |
a4e98857 | 34 | // Use case: |
7acf6008 | 35 | // |
36 | // root [0] AliPHOSReconstructioner * r = new AliPHOSReconstructioner("galice.root") | |
37 | // // Set the header file | |
38 | // root [1] r->ExecuteTask() | |
a4e98857 | 39 | // // Make full chain of reconstruction |
7acf6008 | 40 | // |
41 | // // One can specify the title for each branch | |
42 | // root [2] r->SetBranchFileName("RecPoints","RecPoints1") ; | |
7acf6008 | 43 | // |
9a6ec61a | 44 | // // One can change parameters of reconstruction algorithms |
45 | // root [3] r->GetClusterizer()->SetEmcLocalMaxCut(0.02) | |
46 | // | |
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 | |
7acf6008 | 52 | // |
53 | // // And finally one can call ExecuteTask() with the following options | |
9a6ec61a | 54 | // root [5] r->ExecuteTask("debug all timing") |
7acf6008 | 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 | |
9a6ec61a | 58 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
d15a28e7 | 59 | |
60 | // --- ROOT system --- | |
61 | ||
d15a28e7 | 62 | // --- Standard library --- |
e957fea8 | 63 | #include "Riostream.h" |
364de5c6 | 64 | |
d15a28e7 | 65 | // --- AliRoot header files --- |
88cb7938 | 66 | #include "AliRunLoader.h" |
35293055 | 67 | #include "AliESD.h" |
68 | #include "AliESDCaloTrack.h" | |
d15a28e7 | 69 | #include "AliPHOSReconstructioner.h" |
7acf6008 | 70 | #include "AliPHOSClusterizerv1.h" |
71 | #include "AliPHOSDigitizer.h" | |
72 | #include "AliPHOSSDigitizer.h" | |
73 | #include "AliPHOSTrackSegmentMakerv1.h" | |
74 | #include "AliPHOSPIDv1.h" | |
35293055 | 75 | #include "AliPHOSGetter.h" |
e957fea8 | 76 | |
88cb7938 | 77 | #include "AliPHOSLoader.h" |
d15a28e7 | 78 | |
79 | ClassImp(AliPHOSReconstructioner) | |
80 | ||
d15a28e7 | 81 | //____________________________________________________________________________ |
7acf6008 | 82 | AliPHOSReconstructioner::AliPHOSReconstructioner():TTask("AliPHOSReconstructioner","") |
d15a28e7 | 83 | { |
b2a60966 | 84 | // ctor |
7acf6008 | 85 | fDigitizer = 0 ; |
86 | fClusterizer = 0 ; | |
87 | fTSMaker = 0 ; | |
88 | fPID = 0 ; | |
89 | fSDigitizer = 0 ; | |
d15a28e7 | 90 | |
7acf6008 | 91 | fIsInitialized = kFALSE ; |
d15a28e7 | 92 | |
6ad0bfa0 | 93 | } |
94 | ||
6ad0bfa0 | 95 | //____________________________________________________________________________ |
88cb7938 | 96 | AliPHOSReconstructioner::AliPHOSReconstructioner(const char* evFoldName,const char * branchName): |
97 | TTask("AliPHOSReconstructioner",evFoldName) | |
d15a28e7 | 98 | { |
7acf6008 | 99 | // ctor |
88cb7938 | 100 | AliRunLoader* rl = AliRunLoader::GetRunLoader(evFoldName); |
101 | if (rl == 0x0) | |
102 | { | |
103 | Fatal("AliPHOSReconstructioner","Can not get Run Loader from folder %s.",evFoldName); | |
104 | } | |
105 | if (rl->GetAliRun() == 0x0) | |
106 | { | |
107 | delete gAlice; | |
108 | gAlice = 0x0; | |
109 | rl->LoadgAlice(); | |
110 | gAlice = rl->GetAliRun(); | |
111 | } | |
112 | ||
113 | AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(rl->GetLoader("PHOSLoader")); | |
114 | if (gime == 0x0) | |
115 | { | |
116 | Error("AliPHOSReconstructioner","Can not get PHOS Loader"); | |
117 | return; | |
118 | } | |
119 | ||
120 | TString galicefn = rl->GetFileName(); | |
121 | TString method("AliPHOSReconstructioner::AliPHOSReconstructioner("); | |
122 | method = (((method + evFoldName)+",")+branchName)+"): "; | |
7acf6008 | 123 | |
108bc8df | 124 | fSDigitsBranch= branchName; |
88cb7938 | 125 | |
126 | //P.Skowronski remark | |
127 | // Tasks has default fixed names | |
128 | // other tasks can be added, even runtime | |
129 | // with arbitrary name. See AliDataLoader:: | |
130 | cout<<"\n\n\n"; | |
131 | cout<<method<<"\n\nCreating SDigitizer\n"; | |
132 | fSDigitizer = new AliPHOSSDigitizer(galicefn,GetTitle()); | |
133 | Add(fSDigitizer); | |
134 | gime->PostSDigitizer(fSDigitizer); | |
135 | ||
136 | fDigitsBranch=branchName ; | |
137 | cout<<"\n\n\n"; | |
138 | cout<<method<<"\n\nCreating Digitizer\n"; | |
139 | fDigitizer = new AliPHOSDigitizer(galicefn,GetTitle()) ; | |
7acf6008 | 140 | Add(fDigitizer) ; |
88cb7938 | 141 | gime->PostDigitizer(fDigitizer); |
7acf6008 | 142 | |
108bc8df | 143 | fRecPointBranch=branchName ; |
88cb7938 | 144 | cout<<"\n\n\n"; |
145 | cout<<method<<"Creating Clusterizer\n"; | |
146 | fClusterizer = new AliPHOSClusterizerv1(galicefn,GetTitle()); | |
147 | Add(fClusterizer); | |
148 | gime->PostReconstructioner(fClusterizer); | |
2131115b | 149 | |
108bc8df | 150 | fTSBranch=branchName ; |
88cb7938 | 151 | fTSMaker = new AliPHOSTrackSegmentMakerv1(galicefn,GetTitle()); |
7acf6008 | 152 | Add(fTSMaker) ; |
88cb7938 | 153 | gime->PostTracker(fTSMaker); |
154 | ||
7acf6008 | 155 | |
108bc8df | 156 | fRecPartBranch=branchName ; |
88cb7938 | 157 | cout<<"\n\n\n"; |
158 | cout<<method<<"Creating PID\n"; | |
159 | fPID = new AliPHOSPIDv1(galicefn,GetTitle()); | |
160 | Add(fPID); | |
161 | cout<<"\nFINISHED \n\n"<<method; | |
7acf6008 | 162 | |
163 | fIsInitialized = kTRUE ; | |
7acf6008 | 164 | } |
165 | //____________________________________________________________________________ | |
35293055 | 166 | void AliPHOSReconstructioner::Exec(Option_t *opt) |
a4e98857 | 167 | { |
90cceaf6 | 168 | //check, if the names of branches, which should be made conicide with already |
7acf6008 | 169 | //existing |
e957fea8 | 170 | if (!opt) |
171 | return ; | |
7acf6008 | 172 | if(!fIsInitialized) |
173 | Init() ; | |
7acf6008 | 174 | } |
175 | //____________________________________________________________________________ | |
35293055 | 176 | void AliPHOSReconstructioner:: Clusters2Tracks(Int_t ievent, AliESD *event) |
177 | { | |
178 | // Convert PHOS reconstructed particles into ESD object for event# ievent. | |
179 | // ESD object is returned as an argument event | |
180 | ||
181 | if(!fIsInitialized) Init() ; | |
182 | ||
183 | fClusterizer->SetEventRange(ievent,ievent); | |
184 | fClusterizer->ExecuteTask(); | |
185 | ||
186 | fTSMaker ->SetEventRange(ievent,ievent); | |
187 | fTSMaker ->ExecuteTask(); | |
188 | ||
189 | fPID ->SetEventRange(ievent,ievent); | |
190 | fPID ->ExecuteTask(); | |
191 | ||
192 | AliPHOSGetter *gime = AliPHOSGetter::Instance(); | |
193 | TClonesArray *recParticles = gime->RecParticles(); | |
194 | Int_t nOfRecParticles = recParticles->GetEntries(); | |
195 | for (Int_t recpart=0; recpart<nOfRecParticles; recpart++) { | |
196 | AliESDCaloTrack *ct = new AliESDCaloTrack((AliPHOSRecParticle*)recParticles->At(recpart)); | |
197 | event->AddCaloTrack(ct); | |
198 | } | |
199 | ||
200 | } | |
201 | //____________________________________________________________________________ | |
7acf6008 | 202 | void AliPHOSReconstructioner::Init() |
203 | { | |
a4e98857 | 204 | // initiliaze Reconstructioner if necessary: we can not do this in default constructor |
7acf6008 | 205 | |
206 | if(!fIsInitialized){ | |
207 | // Initialisation | |
208 | ||
81b0fcd1 | 209 | fSDigitsBranch="Default" ; |
88cb7938 | 210 | fSDigitizer = new AliPHOSSDigitizer(GetTitle(),fSDigitsBranch.Data()) ; |
7acf6008 | 211 | Add(fSDigitizer) ; |
212 | ||
81b0fcd1 | 213 | fDigitsBranch="Default" ; |
88cb7938 | 214 | fDigitizer = new AliPHOSDigitizer(GetTitle(),fDigitsBranch.Data()); |
7acf6008 | 215 | Add(fDigitizer) ; |
216 | ||
81b0fcd1 | 217 | fRecPointBranch="Default" ; |
88cb7938 | 218 | fClusterizer = new AliPHOSClusterizerv1(GetTitle(),fRecPointBranch.Data()); |
7acf6008 | 219 | Add(fClusterizer) ; |
220 | ||
81b0fcd1 | 221 | fTSBranch="Default" ; |
88cb7938 | 222 | fTSMaker = new AliPHOSTrackSegmentMakerv1(GetTitle(),fTSBranch.Data()); |
7acf6008 | 223 | Add(fTSMaker) ; |
224 | ||
225 | ||
88cb7938 | 226 | fRecPartBranch="Default"; |
227 | fPID = new AliPHOSPIDv1(GetTitle(),fRecPartBranch.Data()) ; | |
7acf6008 | 228 | Add(fPID) ; |
229 | ||
230 | fIsInitialized = kTRUE ; | |
88cb7938 | 231 | |
7acf6008 | 232 | } |
233 | } | |
234 | //____________________________________________________________________________ | |
235 | AliPHOSReconstructioner::~AliPHOSReconstructioner() | |
236 | { | |
baef0810 | 237 | // Delete data members if any |
7acf6008 | 238 | } |
baef0810 | 239 | |
90cceaf6 | 240 | void AliPHOSReconstructioner::Print()const { |
baef0810 | 241 | // Print reconstructioner data |
242 | ||
21cd0c07 | 243 | TString message ; |
244 | message = "-----------------AliPHOSReconstructioner---------------\n" ; | |
245 | message += " Reconstruction of the header file %s\n" ; | |
246 | message += " with the following modules:\n" ; | |
7acf6008 | 247 | |
248 | if(fSDigitizer->IsActive()){ | |
21cd0c07 | 249 | message += " (+) %s to branch %s\n" ; |
7acf6008 | 250 | } |
251 | if(fDigitizer->IsActive()){ | |
21cd0c07 | 252 | message += " (+) %s to branch %s\n" ; |
7acf6008 | 253 | } |
254 | ||
255 | if(fClusterizer->IsActive()){ | |
21cd0c07 | 256 | message += " (+) %s to branch %s\n" ; |
7acf6008 | 257 | } |
258 | ||
259 | if(fTSMaker->IsActive()){ | |
21cd0c07 | 260 | message += " (+) %s to branch %s\n" ; |
7acf6008 | 261 | } |
262 | ||
7acf6008 | 263 | if(fPID->IsActive()){ |
21cd0c07 | 264 | message += " (+) %s to branch %s\n" ; |
7acf6008 | 265 | } |
21cd0c07 | 266 | Info("Print", message.Data(), |
88cb7938 | 267 | GetTitle(), |
21cd0c07 | 268 | fSDigitizer->GetName(), fSDigitsBranch.Data(), |
269 | fDigitizer->GetName(), fDigitsBranch.Data() , | |
270 | fClusterizer->GetName(), fRecPointBranch.Data(), | |
271 | fTSMaker->GetName(), fTSBranch.Data() , | |
272 | fPID->GetName(), fRecPartBranch.Data() ) ; | |
51926850 | 273 | } |