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.3.4.4 2000/06/11 20:31:37 barbera
19 Coding conventions update.
21 Revision 1.3.4.2 2000/03/04 23:43:57 nilsen
22 Fixed up the comments/documentation.
24 Revision 1.3.4.1 2000/01/12 19:03:32 nilsen
25 This is the version of the files after the merging done in December 1999.
26 See the ReadMe110100.txt file for details
28 Revision 1.3 1999/09/29 09:24:20 fca
29 Introduction of the Copyright and cvs Log
37 #include <TGeometry.h>
42 #include "AliITSgeom.h"
44 #include "AliITShit.h"
48 ////////////////////////////////////////////////////////////////////////
50 // Written by Rene Brun, Federico Carminati, and Roberto Barbera
53 // Modified and documented by Bjorn S. Nilsen
56 // AliITShit is the hit class for the ITS. Hits are the information
57 // that comes from a Monte Carlo at each step as a particle mass through
58 // sensitive detector elements as particles are transported through a
63 <img src="picts/ITS/AliITShit_Class_Diagram.gif">
66 <font size=+2 color=red>
67 <p>This show the relasionships between the ITS hit class and the rest of Aliroot.
72 ////////////////////////////////////////////////////////////////////////
73 // Inline Member functions:
76 // The default creator of the AliITShit class.
79 // The default destructor of the AliITShit class.
82 // See AliHit for a full description. Returns the track number fTrack
85 // SetTrack(int track)
86 // See AliHit for a full description. Sets the track number fTrack
89 // Int_t GetTrackStatus()
90 // Returns the value of the track status flag fStatus. This flag
91 // indicates the track status at the time of creating this hit. It is
92 // made up of the following 8 status bits from highest order to lowest
94 // 0 : IsTrackAlive(): IsTrackStop():IsTrackDisappeared():
95 // IsTrackOut():IsTrackExiting():IsTrackEntering():IsTrackInside() .
96 // See AliMC for a description of these functions. If the function is
97 // true then the bit is set to one, otherwise it is zero.
99 // Bool_t StatusInside()
100 // Returns kTRUE if the particle producing this hit is still inside
101 // the present volume. Returns kFalse if this particle will be in another
102 // volume. {bit IsTrackInside is set or not}
104 // Bool_t StatusEntering()
105 // Returns kTRUE if the particle producing this hit is has just enterd
106 // the present volume. Returns kFalse otherwise. {bit IsTrackEntering is
109 // Bool_t StatusExiting()
110 // Returns kTRUE if the particle producing this hit is will exit
111 // the present volume. Returns kFalse otherwise. {bit IsTrackExiting is set
114 // Bool_t StatusOut()
115 // Returns kTRUE if the particle producing this hit is goint exit the
116 // simulation. Returns kFalse otherwise. {bit IsTrackOut is set or not}
118 // Bool_t StatusDisappeared()
119 // Returns kTRUE if the particle producing this hit is going to "disappear"
120 // for example it has interacted producing some other particles. Returns
121 // kFalse otherwise. {bit IsTrackOut is set or not}
123 // Bool_t StatusStop()
124 // Returns kTRUE if the particle producing this hit is has dropped below
125 // its energy cut off producing some other particles. Returns kFalse otherwise.
126 // {bit IsTrackOut is set or not}
128 // Bool_t StatuAlives()
129 // Returns kTRUE if the particle producing this hit is going to continue
130 // to be transported. Returns kFalse otherwise. {bit IsTrackOut is set or not}
133 // Returns the layer number, fLayer, for this hit.
136 // Returns the ladder number, fLadder, for this hit.
138 // Int_t GetDetector()
139 // Returns the detector number, fDet, for this hit.
141 // GetDetectorID(Int_t &layer, Int_t &ladder, Int_t &detector)
142 // Returns the layer, ladder, and detector numbers, fLayer fLadder fDet,
145 // Float_t GetIonization()
146 // Returns the energy lost, fDestep, by the particle creating this hit,
147 // in the units defined by the Monte Carlo.
149 // GetPositionG(Float_t &x, Float_t &y, Float_t &z)
150 // Returns the global position, fX fY fZ, of this hit, in the units
151 // define by the Monte Carlo.
153 // GetPositionG(Double_t &x, Double_t &y, Double_t &z)
154 // Returns the global position, fX fY fZ, of this hit, in the units
155 // define by the Monte Carlo.
157 // GetPositionG(Float_t &x, Float_t &y, Float_t &z, Float_t &tof)
158 // Returns the global position and time of flight, fX fY fZ fTof, of
159 // this hit, in the units define by the Monte Carlo.
161 // GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &tof)
162 // Returns the global position and time of flight, fX fY fZ fTof, of
163 // this hit, in the units define by the Monte Carlo.
165 // GetPositionL(Double_t &x,Double_t &y,Double_t &z)
166 // Returns the local position, fX fY fZ, of this hit in the coordiante
167 // of this module, in the units define by the Monte Carlo.
169 // GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &tof)
170 // Returns the local position and time of flight, fX fY fZ fTof, of
171 // this hit in the coordinates of this module, in the units define by the
175 // Returns the global x position in the units defined by the Monte Carlo.
178 // Returns the global y position in the units defined by the Monte Carlo.
181 // Returns the global z position in the units defined by the Monte Carlo.
184 // Returns the time of flight, fTof, of this hit, in the units defined
185 // by the Monte Carlo.
187 // GetMomentumG(Float_t &px, Float_t &py, Float_t &pz)
188 // Returns the global momentum, fPx fPy fPz, of the particle that made
189 // this hit, in the units define by the Monte Carlo.
191 // GetMomentumG(Double_t &px,Double_t &py,Double_t &pz)
192 // Returns the global momentum, fPx fPy fPz, of the particle that made
193 // this hit, in the units define by the Monte Carlo.
195 // GetMomentumL(Double_t &px,Double_t &py,Double_t &pz)
196 // Returns the momentum, fPx fPy fPz in coordinate appropreate for this
197 // specific module, in the units define by the Monte Carlo.
200 // Returns the global X momentum in the units defined by the Monte Carlo.
203 // Returns the global Y momentum in the units defined by the Monte Carlo.
206 // Returns the global Z momentum in the units defined by the Monte Carlo.
208 ////////////////////////////////////////////////////////////////////////
209 //_____________________________________________________________________________
210 AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
211 AliHit(shunt, track){
212 ////////////////////////////////////////////////////////////////////////
214 // The creator of the AliITShit class. The variables shunt and
215 // track are passed to the creator of the AliHit class. See the AliHit
216 // class for a full description. the integer array *vol contains, in order,
217 // fLayer = vol[0], fDet = vol[1], fLadder = vol[2], fStatus = vol[3].
218 // The array *hits contains, in order, fX = hits[0], fY = hits[1],
219 // fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5],
220 // fDestep = hits[6], and fTof = hits[7]. In the units of the Monte Carlo
221 ////////////////////////////////////////////////////////////////////////
222 fLayer = vol[0]; // Layer number
223 fLadder = vol[2]; // Ladder number
224 fDet = vol[1]; // Detector number
225 fStatus = vol[3]; // Track status flags
226 fX = hits[0]; // Track X position
227 fY = hits[1]; // Track Y position
228 fZ = hits[2]; // Track Z position
229 fPx = hits[3]; // Track X Momentum
230 fPy = hits[4]; // Track Y Momentum
231 fPz = hits[5]; // Track Z Momentum
232 fDestep = hits[6]; // Track dE/dx for this step
233 fTof = hits[7]; // Track Time of Flight for this step
235 //______________________________________________________________________
236 void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z){
237 ////////////////////////////////////////////////////////////////////////
238 // Returns the position of this hit in the local coordinates of this
239 // module, and in the units of the Monte Carlo.
240 ////////////////////////////////////////////////////////////////////////
241 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
247 gm->GtoL(fLayer,fLadder,fDet,g,l);
253 //______________________________________________________________________
254 void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof){
255 ////////////////////////////////////////////////////////////////////////
256 // Returns the position and time of flight of this hit in the local
257 // coordinates of this module, and in the units of the Monte Carlo.
258 ////////////////////////////////////////////////////////////////////////
259 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
265 gm->GtoL(fLayer,fLadder,fDet,g,l);
272 //______________________________________________________________________
273 Float_t AliITShit::GetXL(){
274 ////////////////////////////////////////////////////////////////////////
275 // Returns the x position of this hit in the local coordinates of this
276 // module, and in the units of the Monte Carlo.
277 ////////////////////////////////////////////////////////////////////////
278 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
284 gm->GtoL(fLayer,fLadder,fDet,g,l);
287 //______________________________________________________________________
288 Float_t AliITShit::GetYL(){
289 ////////////////////////////////////////////////////////////////////////
290 // Returns the y position of this hit in the local coordinates of this
291 // module, and in the units of the Monte Carlo.
292 ////////////////////////////////////////////////////////////////////////
293 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
299 gm->GtoL(fLayer,fLadder,fDet,g,l);
302 //______________________________________________________________________
303 Float_t AliITShit::GetZL(){
304 ////////////////////////////////////////////////////////////////////////
305 // Returns the z position of this hit in the local coordinates of this
306 // module, and in the units of the Monte Carlo.
307 ////////////////////////////////////////////////////////////////////////
308 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
314 gm->GtoL(fLayer,fLadder,fDet,g,l);
317 //______________________________________________________________________
318 void AliITShit::GetMomentumL(Float_t &px,Float_t &py,Float_t &pz){
319 ////////////////////////////////////////////////////////////////////////
320 // Returns the momentum of this hit in the local coordinates of this
321 // module, and in the units of the Monte Carlo.
322 ////////////////////////////////////////////////////////////////////////
323 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
329 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
335 //______________________________________________________________________
336 Float_t AliITShit::GetPXL(){
337 ////////////////////////////////////////////////////////////////////////
338 // Returns the X momentum of this hit in the local coordinates of this
339 // module, and in the units of the Monte Carlo.
340 ////////////////////////////////////////////////////////////////////////
341 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
347 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
350 //______________________________________________________________________
351 Float_t AliITShit::GetPYL(){
352 ////////////////////////////////////////////////////////////////////////
353 // Returns the Y momentum of this hit in the local coordinates of this
354 // module, and in the units of the Monte Carlo.
355 ////////////////////////////////////////////////////////////////////////
356 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
362 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
365 //______________________________________________________________________
366 Float_t AliITShit::GetPZL(){
367 ////////////////////////////////////////////////////////////////////////
368 // Returns the Z momentum of this hit in the local coordinates of this
369 // module, and in the units of the Monte Carlo.
370 ////////////////////////////////////////////////////////////////////////
371 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
377 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
380 //___________________________________________________________________________;
381 Int_t AliITShit::GetModule(){
382 ////////////////////////////////////////////////////////////////////////
383 // Returns the module index number of the module where this hit was in.
384 ////////////////////////////////////////////////////////////////////////
385 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
387 return gm->GetModuleIndex(fLayer,fLadder,fDet);
389 //______________________________________________________________________
390 TParticle * AliITShit::GetParticle(){
391 ////////////////////////////////////////////////////////////////////////
392 // Returns the pointer to the TParticle for the particle that created
393 // this hit. From the TParticle all kinds of information about this
394 // particle can be found. See the TParticle class.
395 ////////////////////////////////////////////////////////////////////////
396 TClonesArray *parts = gAlice->Particles();
397 return ((TParticle*)parts->UncheckedAt(this->GetTrack()));
399 //___________________________________________________________________________
400 void AliITShit::Streamer(TBuffer &R__b){
401 ////////////////////////////////////////////////////////////////////////
402 // The streamer function for this AliITShit class. This has been set
403 // up so that future changes to this class can be easly incorporated.
404 ////////////////////////////////////////////////////////////////////////
405 if (R__b.IsReading()) {
406 Version_t R__v = R__b.ReadVersion();
408 AliHit::Streamer(R__b);
418 }else{ // for futrue changes to this class.
421 R__b.WriteVersion(AliITShit::IsA());
422 AliHit::Streamer(R__b);
432 } // end if R__b.IsReading()