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,
63 fClusterizer = Clusterizer ;
64 fTrackSegmentMaker = Tracker ;
66 fDebugReconstruction = kFALSE ;
69 //____________________________________________________________________________
70 void AliPHOSReconstructioner::Make(DigitsList * dl,
71 AliPHOSRecPoint::RecPointsList * emccl,
72 AliPHOSRecPoint::RecPointsList * ppsdl,
73 AliPHOSTrackSegment::TrackSegmentsList * trsl,
74 AliPHOSRecParticle::RecParticlesList * rpl)
76 // Launches the Reconstruction process in the sequence: Make the reconstructed poins (clusterize)
77 // Make the track segments
78 // Make the reconstructed particles
80 if (fDebugReconstruction)
81 cout << "DebugReconstruction>>> " << "Start making reconstructed points (clusterizing!!)" << endl;
83 fClusterizer->MakeClusters(dl, emccl, ppsdl);
85 if (fDebugReconstruction){
86 cout << "DebugReconstruction>>> " << "AliPHOSReconstructioner: Digit list entries is " << dl->GetEntries() << endl ;
87 cout << "AliPHOSReconstructioner: Emc list entries is " << emccl->GetEntries() << endl ;
88 cout << "AliPHOSReconstructioner: Ppsd list entries is " << ppsdl->GetEntries() << endl ;
92 if (fDebugReconstruction) {
93 cout << ">>>>>>>>>>>>>>>>>>>>>> DebugReconstruction <<<<<<<<<<<<<<<<<<<<<<<<<<" << endl ;
94 cout << "DebugReconstruction>>> Digit list entries is " << dl->GetEntries() << endl ;
98 cout << "DebugReconstruction>>> Vol Id " <<
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) << calorimeter <<
112 setw(10) << factor*fClusterizer->Calibrate(digit->GetAmp()) << " " <<
113 setw(6) << digit->GetIndexInList() << " " <<
114 setw(5) << digit->GetNprimary() <<" " <<
115 setw(5) << digit->GetPrimary(1) <<" " <<
116 setw(5) << digit->GetPrimary(2) <<" " <<
117 setw(5) << digit->GetPrimary(3) << endl;
125 if (fDebugReconstruction) cout << "DebugReconstruction>>> Start making reconstructed points (clusterizing)" << endl;
127 // mark the position of the RecPoints in the array
128 AliPHOSEmcRecPoint * emcrp ;
129 for (index = 0 ; index < emccl->GetEntries() ; index++) {
130 emcrp = (AliPHOSEmcRecPoint * )emccl->At(index) ;
131 emcrp->SetIndexInList(index) ;
133 AliPHOSPpsdRecPoint * ppsdrp ;
134 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
135 ppsdrp = (AliPHOSPpsdRecPoint * )ppsdl->At(index) ;
136 ppsdrp->SetIndexInList(index) ;
139 if (fDebugReconstruction)
141 cout << "DebugReconstruction>>> Cluster emc list entries is " << emccl->GetEntries() << endl ;
142 AliPHOSEmcRecPoint * recpoint;
143 cout << "DebugReconstruction>>> Module " <<
157 for (index = 0 ; index < emccl->GetEntries() ; index++) {
158 recpoint = (AliPHOSEmcRecPoint * )emccl->At(index) ;
159 TVector3 locpos; recpoint->GetLocalPosition(locpos);
160 Float_t lambda[2]; recpoint->GetElipsAxis(lambda);
163 primaries = recpoint->GetPrimaries(nprimaries);
164 cout << "DebugReconstruction>>> " <<
165 setw(2) <<recpoint->GetPHOSMod() << " " <<
166 setw(9) << 1000.*recpoint->GetTotalEnergy() << " " <<
167 setw(6) << recpoint->GetIndexInList() << " " <<
168 setw(5) << recpoint->GetMultiplicity() <<" " <<
169 setw(8) << locpos.X() <<" " <<
170 setw(8) << locpos.Y() <<" " <<
171 setw(8) << locpos.Z() << " " <<
172 setw(10) << lambda[0] << " " <<
173 setw(10) << lambda[1] << " " <<
174 setw(9) << 1000*recpoint->GetMaximalEnergy() << " " <<
175 setw(9) << nprimaries << " " <<
176 setw(4) << primaries[0] << " " <<
177 setw(4) << primaries[1] << " " <<
178 setw(4) << primaries[2] << " " << endl;
181 cout << "DebugReconstruction>>> Cluster ppsd list entries is " << ppsdl->GetEntries() << endl ;
182 AliPHOSPpsdRecPoint * ppsdrecpoint;
184 cout << "DebugReconstruction>>> Module " <<
196 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
197 ppsdrecpoint = (AliPHOSPpsdRecPoint * ) ppsdl->At(index) ;
198 TVector3 locpos; ppsdrecpoint->GetLocalPosition(locpos);
201 if (ppsdrecpoint->GetUp())
202 strcpy(detector, "CPV");
204 strcpy(detector, "PC ");
205 primaries = ppsdrecpoint->GetPrimaries(nprimaries);
206 cout << "DebugReconstruction>>> " <<
207 setw(4) << ppsdrecpoint->GetPHOSMod() << " " <<
208 setw(4) << detector << " " <<
209 setw(9) << 1000000.*ppsdrecpoint->GetTotalEnergy() << " " <<
210 setw(6) << ppsdrecpoint->GetIndexInList() << " " <<
211 setw(5) << ppsdrecpoint->GetMultiplicity() <<" " <<
212 setw(8) << locpos.X() <<" " <<
213 setw(8) << locpos.Y() <<" " <<
214 setw(8) << locpos.Z() << " " <<
215 setw(9) << nprimaries << " " <<
216 setw(4) << primaries[0] << " " <<
217 setw(4) << primaries[1] << " " <<
218 setw(4) << primaries[2] << " " << endl;
223 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making track segments(unfolding+tracksegments)" << endl;
224 fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, trsl) ;
226 // mark the position of the TrackSegments in the array
227 AliPHOSTrackSegment * trs ;
228 for (index = 0 ; index < trsl->GetEntries() ; index++) {
229 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
230 trs->SetIndexInList(index) ;
232 if (fDebugReconstruction){
233 cout << "DebugReconstruction>>> Track segment list entries is " << trsl->GetEntries() << endl ;
234 cout << "DebugReconstruction>>> Module " <<
248 for (index = 0 ; index < trsl->GetEntries() ; index++) {
249 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
250 TVector3 locpos; trs->GetPosition(locpos);
253 primaries = trs->GetPrimariesEmc(nprimaries);
254 cout << "DebugReconstruction>>> " <<
255 setw(4) << trs->GetPHOSMod() << " " <<
256 setw(9) << 1000.*trs->GetEnergy() << " " <<
257 setw(3) << trs->GetIndexInList() << " " <<
258 setw(9) << locpos.X() <<" " <<
259 setw(9) << locpos.Y() <<" " <<
260 setw(9) << locpos.Z() << " " <<
261 setw(10) << (trs->GetMomentumDirection()).X() << " " <<
262 setw(10) << (trs->GetMomentumDirection()).Y() << " " <<
263 setw(10) << (trs->GetMomentumDirection()).Z() << " " <<
264 setw(4) << nprimaries << " " <<
265 setw(4) << primaries[0] << " " <<
266 setw(4) << primaries[1] << " " <<
267 setw(4) << primaries[2] << " " << endl;
271 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making reconstructed particles" << endl;
273 fPID->MakeParticles(trsl, rpl) ;
275 // mark the position of the RecParticles in the array
276 AliPHOSRecParticle * rp ;
277 for (index = 0 ; index < rpl->GetEntries() ; index++) {
278 rp = (AliPHOSRecParticle * )rpl->At(index) ;
279 rp->SetIndexInList(index) ;
281 //Debugger of RecParticles
282 if (fDebugReconstruction){
283 cout << "DebugReconstruction>>> Reconstructed particle list entries is " << rpl->GetEntries() << endl ;
284 cout << "DebugReconstruction>>> Module " <<
295 for (index = 0 ; index < rpl->GetEntries() ; index++) {
296 rp = (AliPHOSRecParticle * ) rpl->At(index) ;
297 TVector3 locpos; (rp->GetPHOSTrackSegment())->GetPosition(locpos);
301 primaries = (rp->GetPHOSTrackSegment())->GetPrimariesEmc(nprimaries);
302 switch(rp->GetType())
304 case AliPHOSFastRecParticle::kNEUTRALEM:
305 strcpy( particle, "NEUTRAL_EM");
307 case AliPHOSFastRecParticle::kNEUTRALHA:
308 strcpy(particle, "NEUTRAL_HA");
310 case AliPHOSFastRecParticle::kGAMMA:
311 strcpy(particle, "GAMMA");
313 case AliPHOSFastRecParticle::kGAMMAHA:
314 strcpy(particle, "GAMMA_H");
316 case AliPHOSFastRecParticle::kABSURDEM:
317 strcpy(particle, "ABSURD_EM") ;
319 case AliPHOSFastRecParticle::kABSURDHA:
320 strcpy(particle, "ABSURD_HA") ;
322 case AliPHOSFastRecParticle::kELECTRON:
323 strcpy(particle, "ELECTRON") ;
325 case AliPHOSFastRecParticle::kCHARGEDHA:
326 strcpy(particle, "CHARGED_HA") ;
330 cout << "DebugReconstruction>>> " <<
331 setw(4) << (rp->GetPHOSTrackSegment())->GetPHOSMod() << " " <<
332 setw(15) << particle << " " <<
333 setw(9) << 1000.*(rp->GetPHOSTrackSegment())->GetEnergy() << " " <<
334 setw(3) << rp->GetIndexInList() << " " <<
335 setw(9) << locpos.X() <<" " <<
336 setw(9) << locpos.Y() <<" " <<
337 setw(9) << locpos.Z() << " " <<
338 setw(4) << nprimaries << " " <<
339 setw(4) << primaries[0] << " " <<
340 setw(4) << primaries[1] << " " <<
341 setw(4) << primaries[2] << " " << endl;