]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSReconstructioner.cxx
the MIXT geometry (IHEP+GPS2) has been introduced
[u/mrichter/AliRoot.git] / PHOS / AliPHOSReconstructioner.cxx
CommitLineData
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//_________________________________________________________________________
b2a60966 19// Algorithm class for the reconstruction: clusterizer
20// track segment maker
21// particle identifier
a3dfe79c 22//*--
b2a60966 23//*-- Author: Gines Martinez & Yves Schutz (SUBATECH)
24
d15a28e7 25
26// --- ROOT system ---
27
28#include "TClonesArray.h"
29
30// --- Standard library ---
31
e126816e 32#include <iomanip.h>
364de5c6 33
d15a28e7 34// --- AliRoot header files ---
35
36#include "AliPHOSReconstructioner.h"
37#include "AliPHOSClusterizer.h"
9ec91567 38#include "AliPHOSFastRecParticle.h"
0b06c60d 39#include "AliPHOSCpvRecPoint.h"
d15a28e7 40
41ClassImp(AliPHOSReconstructioner)
42
d15a28e7 43//____________________________________________________________________________
6ad0bfa0 44AliPHOSReconstructioner::AliPHOSReconstructioner(AliPHOSClusterizer * Clusterizer,
45 AliPHOSTrackSegmentMaker * Tracker,
908558fc 46 AliPHOSPID * Pid)
d15a28e7 47{
b2a60966 48 // ctor
49
6ad0bfa0 50 fClusterizer = Clusterizer ;
51 fTrackSegmentMaker = Tracker ;
908558fc 52 fPID = Pid ;
364de5c6 53 fDebugReconstruction = kFALSE ;
d15a28e7 54}
55
d15a28e7 56
57//____________________________________________________________________________
6ad0bfa0 58 void AliPHOSReconstructioner::Init(AliPHOSClusterizer * Clusterizer,
59 AliPHOSTrackSegmentMaker * Tracker,
908558fc 60 AliPHOSPID * Pid)
6ad0bfa0 61{
839ffcb3 62 // Initialisation
63
6ad0bfa0 64 fClusterizer = Clusterizer ;
65 fTrackSegmentMaker = Tracker ;
908558fc 66 fPID = Pid ;
364de5c6 67 fDebugReconstruction = kFALSE ;
6ad0bfa0 68}
69
6ad0bfa0 70//____________________________________________________________________________
b73f246d 71 void AliPHOSReconstructioner::Make(DigitsList * dl,
72 AliPHOSRecPoint::RecPointsList * emccl,
73 AliPHOSRecPoint::RecPointsList * ppsdl,
74 AliPHOSRecPoint::RecPointsList * cpvcl,
75 AliPHOSTrackSegment::TrackSegmentsList * trsl,
76 AliPHOSRecParticle::RecParticlesList * rpl)
d15a28e7 77{
b2a60966 78 // Launches the Reconstruction process in the sequence: Make the reconstructed poins (clusterize)
79 // Make the track segments
80 // Make the reconstructed particles
59cd4405 81 Int_t index ;
2131115b 82 if (fDebugReconstruction)
51926850 83 cout << "\n\nDebugReconstruction>>> " << "Start making reconstructed points (clusterizing!!)" << endl;
2131115b 84
b73f246d 85 fClusterizer->MakeClusters(dl, emccl, ppsdl, cpvcl);
86
2131115b 87 if (fDebugReconstruction){
88 cout << "DebugReconstruction>>> " << "AliPHOSReconstructioner: Digit list entries is " << dl->GetEntries() << endl ;
89 cout << "AliPHOSReconstructioner: Emc list entries is " << emccl->GetEntries() << endl ;
90 cout << "AliPHOSReconstructioner: Ppsd list entries is " << ppsdl->GetEntries() << endl ;
91 }
59cd4405 92
364de5c6 93 // Digit Debuging
2aad621e 94 if (fDebugReconstruction) {
95 cout << ">>>>>>>>>>>>>>>>>>>>>> DebugReconstruction <<<<<<<<<<<<<<<<<<<<<<<<<<" << endl ;
96 cout << "DebugReconstruction>>> Digit list entries is " << dl->GetEntries() << endl ;
97 AliPHOSDigit * digit;
98 Bool_t calorimeter ;
99 Float_t factor;
100 cout << "DebugReconstruction>>> Vol Id " <<
51926850 101 " Ene(MeV, KeV) " <<
102 " Index " <<
103 " Nprim " <<
104 " Primaries list " << endl;
2aad621e 105 for (index = 0 ; index < dl->GetEntries() ; index++) {
106 digit = (AliPHOSDigit * ) dl->At(index) ;
107 calorimeter = fClusterizer->IsInEmc(digit);
108 if (calorimeter) factor =1000. ; else factor=1000000.;
109 cout << "DebugReconstruction>>> " <<
51926850 110 setw(8) << digit->GetId() << " " <<
111 setw(3) << (Int_t) calorimeter <<
112 setw(10) << factor*fClusterizer->Calibrate(digit->GetAmp()) << " " <<
2aad621e 113 setw(6) << digit->GetIndexInList() << " " <<
51926850 114 setw(5) << digit->GetNprimary() <<" ";
115 for (Int_t iprimary=0; iprimary<digit->GetNprimary(); iprimary++)
116 cout << setw(5) << digit->GetPrimary(iprimary+1) << " ";
117 cout << endl;
364de5c6 118 }
2aad621e 119
120 }
364de5c6 121
2885696f 122 // Making Clusters
031f0861 123 if (fDebugReconstruction) cout << "DebugReconstruction>>> Start making reconstructed points (clusterizing)" << endl;
6ad0bfa0 124
031f0861 125 // mark the position of the RecPoints in the array
126 AliPHOSEmcRecPoint * emcrp ;
127 for (index = 0 ; index < emccl->GetEntries() ; index++) {
128 emcrp = (AliPHOSEmcRecPoint * )emccl->At(index) ;
129 emcrp->SetIndexInList(index) ;
130 }
131 AliPHOSPpsdRecPoint * ppsdrp ;
132 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
133 ppsdrp = (AliPHOSPpsdRecPoint * )ppsdl->At(index) ;
134 ppsdrp->SetIndexInList(index) ;
135 }
2aad621e 136
51926850 137 if (fDebugReconstruction) {
138 cout << "DebugReconstruction>>> Cluster emc list entries is " << emccl->GetEntries() << endl ;
139 AliPHOSEmcRecPoint * recpoint;
140 cout << "DebugReconstruction>>> Module " <<
141 "Ene(MeV) " <<
142 "Index " <<
143 "Multi " <<
144 " X " <<
145 " Y " <<
146 " Z " <<
147 " Lambda 1 " <<
148 " Lambda 2 " <<
149 "MaxEnergy(MeV) " <<
150 "Nprim " <<
151 " Primaries list " << endl;
152 for (index = 0 ; index < emccl->GetEntries() ; index++) {
153 recpoint = (AliPHOSEmcRecPoint * )emccl->At(index) ;
154 TVector3 locpos; recpoint->GetLocalPosition(locpos);
155 Float_t lambda[2]; recpoint->GetElipsAxis(lambda);
156 Int_t * primaries;
157 Int_t nprimaries;
158 primaries = recpoint->GetPrimaries(nprimaries);
159 cout << "DebugReconstruction>>> " <<
160 setw(2) <<recpoint->GetPHOSMod() << " " <<
161 setw(9) << 1000.*recpoint->GetTotalEnergy() << " " <<
162 setw(6) << recpoint->GetIndexInList() << " " <<
163 setw(5) << recpoint->GetMultiplicity() <<" " <<
164 setw(8) << locpos.X() <<" " <<
165 setw(8) << locpos.Y() <<" " <<
166 setw(8) << locpos.Z() << " " <<
167 setw(10) << lambda[0] << " " <<
168 setw(10) << lambda[1] << " " <<
169 setw(9) << 1000*recpoint->GetMaximalEnergy() << " " <<
170 setw(9) << nprimaries << " ";
171 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
172 cout << setw(4) << primaries[iprimary] << " ";
173 cout << endl;
174 }
2aad621e 175
51926850 176 cout << "DebugReconstruction>>> Cluster ppsd list entries is " << ppsdl->GetEntries() << endl ;
177 AliPHOSPpsdRecPoint * ppsdrecpoint;
178 Text_t detector[4];
179 cout << "DebugReconstruction>>> Module " <<
180 "Det " <<
181 "Ene(KeV) " <<
182 "Index " <<
183 "Multi " <<
184 " X " <<
185 " Y " <<
186 " Z " <<
187 "Nprim " <<
188 " Primaries list " << endl;
189 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
190 ppsdrecpoint = (AliPHOSPpsdRecPoint * ) ppsdl->At(index) ;
191 TVector3 locpos; ppsdrecpoint->GetLocalPosition(locpos);
192 Int_t * primaries;
193 Int_t nprimaries;
194 if (ppsdrecpoint->GetUp())
195 strcpy(detector, "CPV");
196 else
197 strcpy(detector, "PC ");
198 primaries = ppsdrecpoint->GetPrimaries(nprimaries);
199 cout << "DebugReconstruction>>> " <<
200 setw(4) << ppsdrecpoint->GetPHOSMod() << " " <<
201 setw(4) << detector << " " <<
202 setw(9) << 1000000.*ppsdrecpoint->GetTotalEnergy() << " " <<
203 setw(6) << ppsdrecpoint->GetIndexInList() << " " <<
204 setw(5) << ppsdrecpoint->GetMultiplicity() <<" " <<
205 setw(8) << locpos.X() <<" " <<
206 setw(8) << locpos.Y() <<" " <<
207 setw(8) << locpos.Z() << " " <<
208 setw(9) << nprimaries << " ";
209 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
210 cout << setw(4) << primaries[iprimary] << " ";
211 cout << endl;
212 }
213 }
2aad621e 214
215
031f0861 216 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making track segments(unfolding+tracksegments)" << endl;
b73f246d 217 fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, cpvcl, trsl) ;
2aad621e 218
83974468 219 // mark the position of the TrackSegments in the array
220 AliPHOSTrackSegment * trs ;
221 for (index = 0 ; index < trsl->GetEntries() ; index++) {
222 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
223 trs->SetIndexInList(index) ;
224 }
031f0861 225 if (fDebugReconstruction){
226 cout << "DebugReconstruction>>> Track segment list entries is " << trsl->GetEntries() << endl ;
227 cout << "DebugReconstruction>>> Module " <<
228 "Ene(KeV) " <<
51926850 229 "Index " <<
230 " X " <<
231 " Y " <<
232 " Z " <<
233 " rX " <<
234 " rY " <<
235 " rZ " <<
236 "Nprim " <<
237 " Primaries list " << endl;
2aad621e 238
031f0861 239 for (index = 0 ; index < trsl->GetEntries() ; index++) {
240 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
241 TVector3 locpos; trs->GetPosition(locpos);
242 Int_t * primaries;
243 Int_t nprimaries;
244 primaries = trs->GetPrimariesEmc(nprimaries);
245 cout << "DebugReconstruction>>> " <<
246 setw(4) << trs->GetPHOSMod() << " " <<
247 setw(9) << 1000.*trs->GetEnergy() << " " <<
248 setw(3) << trs->GetIndexInList() << " " <<
249 setw(9) << locpos.X() <<" " <<
250 setw(9) << locpos.Y() <<" " <<
251 setw(9) << locpos.Z() << " " <<
252 setw(10) << (trs->GetMomentumDirection()).X() << " " <<
253 setw(10) << (trs->GetMomentumDirection()).Y() << " " <<
254 setw(10) << (trs->GetMomentumDirection()).Z() << " " <<
51926850 255 setw(4) << nprimaries << " ";
256 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
257 cout << setw(4) << primaries[iprimary] << " ";
258 cout << endl;
2aad621e 259 }
260
031f0861 261 }
2aad621e 262 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making reconstructed particles" << endl;
b73f246d 263
264 if (fPID) {
265 fPID->MakeParticles(trsl, rpl) ;
83974468 266
b73f246d 267 // mark the position of the RecParticles in the array
268 AliPHOSRecParticle * rp ;
2aad621e 269 for (index = 0 ; index < rpl->GetEntries() ; index++) {
b73f246d 270 rp = (AliPHOSRecParticle * )rpl->At(index) ;
271 rp->SetIndexInList(index) ;
272 }
273 //Debugger of RecParticles
274 if (fDebugReconstruction){
275 cout << "DebugReconstruction>>> Reconstructed particle list entries is " << rpl->GetEntries() << endl ;
276 cout << "DebugReconstruction>>> Module " <<
277 " PARTICLE " <<
278 "Ene(KeV) " <<
279 "Index " <<
280 " X " <<
281 " Y " <<
282 " Z " <<
283 "Nprim " <<
284 " Primaries list " << endl;
285 for (index = 0 ; index < rpl->GetEntries() ; index++) {
286 rp = (AliPHOSRecParticle * ) rpl->At(index) ;
287 TVector3 locpos; (rp->GetPHOSTrackSegment())->GetPosition(locpos);
288 Int_t * primaries;
289 Int_t nprimaries;
290 Text_t particle[11];
291 primaries = (rp->GetPHOSTrackSegment())->GetPrimariesEmc(nprimaries);
292 switch(rp->GetType()) {
9ec91567 293 case AliPHOSFastRecParticle::kNEUTRALEM:
e126816e 294 strcpy( particle, "NEUTRAL_EM");
2aad621e 295 break;
9ec91567 296 case AliPHOSFastRecParticle::kNEUTRALHA:
e126816e 297 strcpy(particle, "NEUTRAL_HA");
2aad621e 298 break;
9ec91567 299 case AliPHOSFastRecParticle::kGAMMA:
e126816e 300 strcpy(particle, "GAMMA");
2aad621e 301 break ;
9ec91567 302 case AliPHOSFastRecParticle::kGAMMAHA:
e126816e 303 strcpy(particle, "GAMMA_H");
2aad621e 304 break ;
9ec91567 305 case AliPHOSFastRecParticle::kABSURDEM:
e126816e 306 strcpy(particle, "ABSURD_EM") ;
2aad621e 307 break ;
9ec91567 308 case AliPHOSFastRecParticle::kABSURDHA:
e126816e 309 strcpy(particle, "ABSURD_HA") ;
2aad621e 310 break ;
9ec91567 311 case AliPHOSFastRecParticle::kELECTRON:
e126816e 312 strcpy(particle, "ELECTRON") ;
2aad621e 313 break ;
9ec91567 314 case AliPHOSFastRecParticle::kCHARGEDHA:
e126816e 315 strcpy(particle, "CHARGED_HA") ;
2aad621e 316 break ;
317 }
b73f246d 318
319 cout << "DebugReconstruction>>> " <<
320 setw(4) << (rp->GetPHOSTrackSegment())->GetPHOSMod() << " " <<
321 setw(15) << particle << " " <<
322 setw(9) << 1000.*(rp->GetPHOSTrackSegment())->GetEnergy() << " " <<
323 setw(3) << rp->GetIndexInList() << " " <<
324 setw(9) << locpos.X() <<" " <<
325 setw(9) << locpos.Y() <<" " <<
326 setw(9) << locpos.Z() << " " <<
327 setw(4) << nprimaries << " ";
328 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
329 cout << setw(4) << primaries[iprimary] << " ";
330 cout << endl;
331 }
2aad621e 332 }
333
334 }
335
51926850 336}