Debugger output in AliPHOSReconstructioner
[u/mrichter/AliRoot.git] / PHOS / AliPHOSReconstructioner.cxx
CommitLineData
d15a28e7 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
b2a60966 16/* $Id$ */
17
d15a28e7 18//_________________________________________________________________________
b2a60966 19// Algorithm class for the reconstruction: clusterizer
20// track segment maker
21// particle identifier
22//
23//*-- Author: Gines Martinez & Yves Schutz (SUBATECH)
24
d15a28e7 25
26// --- ROOT system ---
27
28#include "TClonesArray.h"
29
30// --- Standard library ---
31
364de5c6 32#include <iomanip>
33
d15a28e7 34// --- AliRoot header files ---
35
36#include "AliPHOSReconstructioner.h"
37#include "AliPHOSClusterizer.h"
38
39ClassImp(AliPHOSReconstructioner)
40
d15a28e7 41//____________________________________________________________________________
6ad0bfa0 42AliPHOSReconstructioner::AliPHOSReconstructioner(AliPHOSClusterizer * Clusterizer,
43 AliPHOSTrackSegmentMaker * Tracker,
908558fc 44 AliPHOSPID * Pid)
d15a28e7 45{
b2a60966 46 // ctor
47
6ad0bfa0 48 fClusterizer = Clusterizer ;
49 fTrackSegmentMaker = Tracker ;
908558fc 50 fPID = Pid ;
364de5c6 51 fDebugReconstruction = kFALSE ;
d15a28e7 52}
53
d15a28e7 54
55//____________________________________________________________________________
6ad0bfa0 56 void AliPHOSReconstructioner::Init(AliPHOSClusterizer * Clusterizer,
57 AliPHOSTrackSegmentMaker * Tracker,
908558fc 58 AliPHOSPID * Pid)
6ad0bfa0 59{
60 fClusterizer = Clusterizer ;
61 fTrackSegmentMaker = Tracker ;
908558fc 62 fPID = Pid ;
364de5c6 63 fDebugReconstruction = kFALSE ;
6ad0bfa0 64}
65
6ad0bfa0 66//____________________________________________________________________________
83974468 67 void AliPHOSReconstructioner::Make(DigitsList * dl, RecPointsList * emccl, RecPointsList * ppsdl,
6ad0bfa0 68 TrackSegmentsList * trsl, RecParticlesList * rpl)
d15a28e7 69{
b2a60966 70 // Launches the Reconstruction process in the sequence: Make the reconstructed poins (clusterize)
71 // Make the track segments
72 // Make the reconstructed particles
6a3f1304 73
83974468 74 Int_t index ;
364de5c6 75 // Digit Debuging
76
77
78 if (fDebugReconstruction)
79 {
80 cout << ">>>>>>>>>>>>>>>>>>>>>> DebugReconstruction <<<<<<<<<<<<<<<<<<<<<<<<<<" << endl ;
81 cout << "DebugReconstruction>>> Digit list entries is " << dl->GetEntries() << endl ;
2885696f 82 AliPHOSDigit * digit;
031f0861 83 Bool_t calorimeter ;
84 Float_t factor;
364de5c6 85 cout << "DebugReconstruction>>> Vol Id " <<
031f0861 86 " Ene(MeV, KeV) " <<
364de5c6 87 " Index " <<
88 " Nprim " <<
89 " Prim1 " <<
90 " Prim2 " <<
91 " Prim3 " << endl;
92
93 for (index = 0 ; index < dl->GetEntries() ; index++) {
2885696f 94 digit = (AliPHOSDigit * ) dl->At(index) ;
031f0861 95 calorimeter = fClusterizer->IsInEmc(digit);
96 if (calorimeter) factor =1000. ; else factor=1000000.;
364de5c6 97 cout << "DebugReconstruction>>> " <<
031f0861 98 setw(8) << digit->GetId() << " " <<
99 setw(3) << calorimeter <<
100 setw(10) << factor*fClusterizer->Calibrate(digit->GetAmp()) << " " <<
101 setw(6) << digit->GetIndexInList() << " " <<
102 setw(5) << digit->GetNprimary() <<" " <<
103 setw(5) << digit->GetPrimary(1) <<" " <<
104 setw(5) << digit->GetPrimary(2) <<" " <<
105 setw(5) << digit->GetPrimary(3) << endl;
2885696f 106 }
364de5c6 107
108 }
109
110
2885696f 111
112 // Making Clusters
031f0861 113 if (fDebugReconstruction) cout << "DebugReconstruction>>> Start making reconstructed points (clusterizing)" << endl;
d15a28e7 114 fClusterizer->MakeClusters(dl, emccl, ppsdl);
6ad0bfa0 115
031f0861 116 // mark the position of the RecPoints in the array
117 AliPHOSEmcRecPoint * emcrp ;
118 for (index = 0 ; index < emccl->GetEntries() ; index++) {
119 emcrp = (AliPHOSEmcRecPoint * )emccl->At(index) ;
120 emcrp->SetIndexInList(index) ;
121 }
122 AliPHOSPpsdRecPoint * ppsdrp ;
123 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
124 ppsdrp = (AliPHOSPpsdRecPoint * )ppsdl->At(index) ;
125 ppsdrp->SetIndexInList(index) ;
126 }
2885696f 127
128 if (fDebugReconstruction)
129 {
031f0861 130 cout << "DebugReconstruction>>> Cluster emc list entries is " << emccl->GetEntries() << endl ;
2885696f 131 AliPHOSEmcRecPoint * recpoint;
031f0861 132 cout << "DebugReconstruction>>> Module " <<
133 "Ene(MeV) " <<
2885696f 134 "Index " <<
135 "Multi " <<
136 " X " <<
137 " Y " <<
138 " Z " <<
139 " Lambda 1 " <<
140 " Lambda 2 " <<
141 "MaxEnergy(MeV) " <<
142 "Nprim " <<
143 "Prim1 " <<
144 "Prim2 " <<
031f0861 145 "Prim3 " << endl;
2885696f 146 for (index = 0 ; index < emccl->GetEntries() ; index++) {
147 recpoint = (AliPHOSEmcRecPoint * )emccl->At(index) ;
148 TVector3 locpos; recpoint->GetLocalPosition(locpos);
149 Float_t lambda[2]; recpoint->GetElipsAxis(lambda);
150 Int_t * primaries;
151 Int_t nprimaries;
152 primaries = recpoint->GetPrimaries(nprimaries);
153 cout << "DebugReconstruction>>> " <<
154 setw(2) <<recpoint->GetPHOSMod() << " " <<
155 setw(9) << 1000.*recpoint->GetTotalEnergy() << " " <<
156 setw(6) << recpoint->GetIndexInList() << " " <<
157 setw(5) << recpoint->GetMultiplicity() <<" " <<
158 setw(8) << locpos.X() <<" " <<
159 setw(8) << locpos.Y() <<" " <<
160 setw(8) << locpos.Z() << " " <<
161 setw(10) << lambda[0] << " " <<
162 setw(10) << lambda[1] << " " <<
163 setw(9) << 1000*recpoint->GetMaximalEnergy() << " " <<
164 setw(9) << nprimaries << " " <<
165 setw(4) << primaries[0] << " " <<
166 setw(4) << primaries[1] << " " <<
031f0861 167 setw(4) << primaries[2] << " " << endl;
2885696f 168 }
169
031f0861 170 cout << "DebugReconstruction>>> Cluster ppsd list entries is " << ppsdl->GetEntries() << endl ;
171 AliPHOSPpsdRecPoint * ppsdrecpoint;
172 Text_t detector[4];
173 cout << "DebugReconstruction>>> Module " <<
174 "Det " <<
175 "Ene(KeV) " <<
176 "Index " <<
177 "Multi " <<
178 " X " <<
179 " Y " <<
180 " Z " <<
181 "Nprim " <<
182 "Prim1 " <<
183 "Prim2 " <<
184 "Prim3 " << endl;
185 for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
186 ppsdrecpoint = (AliPHOSPpsdRecPoint * ) ppsdl->At(index) ;
187 TVector3 locpos; ppsdrecpoint->GetLocalPosition(locpos);
188 Int_t * primaries;
189 Int_t nprimaries;
190 if (ppsdrecpoint->GetUp()) detector="CPV"; else detector="PC ";
191 primaries = ppsdrecpoint->GetPrimaries(nprimaries);
192 cout << "DebugReconstruction>>> " <<
193 setw(4) << ppsdrecpoint->GetPHOSMod() << " " <<
194 setw(4) << detector << " " <<
195 setw(9) << 1000000.*ppsdrecpoint->GetTotalEnergy() << " " <<
196 setw(6) << ppsdrecpoint->GetIndexInList() << " " <<
197 setw(5) << ppsdrecpoint->GetMultiplicity() <<" " <<
198 setw(8) << locpos.X() <<" " <<
199 setw(8) << locpos.Y() <<" " <<
200 setw(8) << locpos.Z() << " " <<
201 setw(9) << nprimaries << " " <<
202 setw(4) << primaries[0] << " " <<
203 setw(4) << primaries[1] << " " <<
204 setw(4) << primaries[2] << " " << endl;
205 }
206 }
83974468 207
6ad0bfa0 208
031f0861 209 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making track segments(unfolding+tracksegments)" << endl;
83974468 210 fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, trsl) ;
211
212 // mark the position of the TrackSegments in the array
213 AliPHOSTrackSegment * trs ;
214 for (index = 0 ; index < trsl->GetEntries() ; index++) {
215 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
216 trs->SetIndexInList(index) ;
217 }
031f0861 218 if (fDebugReconstruction){
219 cout << "DebugReconstruction>>> Track segment list entries is " << trsl->GetEntries() << endl ;
220 cout << "DebugReconstruction>>> Module " <<
221 "Ene(KeV) " <<
222 "Index " <<
223 " X " <<
224 " Y " <<
225 " Z " <<
226 " rX " <<
227 " rY " <<
228 " rZ " <<
229 "Nprim " <<
230 "Prim1 " <<
231 "Prim2 " <<
232 "Prim3 " << endl;
233
234 for (index = 0 ; index < trsl->GetEntries() ; index++) {
235 trs = (AliPHOSTrackSegment * )trsl->At(index) ;
236 TVector3 locpos; trs->GetPosition(locpos);
237 Int_t * primaries;
238 Int_t nprimaries;
239 primaries = trs->GetPrimariesEmc(nprimaries);
240 cout << "DebugReconstruction>>> " <<
241 setw(4) << trs->GetPHOSMod() << " " <<
242 setw(9) << 1000.*trs->GetEnergy() << " " <<
243 setw(3) << trs->GetIndexInList() << " " <<
244 setw(9) << locpos.X() <<" " <<
245 setw(9) << locpos.Y() <<" " <<
246 setw(9) << locpos.Z() << " " <<
247 setw(10) << (trs->GetMomentumDirection()).X() << " " <<
248 setw(10) << (trs->GetMomentumDirection()).Y() << " " <<
249 setw(10) << (trs->GetMomentumDirection()).Z() << " " <<
250 setw(4) << nprimaries << " " <<
251 setw(4) << primaries[0] << " " <<
252 setw(4) << primaries[1] << " " <<
253 setw(4) << primaries[2] << " " << endl;
254 }
255
256 }
257 if (fDebugReconstruction) cout << "DebugReconstruction>>>> Start making particles" << endl;
83974468 258
0dd37dda 259 fPID->MakeParticles(trsl, rpl) ;
83974468 260
261 // mark the position of the RecParticles in the array
262 AliPHOSRecParticle * rp ;
263 for (index = 0 ; index < rpl->GetEntries() ; index++) {
264 rp = (AliPHOSRecParticle * )rpl->At(index) ;
265 rp->SetIndexInList(index) ;
266 }
d15a28e7 267}