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"
40 ClassImp(AliPHOSReconstructioner)
42 //____________________________________________________________________________
43 AliPHOSReconstructioner::AliPHOSReconstructioner(AliPHOSClusterizer * Clusterizer,
44 AliPHOSTrackSegmentMaker * Tracker,
49 fClusterizer = Clusterizer ;
50 fTrackSegmentMaker = Tracker ;
52 fDebugReconstruction = kFALSE ;
56 //____________________________________________________________________________
57 void AliPHOSReconstructioner::Init(AliPHOSClusterizer * Clusterizer,
58 AliPHOSTrackSegmentMaker * Tracker,
61 fClusterizer = Clusterizer ;
62 fTrackSegmentMaker = Tracker ;
64 fDebugReconstruction = kFALSE ;
67 //____________________________________________________________________________
68 void AliPHOSReconstructioner::Make(DigitsList * dl,
69 AliPHOSRecPoint::RecPointsList * emccl,
70 AliPHOSRecPoint::RecPointsList * ppsdl,
71 AliPHOSTrackSegment::TrackSegmentsList * trsl,
72 AliPHOSRecParticle::RecParticlesList * rpl)
74 // Launches the Reconstruction process in the sequence: Make the reconstructed poins (clusterize)
75 // Make the track segments
76 // Make the reconstructed particles
78 cout << "Start making reconstructed points (clusterizing!!)" << endl;
79 fClusterizer->MakeClusters(dl, emccl, ppsdl);
81 cout << "AliPHOSReconstructioner: Digit list entries is " << dl->GetEntries() << endl ;
82 cout << "AliPHOSReconstructioner: Emc list entries is " << emccl->GetEntries() << endl ;
83 cout << "AliPHOSReconstructioner: Ppsd list entries is " << ppsdl->GetEntries() << endl ;
86 if (fDebugReconstruction) {
87 cout << ">>>>>>>>>>>>>>>>>>>>>> DebugReconstruction <<<<<<<<<<<<<<<<<<<<<<<<<<" << endl ;
88 cout << "DebugReconstruction>>> Digit list entries is " << dl->GetEntries() << endl ;
92 cout << "DebugReconstruction>>> Vol Id " <<
99 for (index = 0 ; index < dl->GetEntries() ; index++) {
100 digit = (AliPHOSDigit * ) dl->At(index) ;
101 calorimeter = fClusterizer->IsInEmc(digit);
102 if (calorimeter) factor =1000. ; else factor=1000000.;
103 cout << "DebugReconstruction>>> " <<
104 setw(8) << digit->GetId() << " " <<
105 setw(3) << calorimeter <<
106 setw(10) << factor*fClusterizer->Calibrate(digit->GetAmp()) << " " <<
107 setw(6) << digit->GetIndexInList() << " " <<
108 setw(5) << digit->GetNprimary() <<" " <<
109 setw(5) << digit->GetPrimary(1) <<" " <<
110 setw(5) << digit->GetPrimary(2) <<" " <<
111 setw(5) << digit->GetPrimary(3) << endl;
119 if (fDebugReconstruction) cout << "DebugReconstruction>>> Start making reconstructed points (clusterizing)" << endl;
121 // mark the position of the RecPoints in the array
122 AliPHOSEmcRecPoint * emcrp ;
123 for (index = 0 ; index < emccl->GetEntries() ; index++) {
124 emcrp = (AliPHOSEmcRecPoint * )emccl->At(index) ;
125 emcrp->SetIndexInList(index) ;
127 AliPHOSPpsdRecPoint * ppsdrp ;
128 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
129 ppsdrp = (AliPHOSPpsdRecPoint * )ppsdl->At(index) ;
130 ppsdrp->SetIndexInList(index) ;
133 if (fDebugReconstruction)
135 cout << "DebugReconstruction>>> Cluster emc list entries is " << emccl->GetEntries() << endl ;
136 AliPHOSEmcRecPoint * recpoint;
137 cout << "DebugReconstruction>>> Module " <<
151 for (index = 0 ; index < emccl->GetEntries() ; index++) {
152 recpoint = (AliPHOSEmcRecPoint * )emccl->At(index) ;
153 TVector3 locpos; recpoint->GetLocalPosition(locpos);
154 Float_t lambda[2]; recpoint->GetElipsAxis(lambda);
157 primaries = recpoint->GetPrimaries(nprimaries);
158 cout << "DebugReconstruction>>> " <<
159 setw(2) <<recpoint->GetPHOSMod() << " " <<
160 setw(9) << 1000.*recpoint->GetTotalEnergy() << " " <<
161 setw(6) << recpoint->GetIndexInList() << " " <<
162 setw(5) << recpoint->GetMultiplicity() <<" " <<
163 setw(8) << locpos.X() <<" " <<
164 setw(8) << locpos.Y() <<" " <<
165 setw(8) << locpos.Z() << " " <<
166 setw(10) << lambda[0] << " " <<
167 setw(10) << lambda[1] << " " <<
168 setw(9) << 1000*recpoint->GetMaximalEnergy() << " " <<
169 setw(9) << nprimaries << " " <<
170 setw(4) << primaries[0] << " " <<
171 setw(4) << primaries[1] << " " <<
172 setw(4) << primaries[2] << " " << endl;
175 cout << "DebugReconstruction>>> Cluster ppsd list entries is " << ppsdl->GetEntries() << endl ;
176 AliPHOSPpsdRecPoint * ppsdrecpoint;
178 cout << "DebugReconstruction>>> Module " <<
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 setw(4) << primaries[0] << " " <<
211 setw(4) << primaries[1] << " " <<
212 setw(4) << primaries[2] << " " << endl;
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 " <<
242 for (index = 0 ; index < trsl->GetEntries() ; index++) {
243 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
244 TVector3 locpos; trs->GetPosition(locpos);
247 primaries = trs->GetPrimariesEmc(nprimaries);
248 cout << "DebugReconstruction>>> " <<
249 setw(4) << trs->GetPHOSMod() << " " <<
250 setw(9) << 1000.*trs->GetEnergy() << " " <<
251 setw(3) << trs->GetIndexInList() << " " <<
252 setw(9) << locpos.X() <<" " <<
253 setw(9) << locpos.Y() <<" " <<
254 setw(9) << locpos.Z() << " " <<
255 setw(10) << (trs->GetMomentumDirection()).X() << " " <<
256 setw(10) << (trs->GetMomentumDirection()).Y() << " " <<
257 setw(10) << (trs->GetMomentumDirection()).Z() << " " <<
258 setw(4) << nprimaries << " " <<
259 setw(4) << primaries[0] << " " <<
260 setw(4) << primaries[1] << " " <<
261 setw(4) << primaries[2] << " " << endl;
265 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making reconstructed particles" << endl;
267 fPID->MakeParticles(trsl, rpl) ;
269 // mark the position of the RecParticles in the array
270 AliPHOSRecParticle * rp ;
271 for (index = 0 ; index < rpl->GetEntries() ; index++) {
272 rp = (AliPHOSRecParticle * )rpl->At(index) ;
273 rp->SetIndexInList(index) ;
275 //Debugger of RecParticles
276 if (fDebugReconstruction){
277 cout << "DebugReconstruction>>> Reconstructed particle list entries is " << rpl->GetEntries() << endl ;
278 cout << "DebugReconstruction>>> Module " <<
289 for (index = 0 ; index < rpl->GetEntries() ; index++) {
290 rp = (AliPHOSRecParticle * ) rpl->At(index) ;
291 TVector3 locpos; (rp->GetPHOSTrackSegment())->GetPosition(locpos);
295 primaries = (rp->GetPHOSTrackSegment())->GetPrimariesEmc(nprimaries);
296 switch(rp->GetType())
298 case AliPHOSFastRecParticle::kNEUTRALEM:
299 strcpy( particle, "NEUTRAL_EM");
301 case AliPHOSFastRecParticle::kNEUTRALHA:
302 strcpy(particle, "NEUTRAL_HA");
304 case AliPHOSFastRecParticle::kGAMMA:
305 strcpy(particle, "GAMMA");
307 case AliPHOSFastRecParticle::kGAMMAHA:
308 strcpy(particle, "GAMMA_H");
310 case AliPHOSFastRecParticle::kABSURDEM:
311 strcpy(particle, "ABSURD_EM") ;
313 case AliPHOSFastRecParticle::kABSURDHA:
314 strcpy(particle, "ABSURD_HA") ;
316 case AliPHOSFastRecParticle::kELECTRON:
317 strcpy(particle, "ELECTRON") ;
319 case AliPHOSFastRecParticle::kCHARGEDHA:
320 strcpy(particle, "CHARGED_HA") ;
324 cout << "DebugReconstruction>>> " <<
325 setw(4) << (rp->GetPHOSTrackSegment())->GetPHOSMod() << " " <<
326 setw(15) << particle << " " <<
327 setw(9) << 1000.*(rp->GetPHOSTrackSegment())->GetEnergy() << " " <<
328 setw(3) << rp->GetIndexInList() << " " <<
329 setw(9) << locpos.X() <<" " <<
330 setw(9) << locpos.Y() <<" " <<
331 setw(9) << locpos.Z() << " " <<
332 setw(4) << nprimaries << " " <<
333 setw(4) << primaries[0] << " " <<
334 setw(4) << primaries[1] << " " <<
335 setw(4) << primaries[2] << " " << endl;