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 AliPHOSRecPoint::RecPointsList * cpvcl,
75 AliPHOSTrackSegment::TrackSegmentsList * trsl,
76 AliPHOSRecParticle::RecParticlesList * rpl)
78 // Launches the Reconstruction process in the sequence: Make the reconstructed poins (clusterize)
79 // Make the track segments
80 // Make the reconstructed particles
82 if (fDebugReconstruction)
83 cout << "\n\nDebugReconstruction>>> " << "Start making reconstructed points (clusterizing!!)" << endl;
85 fClusterizer->MakeClusters(dl, emccl, ppsdl, cpvcl);
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 ;
94 if (fDebugReconstruction) {
95 cout << ">>>>>>>>>>>>>>>>>>>>>> DebugReconstruction <<<<<<<<<<<<<<<<<<<<<<<<<<" << endl ;
96 cout << "DebugReconstruction>>> Digit list entries is " << dl->GetEntries() << endl ;
100 cout << "DebugReconstruction>>> Vol Id " <<
104 " Primaries list " << endl;
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>>> " <<
110 setw(8) << digit->GetId() << " " <<
111 setw(3) << (Int_t) calorimeter <<
112 setw(10) << factor*fClusterizer->Calibrate(digit->GetAmp()) << " " <<
113 setw(6) << digit->GetIndexInList() << " " <<
114 setw(5) << digit->GetNprimary() <<" ";
115 for (Int_t iprimary=0; iprimary<digit->GetNprimary(); iprimary++)
116 cout << setw(5) << digit->GetPrimary(iprimary+1) << " ";
123 if (fDebugReconstruction) cout << "DebugReconstruction>>> Start making reconstructed points (clusterizing)" << endl;
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) ;
131 AliPHOSPpsdRecPoint * ppsdrp ;
132 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
133 ppsdrp = (AliPHOSPpsdRecPoint * )ppsdl->At(index) ;
134 ppsdrp->SetIndexInList(index) ;
137 if (fDebugReconstruction) {
138 cout << "DebugReconstruction>>> Cluster emc list entries is " << emccl->GetEntries() << endl ;
139 AliPHOSEmcRecPoint * recpoint;
140 cout << "DebugReconstruction>>> Module " <<
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);
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] << " ";
176 cout << "DebugReconstruction>>> Cluster ppsd list entries is " << ppsdl->GetEntries() << endl ;
177 AliPHOSPpsdRecPoint * ppsdrecpoint;
179 cout << "DebugReconstruction>>> Module " <<
188 " Primaries list " << endl;
189 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
190 ppsdrecpoint = (AliPHOSPpsdRecPoint * ) ppsdl->At(index) ;
191 TVector3 locpos; ppsdrecpoint->GetLocalPosition(locpos);
194 if (ppsdrecpoint->GetUp())
195 strcpy(detector, "CPV");
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] << " ";
216 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making track segments(unfolding+tracksegments)" << endl;
217 fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, cpvcl, trsl) ;
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) ;
225 if (fDebugReconstruction){
226 cout << "DebugReconstruction>>> Track segment list entries is " << trsl->GetEntries() << endl ;
227 cout << "DebugReconstruction>>> Module " <<
237 " Primaries list " << endl;
239 for (index = 0 ; index < trsl->GetEntries() ; index++) {
240 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
241 TVector3 locpos; trs->GetPosition(locpos);
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() << " " <<
255 setw(4) << nprimaries << " ";
256 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
257 cout << setw(4) << primaries[iprimary] << " ";
262 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()) {
293 case AliPHOSFastRecParticle::kNEUTRALEM:
294 strcpy( particle, "NEUTRAL_EM");
296 case AliPHOSFastRecParticle::kNEUTRALHA:
297 strcpy(particle, "NEUTRAL_HA");
299 case AliPHOSFastRecParticle::kGAMMA:
300 strcpy(particle, "GAMMA");
302 case AliPHOSFastRecParticle::kGAMMAHA:
303 strcpy(particle, "GAMMA_H");
305 case AliPHOSFastRecParticle::kABSURDEM:
306 strcpy(particle, "ABSURD_EM") ;
308 case AliPHOSFastRecParticle::kABSURDHA:
309 strcpy(particle, "ABSURD_HA") ;
311 case AliPHOSFastRecParticle::kELECTRON:
312 strcpy(particle, "ELECTRON") ;
314 case AliPHOSFastRecParticle::kCHARGEDHA:
315 strcpy(particle, "CHARGED_HA") ;
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] << " ";