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 // A Particle modified by EMCAL response and produced by AliEMCALvFast
21 // To become a general class of AliRoot ?
23 //*-- Author: Yves Schutz (SUBATECH)
25 /////////////////////////////////////////////////////////////////////////////
27 // --- ROOT system ---
29 // --- Standard library ---
31 // --- AliRoot header files ---
33 #include "AliEMCALFastRecParticle.h"
35 #include "TPaveText.h"
37 ClassImp(AliEMCALFastRecParticle) ;
39 //____________________________________________________________________________
40 AliEMCALFastRecParticle::AliEMCALFastRecParticle() : TParticle()
46 //____________________________________________________________________________
47 AliEMCALFastRecParticle::AliEMCALFastRecParticle(const AliEMCALFastRecParticle & rp)
53 fPdgCode = rp.fPdgCode;
54 fStatusCode = rp.fStatusCode;
55 fMother[0] = rp.fMother[0];
56 fMother[1] = rp.fMother[1];
57 fDaughter[0] = rp.fDaughter[0];
58 fDaughter[1] = rp.fDaughter[1];
60 fCalcMass = rp.fCalcMass;
69 fPolarTheta = rp.fPolarTheta;
70 fPolarPhi = rp.fPolarPhi;
71 fParticlePDG = rp.fParticlePDG;
74 //____________________________________________________________________________
75 AliEMCALFastRecParticle::AliEMCALFastRecParticle(const TParticle & pp)
77 // ctor from a TParticle (crummy?!)
79 TParticle & pnoconst = (TParticle &)(pp) ;
80 AliEMCALFastRecParticle & p = (AliEMCALFastRecParticle &)(pnoconst) ;
82 fPdgCode = p.fPdgCode;
83 fStatusCode = p.fStatusCode;
84 fMother[0] = p.fMother[0];
85 fMother[1] = p.fMother[1];
86 fDaughter[0] = p.fDaughter[0];
87 fDaughter[1] = p.fDaughter[1];
89 fCalcMass = p.fCalcMass;
98 fPolarTheta = p.fPolarTheta;
99 fPolarPhi = p.fPolarPhi;
100 fParticlePDG = p.fParticlePDG;
104 //____________________________________________________________________________
105 Int_t AliEMCALFastRecParticle::DistancetoPrimitive(Int_t px, Int_t py)
107 // Compute distance from point px,py to a AliEMCALFastRecParticle considered as a Tmarker
108 // Compute the closest distance of approach from point px,py to this marker.
109 // The distance is computed in pixels units.
111 Double_t kRADDEG = 180. / TMath::Pi() ;
112 Coord_t x = Phi() * kRADDEG ;
113 Coord_t y = Theta() * kRADDEG ;
114 const Int_t kMaxDiff = 10;
115 Int_t pxm = gPad->XtoAbsPixel(x);
116 Int_t pym = gPad->YtoAbsPixel(y);
117 Int_t dist = (px-pxm)*(px-pxm) + (py-pym)*(py-pym);
119 if (dist > kMaxDiff) return 9999;
123 //___________________________________________________________________________
124 void AliEMCALFastRecParticle::Draw(Option_t *option)
126 // Draw this AliEMCALFastRecParticle with its current attributes
131 //______________________________________________________________________________
132 void AliEMCALFastRecParticle::ExecuteEvent(Int_t event, Int_t /*px*/, Int_t /*py*/)
134 // Execute action corresponding to one event
135 // This member function is called when a AliEMCALFastRecParticle is clicked with the locator
137 if (!gPad->IsEditable())
140 static TPaveText * clustertext = 0 ;
145 Double_t kRADDEG = 180. / TMath::Pi() ;
146 Coord_t x = Phi() * kRADDEG ;
147 Coord_t y = Theta() * kRADDEG ;
148 clustertext = new TPaveText(x-1, y+1, x+5, y+3, "") ;
151 sprintf( line1, "PID: %s ", (const char*)Name() ) ;
152 sprintf( line2, "ENERGY: %f ", Energy() ) ;
153 clustertext ->AddText(line1) ;
154 clustertext ->AddText(line2) ;
155 clustertext ->Draw("");
170 //____________________________________________________________________________
171 TString AliEMCALFastRecParticle::Name()const
173 // Returns the name of the particle type (only valid if PIDv1 is employed)
178 name = "PHOTON_LOPU_HIEF" ; //PCA = 001 TOF = 111 CPV = 111
181 name = "PHOTON_HIPU_LOEF" ; //PCA = 011 TOF = 111 CPV = 111
184 name = "PHOTON_MED_PU_EF" ; //PCA = 111 TOF = 111 CPV = 111
186 if((fType == 383)||(fType == 447))
187 name = "PHOTON_STRANGE" ; //PCA = 101 or 110 TOF = 111 CPV = 111
190 name = "NEUTRAL_FAST_HADRON" ; //PCA = 000 TOF = 111 CPV = 111
192 if((fType == 504) || (fType == 505) ||(fType == 248)||(fType == 249)||(fType == 120)||(fType == 121))
193 name = "CHARGED_FAST_EM" ; //PCA = 111, 011 or 001 TOF =111 CPV = 000 or 001
195 if((fType == 56)||(fType == 57))
196 name = "CHARGED_FAST_HADRON" ; //PCA = 000 TOF = 111 CPV = 000 or 001
198 if((fType < 8)&&(fType > 0))
199 name = "NEUTRAL_SLOW_HADRON" ; //PCA = 000 TOF = 000 CPV = 001 or 011 or 111
202 name = "CHARGED_SLOW_HADRON" ; //PCA = 000 TOF = 000 CPV = 000
204 if((fType == 448) || (fType == 449) ||(fType == 192)||(fType == 193)||(fType == 64)||(fType == 64))
205 name = "CHARGED_SLOW_EM" ; //PCA = 111, 011 or 001 TOF =000 CPV = 000 or 001
211 //______________________________________________________________________________
212 void AliEMCALFastRecParticle::SetType(Int_t type) {
213 // sets the particle type
216 if((type == 127) || (fType == 511) || (fType == 255) ||(fType == 383)||(fType == 447)){
221 if ((fType == 63)|| ((fType < 8)&&(fType > 0)) ){
225 if ( ((fType == 504) || (fType == 505) ||(fType == 248)||(fType == 249)||(fType == 120)||(fType == 121)) ){
229 if ((fType == 448) || (fType == 449) ||(fType == 192)||(fType == 193)||(fType == 64)||(fType == 64)){
233 if((fType == 56)||(fType == 57)){
244 //______________________________________________________________________________
245 void AliEMCALFastRecParticle::Paint(Option_t *)
247 // Paint this ALiRecParticle in theta,phi coordinate as a TMarker with its current attributes
249 Double_t kRADDEG = 180. / TMath::Pi() ;
250 Coord_t x = Phi() * kRADDEG ;
251 Coord_t y = Theta() * kRADDEG ;
252 Color_t markercolor = 1 ;
253 Size_t markersize = 1. ;
254 Style_t markerstyle = 5 ;
256 if (!gPad->IsBatch()) {
257 gVirtualX->SetMarkerColor(markercolor) ;
258 gVirtualX->SetMarkerSize (markersize) ;
259 gVirtualX->SetMarkerStyle(markerstyle) ;
261 gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ;
262 gPad->PaintPolyMarker(1,&x,&y,"") ;
265 //____________________________________________________________________________
266 void AliEMCALFastRecParticle::Print(Option_t * /*opt*/)const
268 // Print the type, energy and momentum of the reconstructed particle
270 printf("Print Summary:") ;
271 printf("AliEMCALFastRecParticle > type is %s\n", Name().Data()) ;
272 printf(" Energy = %f\n", fE) ;
273 printf(" Px = %f\n", fPx) ;
274 printf(" Py = %f\n", fPy) ;
275 printf(" Pz = %f\n", fPz) ;