]>
Commit | Line | Data |
---|---|---|
0279872e | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
0279872e | 16 | /////////////////////////////////////////////////////////////////////////////// |
17 | // // | |
18 | // This class contains the points for the ALICE event display // | |
19 | // // | |
20 | //Begin_Html | |
21 | /* | |
22 | <img src="gif/AliRICHPointsClass.gif"> | |
23 | */ | |
24 | //End_Html | |
25 | // // | |
26 | // // | |
27 | /////////////////////////////////////////////////////////////////////////////// | |
53fd478b | 28 | #include "AliRICHPoints.h" |
29 | #include "AliRICHDisplay.h" | |
30 | #include "AliRICHChamber.h" | |
31 | #include "AliRICH.h" | |
237c933d | 32 | #include <TPad.h> |
94de3818 | 33 | #include <TTree.h> |
237c933d | 34 | #include <TView.h> |
35 | #include <TMath.h> | |
488e98ba | 36 | #include <TPolyMarker3D.h> |
37 | #include <TMarker3DBox.h> | |
4ad0d8b4 | 38 | #include <TParticle.h> |
aed240d4 | 39 | #include <AliRun.h> |
aed240d4 | 40 | #include <AliMC.h> |
53fd478b | 41 | #include <TRotMatrix.h> |
237c933d | 42 | |
43 | const Int_t kMaxNipx=400, kMaxNipy=800; | |
0279872e | 44 | |
45 | ClassImp(AliRICHPoints) | |
46 | ||
47 | //_____________________________________________________________________________ | |
48 | AliRICHPoints::AliRICHPoints() | |
49 | { | |
50 | // | |
51 | // Default constructor | |
52 | // | |
53 | fHitIndex = 0; | |
54 | fTrackIndex = 0; | |
55 | fDigitIndex = 0; | |
56 | fMarker[0] = fMarker[1] = fMarker[2]=0; | |
57 | } | |
58 | ||
59 | //_____________________________________________________________________________ | |
60 | AliRICHPoints::AliRICHPoints(Int_t npoints) | |
61 | :AliPoints(npoints) | |
62 | { | |
63 | // | |
64 | // Standard constructor | |
65 | // | |
66 | fHitIndex = 0; | |
67 | fTrackIndex = 0; | |
68 | fDigitIndex = 0; | |
69 | fMarker[0] = fMarker[1] = fMarker[2]=0; | |
70 | } | |
71 | ||
72 | //_____________________________________________________________________________ | |
73 | AliRICHPoints::~AliRICHPoints() | |
74 | { | |
75 | // | |
76 | // Default destructor | |
77 | // | |
78 | fHitIndex = 0; | |
79 | fTrackIndex = 0; | |
80 | fDigitIndex = 0; | |
81 | } | |
82 | ||
83 | //_____________________________________________________________________________ | |
84 | void AliRICHPoints::DumpHit() | |
85 | { | |
86 | // | |
87 | // Dump hit corresponding to this point | |
88 | // | |
853634d3 | 89 | AliRICHhit *hit = GetHit(); |
0279872e | 90 | if (hit) hit->Dump(); |
91 | } | |
92 | ||
93 | //_____________________________________________________________________________ | |
94 | void AliRICHPoints::DumpDigit() | |
95 | { | |
96 | // | |
97 | // Dump digit corresponding to this point | |
98 | // | |
aed240d4 | 99 | AliRICHdigit *digit = GetDigit(); |
0279872e | 100 | if (digit) digit->Dump(); |
101 | } | |
102 | ||
103 | //_____________________________________________________________________________ | |
104 | void AliRICHPoints::InspectHit() | |
105 | { | |
106 | // | |
107 | // Inspect hit corresponding to this point | |
108 | // | |
853634d3 | 109 | AliRICHhit *hit = GetHit(); |
0279872e | 110 | if (hit) hit->Inspect(); |
111 | } | |
112 | ||
113 | //_____________________________________________________________________________ | |
114 | void AliRICHPoints::InspectDigit() | |
115 | { | |
116 | // | |
117 | // Inspect digit corresponding to this point | |
118 | // | |
aed240d4 | 119 | AliRICHdigit *digit = GetDigit(); |
0279872e | 120 | if (digit) digit->Inspect(); |
121 | } | |
122 | ||
123 | //_____________________________________________________________________________ | |
124 | Int_t AliRICHPoints::GetTrackIndex() | |
125 | { | |
126 | // | |
127 | // Dump digit corresponding to this point | |
128 | // | |
129 | printf("GetTrackIndex - fTrackIndex %d \n",fTrackIndex); | |
130 | this->Inspect(); | |
131 | return fTrackIndex; | |
132 | } | |
7ea4320b | 133 | //_____________________________________________________________________________ |
134 | TParticle *AliRICHPoints::GetParticle() const | |
135 | { | |
136 | // | |
137 | // Returns pointer to particle index in AliRun::fParticles | |
138 | // | |
5d12ce38 | 139 | if (fIndex < 0 || fIndex >= gAlice->GetMCApp()->GetNtrack()) return 0; |
140 | return gAlice->GetMCApp()->Particle(fIndex); | |
7ea4320b | 141 | } |
0279872e | 142 | |
143 | //_____________________________________________________________________________ | |
853634d3 | 144 | AliRICHhit *AliRICHPoints::GetHit() const |
0279872e | 145 | { |
146 | // | |
147 | // Returns pointer to hit index in AliRun::fParticles | |
148 | // | |
237c933d | 149 | AliRICH *pRICH = (AliRICH*)gAlice->GetDetector("RICH"); |
88cb7938 | 150 | pRICH->TreeH()->GetEvent(fTrackIndex); |
237c933d | 151 | TClonesArray *pRICHhits = pRICH->Hits(); |
152 | Int_t nhits = pRICHhits->GetEntriesFast(); | |
0279872e | 153 | if (fHitIndex < 0 || fHitIndex >= nhits) return 0; |
853634d3 | 154 | return (AliRICHhit*)pRICHhits->UncheckedAt(fHitIndex); |
0279872e | 155 | } |
156 | ||
157 | //_____________________________________________________________________________ | |
aed240d4 | 158 | AliRICHdigit *AliRICHPoints::GetDigit() const |
0279872e | 159 | { |
160 | // | |
161 | // Returns pointer to digit index in AliRun::fParticles | |
162 | // | |
163 | ||
164 | AliRICHDisplay *display=(AliRICHDisplay*)gAlice->Display(); | |
165 | Int_t chamber=display->GetChamber(); | |
166 | Int_t cathode=display->GetCathode(); | |
167 | ||
237c933d | 168 | AliRICH *pRICH = (AliRICH*)gAlice->GetDetector("RICH"); |
aed240d4 | 169 | TClonesArray *pRICHdigits = pRICH->Digits(chamber); |
0279872e | 170 | gAlice->TreeD()->GetEvent(cathode); |
237c933d | 171 | Int_t ndigits = pRICHdigits->GetEntriesFast(); |
0279872e | 172 | if (fDigitIndex < 0 || fDigitIndex >= ndigits) return 0; |
aed240d4 | 173 | return (AliRICHdigit*)pRICHdigits->UncheckedAt(fDigitIndex); |
0279872e | 174 | } |
7ea4320b | 175 | //---------------------------------------------------------------------------- |
84365c70 | 176 | void AliRICHPoints::ShowRing(Int_t highlight) |
177 | { | |
237c933d | 178 | |
179 | // | |
180 | // Highlights all pads generated by the same mother particle | |
181 | ||
84365c70 | 182 | highlight++; |
7ea4320b | 183 | |
7ea4320b | 184 | |
7ea4320b | 185 | } |
0279872e | 186 | |
187 | //_____________________________________________________________________________ | |
188 | const Text_t *AliRICHPoints::GetName() const | |
189 | { | |
190 | // | |
191 | // Return name of the Geant3 particle corresponding to this point | |
192 | // | |
193 | TParticle *particle = GetParticle(); | |
194 | if (!particle) return "Particle"; | |
195 | return particle->GetName(); | |
196 | } | |
197 | ||
198 | //_____________________________________________________________________________ | |
199 | Text_t *AliRICHPoints::GetObjectInfo(Int_t, Int_t) | |
200 | { | |
201 | // | |
202 | // Redefines TObject::GetObjectInfo. | |
203 | // Displays the info (particle,etc | |
204 | // corresponding to cursor position px,py | |
205 | // | |
206 | static char info[64]; | |
207 | sprintf(info,"%s %d",GetName(),fIndex); | |
208 | return info; | |
209 | } | |
210 | ||
211 | ||
212 |