1 ///////////////////////////////////////////////////////////////////////////////
3 // This class contains the points for the ALICE event display //
7 <img src="picts/AliPointsClass.gif">
12 ///////////////////////////////////////////////////////////////////////////////
14 #include "AliPoints.h"
16 #include "AliDetector.h"
22 //_____________________________________________________________________________
23 AliPoints::AliPoints()
26 // Default constructor
32 //_____________________________________________________________________________
33 AliPoints::AliPoints(Int_t nhits)
37 // Standard constructor
44 //_____________________________________________________________________________
45 AliPoints::~AliPoints()
48 // Default constructor
54 //_____________________________________________________________________________
55 Int_t AliPoints::DistancetoPrimitive(Int_t px, Int_t py)
58 //*-*-*-*-*-*-*Compute distance from point px,py to a 3-D polymarker*-*-*-*-*
59 //*-* =====================================================
61 //*-* Compute the closest distance of approach from point
62 //*-* px,py to each segment
63 //*-* of the polyline.
64 //*-* Returns when the distance found is below DistanceMaximum.
65 //*-* The distance is computed in pixels units.
67 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
69 //const Int_t inaxis = 7;
71 return TPolyMarker3D::DistancetoPrimitive(px,py);
74 //_____________________________________________________________________________
75 void AliPoints::DumpParticle()
78 // Dump particle corresponding to this point
80 TParticle *particle = GetParticle();
81 if (particle) particle->Dump();
84 //_____________________________________________________________________________
85 void AliPoints::ExecuteEvent(Int_t event, Int_t px, Int_t py)
88 //*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*-*-*-*-*
89 //*-* =========================================
91 //*-* This member function must be implemented to realize the action
92 //*-* corresponding to the mouse click on the object in the window
94 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
96 gPad->SetCursor(kCross);
99 gPad->GetView()->ExecuteRotateView(event, px, py);
103 //_____________________________________________________________________________
104 const Text_t *AliPoints::GetName() const
107 // Return name of the Geant3 particle corresponding to this point
109 TParticle *particle = GetParticle();
110 if (!particle) return "Particle";
111 return particle->GetName();
114 //_____________________________________________________________________________
115 Text_t *AliPoints::GetObjectInfo(Int_t, Int_t)
118 // Redefines TObject::GetObjectInfo.
119 // Displays the info (particle,etc
120 // corresponding to cursor position px,py
122 static char info[64];
123 sprintf(info,"%s %d",GetName(),fIndex);
127 //_____________________________________________________________________________
128 TParticle *AliPoints::GetParticle() const
131 // Returns pointer to particle index in AliRun::fParticles
133 TClonesArray *particles = gAlice->Particles();
134 Int_t nparticles = particles->GetEntriesFast();
135 if (fIndex < 0 || fIndex >= nparticles) return 0;
136 return (TParticle*)particles->UncheckedAt(fIndex);
139 //_____________________________________________________________________________
140 void AliPoints::InspectParticle()
143 // Inspect particle corresponding to this point
145 TParticle *particle = GetParticle();
146 if (particle) particle->Inspect();
149 //_____________________________________________________________________________
150 void AliPoints::Propagate()
153 // Set attributes of all detectors to be the attributes of this point
159 TIter next(gAlice->Detectors());
160 AliDetector *detector;
161 while((detector = (AliDetector*)next())) {
162 if (!detector->IsActive()) continue;
163 points = detector->Points();
164 if (!points) continue;
165 ntracks = points->GetEntriesFast();
166 for (track=0;track<ntracks;track++) {
167 pm = (AliPoints*)points->UncheckedAt(track);
169 if (fIndex == pm->GetIndex()) {
170 pm->SetMarkerColor(GetMarkerColor());
171 pm->SetMarkerSize(GetMarkerSize());
172 pm->SetMarkerStyle(GetMarkerStyle());