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"
39 ClassImp(AliPHOSReconstructioner)
41 //____________________________________________________________________________
42 AliPHOSReconstructioner::AliPHOSReconstructioner(AliPHOSClusterizer * Clusterizer,
43 AliPHOSTrackSegmentMaker * Tracker,
48 fClusterizer = Clusterizer ;
49 fTrackSegmentMaker = Tracker ;
51 fDebugReconstruction = kFALSE ;
55 //____________________________________________________________________________
56 void AliPHOSReconstructioner::Init(AliPHOSClusterizer * Clusterizer,
57 AliPHOSTrackSegmentMaker * Tracker,
60 fClusterizer = Clusterizer ;
61 fTrackSegmentMaker = Tracker ;
63 fDebugReconstruction = kFALSE ;
66 //____________________________________________________________________________
67 void AliPHOSReconstructioner::Make(DigitsList * dl,
68 AliPHOSRecPoint::RecPointsList * emccl,
69 AliPHOSRecPoint::RecPointsList * ppsdl,
70 AliPHOSTrackSegment::TrackSegmentsList * trsl,
71 AliPHOSRecParticle::RecParticlesList * rpl)
73 // Launches the Reconstruction process in the sequence: Make the reconstructed poins (clusterize)
74 // Make the track segments
75 // Make the reconstructed particles
78 if (fDebugReconstruction) {
79 cout << ">>>>>>>>>>>>>>>>>>>>>> DebugReconstruction <<<<<<<<<<<<<<<<<<<<<<<<<<" << endl ;
80 cout << "DebugReconstruction>>> Digit list entries is " << dl->GetEntries() << endl ;
84 cout << "DebugReconstruction>>> Vol Id " <<
91 for (index = 0 ; index < dl->GetEntries() ; index++) {
92 digit = (AliPHOSDigit * ) dl->At(index) ;
93 calorimeter = fClusterizer->IsInEmc(digit);
94 if (calorimeter) factor =1000. ; else factor=1000000.;
95 cout << "DebugReconstruction>>> " <<
96 setw(8) << digit->GetId() << " " <<
97 setw(3) << calorimeter <<
98 setw(10) << factor*fClusterizer->Calibrate(digit->GetAmp()) << " " <<
99 setw(6) << digit->GetIndexInList() << " " <<
100 setw(5) << digit->GetNprimary() <<" " <<
101 setw(5) << digit->GetPrimary(1) <<" " <<
102 setw(5) << digit->GetPrimary(2) <<" " <<
103 setw(5) << digit->GetPrimary(3) << endl;
111 if (fDebugReconstruction) cout << "DebugReconstruction>>> Start making reconstructed points (clusterizing)" << endl;
112 fClusterizer->MakeClusters(dl, emccl, ppsdl);
114 // mark the position of the RecPoints in the array
115 AliPHOSEmcRecPoint * emcrp ;
116 for (index = 0 ; index < emccl->GetEntries() ; index++) {
117 emcrp = (AliPHOSEmcRecPoint * )emccl->At(index) ;
118 emcrp->SetIndexInList(index) ;
120 AliPHOSPpsdRecPoint * ppsdrp ;
121 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
122 ppsdrp = (AliPHOSPpsdRecPoint * )ppsdl->At(index) ;
123 ppsdrp->SetIndexInList(index) ;
126 if (fDebugReconstruction)
128 cout << "DebugReconstruction>>> Cluster emc list entries is " << emccl->GetEntries() << endl ;
129 AliPHOSEmcRecPoint * recpoint;
130 cout << "DebugReconstruction>>> Module " <<
144 for (index = 0 ; index < emccl->GetEntries() ; index++) {
145 recpoint = (AliPHOSEmcRecPoint * )emccl->At(index) ;
146 TVector3 locpos; recpoint->GetLocalPosition(locpos);
147 Float_t lambda[2]; recpoint->GetElipsAxis(lambda);
150 primaries = recpoint->GetPrimaries(nprimaries);
151 cout << "DebugReconstruction>>> " <<
152 setw(2) <<recpoint->GetPHOSMod() << " " <<
153 setw(9) << 1000.*recpoint->GetTotalEnergy() << " " <<
154 setw(6) << recpoint->GetIndexInList() << " " <<
155 setw(5) << recpoint->GetMultiplicity() <<" " <<
156 setw(8) << locpos.X() <<" " <<
157 setw(8) << locpos.Y() <<" " <<
158 setw(8) << locpos.Z() << " " <<
159 setw(10) << lambda[0] << " " <<
160 setw(10) << lambda[1] << " " <<
161 setw(9) << 1000*recpoint->GetMaximalEnergy() << " " <<
162 setw(9) << nprimaries << " " <<
163 setw(4) << primaries[0] << " " <<
164 setw(4) << primaries[1] << " " <<
165 setw(4) << primaries[2] << " " << endl;
168 cout << "DebugReconstruction>>> Cluster ppsd list entries is " << ppsdl->GetEntries() << endl ;
169 AliPHOSPpsdRecPoint * ppsdrecpoint;
171 cout << "DebugReconstruction>>> Module " <<
183 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
184 ppsdrecpoint = (AliPHOSPpsdRecPoint * ) ppsdl->At(index) ;
185 TVector3 locpos; ppsdrecpoint->GetLocalPosition(locpos);
188 if (ppsdrecpoint->GetUp())
189 strcpy(detector, "CPV");
191 strcpy(detector, "PC ");
192 primaries = ppsdrecpoint->GetPrimaries(nprimaries);
193 cout << "DebugReconstruction>>> " <<
194 setw(4) << ppsdrecpoint->GetPHOSMod() << " " <<
195 setw(4) << detector << " " <<
196 setw(9) << 1000000.*ppsdrecpoint->GetTotalEnergy() << " " <<
197 setw(6) << ppsdrecpoint->GetIndexInList() << " " <<
198 setw(5) << ppsdrecpoint->GetMultiplicity() <<" " <<
199 setw(8) << locpos.X() <<" " <<
200 setw(8) << locpos.Y() <<" " <<
201 setw(8) << locpos.Z() << " " <<
202 setw(9) << nprimaries << " " <<
203 setw(4) << primaries[0] << " " <<
204 setw(4) << primaries[1] << " " <<
205 setw(4) << primaries[2] << " " << endl;
210 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making track segments(unfolding+tracksegments)" << endl;
211 fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, trsl) ;
213 // mark the position of the TrackSegments in the array
214 AliPHOSTrackSegment * trs ;
215 for (index = 0 ; index < trsl->GetEntries() ; index++) {
216 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
217 trs->SetIndexInList(index) ;
219 if (fDebugReconstruction){
220 cout << "DebugReconstruction>>> Track segment list entries is " << trsl->GetEntries() << endl ;
221 cout << "DebugReconstruction>>> Module " <<
235 for (index = 0 ; index < trsl->GetEntries() ; index++) {
236 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
237 TVector3 locpos; trs->GetPosition(locpos);
240 primaries = trs->GetPrimariesEmc(nprimaries);
241 cout << "DebugReconstruction>>> " <<
242 setw(4) << trs->GetPHOSMod() << " " <<
243 setw(9) << 1000.*trs->GetEnergy() << " " <<
244 setw(3) << trs->GetIndexInList() << " " <<
245 setw(9) << locpos.X() <<" " <<
246 setw(9) << locpos.Y() <<" " <<
247 setw(9) << locpos.Z() << " " <<
248 setw(10) << (trs->GetMomentumDirection()).X() << " " <<
249 setw(10) << (trs->GetMomentumDirection()).Y() << " " <<
250 setw(10) << (trs->GetMomentumDirection()).Z() << " " <<
251 setw(4) << nprimaries << " " <<
252 setw(4) << primaries[0] << " " <<
253 setw(4) << primaries[1] << " " <<
254 setw(4) << primaries[2] << " " << endl;
258 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making reconstructed particles" << endl;
260 fPID->MakeParticles(trsl, rpl) ;
262 // mark the position of the RecParticles in the array
263 AliPHOSRecParticle * rp ;
264 for (index = 0 ; index < rpl->GetEntries() ; index++) {
265 rp = (AliPHOSRecParticle * )rpl->At(index) ;
266 rp->SetIndexInList(index) ;
268 //Debugger of RecParticles
269 if (fDebugReconstruction){
270 cout << "DebugReconstruction>>> Reconstructed particle list entries is " << rpl->GetEntries() << endl ;
271 cout << "DebugReconstruction>>> Module " <<
282 for (index = 0 ; index < rpl->GetEntries() ; index++) {
283 rp = (AliPHOSRecParticle * ) rpl->At(index) ;
284 TVector3 locpos; (rp->GetPHOSTrackSegment())->GetPosition(locpos);
288 primaries = (rp->GetPHOSTrackSegment())->GetPrimariesEmc(nprimaries);
289 switch(rp->GetType())
292 strcpy( particle, "NEUTRAL_EM");
295 strcpy(particle, "NEUTRAL_HA");
298 strcpy(particle, "GAMMA");
301 strcpy(particle, "GAMMA_H");
304 strcpy(particle, "ABSURD_EM") ;
307 strcpy(particle, "ABSURD_HA") ;
310 strcpy(particle, "ELECTRON") ;
313 strcpy(particle, "CHARGED_HA") ;
317 cout << "DebugReconstruction>>> " <<
318 setw(4) << (rp->GetPHOSTrackSegment())->GetPHOSMod() << " " <<
319 setw(15) << particle << " " <<
320 setw(9) << 1000.*(rp->GetPHOSTrackSegment())->GetEnergy() << " " <<
321 setw(3) << rp->GetIndexInList() << " " <<
322 setw(9) << locpos.X() <<" " <<
323 setw(9) << locpos.Y() <<" " <<
324 setw(9) << locpos.Z() << " " <<
325 setw(4) << nprimaries << " " <<
326 setw(4) << primaries[0] << " " <<
327 setw(4) << primaries[1] << " " <<
328 setw(4) << primaries[2] << " " << endl;