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 //_________________________________________________________________________
19 // Algorithm class for the reconstruction: clusterizer
20 // track segment maker
21 // particle identifier
23 //*-- Author: Gines Martinez & Yves Schutz (SUBATECH)
26 // --- ROOT system ---
28 #include "TClonesArray.h"
30 // --- Standard library ---
34 // --- AliRoot header files ---
36 #include "AliPHOSReconstructioner.h"
37 #include "AliPHOSClusterizer.h"
38 #include "AliPHOSFastRecParticle.h"
39 #include "AliPHOSCpvRecPoint.h"
41 ClassImp(AliPHOSReconstructioner)
43 //____________________________________________________________________________
44 AliPHOSReconstructioner::AliPHOSReconstructioner(AliPHOSClusterizer * Clusterizer,
45 AliPHOSTrackSegmentMaker * Tracker,
50 fClusterizer = Clusterizer ;
51 fTrackSegmentMaker = Tracker ;
53 fDebugReconstruction = kFALSE ;
57 //____________________________________________________________________________
58 void AliPHOSReconstructioner::Init(AliPHOSClusterizer * Clusterizer,
59 AliPHOSTrackSegmentMaker * Tracker,
64 fClusterizer = Clusterizer ;
65 fTrackSegmentMaker = Tracker ;
67 fDebugReconstruction = kFALSE ;
70 //____________________________________________________________________________
71 void AliPHOSReconstructioner::Make(DigitsList * dl,
72 AliPHOSRecPoint::RecPointsList * emccl,
73 AliPHOSRecPoint::RecPointsList * ppsdl,
74 AliPHOSTrackSegment::TrackSegmentsList * trsl,
75 AliPHOSRecParticle::RecParticlesList * rpl)
77 // Launches the Reconstruction process in the sequence: Make the reconstructed poins (clusterize)
78 // Make the track segments
79 // Make the reconstructed particles
81 if (fDebugReconstruction)
82 cout << "\n\nDebugReconstruction>>> " << "Start making reconstructed points (clusterizing!!)" << endl;
84 fClusterizer->MakeClusters(dl, emccl, ppsdl);
86 if (fDebugReconstruction){
87 cout << "DebugReconstruction>>> " << "AliPHOSReconstructioner: Digit list entries is " << dl->GetEntries() << endl ;
88 cout << "AliPHOSReconstructioner: Emc list entries is " << emccl->GetEntries() << endl ;
89 cout << "AliPHOSReconstructioner: Ppsd list entries is " << ppsdl->GetEntries() << endl ;
93 if (fDebugReconstruction) {
94 cout << ">>>>>>>>>>>>>>>>>>>>>> DebugReconstruction <<<<<<<<<<<<<<<<<<<<<<<<<<" << endl ;
95 cout << "DebugReconstruction>>> Digit list entries is " << dl->GetEntries() << endl ;
99 cout << "DebugReconstruction>>> Vol Id " <<
103 " Primaries list " << endl;
104 for (index = 0 ; index < dl->GetEntries() ; index++) {
105 digit = (AliPHOSDigit * ) dl->At(index) ;
106 calorimeter = fClusterizer->IsInEmc(digit);
107 if (calorimeter) factor =1000. ; else factor=1000000.;
108 cout << "DebugReconstruction>>> " <<
109 setw(8) << digit->GetId() << " " <<
110 setw(3) << (Int_t) calorimeter <<
111 setw(10) << factor*fClusterizer->Calibrate(digit->GetAmp()) << " " <<
112 setw(6) << digit->GetIndexInList() << " " <<
113 setw(5) << digit->GetNprimary() <<" ";
114 for (Int_t iprimary=0; iprimary<digit->GetNprimary(); iprimary++)
115 cout << setw(5) << digit->GetPrimary(iprimary+1) << " ";
124 if (fDebugReconstruction) cout << "DebugReconstruction>>> Start making reconstructed points (clusterizing)" << endl;
126 // mark the position of the RecPoints in the array
127 AliPHOSEmcRecPoint * emcrp ;
128 for (index = 0 ; index < emccl->GetEntries() ; index++) {
129 emcrp = (AliPHOSEmcRecPoint * )emccl->At(index) ;
130 emcrp->SetIndexInList(index) ;
132 AliPHOSPpsdRecPoint * ppsdrp ;
133 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
134 ppsdrp = (AliPHOSPpsdRecPoint * )ppsdl->At(index) ;
135 ppsdrp->SetIndexInList(index) ;
138 if (fDebugReconstruction) {
139 cout << "DebugReconstruction>>> Cluster emc list entries is " << emccl->GetEntries() << endl ;
140 AliPHOSEmcRecPoint * recpoint;
141 cout << "DebugReconstruction>>> Module " <<
152 " Primaries list " << endl;
153 for (index = 0 ; index < emccl->GetEntries() ; index++) {
154 recpoint = (AliPHOSEmcRecPoint * )emccl->At(index) ;
155 TVector3 locpos; recpoint->GetLocalPosition(locpos);
156 Float_t lambda[2]; recpoint->GetElipsAxis(lambda);
159 primaries = recpoint->GetPrimaries(nprimaries);
160 cout << "DebugReconstruction>>> " <<
161 setw(2) <<recpoint->GetPHOSMod() << " " <<
162 setw(9) << 1000.*recpoint->GetTotalEnergy() << " " <<
163 setw(6) << recpoint->GetIndexInList() << " " <<
164 setw(5) << recpoint->GetMultiplicity() <<" " <<
165 setw(8) << locpos.X() <<" " <<
166 setw(8) << locpos.Y() <<" " <<
167 setw(8) << locpos.Z() << " " <<
168 setw(10) << lambda[0] << " " <<
169 setw(10) << lambda[1] << " " <<
170 setw(9) << 1000*recpoint->GetMaximalEnergy() << " " <<
171 setw(9) << nprimaries << " ";
172 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
173 cout << setw(4) << primaries[iprimary] << " ";
177 cout << "DebugReconstruction>>> Cluster ppsd list entries is " << ppsdl->GetEntries() << endl ;
178 AliPHOSPpsdRecPoint * ppsdrecpoint;
180 cout << "DebugReconstruction>>> Module " <<
189 " Primaries list " << endl;
190 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
191 ppsdrecpoint = (AliPHOSPpsdRecPoint * ) ppsdl->At(index) ;
192 TVector3 locpos; ppsdrecpoint->GetLocalPosition(locpos);
195 if (ppsdrecpoint->GetUp())
196 strcpy(detector, "CPV");
198 strcpy(detector, "PC ");
199 primaries = ppsdrecpoint->GetPrimaries(nprimaries);
200 cout << "DebugReconstruction>>> " <<
201 setw(4) << ppsdrecpoint->GetPHOSMod() << " " <<
202 setw(4) << detector << " " <<
203 setw(9) << 1000000.*ppsdrecpoint->GetTotalEnergy() << " " <<
204 setw(6) << ppsdrecpoint->GetIndexInList() << " " <<
205 setw(5) << ppsdrecpoint->GetMultiplicity() <<" " <<
206 setw(8) << locpos.X() <<" " <<
207 setw(8) << locpos.Y() <<" " <<
208 setw(8) << locpos.Z() << " " <<
209 setw(9) << nprimaries << " ";
210 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
211 cout << setw(4) << primaries[iprimary] << " ";
217 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making track segments(unfolding+tracksegments)" << endl;
218 fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, trsl) ;
220 // mark the position of the TrackSegments in the array
221 AliPHOSTrackSegment * trs ;
222 for (index = 0 ; index < trsl->GetEntries() ; index++) {
223 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
224 trs->SetIndexInList(index) ;
226 if (fDebugReconstruction){
227 cout << "DebugReconstruction>>> Track segment list entries is " << trsl->GetEntries() << endl ;
228 cout << "DebugReconstruction>>> Module " <<
238 " Primaries list " << endl;
240 for (index = 0 ; index < trsl->GetEntries() ; index++) {
241 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
242 TVector3 locpos; trs->GetPosition(locpos);
245 primaries = trs->GetPrimariesEmc(nprimaries);
246 cout << "DebugReconstruction>>> " <<
247 setw(4) << trs->GetPHOSMod() << " " <<
248 setw(9) << 1000.*trs->GetEnergy() << " " <<
249 setw(3) << trs->GetIndexInList() << " " <<
250 setw(9) << locpos.X() <<" " <<
251 setw(9) << locpos.Y() <<" " <<
252 setw(9) << locpos.Z() << " " <<
253 setw(10) << (trs->GetMomentumDirection()).X() << " " <<
254 setw(10) << (trs->GetMomentumDirection()).Y() << " " <<
255 setw(10) << (trs->GetMomentumDirection()).Z() << " " <<
256 setw(4) << nprimaries << " ";
257 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
258 cout << setw(4) << primaries[iprimary] << " ";
263 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making reconstructed particles" << endl;
265 fPID->MakeParticles(trsl, rpl) ;
267 // mark the position of the RecParticles in the array
268 AliPHOSRecParticle * rp ;
269 for (index = 0 ; index < rpl->GetEntries() ; index++) {
270 rp = (AliPHOSRecParticle * )rpl->At(index) ;
271 rp->SetIndexInList(index) ;
273 //Debugger of RecParticles
274 if (fDebugReconstruction){
275 cout << "DebugReconstruction>>> Reconstructed particle list entries is " << rpl->GetEntries() << endl ;
276 cout << "DebugReconstruction>>> Module " <<
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);
291 primaries = (rp->GetPHOSTrackSegment())->GetPrimariesEmc(nprimaries);
292 switch(rp->GetType())
294 case AliPHOSFastRecParticle::kNEUTRALEM:
295 strcpy( particle, "NEUTRAL_EM");
297 case AliPHOSFastRecParticle::kNEUTRALHA:
298 strcpy(particle, "NEUTRAL_HA");
300 case AliPHOSFastRecParticle::kGAMMA:
301 strcpy(particle, "GAMMA");
303 case AliPHOSFastRecParticle::kGAMMAHA:
304 strcpy(particle, "GAMMA_H");
306 case AliPHOSFastRecParticle::kABSURDEM:
307 strcpy(particle, "ABSURD_EM") ;
309 case AliPHOSFastRecParticle::kABSURDHA:
310 strcpy(particle, "ABSURD_HA") ;
312 case AliPHOSFastRecParticle::kELECTRON:
313 strcpy(particle, "ELECTRON") ;
315 case AliPHOSFastRecParticle::kCHARGEDHA:
316 strcpy(particle, "CHARGED_HA") ;
320 cout << "DebugReconstruction>>> " <<
321 setw(4) << (rp->GetPHOSTrackSegment())->GetPHOSMod() << " " <<
322 setw(15) << particle << " " <<
323 setw(9) << 1000.*(rp->GetPHOSTrackSegment())->GetEnergy() << " " <<
324 setw(3) << rp->GetIndexInList() << " " <<
325 setw(9) << locpos.X() <<" " <<
326 setw(9) << locpos.Y() <<" " <<
327 setw(9) << locpos.Z() << " " <<
328 setw(4) << nprimaries << " ";
329 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
330 cout << setw(4) << primaries[iprimary] << " ";
339 //____________________________________________________________________________
340 void AliPHOSReconstructioner::Make(DigitsList * dl,
341 AliPHOSRecPoint::RecPointsList * emccl,
342 AliPHOSRecPoint::RecPointsList * cpvcl)
345 // Launches the Reconstruction process of EMC and CPV in the sequence:
346 // Make the reconstructed poins (clusterize)
347 // Make the track segments
348 // Particle identification is not made here
349 // EMC and CPV rec.points are the same yet
351 // Yuri Kharlov. 20 October 2000
356 if (fDebugReconstruction)
357 cout << "DebugReconstruction>>> Start clusterizing reconstructed points" << endl;
358 fClusterizer->MakeClusters(dl, emccl, cpvcl);
360 if (fDebugReconstruction){
362 cout << "AliPHOSReconstructioner: Digit list entries are " << dl->GetEntries() << endl ;
363 cout << "AliPHOSReconstructioner: EMC list entries are " << emccl->GetEntries() << endl ;
364 cout << "AliPHOSReconstructioner: CPV list entries are " << cpvcl->GetEntries() << endl ;
365 cout << ">>>>>>>>>>>>>>>>>>>>>> DebugReconstruction <<<<<<<<<<<<<<<<<<<<<<<<<<" << endl ;
366 cout << "DebugReconstruction>>> Digit list entries is " << dl->GetEntries() << endl ;
367 AliPHOSDigit * digit;
370 cout << "DebugReconstruction>>> Vol Id " <<
374 " Primaries list " << endl;
375 for (index = 0 ; index < dl->GetEntries() ; index++) {
376 digit = (AliPHOSDigit * ) dl->At(index) ;
377 calorimeter = fClusterizer->IsInEmc(digit);
378 if (calorimeter) factor =1000. ; else factor=1000000.;
379 cout << "DebugReconstruction>>> " <<
380 setw(8) << digit->GetId() << " " <<
381 setw(3) << (Int_t) calorimeter <<
382 setw(10) << factor*fClusterizer->Calibrate(digit->GetAmp()) << " " <<
383 setw(6) << digit->GetIndexInList() << " " <<
384 setw(5) << digit->GetNprimary() <<" ";
385 for (Int_t iprimary=0; iprimary<digit->GetNprimary(); iprimary++)
386 cout << setw(5) << digit->GetPrimary(iprimary+1) << " ";
392 // mark the position of the RecPoints in the array
393 AliPHOSEmcRecPoint * emcrp ;
394 Int_t currentPHOSModule;
395 for (index = 0 ; index < emccl->GetEntries() ; index++) {
396 emcrp = (AliPHOSEmcRecPoint * )emccl->At(index) ;
397 emcrp ->SetIndexInList(index) ;
398 TVector3 locpos; emcrp->GetLocalPosition(locpos);
399 currentPHOSModule = emcrp->GetPHOSMod();
401 AliPHOSCpvRecPoint * cpvrp ;
402 for (index = 0 ; index < cpvcl->GetEntries() ; index++) {
403 cpvrp = (AliPHOSCpvRecPoint * )cpvcl->At(index) ;
404 cpvrp ->SetIndexInList(index) ;
405 TVector3 locpos; cpvrp->GetLocalPosition(locpos);
406 Int_t lengX,lengZ; cpvrp->GetClusterLengths(lengX,lengZ);
407 currentPHOSModule = cpvrp->GetPHOSMod();
410 if (fDebugReconstruction)
411 cout << "DebugReconstruction>>>> Start unfolding reconstructed points" << endl;
412 fTrackSegmentMaker->MakeTrackSegmentsCPV(dl, emccl, cpvcl) ;