1 <!DOCTYPE HTML PUBLIC "-// IETF/DTD HTML 2.0// EN">
4 <!-- Author: ROOT team (rootdev@hpsalo.cern.ch) -->
6 <!-- Date: Sun Mar 12 00:45:55 2000 -->
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.">
16 <body BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#551a8b" ALINK="#ff0000" TEXT="#000000">
17 <a name="TopOfPage"></a>
19 /**************************************************************************
20 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
22 * Author: The ALICE Off-line Project. *
23 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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>
40 <b>//*-- Author: Yves Schutz (SUBATECH)</b>
42 <b>// --- ROOT system ---</b>
44 <b>// --- Standard library ---</b>
46 #include <iostream>
48 <b>// --- AliRoot header files ---</b>
50 #include "<a href="../AliPHOSFastRecParticle.h">AliPHOSFastRecParticle.h</a>"
52 #include "TPaveText.h"
54 ClassImp(AliPHOSFastRecParticle)
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> & rp)
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];
69 fCalcMass = rp.fCalcMass;
78 fPolarTheta = rp.fPolarTheta;
79 fPolarPhi = rp.fPolarPhi;
80 fParticlePDG = rp.fParticlePDG;
83 <b>//____________________________________________________________________________</b>
84 <a name="AliPHOSFastRecParticle:AliPHOSFastRecParticle"> </a> <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:AliPHOSFastRecParticle">AliPHOSFastRecParticle::AliPHOSFastRecParticle</a>(const TParticle & pp)
86 <b> // ctor from a TParticle (crummy?!)</b>
88 TParticle & pnoconst = const_cast<TParticle &>(pp) ;
89 <a href=".././AliPHOSFastRecParticle.html">AliPHOSFastRecParticle</a> & p = static_cast<<a href=".././AliPHOSFastRecParticle.html">AliPHOSFastRecParticle</a>&>(pnoconst) ;
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];
98 fCalcMass = p.fCalcMass;
107 fPolarTheta = p.fPolarTheta;
108 fPolarPhi = p.fPolarPhi;
109 fParticlePDG = p.fParticlePDG;
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)
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>
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->XtoAbsPixel(x);
124 <a href="../ListOfTypes.html#Int_t">Int_t</a> pym = gPad->YtoAbsPixel(y);
125 <a href="../ListOfTypes.html#Int_t">Int_t</a> dist = (px-pxm)*(px-pxm) + (py-pym)*(py-pym);
127 if (dist > kMaxDiff) return 9999;
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)
134 <b> // Draw this <a href=".././AliPHOSFastRecParticle.html">AliPHOSFastRecParticle</a> with its current attributes</b>
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)
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>
145 if (!gPad->IsEditable())
148 static TPaveText * clustertext = 0 ;
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 ->AddText(line1) ;
162 clustertext ->AddText(line2) ;
163 clustertext -><a href="#AliPHOSFastRecParticle:Draw">Draw</a>("");
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> & number)
182 <b> // Retrieves the unique primary particle at the origine of the present reconstruced particle</b>
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> ;
191 <b>//____________________________________________________________________________</b>
192 <a name="AliPHOSFastRecParticle:Name"> </a>TString <a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:Name">AliPHOSFastRecParticle::Name</a>()
194 <b> // Returns the name of the particle type</b>
197 switch (<a href=".././AliPHOSFastRecParticle.html#AliPHOSFastRecParticle:fType">fType</a>) {
208 name = "CHARGED HADRON" ;
211 name = "NEUTRAL HADRON" ;
214 name = "NEUTRAL EM" ;
217 name = "PHOTON HADRON" ;
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> *)
227 <b> // Paint this ALiRecParticle in theta,phi coordinate as a TMarker with its current attributes</b>
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 ;
236 if (!gPad->IsBatch()) {
237 gVirtualX->SetMarkerColor(markercolor) ;
238 gVirtualX->SetMarkerSize (markersize) ;
239 gVirtualX->SetMarkerStyle(markerstyle) ;
241 gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ;
242 gPad->PaintPolyMarker(1,&x,&y,"") ;
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>()
248 <b> // Print the typr, energy and momentum</b>
250 cout << "<a href=".././AliPHOSFastRecParticle.html">AliPHOSFastRecParticle</a> > " << "type is " << <a href="#AliPHOSFastRecParticle:Name">Name</a>() << endl
251 << " " << "Energy = " << fE << endl
252 << " " << "Px = " << fPx << endl
253 << " " << "Py = " << fPy << endl
254 << " " << "Pz = " << fPz << endl ;
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>
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.