]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALReconstruct.C
libEMCALbase, libEMCALsim, and libEMCALrec instead of libEMCAL (A.Pavlinov)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALReconstruct.C
1 // YS Subatech Mai 2002
2 // YK Subatech 6 Aug 2002
3
4 // EMCAL Reconstruction chain:
5 // Hits -> SDigits -> Digits -> RecPoints -> TrackSegments -> RecParticles
6
7 //Root
8 #if !defined(__CINT__) || defined(__MAKECINT__)
9 #include "TString.h"
10
11 //AliRoot
12 #include "STEER/AliRun.h"
13 #include "EMCAL/AliEMCALSDigitizer.h"
14 #include "EMCAL/AliEMCALDigitizer.h"
15 #include "EMCAL/AliEMCALClusterizerv1.h"
16 // #include "EMCAL/AliEMCALTrackSegmentMakerv1.h"
17 // #include "EMCAL/AliEMCALPIDv1.h"
18 #endif
19
20 void EMCALHits2SDigits( Bool_t split=kFALSE, TString fileName = "galice.root") {
21
22   // usage : 
23   // 1. write SDigits in the same file as Hits --------------- (OK)
24   //root [0] .L Reconstruct.C++
25   //root [1] SDigits2Digits()
26   // 2. write SDigits in a separate file, one per detector, from Hits --------------- (OK)
27   //root [0] .L Reconstruct.C++
28   //root [1] SDigits2Digits(kTRUE) // SDigits saved in [DET}.SDigits.root (DET=EMCAL, EMCAL)
29
30   delete gAlice ; 
31   gAlice = 0 ; 
32   
33   AliEMCALSDigitizer * sdp = new AliEMCALSDigitizer(fileName) ; 
34   if (split) 
35     sdp->SetSplitFile() ;
36   sdp->ExecuteTask("deb") ; 
37
38   delete sdp ;
39 }
40
41 //________________________________________________________________________
42 void EMCALSDigits2Digits( Bool_t split=kFALSE, TString fileName = "galice.root") {
43   
44  // usage : 
45   // 1. write SDigits in the same file as SDigits --------------- (OK)
46   //root [0] .L Reconstruct.C++
47   //root [1] SDigits2Digits()
48   // 2. write SDigits in a separate file, one per detector, from SDigits --------------- (OK)
49   //root [0] .L Reconstruct.C++
50   //root [1] SDigitsDigits(kTRUE) // Digits saved in [DET}.Digits.root (DET=EMCAL, EMCAL)
51
52   delete gAlice ; 
53   gAlice = 0 ; 
54   
55   // EMCAL
56   AliEMCALDigitizer * dp = 0 ; 
57  
58   if (split) {
59     dp = new AliEMCALDigitizer("EMCAL.SDigits.root") ; 
60     dp->SetSplitFile() ; } 
61   else 
62     dp = new AliEMCALDigitizer(fileName) ; 
63   
64   dp->ExecuteTask("deb") ; 
65   
66   delete dp ;
67 }
68
69 //________________________________________________________________________
70 void EMCALDigits2RecPoints( Bool_t split=kFALSE, TString fileName = "galice.root") {
71   
72  // usage : 
73   // 1. write RecPoints in the same file as Digits --------------- OK 
74   //root [0] .L Reconstruct.C++
75   //root [1] Digits2RecPoints()
76   // 2. write RecPoints in a separate file, one per detector, from Digits --------------- OK 
77   //root [0] .L Reconstruct.C++
78   //root [1] Digits2RecPoints(kTRUE) // RecPoints saved in [DET}.RecPoints.root (DET=EMCAL, EMCAL)
79
80   delete gAlice ; 
81   gAlice = 0 ; 
82  
83   AliEMCALClusterizer * cp = 0 ; 
84  
85   if (split) {
86     cp = new AliEMCALClusterizerv1("EMCAL.Digits.root") ; 
87     cp->SetSplitFile() ; } 
88   else 
89     cp = new AliEMCALClusterizerv1(fileName) ; 
90   
91   cp->ExecuteTask("deb") ; 
92   
93   delete cp ;
94 }
95
96 // //________________________________________________________________________
97 // void EMCALRecPoints2TrackSegments( Bool_t split=kFALSE, TString fileName = "galice.root") {
98   
99 //  // usage : 
100 //   // 1. write TrackSegments in the same file as RecPoints --------------- (OK) 
101 //   //root [0] .L Reconstruct.C++
102 //   //root [1] RecPoints2TrackSegments()
103 //   // 2. write TrackSegments in a separate file, one per detector, from RecPoints --------------- (Not needed) 
104 //   //root [0] .L Reconstruct.C++
105 //   //root [1] RecPoints2TrackSegments(kTRUE) // TrackSegments saved in [DET}.RecData.root (DET=EMCAL, EMCAL)
106
107 //   delete gAlice ; 
108 //   gAlice = 0 ; 
109   
110 //   AliEMCALTrackSegmentMaker * tmp = 0 ; 
111  
112 //   if (split)
113 //     tmp = new AliEMCALTrackSegmentMakerv1("EMCAL.RecData.root") ; 
114 //   else 
115 //     tmp = new AliEMCALTrackSegmentMakerv1(fileName) ; 
116   
117 //   tmp->ExecuteTask("deb") ; 
118   
119 //   delete tmp ;
120 // }
121
122 // //________________________________________________________________________
123 // void EMCALTrackSegments2RecParticles( Bool_t split=kFALSE, TString fileName = "galice.root") {
124   
125 //  // usage : 
126 //   // 1. write RecParticles in the same file as TrackSegments ---------------  (OK)
127 //   //root [0] .L Reconstruct.C++
128 //   //root [1] TrackSegments2RecParticles()
129 //   // 2. write RecParticles in a separate file, one per detector, from TrackSegments --------------- (Not needed) 
130 //   //root [0] .L Reconstruct.C++
131 //   //root [1] TrackSegments2RecParticles(kTRUE) // RecParticles saved in [DET}.RecData.root (DET=EMCAL, EMCAL)
132
133 //   delete gAlice ; 
134 //   gAlice = 0 ; 
135   
136 //   AliEMCALPID * pp = 0 ; 
137  
138 //   if (split) 
139 //     pp = new AliEMCALPIDv1("EMCAL.RecData.root") ; 
140 //   else 
141 //     pp = new AliEMCALPIDv1(fileName) ; 
142   
143 //   pp->ExecuteTask("deb") ; 
144   
145 //   delete pp ;
146 // }
147
148 // //________________________________________________________________________
149 // void EMCALDigits2RecParticles( Bool_t split=kFALSE, TString fileName = "galice.root") {
150   
151 //  // usage : 
152 //   // 1. write RecPoints, TrackSegments and RecParticles in the same file as Digits --------------- (OK)
153 //   //root [0] .L Reconstruct.C++
154 //   //root [1] Digits2RecParticles()
155 //   // 2. write RecPoints , TrackSegments and RecParticles in a separate file, one per detector, from Digits --------------- (OK)
156 //   //root [0] .L Reconstruct.C++
157 //   //root [1] Digits2RecParticles(kTRUE) // TrackSegments saved in [DET}.RecData.root (DET=EMCAL, EMCAL)
158
159  
160 //   delete gAlice ; 
161 //   gAlice = 0 ; 
162  
163 //   // EMCAL
164 //   AliEMCALClusterizer * cp = 0 ; 
165  
166 //   if (split) {
167 //     cp = new AliEMCALClusterizerv1("EMCAL.Digits.root") ; 
168 //     cp->SetSplitFile() ; } 
169 //   else 
170 //     cp = new AliEMCALClusterizerv1(fileName) ; 
171   
172 //   cp->ExecuteTask("deb") ; 
173
174 //   if (split) 
175 //     delete cp ;
176   
177 //   AliEMCALTrackSegmentMaker * tmp = 0 ; 
178   
179 //   if (split) 
180 //     tmp = new AliEMCALTrackSegmentMakerv1("EMCAL.RecData.root") ; 
181 //   else 
182 //     tmp = new AliEMCALTrackSegmentMakerv1(fileName) ; 
183   
184 //   tmp->ExecuteTask("deb") ; 
185   
186 //   AliEMCALPID * pp = 0 ; 
187  
188 //   if (split) 
189 //     pp = new AliEMCALPIDv1("EMCAL.RecData.root") ; 
190 //   else 
191 //     pp = new AliEMCALPIDv1(fileName) ; 
192   
193 //   pp->ExecuteTask("deb") ; 
194   
195 //   delete tmp; 
196 //   delete pp ; 
197 // }
198
199 //________________________________________________________________________
200 void EMCALHits2Digits (Bool_t split=kFALSE, TString fileName = "galice.root") {
201   // usage : 
202   // 1. write (S)Digits in the same file as Hits --------------- (OK)
203   //root [0] .L Reconstruct.C++
204   //root [1] Hits2Digits()
205   // 2. write (S)Digits in a separate file, one per detector, from Hits --------------- (OK)
206   //root [0] .L Reconstruct.C++
207   //root [1] Hits2Digits(kTRUE) // SDigits saved in [DET}.SDigits.root (DET=EMCAL, EMCAL)
208                                 // Digits  saved in [DET}.Digits.root  (DET=EMCAL, EMCAL)
209
210   delete gAlice ; 
211   gAlice = 0 ; 
212   
213   //EMCAL
214   AliEMCALSDigitizer * sdp = new AliEMCALSDigitizer(fileName) ; 
215   if (split) 
216     sdp->SetSplitFile() ;
217   sdp->ExecuteTask("deb") ; 
218
219   if (split) 
220     delete sdp ; 
221
222   AliEMCALDigitizer * dp = 0 ; 
223  
224   if (split) {
225     dp = new AliEMCALDigitizer("EMCAL.SDigits.root") ; 
226     dp->SetSplitFile() ; } 
227   else 
228     dp = new AliEMCALDigitizer(fileName) ; 
229   
230   dp->ExecuteTask("deb") ; 
231
232   if (split) 
233     delete dp ; 
234
235   if (!split) { 
236     delete sdp ; 
237     delete dp ; 
238   }
239 }
240
241