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 Revision 1.10 2001/01/26 20:01:19 hristov
19 Major upgrade of AliRoot code
21 Revision 1.9 2000/10/02 16:32:51 barbera
22 Automatic streamer used and forward declarations added
24 Revision 1.3.4.7 2000/10/02 15:54:49 barbera
25 Automatic streamer used and forward declarations added
27 Revision 1.8 2000/09/22 12:35:21 nilsen
28 Traps placed incase it is used without a properly initilized AliITSgeom class.
30 Revision 1.7 2000/07/10 16:07:18 fca
31 Release version of ITS code
33 Revision 1.3.4.2 2000/03/04 23:43:57 nilsen
34 Fixed up the comments/documentation.
36 Revision 1.3.4.1 2000/01/12 19:03:32 nilsen
37 This is the version of the files after the merging done in December 1999.
38 See the ReadMe110100.txt file for details
40 Revision 1.3 1999/09/29 09:24:20 fca
41 Introduction of the Copyright and cvs Log
49 #include <TGeometry.h>
52 #include "TParticle.h"
56 #include "AliITSgeom.h"
57 #include "AliITShit.h"
61 ////////////////////////////////////////////////////////////////////////
63 // Written by Rene Brun, Federico Carminati, and Roberto Barbera
66 // Modified and documented by Bjorn S. Nilsen
69 // AliITShit is the hit class for the ITS. Hits are the information
70 // that comes from a Monte Carlo at each step as a particle mass through
71 // sensitive detector elements as particles are transported through a
76 <img src="picts/ITS/AliITShit_Class_Diagram.gif">
79 <font size=+2 color=red>
80 <p>This show the relasionships between the ITS hit class and the rest of Aliroot.
85 ////////////////////////////////////////////////////////////////////////
86 // Inline Member functions:
89 // The default creator of the AliITShit class.
92 // The default destructor of the AliITShit class.
95 // See AliHit for a full description. Returns the track number fTrack
98 // SetTrack(int track)
99 // See AliHit for a full description. Sets the track number fTrack
102 // Int_t GetTrackStatus()
103 // Returns the value of the track status flag fStatus. This flag
104 // indicates the track status at the time of creating this hit. It is
105 // made up of the following 8 status bits from highest order to lowest
107 // 0 : IsTrackAlive(): IsTrackStop():IsTrackDisappeared():
108 // IsTrackOut():IsTrackExiting():IsTrackEntering():IsTrackInside() .
109 // See AliMC for a description of these functions. If the function is
110 // true then the bit is set to one, otherwise it is zero.
112 // Bool_t StatusInside()
113 // Returns kTRUE if the particle producing this hit is still inside
114 // the present volume. Returns kFalse if this particle will be in another
115 // volume. {bit IsTrackInside is set or not}
117 // Bool_t StatusEntering()
118 // Returns kTRUE if the particle producing this hit is has just enterd
119 // the present volume. Returns kFalse otherwise. {bit IsTrackEntering is
122 // Bool_t StatusExiting()
123 // Returns kTRUE if the particle producing this hit is will exit
124 // the present volume. Returns kFalse otherwise. {bit IsTrackExiting is set
127 // Bool_t StatusOut()
128 // Returns kTRUE if the particle producing this hit is goint exit the
129 // simulation. Returns kFalse otherwise. {bit IsTrackOut is set or not}
131 // Bool_t StatusDisappeared()
132 // Returns kTRUE if the particle producing this hit is going to "disappear"
133 // for example it has interacted producing some other particles. Returns
134 // kFalse otherwise. {bit IsTrackOut is set or not}
136 // Bool_t StatusStop()
137 // Returns kTRUE if the particle producing this hit is has dropped below
138 // its energy cut off producing some other particles. Returns kFalse otherwise.
139 // {bit IsTrackOut is set or not}
141 // Bool_t StatuAlives()
142 // Returns kTRUE if the particle producing this hit is going to continue
143 // to be transported. Returns kFalse otherwise. {bit IsTrackOut is set or not}
146 // Returns the layer number, fLayer, for this hit.
149 // Returns the ladder number, fLadder, for this hit.
151 // Int_t GetDetector()
152 // Returns the detector number, fDet, for this hit.
154 // GetDetectorID(Int_t &layer, Int_t &ladder, Int_t &detector)
155 // Returns the layer, ladder, and detector numbers, fLayer fLadder fDet,
158 // Float_t GetIonization()
159 // Returns the energy lost, fDestep, by the particle creating this hit,
160 // in the units defined by the Monte Carlo.
162 // GetPositionG(Float_t &x, Float_t &y, Float_t &z)
163 // Returns the global position, fX fY fZ, of this hit, in the units
164 // define by the Monte Carlo.
166 // GetPositionG(Double_t &x, Double_t &y, Double_t &z)
167 // Returns the global position, fX fY fZ, of this hit, in the units
168 // define by the Monte Carlo.
170 // GetPositionG(Float_t &x, Float_t &y, Float_t &z, Float_t &tof)
171 // Returns the global position and time of flight, fX fY fZ fTof, of
172 // this hit, in the units define by the Monte Carlo.
174 // GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &tof)
175 // Returns the global position and time of flight, fX fY fZ fTof, of
176 // this hit, in the units define by the Monte Carlo.
178 // GetPositionL(Double_t &x,Double_t &y,Double_t &z)
179 // Returns the local position, fX fY fZ, of this hit in the coordiante
180 // of this module, in the units define by the Monte Carlo.
182 // GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &tof)
183 // Returns the local position and time of flight, fX fY fZ fTof, of
184 // this hit in the coordinates of this module, in the units define by the
188 // Returns the global x position in the units defined by the Monte Carlo.
191 // Returns the global y position in the units defined by the Monte Carlo.
194 // Returns the global z position in the units defined by the Monte Carlo.
197 // Returns the time of flight, fTof, of this hit, in the units defined
198 // by the Monte Carlo.
200 // GetMomentumG(Float_t &px, Float_t &py, Float_t &pz)
201 // Returns the global momentum, fPx fPy fPz, of the particle that made
202 // this hit, in the units define by the Monte Carlo.
204 // GetMomentumG(Double_t &px,Double_t &py,Double_t &pz)
205 // Returns the global momentum, fPx fPy fPz, of the particle that made
206 // this hit, in the units define by the Monte Carlo.
208 // GetMomentumL(Double_t &px,Double_t &py,Double_t &pz)
209 // Returns the momentum, fPx fPy fPz in coordinate appropreate for this
210 // specific module, in the units define by the Monte Carlo.
213 // Returns the global X momentum in the units defined by the Monte Carlo.
216 // Returns the global Y momentum in the units defined by the Monte Carlo.
219 // Returns the global Z momentum in the units defined by the Monte Carlo.
221 ////////////////////////////////////////////////////////////////////////
222 //_____________________________________________________________________________
223 AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
224 AliHit(shunt, track){
225 ////////////////////////////////////////////////////////////////////////
227 // The creator of the AliITShit class. The variables shunt and
228 // track are passed to the creator of the AliHit class. See the AliHit
229 // class for a full description. the integer array *vol contains, in order,
230 // fLayer = vol[0], fDet = vol[1], fLadder = vol[2], fStatus = vol[3].
231 // The array *hits contains, in order, fX = hits[0], fY = hits[1],
232 // fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5],
233 // fDestep = hits[6], and fTof = hits[7]. In the units of the Monte Carlo
234 ////////////////////////////////////////////////////////////////////////
235 fLayer = vol[0]; // Layer number
236 fLadder = vol[2]; // Ladder number
237 fDet = vol[1]; // Detector number
238 fStatus = vol[3]; // Track status flags
239 fX = hits[0]; // Track X position
240 fY = hits[1]; // Track Y position
241 fZ = hits[2]; // Track Z position
242 fPx = hits[3]; // Track X Momentum
243 fPy = hits[4]; // Track Y Momentum
244 fPz = hits[5]; // Track Z Momentum
245 fDestep = hits[6]; // Track dE/dx for this step
246 fTof = hits[7]; // Track Time of Flight for this step
248 //______________________________________________________________________
249 void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z){
250 ////////////////////////////////////////////////////////////////////////
251 // Returns the position of this hit in the local coordinates of this
252 // module, and in the units of the Monte Carlo.
253 ////////////////////////////////////////////////////////////////////////
254 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
261 gm->GtoL(fLayer,fLadder,fDet,g,l);
266 Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
267 // AliITSv7 - SDD case
274 //______________________________________________________________________
275 void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof){
276 ////////////////////////////////////////////////////////////////////////
277 // Returns the position and time of flight of this hit in the local
278 // coordinates of this module, and in the units of the Monte Carlo.
279 ////////////////////////////////////////////////////////////////////////
280 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
287 gm->GtoL(fLayer,fLadder,fDet,g,l);
292 Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
293 // AliITSv7 - SDD case
301 //______________________________________________________________________
302 Float_t AliITShit::GetXL(){
303 ////////////////////////////////////////////////////////////////////////
304 // Returns the x position of this hit in the local coordinates of this
305 // module, and in the units of the Monte Carlo.
306 ////////////////////////////////////////////////////////////////////////
307 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
314 gm->GtoL(fLayer,fLadder,fDet,g,l);
317 Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
321 //______________________________________________________________________
322 Float_t AliITShit::GetYL(){
323 ////////////////////////////////////////////////////////////////////////
324 // Returns the y position of this hit in the local coordinates of this
325 // module, and in the units of the Monte Carlo.
326 ////////////////////////////////////////////////////////////////////////
327 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
334 gm->GtoL(fLayer,fLadder,fDet,g,l);
337 Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
341 //______________________________________________________________________
342 Float_t AliITShit::GetZL(){
343 ////////////////////////////////////////////////////////////////////////
344 // Returns the z position of this hit in the local coordinates of this
345 // module, and in the units of the Monte Carlo.
346 ////////////////////////////////////////////////////////////////////////
347 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
354 gm->GtoL(fLayer,fLadder,fDet,g,l);
357 Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
361 //______________________________________________________________________
362 void AliITShit::GetMomentumL(Float_t &px,Float_t &py,Float_t &pz){
363 ////////////////////////////////////////////////////////////////////////
364 // Returns the momentum of this hit in the local coordinates of this
365 // module, and in the units of the Monte Carlo.
366 ////////////////////////////////////////////////////////////////////////
367 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
374 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
379 Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
386 //______________________________________________________________________
387 Float_t AliITShit::GetPXL(){
388 ////////////////////////////////////////////////////////////////////////
389 // Returns the X momentum of this hit in the local coordinates of this
390 // module, and in the units of the Monte Carlo.
391 ////////////////////////////////////////////////////////////////////////
392 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
399 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
402 Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
406 //______________________________________________________________________
407 Float_t AliITShit::GetPYL(){
408 ////////////////////////////////////////////////////////////////////////
409 // Returns the Y momentum of this hit in the local coordinates of this
410 // module, and in the units of the Monte Carlo.
411 ////////////////////////////////////////////////////////////////////////
412 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
419 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
422 Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
427 //______________________________________________________________________
428 Float_t AliITShit::GetPZL(){
429 ////////////////////////////////////////////////////////////////////////
430 // Returns the Z momentum of this hit in the local coordinates of this
431 // module, and in the units of the Monte Carlo.
432 ////////////////////////////////////////////////////////////////////////
433 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
440 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
443 Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
448 //___________________________________________________________________________;
449 Int_t AliITShit::GetModule(){
450 ////////////////////////////////////////////////////////////////////////
451 // Returns the module index number of the module where this hit was in.
452 ////////////////////////////////////////////////////////////////////////
453 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
455 if (gm) return gm->GetModuleIndex(fLayer,fLadder,fDet);
457 Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
461 //______________________________________________________________________
462 TParticle * AliITShit::GetParticle(){
463 ////////////////////////////////////////////////////////////////////////
464 // Returns the pointer to the TParticle for the particle that created
465 // this hit. From the TParticle all kinds of information about this
466 // particle can be found. See the TParticle class.
467 ////////////////////////////////////////////////////////////////////////
468 return gAlice->Particle(GetTrack());