]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONHit.cxx
New versions of GDC and CDH raw data headers. Some CDH getters are added
[u/mrichter/AliRoot.git] / MUON / AliMUONHit.cxx
CommitLineData
a9e2aefa 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
88cb7938 16/* $Id$ */
0e83b872 17
5398f946 18// MUON class for MonteCarlo Hits, inherited from AliHit for the
34c512f6 19// In addition to the ALiHit data member fX, fY, fZ and fTrack, AliMUONHit contains some info about the particle crossing the chamber:
20// Impulsion: fPtot, fPx, fPy and fPz
21// Reference position at the center of the chamber (wire plane) fXref, fYref and fZref
22// Cumulated path along the active volume fTlength for spliting of hits for very inclined tracks
23// Energy loss of the particle inside the gas active volume.
24// Incident fTheta and fPhi angle with respect of the wire plane of the chamber.
25//
6464217e 26#include "Riostream.h"
34c512f6 27
30178c30 28#include <TMath.h>
6464217e 29#include <TString.h>
30178c30 30
6464217e 31#include "AliLog.h"
a9e2aefa 32#include "AliMUONHit.h"
e5df8ea1 33#include "AliMUONGeometryStore.h"
6464217e 34
a9e2aefa 35
5398f946 36/// \cond CLASSIMP
a9e2aefa 37ClassImp(AliMUONHit)
5398f946 38/// \endcond
a9e2aefa 39
30178c30 40//___________________________________________
41AliMUONHit::AliMUONHit()
5398f946 42 : AliHit(),
43 fIsDetElemId(kTRUE),
44 fDetElemId(0),
45 fParticle(0),
46 fTheta(0),
47 fPhi(0),
48 fTlength(0),
49 fEloss(0),
50 fAge(0),
51 fPHfirst(0),
52 fPHlast(0),
53 fPTot(0),
54 fPx(0),
55 fPy(0),
56 fPz(0),
57 fXref(0),
58 fYref(0),
59 fZref(0)
30178c30 60{
5398f946 61/// Default constructor
30178c30 62}
63
a9e2aefa 64//___________________________________________
5398f946 65AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
66 : AliHit(shunt, track),
67 fIsDetElemId(kFALSE),
68 fDetElemId(vol[0]),
69 fParticle(hits[0]),
70 fTheta(hits[4]),
71 fPhi(hits[5]),
72 fTlength(hits[6]),
73 fEloss(hits[7]),
74 fAge(hits[14]),
75 fPHfirst((Int_t)hits[8]),
76 fPHlast((Int_t)hits[9]),
77 fPTot(hits[10]),
78 fPx(hits[11]),
79 fPy(hits[12]),
80 fPz(hits[13]),
81 fXref(0),
82 fYref(0),
83 fZref(0)
a9e2aefa 84{
5398f946 85/// Constructor
86/// \deprecated TBR
87
2eb55fab 88 fX = hits[1];
89 fY = hits[2];
90 fZ = hits[3];
a9e2aefa 91}
d59b2ec3 92
93//___________________________________________
94AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits,
5398f946 95 Bool_t /*isDetElemId*/)
96 : AliHit(shunt, track),
97 fIsDetElemId(kTRUE),
98 fDetElemId(vol[0]),
99 fParticle(hits[0]),
100 fTheta(hits[4]),
101 fPhi(hits[5]),
102 fTlength(hits[6]),
103 fEloss(hits[7]),
104 fAge(hits[14]),
105 fPHfirst((Int_t)hits[8]),
106 fPHlast((Int_t)hits[9]),
107 fPTot(hits[10]),
108 fPx(hits[11]),
109 fPy(hits[12]),
110 fPz(hits[13]),
111 fXref(0),
112 fYref(0),
113 fZref(0)
d59b2ec3 114{
5398f946 115/// Constructor
d59b2ec3 116
d59b2ec3 117 fX = hits[1];
118 fY = hits[2];
119 fZ = hits[3];
d59b2ec3 120}
121
0e83b872 122//___________________________________________
1391e633 123AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t iChamber, Int_t idpart,
124 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
5398f946 125 Float_t theta, Float_t phi, Float_t length, Float_t destep)
126 : AliHit(shunt, track),
127 fIsDetElemId(kFALSE),
128 fDetElemId(iChamber),
129 fParticle(idpart),
130 fTheta(theta),
131 fPhi(phi),
132 fTlength(length),
133 fEloss(destep),
134 fAge(tof),
135 fPHfirst(0),
136 fPHlast(0),
137 fPTot(momentum),
138 fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
139 fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
140 fPz(momentum * TMath::Cos(theta)),
141 fXref(0),
142 fYref(0),
143 fZref(0)
0e83b872 144{
5398f946 145/// Constructor
146/// \deprecated TBR
d59b2ec3 147
0e83b872 148 fX = X;
149 fY = Y;
150 fZ = Z;
0e83b872 151}
d59b2ec3 152
153//___________________________________________
154AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
155 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
156 Float_t theta, Float_t phi, Float_t length, Float_t destep,
5398f946 157 Bool_t /*isDetElemId*/)
158 : AliHit(shunt, track),
159 fIsDetElemId(kTRUE),
160 fDetElemId(detElemId),
161 fParticle(idpart),
162 fTheta(theta),
163 fPhi(phi),
164 fTlength(length),
165 fEloss(destep),
166 fAge(tof),
167 fPHfirst(0),
168 fPHlast(0),
169 fPTot(momentum),
170 fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
171 fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
172 fPz(momentum * TMath::Cos(theta)),
173 fXref(0),
174 fYref(0),
175 fZref(0)
d59b2ec3 176{
5398f946 177/// Constructor
d59b2ec3 178 fX = X;
179 fY = Y;
180 fZ = Z;
d59b2ec3 181}
182
1391e633 183//-----------------------------------------------------------------------------------------------
184AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t iChamber, Int_t idpart,
185 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
186 Float_t theta, Float_t phi, Float_t length, Float_t destep,
5398f946 187 Float_t Xref,Float_t Yref,Float_t Zref)
188 : AliHit(shunt, track),
189 fIsDetElemId(kFALSE),
190 fDetElemId(iChamber),
191 fParticle(idpart),
192 fTheta(theta),
193 fPhi(phi),
194 fTlength(length),
195 fEloss(destep),
196 fAge(tof),
197 fPHfirst(0),
198 fPHlast(0),
199 fPTot(momentum),
200 fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
201 fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
202 fPz(momentum * TMath::Cos(theta)),
203 fXref(Xref),
204 fYref(Yref),
205 fZref(Zref)
1391e633 206{
5398f946 207/// Constructor
208/// \deprecated TBR
d59b2ec3 209
1391e633 210 fX = X;
211 fY = Y;
212 fZ = Z;
1391e633 213}
214//-----------------------------------------------------------------------------------------------
d59b2ec3 215AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
216 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
217 Float_t theta, Float_t phi, Float_t length, Float_t destep,
218 Float_t Xref,Float_t Yref,Float_t Zref,
5398f946 219 Bool_t /*isDetElemId*/)
220 : AliHit(shunt, track),
221 fIsDetElemId(kTRUE),
222 fDetElemId(detElemId),
223 fParticle(idpart),
224 fTheta(theta),
225 fPhi(phi),
226 fTlength(length),
227 fEloss(destep),
228 fAge(tof),
229 fPHfirst(0),
230 fPHlast(0),
231 fPTot(momentum),
232 fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
233 fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
234 fPz(momentum * TMath::Cos(theta)),
235 fXref(Xref),
236 fYref(Yref),
237 fZref(Zref)
d59b2ec3 238{
5398f946 239/// Constructor
240
d59b2ec3 241 fX = X;
242 fY = Y;
243 fZ = Z;
5398f946 244}
245
246//-----------------------------------------------------------------------------------------------
247AliMUONHit::~AliMUONHit()
248{
249/// Dectructor
d59b2ec3 250}
251
252//-----------------------------------------------------------------------------------------------
253Int_t AliMUONHit::DetElemId()const
254{
5398f946 255/// Return detection element ID
d59b2ec3 256
257 if (!fIsDetElemId) {
258 AliWarning("Detection element Id is not defined.");
259 return 0;
260 }
d59b2ec3 261
262 return fDetElemId;
263}
264
265//-----------------------------------------------------------------------------------------------
266Int_t AliMUONHit::Chamber() const
267{
5398f946 268/// Return chamber ID
d59b2ec3 269
8690a0a6 270 if (!fIsDetElemId)
d59b2ec3 271 return fDetElemId;
272 else
e5df8ea1 273 return AliMUONGeometryStore::GetModuleId(fDetElemId)+1;
d59b2ec3 274}
a9e2aefa 275
6464217e 276void AliMUONHit::Print(Option_t* opt) const
277{
278 //
279 // Printing hit information
280 // "full" option for printing all the information about the hit
281 //
282 TString sopt(opt);
283 sopt.ToUpper();
284
285 if ( sopt.Contains("FULL") ) {
286 cout <<"<AliMUONHit>: Geant track=" << setw(4) << Track() <<
287 ", DetEle=" << setw(4) << DetElemId() <<
288 ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<
289 " )cm, Delta E=" << setw(8) << setprecision(3) << Eloss() << " GeV" << endl;
290 }
291 else {
292 cout << "<AliMUONHit>: DetEle=" << setw(4) << DetElemId() <<
293 ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<
294 " ) cm" <<endl;
295 }
296
297}