Introduction of the Copyright and cvs Log
[u/mrichter/AliRoot.git] / ITS / AliITShit.cxx
CommitLineData
4c039060 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
16/*
17$Log$
18*/
19
58005f18 20
21#include <TMath.h>
22#include <TRandom.h>
23#include <TVector.h>
24#include <TGeometry.h>
25#include <TNode.h>
26#include <TTUBE.h>
27
28#include "AliITSgeom.h"
29#include "AliITS.h"
30#include "AliITShit.h"
31#include "AliRun.h"
32
33
34ClassImp(AliITShit)
35////////////////////////////////////////////////////////////////////////
36// Version: 0
37// Written by Rene Brun, Federico Carminati, and Roberto Barbera
38//
39// Version: 1
40// Modified and documented by Bjorn S. Nilsen
41// July 11 1999
42//
43// AliITShit is the hit class for the ITS. Hits are the information
44// that comes from a Monte Carlo at each step as a particle mass through
45// sensitive detector elements as particles are transported through a
46// detector.
47//
48//Begin_Html
49/*
a92b2b7d 50<img src="picts/ITS/AliITShit_Class_Diagram.gif">
58005f18 51</pre>
52<br clear=left>
53<font size=+2 color=red>
54<p>This show the relasionships between the ITS hit class and the rest of Aliroot.
55</font>
56<pre>
57*/
58//End_Html
59//_____________________________________________________________________________
60AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
61 AliHit(shunt, track){
62 //
63 // Create ITS hit
64 // The creator of the AliITShit class. The variables shunt and
65 // track are passed to the creator of the AliHit class. See the AliHit
66 // class for a full description. the integer array *vol contains, in order,
67 // fLayer = vol[0], fDet = vol[1], fLadder = vol[2], fStatus = vol[3].
68 // The array *hits contains, in order, fX = hits[0], fY = hits[1],
69 // fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5],
70 // fDestep = hits[6], and fTof = hits[7].
71 //
72 fLayer = vol[0]; // Layer number
73 fLadder = vol[2]; // Ladder number
74 fDet = vol[1]; // Detector number
75 fStatus = vol[3]; // Track status flags
76 fX = hits[0]; // Track X position
77 fY = hits[1]; // Track Y position
78 fZ = hits[2]; // Track Z position
79 fPx = hits[3]; // Track X Momentum
80 fPy = hits[4]; // Track Y Momentum
81 fPz = hits[5]; // Track Z Momentum
82 fDestep = hits[6]; // Track dE/dx for this step
83 fTof = hits[7]; // Track Time of Flight for this step
84}
85
86void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z){
87 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
88 Float_t g[3],l[3];
89
90 g[0] = fX;
91 g[1] = fY;
92 g[2] = fZ;
93 gm->GtoL(fLayer,fLadder,fDet,g,l);
94 x = l[0];
95 y = l[1];
96 z = l[2];
97 return;
98}
99
100void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof){
101 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
102 Float_t g[3],l[3];
103
104 g[0] = fX;
105 g[1] = fY;
106 g[2] = fZ;
107 gm->GtoL(fLayer,fLadder,fDet,g,l);
108 x = l[0];
109 y = l[1];
110 z = l[2];
111 tof = fTof;
112 return;
113}
114
115Float_t AliITShit::GetXL(){
116 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
117 Float_t g[3],l[3];
118
119 g[0] = fX;
120 g[1] = fY;
121 g[2] = fZ;
122 gm->GtoL(fLayer,fLadder,fDet,g,l);
123 return l[0];
124}
125
126Float_t AliITShit::GetYL(){
127 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
128 Float_t g[3],l[3];
129
130 g[0] = fX;
131 g[1] = fY;
132 g[2] = fZ;
133 gm->GtoL(fLayer,fLadder,fDet,g,l);
134 return l[1];
135}
136
137Float_t AliITShit::GetZL(){
138 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
139 Float_t g[3],l[3];
140
141 g[0] = fX;
142 g[1] = fY;
143 g[2] = fZ;
144 gm->GtoL(fLayer,fLadder,fDet,g,l);
145 return l[2];
146}
147
148void AliITShit::GetMomentumL(Float_t &px,Float_t &py,Float_t &pz){
149 AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
150 Float_t g[3],l[3];
151
152 g[0] = fPx;
153 g[1] = fPy;
154 g[2] = fPz;
155 gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
156 px = l[0];
157 py = l[1];
158 pz = l[2];
159 return;
160}