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) << " ";
122 if (fDebugReconstruction) cout << "DebugReconstruction>>> Start making reconstructed points (clusterizing)" << endl;
124 // mark the position of the RecPoints in the array
125 AliPHOSEmcRecPoint * emcrp ;
126 for (index = 0 ; index < emccl->GetEntries() ; index++) {
127 emcrp = (AliPHOSEmcRecPoint * )emccl->At(index) ;
128 emcrp->SetIndexInList(index) ;
130 AliPHOSPpsdRecPoint * ppsdrp ;
131 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
132 ppsdrp = (AliPHOSPpsdRecPoint * )ppsdl->At(index) ;
133 ppsdrp->SetIndexInList(index) ;
136 if (fDebugReconstruction) {
137 cout << "DebugReconstruction>>> Cluster emc list entries is " << emccl->GetEntries() << endl ;
138 AliPHOSEmcRecPoint * recpoint;
139 cout << "DebugReconstruction>>> Module " <<
150 " Primaries list " << endl;
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 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
171 cout << setw(4) << primaries[iprimary] << " ";
175 cout << "DebugReconstruction>>> Cluster ppsd list entries is " << ppsdl->GetEntries() << endl ;
176 AliPHOSPpsdRecPoint * ppsdrecpoint;
178 cout << "DebugReconstruction>>> Module " <<
187 " Primaries list " << endl;
188 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
189 ppsdrecpoint = (AliPHOSPpsdRecPoint * ) ppsdl->At(index) ;
190 TVector3 locpos; ppsdrecpoint->GetLocalPosition(locpos);
193 if (ppsdrecpoint->GetUp())
194 strcpy(detector, "CPV");
196 strcpy(detector, "PC ");
197 primaries = ppsdrecpoint->GetPrimaries(nprimaries);
198 cout << "DebugReconstruction>>> " <<
199 setw(4) << ppsdrecpoint->GetPHOSMod() << " " <<
200 setw(4) << detector << " " <<
201 setw(9) << 1000000.*ppsdrecpoint->GetTotalEnergy() << " " <<
202 setw(6) << ppsdrecpoint->GetIndexInList() << " " <<
203 setw(5) << ppsdrecpoint->GetMultiplicity() <<" " <<
204 setw(8) << locpos.X() <<" " <<
205 setw(8) << locpos.Y() <<" " <<
206 setw(8) << locpos.Z() << " " <<
207 setw(9) << nprimaries << " ";
208 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
209 cout << setw(4) << primaries[iprimary] << " ";
215 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making track segments(unfolding+tracksegments)" << endl;
216 fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, trsl) ;
218 // mark the position of the TrackSegments in the array
219 AliPHOSTrackSegment * trs ;
220 for (index = 0 ; index < trsl->GetEntries() ; index++) {
221 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
222 trs->SetIndexInList(index) ;
224 if (fDebugReconstruction){
225 cout << "DebugReconstruction>>> Track segment list entries is " << trsl->GetEntries() << endl ;
226 cout << "DebugReconstruction>>> Module " <<
236 " Primaries list " << endl;
238 for (index = 0 ; index < trsl->GetEntries() ; index++) {
239 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
240 TVector3 locpos; trs->GetPosition(locpos);
243 primaries = trs->GetPrimariesEmc(nprimaries);
244 cout << "DebugReconstruction>>> " <<
245 setw(4) << trs->GetPHOSMod() << " " <<
246 setw(9) << 1000.*trs->GetEnergy() << " " <<
247 setw(3) << trs->GetIndexInList() << " " <<
248 setw(9) << locpos.X() <<" " <<
249 setw(9) << locpos.Y() <<" " <<
250 setw(9) << locpos.Z() << " " <<
251 setw(10) << (trs->GetMomentumDirection()).X() << " " <<
252 setw(10) << (trs->GetMomentumDirection()).Y() << " " <<
253 setw(10) << (trs->GetMomentumDirection()).Z() << " " <<
254 setw(4) << nprimaries << " ";
255 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
256 cout << setw(4) << primaries[iprimary] << " ";
261 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making reconstructed particles" << endl;
264 fPID->MakeParticles(trsl, rpl) ;
266 // mark the position of the RecParticles in the array
267 AliPHOSRecParticle * rp ;
268 for (index = 0 ; index < rpl->GetEntries() ; index++) {
269 rp = (AliPHOSRecParticle * )rpl->At(index) ;
270 rp->SetIndexInList(index) ;
272 //Debugger of RecParticles
273 if (fDebugReconstruction){
274 cout << "DebugReconstruction>>> Reconstructed particle list entries is " << rpl->GetEntries() << endl ;
275 cout << "DebugReconstruction>>> Module " <<
283 " Primaries list " << endl;
284 for (index = 0 ; index < rpl->GetEntries() ; index++) {
285 rp = (AliPHOSRecParticle * ) rpl->At(index) ;
286 TVector3 locpos; (rp->GetPHOSTrackSegment())->GetPosition(locpos);
290 primaries = (rp->GetPHOSTrackSegment())->GetPrimariesEmc(nprimaries);
291 switch(rp->GetType()) {
292 case AliPHOSFastRecParticle::kNEUTRALEM:
293 strcpy( particle, "NEUTRAL_EM");
295 case AliPHOSFastRecParticle::kNEUTRALHA:
296 strcpy(particle, "NEUTRAL_HA");
298 case AliPHOSFastRecParticle::kGAMMA:
299 strcpy(particle, "GAMMA");
301 case AliPHOSFastRecParticle::kGAMMAHA:
302 strcpy(particle, "GAMMA_H");
304 case AliPHOSFastRecParticle::kABSURDEM:
305 strcpy(particle, "ABSURD_EM") ;
307 case AliPHOSFastRecParticle::kABSURDHA:
308 strcpy(particle, "ABSURD_HA") ;
310 case AliPHOSFastRecParticle::kELECTRON:
311 strcpy(particle, "ELECTRON") ;
313 case AliPHOSFastRecParticle::kCHARGEDHA:
314 strcpy(particle, "CHARGED_HA") ;
318 cout << "DebugReconstruction>>> " <<
319 setw(4) << (rp->GetPHOSTrackSegment())->GetPHOSMod() << " " <<
320 setw(15) << particle << " " <<
321 setw(9) << 1000.*(rp->GetPHOSTrackSegment())->GetEnergy() << " " <<
322 setw(3) << rp->GetIndexInList() << " " <<
323 setw(9) << locpos.X() <<" " <<
324 setw(9) << locpos.Y() <<" " <<
325 setw(9) << locpos.Z() << " " <<
326 setw(4) << nprimaries << " ";
327 for (Int_t iprimary=0; iprimary<nprimaries; iprimary++)
328 cout << setw(4) << primaries[iprimary] << " ";