]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/html/src/AliPHOSEmcRecPoint.cxx.html
Debug statement removed.
[u/mrichter/AliRoot.git] / PHOS / html / src / AliPHOSEmcRecPoint.cxx.html
CommitLineData
aa7c9120 1<!DOCTYPE HTML PUBLIC "-// IETF/DTD HTML 2.0// EN">
2<html>
3<!-- -->
4<!-- Author: ROOT team (rootdev@hpsalo.cern.ch) -->
5<!-- -->
6<!-- Date: Mon Mar 26 12:09:43 2001 -->
7<!-- -->
8<head>
9<title>AliPHOSEmcRecPoint - source file</title>
10<link rev=made href="mailto:rootdev@root.cern.ch">
11<meta name="rating" content="General">
12<meta name="objecttype" content="Manual">
13<meta name="keywords" content="software development, oo, object oriented, unix, x11, windows, c++, html, rene brun, fons rademakers">
14<meta name="description" content="ROOT - An Object Oriented Framework For Large Scale Data Analysis.">
15</head>
16<body BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#551a8b" ALINK="#ff0000" TEXT="#000000">
17<a name="TopOfPage"></a>
18<pre>
19/**************************************************************************
20 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
21 * *
22 * Author: The ALICE Off-line Project. *
23 * Contributors are mentioned in the code where appropriate. *
24 * *
25 * Permission to use, copy, modify and distribute this software and its *
26 * documentation strictly for non-commercial purposes is hereby granted *
27 * without fee, provided that the above copyright notice appears in all *
28 * copies and that both the copyright notice and this permission notice *
29 * appear in the supporting documentation. The authors make no claims *
30 * about the suitability of this software for any purpose. It is *
31 * provided "as is" without express or implied warranty. *
32 **************************************************************************/
33
34/* $Id$ */
35
36<b>//_________________________________________________________________________</b>
37<b>// RecPoint implementation for PHOS-EMC </b>
38<b>// An EmcRecPoint is a cluster of digits </b>
39<b>// </b>
40<b>//*-- Author: Dmitri Peressounko (RRC KI &amp; SUBATECH)</b>
41
42
43<b>// --- ROOT system ---</b>
44#include "TPad.h"
45#include "TH2.h"
46#include "TMath.h"
47#include "TCanvas.h"
48
49<b>// --- Standard library ---</b>
50
51#include &lt;iostream.h&gt;
52
53<b>// --- AliRoot header files ---</b>
54
55 #include "AliGenerator.h"
56#include "AliPHOSGeometry.h"
57#include "AliPHOSEmcRecPoint.h"
58#include "AliRun.h"
59
60ClassImp(AliPHOSEmcRecPoint)
61
62<b>//____________________________________________________________________________</b>
63<a name="AliPHOSEmcRecPoint:AliPHOSEmcRecPoint"> </a><a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:AliPHOSEmcRecPoint">AliPHOSEmcRecPoint::AliPHOSEmcRecPoint</a>() : <a href=".././AliPHOSRecPoint.html">AliPHOSRecPoint</a>()
64{
65<b> // ctor</b>
66
67 fMulDigit = 0 ;
68 fAmp = 0. ;
69 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fCoreEnergy">fCoreEnergy</a> = 0 ;
70 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a> = 0 ;
71 fGeom = <a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetInstance">AliPHOSGeometry::GetInstance</a>() ;
72 fLocPos.SetX(1000000.) ; //Local position should be evaluated
73
74}
75
76<b>//____________________________________________________________________________</b>
77<a name="AliPHOSEmcRecPoint:~AliPHOSEmcRecPoint"> </a><a href=".././AliPHOSEmcRecPoint.html">AliPHOSEmcRecPoint</a>::~<a href=".././AliPHOSEmcRecPoint.html">AliPHOSEmcRecPoint</a>()
78{
79<b> // dtor</b>
80 if ( <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a> )
81 delete[] <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a> ;
82}
83
84<b>//____________________________________________________________________________</b>
85<a name="AliPHOSEmcRecPoint:AddDigit"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:AddDigit">AliPHOSEmcRecPoint::AddDigit</a>(<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> &amp; digit, <a href="../ListOfTypes.html#Float_t">Float_t</a> Energy)
86{
87<b> // Adds a digit to the RecPoint</b>
88<b> // and accumulates the total amplitude and the multiplicity </b>
89
90 if(<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a> == 0)
91 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a> = new <a href="../ListOfTypes.html#Float_t">Float_t</a>[fMaxDigit];
92
93 if ( fMulDigit &gt;= fMaxDigit ) { // increase the size of the lists
94 fMaxDigit*=2 ;
95 <a href="../ListOfTypes.html#Int_t">Int_t</a> * tempo = new ( <a href="../ListOfTypes.html#Int_t">Int_t</a>[fMaxDigit] ) ;
96 <a href="../ListOfTypes.html#Float_t">Float_t</a> * tempoE = new ( <a href="../ListOfTypes.html#Float_t">Float_t</a>[fMaxDigit] ) ;
97
98 <a href="../ListOfTypes.html#Int_t">Int_t</a> index ;
99 for ( index = 0 ; index &lt; fMulDigit ; index++ ){
100 tempo[index] = fDigitsList[index] ;
101 tempoE[index] = <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[index] ;
102 }
103
104 delete [] fDigitsList ;
105 fDigitsList = new ( <a href="../ListOfTypes.html#Int_t">Int_t</a>[fMaxDigit] ) ;
106
107 delete [] <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a> ;
108 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a> = new ( <a href="../ListOfTypes.html#Float_t">Float_t</a>[fMaxDigit] ) ;
109
110 for ( index = 0 ; index &lt; fMulDigit ; index++ ){
111 fDigitsList[index] = tempo[index] ;
112 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[index] = tempoE[index] ;
113 }
114
115 delete [] tempo ;
116 delete [] tempoE ;
117 } // if
118
119 fDigitsList[fMulDigit] = digit.GetIndexInList() ;
120 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[fMulDigit] = Energy ;
121 fMulDigit++ ;
122 fAmp += Energy ;
123
124 EvalPHOSMod(&amp;digit) ;
125}
126
127<b>//____________________________________________________________________________</b>
128<a name="AliPHOSEmcRecPoint:AreNeighbours"> </a><a href="../ListOfTypes.html#Bool_t">Bool_t</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:AreNeighbours">AliPHOSEmcRecPoint::AreNeighbours</a>(<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digit1, <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digit2 ) const
129{
130<b> // Tells if (true) or not (false) two digits are neighbors)</b>
131
132 <a href="../ListOfTypes.html#Bool_t">Bool_t</a> aren = kFALSE ;
133
134 <a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> * phosgeom = (<a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> *) fGeom ;
135 <a href="../ListOfTypes.html#Int_t">Int_t</a> relid1[4] ;
136 phosgeom-&gt;AbsToRelNumbering(digit1-&gt;GetId(), relid1) ;
137
138 <a href="../ListOfTypes.html#Int_t">Int_t</a> relid2[4] ;
139 phosgeom-&gt;AbsToRelNumbering(digit2-&gt;GetId(), relid2) ;
140
141 <a href="../ListOfTypes.html#Int_t">Int_t</a> rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;
142 <a href="../ListOfTypes.html#Int_t">Int_t</a> coldiff = TMath::Abs( relid1[3] - relid2[3] ) ;
143
144 if (( coldiff &lt;= 1 ) &amp;&amp; ( rowdiff &lt;= 1 ) &amp;&amp; (coldiff + rowdiff &gt; 0))
145 aren = kTRUE ;
146
147 return aren ;
148}
149
150<b>//____________________________________________________________________________</b>
151<a name="AliPHOSEmcRecPoint:Compare"> </a><a href="../ListOfTypes.html#Int_t">Int_t</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:Compare">AliPHOSEmcRecPoint::Compare</a>(const TObject * obj) const
152{
153<b> // Compares two RecPoints according to their position in the PHOS modules</b>
154
155 <a href="../ListOfTypes.html#Float_t">Float_t</a> delta = 1 ; //Width of "Sorting row". If you changibg this
156<b> //value (what is senseless) change as vell delta in</b>
157<b> //AliPHOSTrackSegmentMakerv* and other RecPoints...</b>
158 <a href="../ListOfTypes.html#Int_t">Int_t</a> rv ;
159
160 <a href=".././AliPHOSEmcRecPoint.html">AliPHOSEmcRecPoint</a> * clu = (<a href=".././AliPHOSEmcRecPoint.html">AliPHOSEmcRecPoint</a> *)obj ;
161
162
163 <a href="../ListOfTypes.html#Int_t">Int_t</a> phosmod1 = GetPHOSMod() ;
164 <a href="../ListOfTypes.html#Int_t">Int_t</a> phosmod2 = clu-&gt;GetPHOSMod() ;
165
166 TVector3 locpos1;
167 GetLocalPosition(locpos1) ;
168 TVector3 locpos2;
169 clu-&gt;GetLocalPosition(locpos2) ;
170
171 if(phosmod1 == phosmod2 ) {
172 <a href="../ListOfTypes.html#Int_t">Int_t</a> rowdif = (<a href="../ListOfTypes.html#Int_t">Int_t</a>)TMath::Ceil(locpos1.X()/delta)-(<a href="../ListOfTypes.html#Int_t">Int_t</a>)TMath::Ceil(locpos2.X()/delta) ;
173 if (rowdif&gt; 0)
174 rv = 1 ;
175 else if(rowdif &lt; 0)
176 rv = -1 ;
177 else if(locpos1.Z()&gt;locpos2.Z())
178 rv = -1 ;
179 else
180 rv = 1 ;
181 }
182
183 else {
184 if(phosmod1 &lt; phosmod2 )
185 rv = -1 ;
186 else
187 rv = 1 ;
188 }
189
190 return rv ;
191}
192
193<b>//______________________________________________________________________________</b>
194<a name="AliPHOSEmcRecPoint:ExecuteEvent"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:ExecuteEvent">AliPHOSEmcRecPoint::ExecuteEvent</a>(<a href="../ListOfTypes.html#Int_t">Int_t</a> event, <a href="../ListOfTypes.html#Int_t">Int_t</a> px, <a href="../ListOfTypes.html#Int_t">Int_t</a> py)
195{
196<b>// Commented by Dmitri Peressounko: there is no possibility to ensure, </b>
197<b>// that <a href=".././AliPHOSIndexToObject.html">AliPHOSIndexToObject</a> keeps the correct information.</b>
198
199<b>// // Execute action corresponding to one event</b>
200<b>// // This member function is called when a <a href=".././AliPHOSRecPoint.html">AliPHOSRecPoint</a> is clicked with the locator</b>
201<b>// //</b>
202<b>// // If Left button is clicked on <a href=".././AliPHOSRecPoint.html">AliPHOSRecPoint</a>, the digits are switched on </b>
203<b>// // and switched off when the mouse button is released.</b>
204<b>// //</b>
205
206<b>// // static <a href="../ListOfTypes.html#Int_t">Int_t</a> pxold, pyold;</b>
207
208<b>// <a href=".././AliPHOSIndexToObject.html">AliPHOSIndexToObject</a> * please = <a href=".././AliPHOSIndexToObject.html#AliPHOSIndexToObject:GetInstance">AliPHOSIndexToObject::GetInstance</a>() ; </b>
209
210<b>// static TGraph * digitgraph = 0 ;</b>
211
212<b>// if (!gPad-&gt;IsEditable()) return;</b>
213
214<b>// TH2F * histo = 0 ;</b>
215<b>// TCanvas * histocanvas ; </b>
216
217<b>// switch (event) {</b>
218
219<b>// case kButton1Down: {</b>
220<b>// <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digit ;</b>
221<b>// <a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> * phosgeom = (<a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> *) fGeom ;</b>
222<b>// <a href="../ListOfTypes.html#Int_t">Int_t</a> iDigit;</b>
223<b>// <a href="../ListOfTypes.html#Int_t">Int_t</a> relid[4] ;</b>
224
225<b>// const <a href="../ListOfTypes.html#Int_t">Int_t</a> kMulDigit = <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:GetDigitsMultiplicity">AliPHOSEmcRecPoint::GetDigitsMultiplicity</a>() ; </b>
226<b>// <a href="../ListOfTypes.html#Float_t">Float_t</a> * xi = new <a href="../ListOfTypes.html#Float_t">Float_t</a>[kMulDigit] ; </b>
227<b>// <a href="../ListOfTypes.html#Float_t">Float_t</a> * zi = new <a href="../ListOfTypes.html#Float_t">Float_t</a>[kMulDigit] ; </b>
228
229<b>// // create the histogram for the single cluster </b>
230<b>// // 1. gets histogram boundaries</b>
231<b>// <a href="../ListOfTypes.html#Float_t">Float_t</a> ximax = -999. ; </b>
232<b>// <a href="../ListOfTypes.html#Float_t">Float_t</a> zimax = -999. ; </b>
233<b>// <a href="../ListOfTypes.html#Float_t">Float_t</a> ximin = 999. ; </b>
234<b>// <a href="../ListOfTypes.html#Float_t">Float_t</a> zimin = 999. ;</b>
235
236<b>// for(iDigit=0; iDigit&lt;kMulDigit; iDigit++) {</b>
237<b>// digit = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *) ( please-&gt;GimeDigit(fDigitsList[iDigit]) ) ;</b>
238<b>// phosgeom-&gt;AbsToRelNumbering(digit-&gt;GetId(), relid) ;</b>
239<b>// phosgeom-&gt;RelPosInModule(relid, xi[iDigit], zi[iDigit]);</b>
240<b>// if ( xi[iDigit] &gt; ximax )</b>
241<b>// ximax = xi[iDigit] ; </b>
242<b>// if ( xi[iDigit] &lt; ximin )</b>
243<b>// ximin = xi[iDigit] ; </b>
244<b>// if ( zi[iDigit] &gt; zimax )</b>
245<b>// zimax = zi[iDigit] ; </b>
246<b>// if ( zi[iDigit] &lt; zimin )</b>
247<b>// zimin = zi[iDigit] ; </b>
248<b>// }</b>
249<b>// ximax += phosgeom-&gt;GetCrystalSize(0) / 2. ;</b>
250<b>// zimax += phosgeom-&gt;GetCrystalSize(2) / 2. ;</b>
251<b>// ximin -= phosgeom-&gt;GetCrystalSize(0) / 2. ;</b>
252<b>// zimin -= phosgeom-&gt;GetCrystalSize(2) / 2. ;</b>
253<b>// <a href="../ListOfTypes.html#Int_t">Int_t</a> xdim = (<a href="../ListOfTypes.html#int">int</a>)( (ximax - ximin ) / phosgeom-&gt;GetCrystalSize(0) + 0.5 ) ; </b>
254<b>// <a href="../ListOfTypes.html#Int_t">Int_t</a> zdim = (<a href="../ListOfTypes.html#int">int</a>)( (zimax - zimin ) / phosgeom-&gt;GetCrystalSize(2) + 0.5 ) ;</b>
255
256<b>// // 2. gets the histogram title</b>
257
258<b>// <a href="../ListOfTypes.html#Text_t">Text_t</a> title[100] ; </b>
259<b>// sprintf(title,"Energy=%1.2f GeV ; Digits ; %d ", GetEnergy(), GetDigitsMultiplicity()) ;</b>
260
261<b>// if (!histo) {</b>
262<b>// delete histo ; </b>
263<b>// histo = 0 ; </b>
264<b>// }</b>
265<b>// histo = new TH2F("cluster3D", title, xdim, ximin, ximax, zdim, zimin, zimax) ;</b>
266
267<b>// <a href="../ListOfTypes.html#Float_t">Float_t</a> x, z ; </b>
268<b>// for(iDigit=0; iDigit&lt;kMulDigit; iDigit++) {</b>
269<b>// digit = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *) ( please-&gt;GimeDigit(fDigitsList[iDigit]) ) ;</b>
270<b>// phosgeom-&gt;AbsToRelNumbering(digit-&gt;GetId(), relid) ;</b>
271<b>// phosgeom-&gt;RelPosInModule(relid, x, z);</b>
272<b>// histo-&gt;Fill(x, z, <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit] ) ;</b>
273<b>// }</b>
274
275<b>// if (!digitgraph) {</b>
276<b>// digitgraph = new TGraph(kMulDigit,xi,zi);</b>
277<b>// digitgraph-&gt; SetMarkerStyle(5) ; </b>
278<b>// digitgraph-&gt; SetMarkerSize(1.) ;</b>
279<b>// digitgraph-&gt; SetMarkerColor(1) ;</b>
280<b>// digitgraph-&gt; Paint("P") ;</b>
281<b>// }</b>
282
283<b>// <a href="#AliPHOSEmcRecPoint:Print">Print</a>() ;</b>
284<b>// histocanvas = new TCanvas("cluster", "a single cluster", 600, 500) ; </b>
285<b>// histocanvas-&gt;Draw() ; </b>
286<b>// histo-&gt;Draw("lego1") ; </b>
287
288<b>// delete[] xi ; </b>
289<b>// delete[] zi ; </b>
290
291<b>// break;</b>
292<b>// }</b>
293
294<b>// case kButton1Up: </b>
295<b>// if (digitgraph) {</b>
296<b>// delete digitgraph ;</b>
297<b>// digitgraph = 0 ;</b>
298<b>// }</b>
299<b>// break;</b>
300
301<b>// }</b>
302}
303
304<b>//____________________________________________________________________________</b>
305<a name="AliPHOSEmcRecPoint:EvalDispersion"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:EvalDispersion">AliPHOSEmcRecPoint::EvalDispersion</a>(<a href="../ListOfTypes.html#Float_t">Float_t</a> logWeight,TClonesArray * digits)
306{
307<b> // Calculates the dispersion of the shower at the origine of the RecPoint</b>
308
309 <a href="../ListOfTypes.html#Float_t">Float_t</a> d = 0 ;
310 <a href="../ListOfTypes.html#Float_t">Float_t</a> wtot = 0 ;
311
312 TVector3 locpos;
313 GetLocalPosition(locpos);
314 <a href="../ListOfTypes.html#Float_t">Float_t</a> x = locpos.X() ;
315 <a href="../ListOfTypes.html#Float_t">Float_t</a> z = locpos.Z() ;
316
317 <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digit ;
318 <a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> * phosgeom = (<a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> *) fGeom ;
319
320 <a href="../ListOfTypes.html#Int_t">Int_t</a> iDigit;
321 for(iDigit=0; iDigit &lt; fMulDigit; iDigit++) {
322 digit = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *) digits-&gt;At(fDigitsList[iDigit]) ;
323 <a href="../ListOfTypes.html#Int_t">Int_t</a> relid[4] ;
324 <a href="../ListOfTypes.html#Float_t">Float_t</a> xi ;
325 <a href="../ListOfTypes.html#Float_t">Float_t</a> zi ;
326 phosgeom-&gt;AbsToRelNumbering(digit-&gt;GetId(), relid) ;
327 phosgeom-&gt;RelPosInModule(relid, xi, zi);
328 <a href="../ListOfTypes.html#Float_t">Float_t</a> w = TMath::Max(0.,logWeight+TMath::Log(<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit]/fAmp ) ) ;
329 d += w*((xi-x)*(xi-x) + (zi-z)*(zi-z) ) ;
330 wtot+=w ;
331 }
332
333
334 d /= wtot ;
335
336 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fDispersion">fDispersion</a> = TMath::Sqrt(d) ;
337}
338<b>//______________________________________________________________________________</b>
339<a name="AliPHOSEmcRecPoint:EvalCoreEnergy"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:EvalCoreEnergy">AliPHOSEmcRecPoint::EvalCoreEnergy</a>(TClonesArray * digits)
340{
341<b> //This function calculates energy in the core, </b>
342<b> //i.e. within radius rad = 3cm. Beyond this radius</b>
343<b> //in accoradnce with shower profile energy deposition </b>
344<b> // should be less than 2%</b>
345
346 <a href="../ListOfTypes.html#Float_t">Float_t</a> coreRadius = 3 ;
347
348 TVector3 locpos;
349 GetLocalPosition(locpos);
350 <a href="../ListOfTypes.html#Float_t">Float_t</a> x = locpos.X() ;
351 <a href="../ListOfTypes.html#Float_t">Float_t</a> z = locpos.Z() ;
352
353 <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digit ;
354 <a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> * phosgeom = (<a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> *) fGeom ;
355
356 <a href="../ListOfTypes.html#Int_t">Int_t</a> iDigit;
357 for(iDigit=0; iDigit &lt; fMulDigit; iDigit++) {
358 digit = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *) ( digits-&gt;At(fDigitsList[iDigit]) ) ;
359 <a href="../ListOfTypes.html#Int_t">Int_t</a> relid[4] ;
360 <a href="../ListOfTypes.html#Float_t">Float_t</a> xi ;
361 <a href="../ListOfTypes.html#Float_t">Float_t</a> zi ;
362 phosgeom-&gt;AbsToRelNumbering(digit-&gt;GetId(), relid) ;
363 phosgeom-&gt;RelPosInModule(relid, xi, zi);
364 <a href="../ListOfTypes.html#Float_t">Float_t</a> distance = TMath::Sqrt((xi-x)*(xi-x)+(zi-z)*(zi-z)) ;
365 if(distance &lt; coreRadius)
366 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fCoreEnergy">fCoreEnergy</a> += <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit] ;
367 }
368
369}
370
371<b>//____________________________________________________________________________</b>
372<a name="AliPHOSEmcRecPoint:EvalElipsAxis"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:EvalElipsAxis">AliPHOSEmcRecPoint::EvalElipsAxis</a>(<a href="../ListOfTypes.html#Float_t">Float_t</a> logWeight,TClonesArray * digits)
373{
374<b> // Calculates the axis of the shower ellipsoid</b>
375
376 <a href="../ListOfTypes.html#Double_t">Double_t</a> wtot = 0. ;
377 <a href="../ListOfTypes.html#Double_t">Double_t</a> x = 0.;
378 <a href="../ListOfTypes.html#Double_t">Double_t</a> z = 0.;
379 <a href="../ListOfTypes.html#Double_t">Double_t</a> dxx = 0.;
380 <a href="../ListOfTypes.html#Double_t">Double_t</a> dzz = 0.;
381 <a href="../ListOfTypes.html#Double_t">Double_t</a> dxz = 0.;
382
383 <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digit ;
384 <a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> * phosgeom = (<a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> *) fGeom ;
385 <a href="../ListOfTypes.html#Int_t">Int_t</a> iDigit;
386
387 for(iDigit=0; iDigit&lt;fMulDigit; iDigit++) {
388 digit = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *) digits-&gt;At(fDigitsList[iDigit]) ;
389 <a href="../ListOfTypes.html#Int_t">Int_t</a> relid[4] ;
390 <a href="../ListOfTypes.html#Float_t">Float_t</a> xi ;
391 <a href="../ListOfTypes.html#Float_t">Float_t</a> zi ;
392 phosgeom-&gt;AbsToRelNumbering(digit-&gt;GetId(), relid) ;
393 phosgeom-&gt;RelPosInModule(relid, xi, zi);
394 <a href="../ListOfTypes.html#Double_t">Double_t</a> w = TMath::Max(0.,logWeight+TMath::Log(<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit]/fAmp ) ) ;
395 dxx += w * xi * xi ;
396 x += w * xi ;
397 dzz += w * zi * zi ;
398 z += w * zi ;
399 dxz += w * xi * zi ;
400 wtot += w ;
401 }
402 dxx /= wtot ;
403 x /= wtot ;
404 dxx -= x * x ;
405 dzz /= wtot ;
406 z /= wtot ;
407 dzz -= z * z ;
408 dxz /= wtot ;
409 dxz -= x * z ;
410
411<b>// //Apply correction due to non-perpendicular incidence</b>
412<b>// <a href="../ListOfTypes.html#Double_t">Double_t</a> CosX ;</b>
413<b>// <a href="../ListOfTypes.html#Double_t">Double_t</a> CosZ ;</b>
414<b>// <a href="../ListOfTypes.html#Double_t">Double_t</a> DistanceToIP= (<a href="../ListOfTypes.html#Double_t">Double_t</a> ) ((<a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> *) fGeom)-&gt;GetIPtoCrystalSurface() ;</b>
415
416<b>// CosX = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+x*x) ;</b>
417<b>// CosZ = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+z*z) ;</b>
418
419<b>// dxx = dxx/(CosX*CosX) ;</b>
420<b>// dzz = dzz/(CosZ*CosZ) ;</b>
421<b>// dxz = dxz/(CosX*CosZ) ;</b>
422
423
424 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fLambda">fLambda</a>[0] = 0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
425 if(<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fLambda">fLambda</a>[0] &gt; 0)
426 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fLambda">fLambda</a>[0] = TMath::Sqrt(<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fLambda">fLambda</a>[0]) ;
427
428 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fLambda">fLambda</a>[1] = 0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz ) ;
429 if(<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fLambda">fLambda</a>[1] &gt; 0) //To avoid exception if numerical errors lead to negative lambda.
430 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fLambda">fLambda</a>[1] = TMath::Sqrt(<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fLambda">fLambda</a>[1]) ;
431 else
432 <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fLambda">fLambda</a>[1]= 0. ;
433}
434
435<b>//____________________________________________________________________________</b>
436<a name="AliPHOSEmcRecPoint:EvalAll"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:EvalAll">AliPHOSEmcRecPoint::EvalAll</a>(<a href="../ListOfTypes.html#Float_t">Float_t</a> logWeight, TClonesArray * digits )
437{
438 <a href=".././AliPHOSRecPoint.html#AliPHOSRecPoint:EvalAll">AliPHOSRecPoint::EvalAll</a>(logWeight,digits) ;
439 <a href="#AliPHOSEmcRecPoint:EvalLocalPosition">EvalLocalPosition</a>(logWeight, digits) ;
440 <a href="#AliPHOSEmcRecPoint:EvalElipsAxis">EvalElipsAxis</a>(logWeight, digits) ;
441 <a href="#AliPHOSEmcRecPoint:EvalDispersion">EvalDispersion</a>(logWeight, digits) ;
442 <a href="#AliPHOSEmcRecPoint:EvalCoreEnergy">EvalCoreEnergy</a>(digits);
443}
444<b>//____________________________________________________________________________</b>
445<a name="AliPHOSEmcRecPoint:EvalLocalPosition"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:EvalLocalPosition">AliPHOSEmcRecPoint::EvalLocalPosition</a>(<a href="../ListOfTypes.html#Float_t">Float_t</a> logWeight, TClonesArray * digits)
446{
447<b> // Calculates the center of gravity in the local PHOS-module coordinates </b>
448
449 <a href="../ListOfTypes.html#Float_t">Float_t</a> wtot = 0. ;
450
451 <a href="../ListOfTypes.html#Int_t">Int_t</a> relid[4] ;
452
453 <a href="../ListOfTypes.html#Float_t">Float_t</a> x = 0. ;
454 <a href="../ListOfTypes.html#Float_t">Float_t</a> z = 0. ;
455
456 <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digit ;
457
458 <a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> * phosgeom = (<a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> *) fGeom ;
459
460 <a href="../ListOfTypes.html#Int_t">Int_t</a> iDigit;
461
462 for(iDigit=0; iDigit&lt;fMulDigit; iDigit++) {
463 digit = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *) digits-&gt;At(fDigitsList[iDigit]) ;
464
465 <a href="../ListOfTypes.html#Float_t">Float_t</a> xi ;
466 <a href="../ListOfTypes.html#Float_t">Float_t</a> zi ;
467 phosgeom-&gt;AbsToRelNumbering(digit-&gt;GetId(), relid) ;
468 phosgeom-&gt;RelPosInModule(relid, xi, zi);
469 <a href="../ListOfTypes.html#Float_t">Float_t</a> w = TMath::Max( 0., logWeight + TMath::Log( <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit] / fAmp ) ) ;
470 x += xi * w ;
471 z += zi * w ;
472 wtot += w ;
473
474 }
475
476 x /= wtot ;
477 z /= wtot ;
478
479<b> // Correction for the depth of the shower starting <a href="../ListOfTypes.html#point">point</a> (TDR p 127) </b>
480 <a href="../ListOfTypes.html#Float_t">Float_t</a> para = 0.925 ;
481 <a href="../ListOfTypes.html#Float_t">Float_t</a> parb = 6.52 ;
482
483 <a href="../ListOfTypes.html#Float_t">Float_t</a> xo,yo,zo ; //Coordinates of the origin
484 gAlice-&gt;Generator()-&gt;GetOrigin(xo,yo,zo) ;
485
486 <a href="../ListOfTypes.html#Float_t">Float_t</a> phi = phosgeom-&gt;GetPHOSAngle(relid[0]) ;
487
488<b> //Transform to the local ref.frame</b>
489 <a href="../ListOfTypes.html#Float_t">Float_t</a> xoL,yoL ;
490 xoL = xo*TMath::Cos(phi)-yo*TMath::Sin(phi) ;
491 yoL = xo*TMath::Sin(phi)+yo*TMath::Cos(phi) ;
492
493 <a href="../ListOfTypes.html#Float_t">Float_t</a> radius = TMath::Sqrt((xoL-x)*(xoL-x)+
494 (phosgeom-&gt;GetIPtoCrystalSurface()-yoL)*(phosgeom-&gt;GetIPtoCrystalSurface()-yoL)+
495 (zo-z)*(zo-z));
496
497 <a href="../ListOfTypes.html#Float_t">Float_t</a> incidencephi = TMath::ATan((x-xoL ) / radius) ;
498 <a href="../ListOfTypes.html#Float_t">Float_t</a> incidencetheta = TMath::ATan((z-zo) / radius) ;
499
500 <a href="../ListOfTypes.html#Float_t">Float_t</a> depthx = ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencephi) ;
501 <a href="../ListOfTypes.html#Float_t">Float_t</a> depthz = ( para * TMath::Log(fAmp) + parb ) * TMath::Sin(incidencetheta) ;
502
503
504 fLocPos.SetX(x - depthx) ;
505 fLocPos.SetY(0.) ;
506 fLocPos.SetZ(z - depthz) ;
507
508}
509
510<b>//____________________________________________________________________________</b>
511<a name="AliPHOSEmcRecPoint:GetMaximalEnergy"> </a><a href="../ListOfTypes.html#Float_t">Float_t</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:GetMaximalEnergy">AliPHOSEmcRecPoint::GetMaximalEnergy</a>(<a href="../ListOfTypes.html#void">void</a>) const
512{
513<b> // Finds the maximum energy in the cluster</b>
514
515 <a href="../ListOfTypes.html#Float_t">Float_t</a> menergy = 0. ;
516
517 <a href="../ListOfTypes.html#Int_t">Int_t</a> iDigit;
518
519 for(iDigit=0; iDigit&lt;fMulDigit; iDigit++) {
520
521 if(<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit] &gt; menergy)
522 menergy = <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit] ;
523 }
524 return menergy ;
525}
526
527<b>//____________________________________________________________________________</b>
528<a name="AliPHOSEmcRecPoint:GetMultiplicityAtLevel"> </a><a href="../ListOfTypes.html#Int_t">Int_t</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:GetMultiplicityAtLevel">AliPHOSEmcRecPoint::GetMultiplicityAtLevel</a>(const <a href="../ListOfTypes.html#Float_t">Float_t</a> H) const
529{
530<b> // Calculates the multiplicity of digits with energy larger than H*energy </b>
531
532 <a href="../ListOfTypes.html#Int_t">Int_t</a> multipl = 0 ;
533 <a href="../ListOfTypes.html#Int_t">Int_t</a> iDigit ;
534 for(iDigit=0; iDigit&lt;fMulDigit; iDigit++) {
535
536 if(<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit] &gt; H * fAmp)
537 multipl++ ;
538 }
539 return multipl ;
540}
541
542<b>//____________________________________________________________________________</b>
543<a name="AliPHOSEmcRecPoint:GetNumberOfLocalMax"> </a><a href="../ListOfTypes.html#Int_t">Int_t</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:GetNumberOfLocalMax">AliPHOSEmcRecPoint::GetNumberOfLocalMax</a>(<a href="../ListOfTypes.html#Int_t">Int_t</a> * maxAt, <a href="../ListOfTypes.html#Float_t">Float_t</a> * maxAtEnergy,
544 <a href="../ListOfTypes.html#Float_t">Float_t</a> locMaxCut,TClonesArray * digits) const
545{
546<b> // Calculates the <a href="../ListOfTypes.html#number">number</a> of local maxima in the cluster using fLocalMaxCut as the minimum</b>
547<b> // energy difference between two local maxima</b>
548
549 <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digit ;
550 <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digitN ;
551
552
553 <a href="../ListOfTypes.html#Int_t">Int_t</a> iDigitN ;
554 <a href="../ListOfTypes.html#Int_t">Int_t</a> iDigit ;
555
556 for(iDigit = 0; iDigit &lt; fMulDigit; iDigit++)
557 maxAt[iDigit] = (<a href="../ListOfTypes.html#Int_t">Int_t</a>) digits-&gt;At(fDigitsList[iDigit]) ;
558
559
560 for(iDigit = 0 ; iDigit &lt; fMulDigit; iDigit++) {
561 if(maxAt[iDigit] != -1) {
562 digit = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *) maxAt[iDigit] ;
563
564 for(iDigitN = 0; iDigitN &lt; fMulDigit; iDigitN++) {
565 digitN = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *) digits-&gt;At(fDigitsList[iDigitN]) ;
566
567 if ( <a href="#AliPHOSEmcRecPoint:AreNeighbours">AreNeighbours</a>(digit, digitN) ) {
568 if (<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit] &gt; <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigitN] ) {
569 maxAt[iDigitN] = -1 ;
570<b> // but may be digit too is not local max ?</b>
571 if(<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit] &lt; <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigitN] + locMaxCut)
572 maxAt[iDigit] = -1 ;
573 }
574 else {
575 maxAt[iDigit] = -1 ;
576<b> // but may be digitN too is not local max ?</b>
577 if(<a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit] &gt; <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigitN] - locMaxCut)
578 maxAt[iDigitN] = -1 ;
579 }
580 } // if Areneighbours
581 } // while digitN
582 } // slot not empty
583 } // while digit
584
585 iDigitN = 0 ;
586 for(iDigit = 0; iDigit &lt; fMulDigit; iDigit++) {
587 if(maxAt[iDigit] != -1){
588 maxAt[iDigitN] = maxAt[iDigit] ;
589 maxAtEnergy[iDigitN] = <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit] ;
590 iDigitN++ ;
591 }
592 }
593 return iDigitN ;
594}
595
596
597
598<b>//____________________________________________________________________________</b>
599<a name="AliPHOSEmcRecPoint:Print"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:Print">AliPHOSEmcRecPoint::Print</a>(<a href="../ListOfTypes.html#Option_t">Option_t</a> * option)
600{
601<b> // Print the list of digits belonging to the cluster</b>
602
603 cout &lt;&lt; "<a href=".././AliPHOSEmcRecPoint.html">AliPHOSEmcRecPoint</a>: " &lt;&lt; endl ;
604
605 <a href="../ListOfTypes.html#Int_t">Int_t</a> iDigit;
606 cout &lt;&lt; " digits # = " ;
607 for(iDigit=0; iDigit&lt;fMulDigit; iDigit++)
608 cout &lt;&lt; fDigitsList[iDigit] &lt;&lt; " " ;
609 cout &lt;&lt; endl ;
610
611 cout &lt;&lt; " Energies = " ;
612 for(iDigit=0; iDigit&lt;fMulDigit; iDigit++)
613 cout &lt;&lt; <a href=".././AliPHOSEmcRecPoint.html#AliPHOSEmcRecPoint:fEnergyList">fEnergyList</a>[iDigit] &lt;&lt; " ";
614 cout &lt;&lt; endl ;
615
616 cout &lt;&lt; " Multiplicity = " &lt;&lt; fMulDigit &lt;&lt; endl ;
617 cout &lt;&lt; " Cluster Energy = " &lt;&lt; fAmp &lt;&lt; endl ;
618 cout &lt;&lt; " Stored at position " &lt;&lt; GetIndexInList() &lt;&lt; endl ;
619
620}
621
622
623</pre>
624
625<!--SIGNATURE-->
626<br>
627<address>
628<hr>
629<center>
630<a href="http://root.cern.ch/root/Welcome.html">ROOT page</a> - <a href="../ClassIndex.html">Class index</a> - <a href="#TopOfPage">Top of the page</a><br>
631</center>
632<hr>This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to <a href="mailto:rootdev@root.cern.ch">ROOT support</a>, or contact <a href="mailto:rootdev@root.cern.ch">the developers</a> with any questions or problems regarding ROOT.
633</address>
634</body>
635</html>