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.2 2000/03/04 23:43:57 nilsen
19 Fixed up the comments/documentation.
21 Revision 1.3.4.1 2000/01/12 19:03:32 nilsen
22 This is the version of the files after the merging done in December 1999.
23 See the ReadMe110100.txt file for details
25 Revision 1.3 1999/09/29 09:24:20 fca
26 Introduction of the Copyright and cvs Log
34 #include <TGeometry.h>
39 #include "AliITSgeom.h"
41 #include "AliITShit.h"
45 ////////////////////////////////////////////////////////////////////////
47 // Written by Rene Brun, Federico Carminati, and Roberto Barbera
50 // Modified and documented by Bjorn S. Nilsen
53 // AliITShit is the hit class for the ITS. Hits are the information
54 // that comes from a Monte Carlo at each step as a particle mass through
55 // sensitive detector elements as particles are transported through a
60 <img src="picts/ITS/AliITShit_Class_Diagram.gif">
63 <font size=+2 color=red>
64 <p>This show the relasionships between the ITS hit class and the rest of Aliroot.
69 ////////////////////////////////////////////////////////////////////////
70 // Inline Member functions:
73 // The default creator of the AliITShit class.
76 // The default destructor of the AliITShit class.
79 // See AliHit for a full description. Returns the track number fTrack
82 // SetTrack(int track)
83 // See AliHit for a full description. Sets the track number fTrack
86 // Int_t GetTrackStatus()
87 // Returns the value of the track status flag fStatus. This flag
88 // indicates the track status at the time of creating this hit. It is
89 // made up of the following 8 status bits from highest order to lowest
91 // 0 : IsTrackAlive(): IsTrackStop():IsTrackDisappeared():
92 // IsTrackOut():IsTrackExiting():IsTrackEntering():IsTrackInside() .
93 // See AliMC for a description of these functions. If the function is
94 // true then the bit is set to one, otherwise it is zero.
96 // Bool_t StatusInside()
97 // Returns kTRUE if the particle producing this hit is still inside
98 // the present volume. Returns kFalse if this particle will be in another
99 // volume. {bit IsTrackInside is set or not}
101 // Bool_t StatusEntering()
102 // Returns kTRUE if the particle producing this hit is has just enterd
103 // the present volume. Returns kFalse otherwise. {bit IsTrackEntering is
106 // Bool_t StatusExiting()
107 // Returns kTRUE if the particle producing this hit is will exit
108 // the present volume. Returns kFalse otherwise. {bit IsTrackExiting is set
111 // Bool_t StatusOut()
112 // Returns kTRUE if the particle producing this hit is goint exit the
113 // simulation. Returns kFalse otherwise. {bit IsTrackOut is set or not}
115 // Bool_t StatusDisappeared()
116 // Returns kTRUE if the particle producing this hit is going to "disappear"
117 // for example it has interacted producing some other particles. Returns
118 // kFalse otherwise. {bit IsTrackOut is set or not}
120 // Bool_t StatusStop()
121 // Returns kTRUE if the particle producing this hit is has dropped below
122 // its energy cut off producing some other particles. Returns kFalse otherwise.
123 // {bit IsTrackOut is set or not}
125 // Bool_t StatuAlives()
126 // Returns kTRUE if the particle producing this hit is going to continue
127 // to be transported. Returns kFalse otherwise. {bit IsTrackOut is set or not}
130 // Returns the layer number, fLayer, for this hit.
133 // Returns the ladder number, fLadder, for this hit.
135 // Int_t GetDetector()
136 // Returns the detector number, fDet, for this hit.
138 // GetDetectorID(Int_t &layer, Int_t &ladder, Int_t &detector)
139 // Returns the layer, ladder, and detector numbers, fLayer fLadder fDet,
142 // Float_t GetIonization()
143 // Returns the energy lost, fDestep, by the particle creating this hit,
144 // in the units defined by the Monte Carlo.
146 // GetPositionG(Float_t &x, Float_t &y, Float_t &z)
147 // Returns the global position, fX fY fZ, of this hit, in the units
148 // define by the Monte Carlo.
150 // GetPositionG(Double_t &x, Double_t &y, Double_t &z)
151 // Returns the global position, fX fY fZ, of this hit, in the units
152 // define by the Monte Carlo.
154 // GetPositionG(Float_t &x, Float_t &y, Float_t &z, Float_t &tof)
155 // Returns the global position and time of flight, fX fY fZ fTof, of
156 // this hit, in the units define by the Monte Carlo.
158 // GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &tof)
159 // Returns the global position and time of flight, fX fY fZ fTof, of
160 // this hit, in the units define by the Monte Carlo.
162 // GetPositionL(Double_t &x,Double_t &y,Double_t &z)
163 // Returns the local position, fX fY fZ, of this hit in the coordiante
164 // of this module, in the units define by the Monte Carlo.
166 // GetPositionG(Double_t &x,Double_t &y,Double_t &z,Double_t &tof)
167 // Returns the local position and time of flight, fX fY fZ fTof, of
168 // this hit in the coordinates of this module, in the units define by the
172 // Returns the global x position in the units defined by the Monte Carlo.
175 // Returns the global y position in the units defined by the Monte Carlo.
178 // Returns the global z position in the units defined by the Monte Carlo.
181 // Returns the time of flight, fTof, of this hit, in the units defined
182 // by the Monte Carlo.
184 // GetMomentumG(Float_t &px, Float_t &py, Float_t &pz)
185 // Returns the global momentum, fPx fPy fPz, of the particle that made
186 // this hit, in the units define by the Monte Carlo.
188 // GetMomentumG(Double_t &px,Double_t &py,Double_t &pz)
189 // Returns the global momentum, fPx fPy fPz, of the particle that made
190 // this hit, in the units define by the Monte Carlo.
192 // GetMomentumL(Double_t &px,Double_t &py,Double_t &pz)
193 // Returns the momentum, fPx fPy fPz in coordinate appropreate for this
194 // specific module, in the units define by the Monte Carlo.
197 // Returns the global X momentum in the units defined by the Monte Carlo.
200 // Returns the global Y momentum in the units defined by the Monte Carlo.
203 // Returns the global Z momentum in the units defined by the Monte Carlo.
205 ////////////////////////////////////////////////////////////////////////
206 //_____________________________________________________________________________
207 AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
208 AliHit(shunt, track){
209 ////////////////////////////////////////////////////////////////////////
211 // The creator of the AliITShit class. The variables shunt and
212 // track are passed to the creator of the AliHit class. See the AliHit
213 // class for a full description. the integer array *vol contains, in order,
214 // fLayer = vol[0], fDet = vol[1], fLadder = vol[2], fStatus = vol[3].
215 // The array *hits contains, in order, fX = hits[0], fY = hits[1],
216 // fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5],
217 // fDestep = hits[6], and fTof = hits[7]. In the units of the Monte Carlo
218 ////////////////////////////////////////////////////////////////////////
219 fLayer = vol[0]; // Layer number
220 fLadder = vol[2]; // Ladder number
221 fDet = vol[1]; // Detector number
222 fStatus = vol[3]; // Track status flags
223 fX = hits[0]; // Track X position
224 fY = hits[1]; // Track Y position
225 fZ = hits[2]; // Track Z position
226 fPx = hits[3]; // Track X Momentum
227 fPy = hits[4]; // Track Y Momentum
228 fPz = hits[5]; // Track Z Momentum
229 fDestep = hits[6]; // Track dE/dx for this step
230 fTof = hits[7]; // Track Time of Flight for this step
232 //______________________________________________________________________
233 void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z){
234 ////////////////////////////////////////////////////////////////////////
235 // Returns the position of this hit in the local coordinates of this
236 // module, and in the units of the Monte Carlo.
237 ////////////////////////////////////////////////////////////////////////
238 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
244 gm->GtoL(fLayer,fLadder,fDet,g,l);
250 //______________________________________________________________________
251 void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof){
252 ////////////////////////////////////////////////////////////////////////
253 // Returns the position and time of flight of this hit in the local
254 // coordinates of this module, and in the units of the Monte Carlo.
255 ////////////////////////////////////////////////////////////////////////
256 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
262 gm->GtoL(fLayer,fLadder,fDet,g,l);
269 //______________________________________________________________________
270 Float_t AliITShit::GetXL(){
271 ////////////////////////////////////////////////////////////////////////
272 // Returns the x position of this hit in the local coordinates of this
273 // module, and in the units of the Monte Carlo.
274 ////////////////////////////////////////////////////////////////////////
275 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
281 gm->GtoL(fLayer,fLadder,fDet,g,l);
284 //______________________________________________________________________
285 Float_t AliITShit::GetYL(){
286 ////////////////////////////////////////////////////////////////////////
287 // Returns the y position of this hit in the local coordinates of this
288 // module, and in the units of the Monte Carlo.
289 ////////////////////////////////////////////////////////////////////////
290 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
296 gm->GtoL(fLayer,fLadder,fDet,g,l);
299 //______________________________________________________________________
300 Float_t AliITShit::GetZL(){
301 ////////////////////////////////////////////////////////////////////////
302 // Returns the z position of this hit in the local coordinates of this
303 // module, and in the units of the Monte Carlo.
304 ////////////////////////////////////////////////////////////////////////
305 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
311 gm->GtoL(fLayer,fLadder,fDet,g,l);
314 //______________________________________________________________________
315 void AliITShit::GetMomentumL(Float_t &px,Float_t &py,Float_t &pz){
316 ////////////////////////////////////////////////////////////////////////
317 // Returns the momentum of this hit in the local coordinates of this
318 // module, and in the units of the Monte Carlo.
319 ////////////////////////////////////////////////////////////////////////
320 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
326 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
332 //______________________________________________________________________
333 Float_t AliITShit::GetPXL(){
334 ////////////////////////////////////////////////////////////////////////
335 // Returns the X momentum of this hit in the local coordinates of this
336 // module, and in the units of the Monte Carlo.
337 ////////////////////////////////////////////////////////////////////////
338 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
344 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
347 //______________________________________________________________________
348 Float_t AliITShit::GetPYL(){
349 ////////////////////////////////////////////////////////////////////////
350 // Returns the Y momentum of this hit in the local coordinates of this
351 // module, and in the units of the Monte Carlo.
352 ////////////////////////////////////////////////////////////////////////
353 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
359 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
362 //______________________________________________________________________
363 Float_t AliITShit::GetPZL(){
364 ////////////////////////////////////////////////////////////////////////
365 // Returns the Z momentum of this hit in the local coordinates of this
366 // module, and in the units of the Monte Carlo.
367 ////////////////////////////////////////////////////////////////////////
368 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
374 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
377 //___________________________________________________________________________;
378 Int_t AliITShit::GetModule(){
379 ////////////////////////////////////////////////////////////////////////
380 // Returns the module index number of the module where this hit was in.
381 ////////////////////////////////////////////////////////////////////////
382 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
384 return gm->GetModuleIndex(fLayer,fLadder,fDet);
386 //______________________________________________________________________
387 TParticle * AliITShit::GetParticle(){
388 ////////////////////////////////////////////////////////////////////////
389 // Returns the pointer to the TParticle for the particle that created
390 // this hit. From the TParticle all kinds of information about this
391 // particle can be found. See the TParticle class.
392 ////////////////////////////////////////////////////////////////////////
393 TClonesArray *parts = gAlice->Particles();
394 return ((TParticle*)parts->UncheckedAt(this->GetTrack()));
396 //___________________________________________________________________________
397 void AliITShit::Streamer(TBuffer &R__b){
398 ////////////////////////////////////////////////////////////////////////
399 // The streamer function for this AliITShit class. This has been set
400 // up so that future changes to this class can be easly incorporated.
401 ////////////////////////////////////////////////////////////////////////
402 if (R__b.IsReading()) {
403 Version_t R__v = R__b.ReadVersion();
405 AliHit::Streamer(R__b);
415 }else{ // for futrue changes to this class.
418 R__b.WriteVersion(AliITShit::IsA());
419 AliHit::Streamer(R__b);
429 } // end if R__b.IsReading()