]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/PHOS-HTML/src/AliPHOSFastRecParticle.cxx.html
This commit was generated by cvs2svn to compensate for changes in r799,
[u/mrichter/AliRoot.git] / PHOS / PHOS-HTML / src / AliPHOSFastRecParticle.cxx.html
CommitLineData
29c81279 1<!DOCTYPE HTML PUBLIC "-// IETF/DTD HTML 2.0// EN">
2<html>
3<!-- -->
4<!-- Author: ROOT team (rootdev@hpsalo.cern.ch) -->
5<!-- -->
6<!-- Date: Sun Mar 12 00:45:55 2000 -->
7<!-- -->
8<head>
9<title>AliPHOSFastRecParticle - 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, motif, windows nt, 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>// A Particle modified by PHOS response and produced by <a href=".././AliPHOSvFast.html">AliPHOSvFast</a></b>
38<b>// To become a general class of AliRoot ? </b>
39<b>// </b>
40<b>//*-- Author: Yves Schutz (SUBATECH)</b>
41
42<b>// --- ROOT system ---</b>
43
44<b>// --- Standard library ---</b>
45
46#include &lt;iostream&gt;
47
48<b>// --- AliRoot header files ---</b>
49
50#include "<a href="../AliPHOSFastRecParticle.h">AliPHOSFastRecParticle.h</a>"
51#include "TPad.h"
52#include "TPaveText.h"
53
54ClassImp(AliPHOSFastRecParticle)
55
56<b>//____________________________________________________________________________</b>
57<a name="AliPHOSFastRecParticle:AliPHOSFastRecParticle"> </a> <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:AliPHOSFastRecParticle">AliPHOSFastRecParticle::AliPHOSFastRecParticle</a>(const <a href=".././AliPHOSFastRecParticle.html">AliPHOSFastRecParticle</a> &amp; rp)
58{
59<b> // copy ctor</b>
60
61 <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:fType">fType</a> = rp.<a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:fType">fType</a> ;
62 fPdgCode = rp.fPdgCode;
63 fStatusCode = rp.fStatusCode;
64 fMother[0] = rp.fMother[0];
65 fMother[1] = rp.fMother[1];
66 fDaughter[0] = rp.fDaughter[0];
67 fDaughter[1] = rp.fDaughter[1];
68 fWeight = rp.fWeight;
69 fCalcMass = rp.fCalcMass;
70 fPx = rp.fPx;
71 fPy = rp.fPy;
72 fPz = rp.fPz;
73 fE = rp.fE;
74 fVx = rp.fVx;
75 fVy = rp.fVy;
76 fVz = rp.fVz;
77 fVt = rp.fVt;
78 fPolarTheta = rp.fPolarTheta;
79 fPolarPhi = rp.fPolarPhi;
80 fParticlePDG = rp.fParticlePDG;
81}
82
83<b>//____________________________________________________________________________</b>
84<a name="AliPHOSFastRecParticle:AliPHOSFastRecParticle"> </a> <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:AliPHOSFastRecParticle">AliPHOSFastRecParticle::AliPHOSFastRecParticle</a>(const TParticle &amp; pp)
85{
86<b> // ctor from a TParticle (crummy?!)</b>
87
88 TParticle &amp; pnoconst = const_cast&lt;TParticle &amp;&gt;(pp) ;
89 <a href=".././AliPHOSFastRecParticle.html">AliPHOSFastRecParticle</a> &amp; p = static_cast&lt;<a href=".././AliPHOSFastRecParticle.html">AliPHOSFastRecParticle</a>&amp;&gt;(pnoconst) ;
90
91 fPdgCode = p.fPdgCode;
92 fStatusCode = p.fStatusCode;
93 fMother[0] = p.fMother[0];
94 fMother[1] = p.fMother[1];
95 fDaughter[0] = p.fDaughter[0];
96 fDaughter[1] = p.fDaughter[1];
97 fWeight = p.fWeight;
98 fCalcMass = p.fCalcMass;
99 fPx = p.fPx;
100 fPy = p.fPy;
101 fPz = p.fPz;
102 fE = p.fE;
103 fVx = p.fVx;
104 fVy = p.fVy;
105 fVz = p.fVz;
106 fVt = p.fVt;
107 fPolarTheta = p.fPolarTheta;
108 fPolarPhi = p.fPolarPhi;
109 fParticlePDG = p.fParticlePDG;
110}
111
112<b>//____________________________________________________________________________</b>
113<a name="AliPHOSFastRecParticle:DistancetoPrimitive"> </a><a href="../ListOfTypes.html#Int_t">Int_t</a> <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:DistancetoPrimitive">AliPHOSFastRecParticle::DistancetoPrimitive</a>(<a href="../ListOfTypes.html#Int_t">Int_t</a> px, <a href="../ListOfTypes.html#Int_t">Int_t</a> py)
114{
115<b> // Compute distance from point px,py to a <a href=".././AliPHOSFastRecParticle.html">AliPHOSFastRecParticle</a> considered as a Tmarker</b>
116<b> // Compute the closest distance of approach from point px,py to this marker.</b>
117<b> // The distance is computed in pixels units.</b>
118
119 <a href="../ListOfTypes.html#Double_t">Double_t</a> kRADDEG = 180. / TMath::Pi() ;
120 <a href="../ListOfTypes.html#Coord_t">Coord_t</a> x = Phi() * kRADDEG ;
121 <a href="../ListOfTypes.html#Coord_t">Coord_t</a> y = Theta() * kRADDEG ;
122 const <a href="../ListOfTypes.html#Int_t">Int_t</a> kMaxDiff = 10;
123 <a href="../ListOfTypes.html#Int_t">Int_t</a> pxm = gPad-&gt;XtoAbsPixel(x);
124 <a href="../ListOfTypes.html#Int_t">Int_t</a> pym = gPad-&gt;YtoAbsPixel(y);
125 <a href="../ListOfTypes.html#Int_t">Int_t</a> dist = (px-pxm)*(px-pxm) + (py-pym)*(py-pym);
126
127 if (dist &gt; kMaxDiff) return 9999;
128 return dist;
129}
130
131<b>//___________________________________________________________________________</b>
132<a name="AliPHOSFastRecParticle:Draw"> </a> <a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:Draw">AliPHOSFastRecParticle::Draw</a>(<a href="../ListOfTypes.html#Option_t">Option_t</a> *option)
133 {
134<b> // Draw this <a href=".././AliPHOSFastRecParticle.html">AliPHOSFastRecParticle</a> with its current attributes</b>
135
136 AppendPad(option);
137 }
138
139<b>//______________________________________________________________________________</b>
140<a name="AliPHOSFastRecParticle:ExecuteEvent"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:ExecuteEvent">AliPHOSFastRecParticle::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)
141{
142<b> // Execute action corresponding to one event</b>
143<b> // This member function is called when a <a href=".././AliPHOSFastRecParticle.html">AliPHOSFastRecParticle</a> is clicked with the locator</b>
144
145 if (!gPad-&gt;IsEditable())
146 return ;
147
148 static TPaveText * clustertext = 0 ;
149
150 switch (event) {
151
152 case kButton1Down: {
153 <a href="../ListOfTypes.html#Double_t">Double_t</a> kRADDEG = 180. / TMath::Pi() ;
154 <a href="../ListOfTypes.html#Coord_t">Coord_t</a> x = Phi() * kRADDEG ;
155 <a href="../ListOfTypes.html#Coord_t">Coord_t</a> y = Theta() * kRADDEG ;
156 clustertext = new TPaveText(x-1, y+1, x+5, y+3, "") ;
157 <a href="../ListOfTypes.html#Text_t">Text_t</a> line1[40] ;
158 <a href="../ListOfTypes.html#Text_t">Text_t</a> line2[40] ;
159 sprintf( line1, "PID: %s ", (const <a href="../ListOfTypes.html#char">char</a>*)<a href="#AliPHOSFastRecParticle:Name">Name</a>() ) ;
160 sprintf( line2, "ENERGY: %f ", Energy() ) ;
161 clustertext -&gt;AddText(line1) ;
162 clustertext -&gt;AddText(line2) ;
163 clustertext -&gt;<a href="#AliPHOSFastRecParticle:Draw">Draw</a>("");
164 gPad-&gt;Update() ;
165 break ;
166 }
167
168 case kButton1Up: {
169 delete clustertext ;
170 clustertext = 0 ;
171 gPad-&gt;Update() ;
172 break ;
173 }
174
175 }
176
177}
178
179<b>//____________________________________________________________________________</b>
180<a name="AliPHOSFastRecParticle:GetPrimaries"> </a><a href="../ListOfTypes.html#Int_t">Int_t</a> * <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:GetPrimaries">AliPHOSFastRecParticle::GetPrimaries</a>(<a href="../ListOfTypes.html#Int_t">Int_t</a> &amp; number)
181{
182<b> // Retrieves the unique primary particle at the origine of the present reconstruced particle</b>
183
184 number = 1 ;
185 <a href="../ListOfTypes.html#Int_t">Int_t</a> * list = new <a href="../ListOfTypes.html#Int_t">Int_t</a>[1] ;
186 list[0] = <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:fPrimary">fPrimary</a> ;
187
188 return list ;
189}
190
191<b>//____________________________________________________________________________</b>
192<a name="AliPHOSFastRecParticle:Name"> </a>TString <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:Name">AliPHOSFastRecParticle::Name</a>()
193{
194<b> // Returns the name of the particle type</b>
195
196 TString name ;
197 switch (<a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:fType">fType</a>) {
198 case kGAMMA:
199 name = "PHOTON" ;
200 break ;
201 case kELECTRON:
202 name = "ELECTRON" ;
203 break ;
204 case kNEUTRAL:
205 name = "NEUTRAL" ;
206 break ;
207 case kCHARGEDHADRON:
208 name = "CHARGED HADRON" ;
209 break ;
210 case kNEUTRALHADRON:
211 name = "NEUTRAL HADRON" ;
212 break ;
213 case kNEUTRALEM:
214 name = "NEUTRAL EM" ;
215 break ;
216 case kGAMMAHADRON:
217 name = "PHOTON HADRON" ;
218 break ;
219
220 }
221 return name ;
222}
223
224<b>//______________________________________________________________________________</b>
225<a name="AliPHOSFastRecParticle:Paint"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:Paint">AliPHOSFastRecParticle::Paint</a>(<a href="../ListOfTypes.html#Option_t">Option_t</a> *)
226{
227<b> // Paint this ALiRecParticle in theta,phi coordinate as a TMarker with its current attributes</b>
228
229 <a href="../ListOfTypes.html#Double_t">Double_t</a> kRADDEG = 180. / TMath::Pi() ;
230 <a href="../ListOfTypes.html#Coord_t">Coord_t</a> x = Phi() * kRADDEG ;
231 <a href="../ListOfTypes.html#Coord_t">Coord_t</a> y = Theta() * kRADDEG ;
232 <a href="../ListOfTypes.html#Color_t">Color_t</a> markercolor = 1 ;
233 <a href="../ListOfTypes.html#Size_t">Size_t</a> markersize = 1. ;
234 <a href="../ListOfTypes.html#Style_t">Style_t</a> markerstyle = 5 ;
235
236 if (!gPad-&gt;IsBatch()) {
237 gVirtualX-&gt;SetMarkerColor(markercolor) ;
238 gVirtualX-&gt;SetMarkerSize (markersize) ;
239 gVirtualX-&gt;SetMarkerStyle(markerstyle) ;
240 }
241 gPad-&gt;SetAttMarkerPS(markercolor,markerstyle,markersize) ;
242 gPad-&gt;PaintPolyMarker(1,&amp;x,&amp;y,"") ;
243}
244
245<b>//____________________________________________________________________________</b>
246<a name="AliPHOSFastRecParticle:Print"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:Print">AliPHOSFastRecParticle::Print</a>()
247{
248<b> // Print the typr, energy and momentum</b>
249
250 cout &lt;&lt; "<a href=".././AliPHOSFastRecParticle.html">AliPHOSFastRecParticle</a> &gt; " &lt;&lt; "type is " &lt;&lt; <a href="#AliPHOSFastRecParticle:Name">Name</a>() &lt;&lt; endl
251 &lt;&lt; " " &lt;&lt; "Energy = " &lt;&lt; fE &lt;&lt; endl
252 &lt;&lt; " " &lt;&lt; "Px = " &lt;&lt; fPx &lt;&lt; endl
253 &lt;&lt; " " &lt;&lt; "Py = " &lt;&lt; fPy &lt;&lt; endl
254 &lt;&lt; " " &lt;&lt; "Pz = " &lt;&lt; fPz &lt;&lt; endl ;
255}
256</pre>
257
258<!--SIGNATURE-->
259<br>
260<address>
261<hr>
262<center>
263<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>
264</center>
265<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.
266</address>
267</body>
268</html>