]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSReconstruct.C
Reconstruction chain script
[u/mrichter/AliRoot.git] / PHOS / AliPHOSReconstruct.C
1 // YS Subatech Mai 2002
2 // YK Subatech 6 Aug 2002
3
4 // Reconstruction chain:
5 // Hits -> SDigits -> Digits -> RecPoints -> TrackSegments -> RecParticles
6
7 //Root
8 #include "TString.h"
9
10 //AliRoot
11 #include "STEER/AliRun.h"
12 #include "PHOS/AliPHOSSDigitizer.h"
13 #include "PHOS/AliPHOSDigitizer.h"
14 #include "PHOS/AliPHOSClusterizerv1.h"
15 #include "PHOS/AliPHOSTrackSegmentMakerv1.h"
16 #include "PHOS/AliPHOSPIDv1.h"
17 #include "EMCAL/AliEMCALSDigitizer.h"
18 #include "EMCAL/AliEMCALDigitizer.h"
19 #include "EMCAL/AliEMCALClusterizerv1.h"
20
21 void Hits2SDigits( Bool_t split=kFALSE, TString fileName = "galice.root") {
22
23   // usage : 
24   // 1. write SDigits in the same file as Hits --------------- (OK)
25   //root [0] .L Reconstruct.C++
26   //root [1] SDigits2Digits()
27   // 2. write SDigits in a separate file, one per detector, from Hits --------------- (OK)
28   //root [0] .L Reconstruct.C++
29   //root [1] SDigits2Digits(kTRUE) // SDigits saved in [DET}.SDigits.root (DET=PHOS, EMCAL)
30
31   delete gAlice ; 
32   gAlice = 0 ; 
33   
34   AliPHOSSDigitizer * sdp = new AliPHOSSDigitizer(fileName) ; 
35   if (split) 
36     sdp->SetSplitFile() ;
37   sdp->ExecuteTask("deb") ; 
38
39   delete sdp ;
40
41  //  AliEMCALSDigitizer * sde = new AliEMCALSDigitizer(fileName) ; 
42 //   if (split) 
43 //     sde->SetSplitFile() ;
44 //   sde->ExecuteTask("deb") ; 
45  
46 //   delete sde ; 
47
48 }
49
50 //________________________________________________________________________
51 void SDigits2Digits( Bool_t split=kFALSE, TString fileName = "galice.root") {
52   
53  // usage : 
54   // 1. write SDigits in the same file as SDigits --------------- (OK)
55   //root [0] .L Reconstruct.C++
56   //root [1] SDigits2Digits()
57   // 2. write SDigits in a separate file, one per detector, from SDigits --------------- (OK)
58   //root [0] .L Reconstruct.C++
59   //root [1] SDigitsDigits(kTRUE) // Digits saved in [DET}.Digits.root (DET=PHOS, EMCAL)
60
61   delete gAlice ; 
62   gAlice = 0 ; 
63   
64   // PHOS
65   AliPHOSDigitizer * dp = 0 ; 
66  
67   if (split) {
68     dp = new AliPHOSDigitizer("PHOS.SDigits.root") ; 
69     dp->SetSplitFile() ; } 
70   else 
71     dp = new AliPHOSDigitizer(fileName) ; 
72   
73   dp->ExecuteTask("deb") ; 
74   
75   delete dp ;
76
77   //EMCAL
78 //   AliEMCALDigitizer * de = 0 ; 
79
80 //   if (split) {
81 //     de = new AliEMCALDigitizer("EMCAL.SDigits.root") ;
82 //     de->SetSplitFile() ;
83 //   } else 
84 //     de = new AliEMCALDigitizer(fileName) ; 
85   
86 //   de->ExecuteTask("deb") ; 
87   
88 //   delete de ; 
89 }
90
91 //________________________________________________________________________
92 void Digits2RecPoints( Bool_t split=kFALSE, TString fileName = "galice.root") {
93   
94  // usage : 
95   // 1. write RecPoints in the same file as Digits --------------- OK 
96   //root [0] .L Reconstruct.C++
97   //root [1] Digits2RecPoints()
98   // 2. write RecPoints in a separate file, one per detector, from Digits --------------- OK 
99   //root [0] .L Reconstruct.C++
100   //root [1] Digits2RecPoints(kTRUE) // RecPoints saved in [DET}.RecPoints.root (DET=PHOS, EMCAL)
101
102   delete gAlice ; 
103   gAlice = 0 ; 
104  
105 // PHOS
106   AliPHOSClusterizer * cp = 0 ; 
107  
108   if (split) {
109     cp = new AliPHOSClusterizerv1("PHOS.Digits.root") ; 
110     cp->SetSplitFile() ; } 
111   else 
112     cp = new AliPHOSClusterizerv1(fileName) ; 
113   
114   cp->ExecuteTask("deb") ; 
115   
116   delete cp ;
117
118 //   //EMCAL
119 //   AliEMCALClusterizerv1 * ce = 0 ;  
120
121 //   if (split) {
122 //     ce = new AliEMCALClusterizerv1("EMCAL.Digits.root") ;
123 //     ce->SetSplitFile() ;
124 //   } else 
125 //     ce = new AliEMCALClusterizerv1(fileName) ; 
126   
127 //   ce->ExecuteTask("deb") ; 
128   
129 //   delete ce ; 
130 }
131
132 //________________________________________________________________________
133 void RecPoints2TrackSegments( Bool_t split=kFALSE, TString fileName = "galice.root") {
134   
135  // usage : 
136   // 1. write TrackSegments in the same file as RecPoints --------------- (OK) 
137   //root [0] .L Reconstruct.C++
138   //root [1] RecPoints2TrackSegments()
139   // 2. write TrackSegments in a separate file, one per detector, from RecPoints --------------- (Not needed) 
140   //root [0] .L Reconstruct.C++
141   //root [1] RecPoints2TrackSegments(kTRUE) // TrackSegments saved in [DET}.RecData.root (DET=PHOS, EMCAL)
142
143   delete gAlice ; 
144   gAlice = 0 ; 
145   
146   AliPHOSTrackSegmentMaker * tmp = 0 ; 
147  
148   if (split)
149     tmp = new AliPHOSTrackSegmentMakerv1("PHOS.RecData.root") ; 
150   else 
151     tmp = new AliPHOSTrackSegmentMakerv1(fileName) ; 
152   
153   tmp->ExecuteTask("deb") ; 
154   
155   delete tmp ;
156 }
157
158 //________________________________________________________________________
159 void TrackSegments2RecParticles( Bool_t split=kFALSE, TString fileName = "galice.root") {
160   
161  // usage : 
162   // 1. write RecParticles in the same file as TrackSegments ---------------  (OK)
163   //root [0] .L Reconstruct.C++
164   //root [1] TrackSegments2RecParticles()
165   // 2. write RecParticles in a separate file, one per detector, from TrackSegments --------------- (Not needed) 
166   //root [0] .L Reconstruct.C++
167   //root [1] TrackSegments2RecParticles(kTRUE) // RecParticles saved in [DET}.RecData.root (DET=PHOS, EMCAL)
168
169   delete gAlice ; 
170   gAlice = 0 ; 
171   
172   AliPHOSPID * pp = 0 ; 
173  
174   if (split) 
175     pp = new AliPHOSPIDv1("PHOS.RecData.root") ; 
176   else 
177     pp = new AliPHOSPIDv1(fileName) ; 
178   
179   pp->ExecuteTask("deb") ; 
180   
181   delete pp ;
182 }
183
184 //________________________________________________________________________
185 void Digits2RecParticles( Bool_t split=kFALSE, TString fileName = "galice.root") {
186   
187  // usage : 
188   // 1. write RecPoints, TrackSegments and RecParticles in the same file as Digits --------------- (OK)
189   //root [0] .L Reconstruct.C++
190   //root [1] Digits2RecParticles()
191   // 2. write RecPoints , TrackSegments and RecParticles in a separate file, one per detector, from Digits --------------- (OK)
192   //root [0] .L Reconstruct.C++
193   //root [1] Digits2RecParticles(kTRUE) // TrackSegments saved in [DET}.RecData.root (DET=PHOS, EMCAL)
194
195  
196   delete gAlice ; 
197   gAlice = 0 ; 
198  
199   // PHOS
200   AliPHOSClusterizer * cp = 0 ; 
201  
202   if (split) {
203     cp = new AliPHOSClusterizerv1("PHOS.Digits.root") ; 
204     cp->SetSplitFile() ; } 
205   else 
206     cp = new AliPHOSClusterizerv1(fileName) ; 
207   
208   cp->ExecuteTask("deb") ; 
209
210   if (split) 
211     delete cp ;
212   
213   AliPHOSTrackSegmentMaker * tmp = 0 ; 
214   
215   if (split) 
216     tmp = new AliPHOSTrackSegmentMakerv1("PHOS.RecData.root") ; 
217   else 
218     tmp = new AliPHOSTrackSegmentMakerv1(fileName) ; 
219   
220   tmp->ExecuteTask("deb") ; 
221   
222   AliPHOSPID * pp = 0 ; 
223  
224   if (split) 
225     pp = new AliPHOSPIDv1("PHOS.RecData.root") ; 
226   else 
227     pp = new AliPHOSPIDv1(fileName) ; 
228   
229   pp->ExecuteTask("deb") ; 
230   
231   delete tmp; 
232   delete pp ; 
233 }
234
235 //________________________________________________________________________
236 void Hits2Digits (Bool_t split=kFALSE, TString fileName = "galice.root") {
237   // usage : 
238   // 1. write (S)Digits in the same file as Hits --------------- (OK)
239   //root [0] .L Reconstruct.C++
240   //root [1] Hits2Digits()
241   // 2. write (S)Digits in a separate file, one per detector, from Hits --------------- (OK)
242   //root [0] .L Reconstruct.C++
243   //root [1] Hits2Digits(kTRUE) // SDigits saved in [DET}.SDigits.root (DET=PHOS, EMCAL)
244                                 // Digits  saved in [DET}.Digits.root  (DET=PHOS, EMCAL)
245
246   delete gAlice ; 
247   gAlice = 0 ; 
248   
249   //PHOS
250   AliPHOSSDigitizer * sdp = new AliPHOSSDigitizer(fileName) ; 
251   if (split) 
252     sdp->SetSplitFile() ;
253   sdp->ExecuteTask("deb") ; 
254
255   if (split) 
256     delete sdp ; 
257
258   AliPHOSDigitizer * dp = 0 ; 
259  
260   if (split) {
261     dp = new AliPHOSDigitizer("PHOS.SDigits.root") ; 
262     dp->SetSplitFile() ; } 
263   else 
264     dp = new AliPHOSDigitizer(fileName) ; 
265   
266   dp->ExecuteTask("deb") ; 
267
268   if (split) 
269     delete dp ; 
270
271   if (!split) { 
272     delete sdp ; 
273     delete dp ; 
274   }
275   
276 //   //EMCAL
277 //   AliEMCALSDigitizer * sde = new AliEMCALSDigitizer(fileName) ; 
278 //   if (split) 
279 //     sde->SetSplitFile() ;
280 //   sde->ExecuteTask("deb") ; 
281   
282 //   delete sde ; 
283   
284 //   AliEMCALDigitizer * de = 0 ; 
285 //   if (split) {
286 //     de = new AliEMCALDigitizer("EMCAL.SDigits.root") ;
287 //     de->SetSplitFile() ;
288 //   } else 
289 //     de = new AliEMCALDigitizer(fileName) ; 
290   
291 //   de->ExecuteTask("deb") ; 
292   
293 //   delete de ; 
294
295 }
296
297
298