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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // This class contains the points for the ALICE event display //
22 <img src="gif/AliRICHPointsClass.gif">
27 ///////////////////////////////////////////////////////////////////////////////
28 #include "AliRICHPoints.h"
29 #include "AliRICHDisplay.h"
30 #include "AliRICHChamber.h"
36 #include <TPolyMarker3D.h>
37 #include <TMarker3DBox.h>
38 #include <TParticle.h>
41 #include <TRotMatrix.h>
43 const Int_t kMaxNipx=400, kMaxNipy=800;
45 ClassImp(AliRICHPoints)
47 //_____________________________________________________________________________
48 AliRICHPoints::AliRICHPoints()
51 // Default constructor
56 fMarker[0] = fMarker[1] = fMarker[2]=0;
59 //_____________________________________________________________________________
60 AliRICHPoints::AliRICHPoints(Int_t npoints)
64 // Standard constructor
69 fMarker[0] = fMarker[1] = fMarker[2]=0;
72 //_____________________________________________________________________________
73 AliRICHPoints::~AliRICHPoints()
83 //_____________________________________________________________________________
84 void AliRICHPoints::DumpHit()
87 // Dump hit corresponding to this point
89 AliRICHhit *hit = GetHit();
93 //_____________________________________________________________________________
94 void AliRICHPoints::DumpDigit()
97 // Dump digit corresponding to this point
99 AliRICHdigit *digit = GetDigit();
100 if (digit) digit->Dump();
103 //_____________________________________________________________________________
104 void AliRICHPoints::InspectHit()
107 // Inspect hit corresponding to this point
109 AliRICHhit *hit = GetHit();
110 if (hit) hit->Inspect();
113 //_____________________________________________________________________________
114 void AliRICHPoints::InspectDigit()
117 // Inspect digit corresponding to this point
119 AliRICHdigit *digit = GetDigit();
120 if (digit) digit->Inspect();
123 //_____________________________________________________________________________
124 Int_t AliRICHPoints::GetTrackIndex()
127 // Dump digit corresponding to this point
129 printf("GetTrackIndex - fTrackIndex %d \n",fTrackIndex);
133 //_____________________________________________________________________________
134 TParticle *AliRICHPoints::GetParticle() const
137 // Returns pointer to particle index in AliRun::fParticles
139 if (fIndex < 0 || fIndex >= gAlice->GetMCApp()->GetNtrack()) return 0;
140 return gAlice->GetMCApp()->Particle(fIndex);
143 //_____________________________________________________________________________
144 AliRICHhit *AliRICHPoints::GetHit() const
147 // Returns pointer to hit index in AliRun::fParticles
149 AliRICH *pRICH = (AliRICH*)gAlice->GetDetector("RICH");
150 pRICH->TreeH()->GetEvent(fTrackIndex);
151 TClonesArray *pRICHhits = pRICH->Hits();
152 Int_t nhits = pRICHhits->GetEntriesFast();
153 if (fHitIndex < 0 || fHitIndex >= nhits) return 0;
154 return (AliRICHhit*)pRICHhits->UncheckedAt(fHitIndex);
157 //_____________________________________________________________________________
158 AliRICHdigit *AliRICHPoints::GetDigit() const
161 // Returns pointer to digit index in AliRun::fParticles
164 AliRICHDisplay *display=(AliRICHDisplay*)gAlice->Display();
165 Int_t chamber=display->GetChamber();
166 Int_t cathode=display->GetCathode();
168 AliRICH *pRICH = (AliRICH*)gAlice->GetDetector("RICH");
169 TClonesArray *pRICHdigits = pRICH->Digits(chamber);
170 gAlice->TreeD()->GetEvent(cathode);
171 Int_t ndigits = pRICHdigits->GetEntriesFast();
172 if (fDigitIndex < 0 || fDigitIndex >= ndigits) return 0;
173 return (AliRICHdigit*)pRICHdigits->UncheckedAt(fDigitIndex);
175 //----------------------------------------------------------------------------
176 void AliRICHPoints::ShowRing(Int_t highlight)
180 // Highlights all pads generated by the same mother particle
187 //_____________________________________________________________________________
188 const Text_t *AliRICHPoints::GetName() const
191 // Return name of the Geant3 particle corresponding to this point
193 TParticle *particle = GetParticle();
194 if (!particle) return "Particle";
195 return particle->GetName();
198 //_____________________________________________________________________________
199 Text_t *AliRICHPoints::GetObjectInfo(Int_t, Int_t)
202 // Redefines TObject::GetObjectInfo.
203 // Displays the info (particle,etc
204 // corresponding to cursor position px,py
206 static char info[64];
207 sprintf(info,"%s %d",GetName(),fIndex);