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 cout << "Start making reconstructed points (clusterizing!!)" << endl;
81 fClusterizer->MakeClusters(dl, emccl, ppsdl);
83 cout << "AliPHOSReconstructioner: Digit list entries is " << dl->GetEntries() << endl ;
84 cout << "AliPHOSReconstructioner: Emc list entries is " << emccl->GetEntries() << endl ;
85 cout << "AliPHOSReconstructioner: Ppsd list entries is " << ppsdl->GetEntries() << endl ;
88 if (fDebugReconstruction) {
89 cout << ">>>>>>>>>>>>>>>>>>>>>> DebugReconstruction <<<<<<<<<<<<<<<<<<<<<<<<<<" << endl ;
90 cout << "DebugReconstruction>>> Digit list entries is " << dl->GetEntries() << endl ;
94 cout << "DebugReconstruction>>> Vol Id " <<
101 for (index = 0 ; index < dl->GetEntries() ; index++) {
102 digit = (AliPHOSDigit * ) dl->At(index) ;
103 calorimeter = fClusterizer->IsInEmc(digit);
104 if (calorimeter) factor =1000. ; else factor=1000000.;
105 cout << "DebugReconstruction>>> " <<
106 setw(8) << digit->GetId() << " " <<
107 setw(3) << calorimeter <<
108 setw(10) << factor*fClusterizer->Calibrate(digit->GetAmp()) << " " <<
109 setw(6) << digit->GetIndexInList() << " " <<
110 setw(5) << digit->GetNprimary() <<" " <<
111 setw(5) << digit->GetPrimary(1) <<" " <<
112 setw(5) << digit->GetPrimary(2) <<" " <<
113 setw(5) << digit->GetPrimary(3) << endl;
121 if (fDebugReconstruction) cout << "DebugReconstruction>>> Start making reconstructed points (clusterizing)" << endl;
123 // mark the position of the RecPoints in the array
124 AliPHOSEmcRecPoint * emcrp ;
125 for (index = 0 ; index < emccl->GetEntries() ; index++) {
126 emcrp = (AliPHOSEmcRecPoint * )emccl->At(index) ;
127 emcrp->SetIndexInList(index) ;
129 AliPHOSPpsdRecPoint * ppsdrp ;
130 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
131 ppsdrp = (AliPHOSPpsdRecPoint * )ppsdl->At(index) ;
132 ppsdrp->SetIndexInList(index) ;
135 if (fDebugReconstruction)
137 cout << "DebugReconstruction>>> Cluster emc list entries is " << emccl->GetEntries() << endl ;
138 AliPHOSEmcRecPoint * recpoint;
139 cout << "DebugReconstruction>>> Module " <<
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 setw(4) << primaries[0] << " " <<
173 setw(4) << primaries[1] << " " <<
174 setw(4) << primaries[2] << " " << endl;
177 cout << "DebugReconstruction>>> Cluster ppsd list entries is " << ppsdl->GetEntries() << endl ;
178 AliPHOSPpsdRecPoint * ppsdrecpoint;
180 cout << "DebugReconstruction>>> Module " <<
192 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
193 ppsdrecpoint = (AliPHOSPpsdRecPoint * ) ppsdl->At(index) ;
194 TVector3 locpos; ppsdrecpoint->GetLocalPosition(locpos);
197 if (ppsdrecpoint->GetUp())
198 strcpy(detector, "CPV");
200 strcpy(detector, "PC ");
201 primaries = ppsdrecpoint->GetPrimaries(nprimaries);
202 cout << "DebugReconstruction>>> " <<
203 setw(4) << ppsdrecpoint->GetPHOSMod() << " " <<
204 setw(4) << detector << " " <<
205 setw(9) << 1000000.*ppsdrecpoint->GetTotalEnergy() << " " <<
206 setw(6) << ppsdrecpoint->GetIndexInList() << " " <<
207 setw(5) << ppsdrecpoint->GetMultiplicity() <<" " <<
208 setw(8) << locpos.X() <<" " <<
209 setw(8) << locpos.Y() <<" " <<
210 setw(8) << locpos.Z() << " " <<
211 setw(9) << nprimaries << " " <<
212 setw(4) << primaries[0] << " " <<
213 setw(4) << primaries[1] << " " <<
214 setw(4) << primaries[2] << " " << endl;
219 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making track segments(unfolding+tracksegments)" << endl;
220 fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, trsl) ;
222 // mark the position of the TrackSegments in the array
223 AliPHOSTrackSegment * trs ;
224 for (index = 0 ; index < trsl->GetEntries() ; index++) {
225 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
226 trs->SetIndexInList(index) ;
228 if (fDebugReconstruction){
229 cout << "DebugReconstruction>>> Track segment list entries is " << trsl->GetEntries() << endl ;
230 cout << "DebugReconstruction>>> Module " <<
244 for (index = 0 ; index < trsl->GetEntries() ; index++) {
245 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
246 TVector3 locpos; trs->GetPosition(locpos);
249 primaries = trs->GetPrimariesEmc(nprimaries);
250 cout << "DebugReconstruction>>> " <<
251 setw(4) << trs->GetPHOSMod() << " " <<
252 setw(9) << 1000.*trs->GetEnergy() << " " <<
253 setw(3) << trs->GetIndexInList() << " " <<
254 setw(9) << locpos.X() <<" " <<
255 setw(9) << locpos.Y() <<" " <<
256 setw(9) << locpos.Z() << " " <<
257 setw(10) << (trs->GetMomentumDirection()).X() << " " <<
258 setw(10) << (trs->GetMomentumDirection()).Y() << " " <<
259 setw(10) << (trs->GetMomentumDirection()).Z() << " " <<
260 setw(4) << nprimaries << " " <<
261 setw(4) << primaries[0] << " " <<
262 setw(4) << primaries[1] << " " <<
263 setw(4) << primaries[2] << " " << endl;
267 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making reconstructed particles" << endl;
269 fPID->MakeParticles(trsl, rpl) ;
271 // mark the position of the RecParticles in the array
272 AliPHOSRecParticle * rp ;
273 for (index = 0 ; index < rpl->GetEntries() ; index++) {
274 rp = (AliPHOSRecParticle * )rpl->At(index) ;
275 rp->SetIndexInList(index) ;
277 //Debugger of RecParticles
278 if (fDebugReconstruction){
279 cout << "DebugReconstruction>>> Reconstructed particle list entries is " << rpl->GetEntries() << endl ;
280 cout << "DebugReconstruction>>> Module " <<
291 for (index = 0 ; index < rpl->GetEntries() ; index++) {
292 rp = (AliPHOSRecParticle * ) rpl->At(index) ;
293 TVector3 locpos; (rp->GetPHOSTrackSegment())->GetPosition(locpos);
297 primaries = (rp->GetPHOSTrackSegment())->GetPrimariesEmc(nprimaries);
298 switch(rp->GetType())
300 case AliPHOSFastRecParticle::kNEUTRALEM:
301 strcpy( particle, "NEUTRAL_EM");
303 case AliPHOSFastRecParticle::kNEUTRALHA:
304 strcpy(particle, "NEUTRAL_HA");
306 case AliPHOSFastRecParticle::kGAMMA:
307 strcpy(particle, "GAMMA");
309 case AliPHOSFastRecParticle::kGAMMAHA:
310 strcpy(particle, "GAMMA_H");
312 case AliPHOSFastRecParticle::kABSURDEM:
313 strcpy(particle, "ABSURD_EM") ;
315 case AliPHOSFastRecParticle::kABSURDHA:
316 strcpy(particle, "ABSURD_HA") ;
318 case AliPHOSFastRecParticle::kELECTRON:
319 strcpy(particle, "ELECTRON") ;
321 case AliPHOSFastRecParticle::kCHARGEDHA:
322 strcpy(particle, "CHARGED_HA") ;
326 cout << "DebugReconstruction>>> " <<
327 setw(4) << (rp->GetPHOSTrackSegment())->GetPHOSMod() << " " <<
328 setw(15) << particle << " " <<
329 setw(9) << 1000.*(rp->GetPHOSTrackSegment())->GetEnergy() << " " <<
330 setw(3) << rp->GetIndexInList() << " " <<
331 setw(9) << locpos.X() <<" " <<
332 setw(9) << locpos.Y() <<" " <<
333 setw(9) << locpos.Z() << " " <<
334 setw(4) << nprimaries << " " <<
335 setw(4) << primaries[0] << " " <<
336 setw(4) << primaries[1] << " " <<
337 setw(4) << primaries[2] << " " << endl;