]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONHit.cxx
Raw2SDigits method implemented
[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//
26
be7a6875 27#include "AliMUONHit.h"
28#include "AliMpDEManager.h"
30178c30 29
6464217e 30#include "AliLog.h"
6464217e 31
be7a6875 32#include <Riostream.h>
33#include <TMath.h>
34#include <TString.h>
a9e2aefa 35
5398f946 36/// \cond CLASSIMP
a9e2aefa 37ClassImp(AliMUONHit)
5398f946 38/// \endcond
a9e2aefa 39
30178c30 40//___________________________________________
41AliMUONHit::AliMUONHit()
5398f946 42 : AliHit(),
5398f946 43 fDetElemId(0),
44 fParticle(0),
45 fTheta(0),
46 fPhi(0),
47 fTlength(0),
48 fEloss(0),
49 fAge(0),
50 fPHfirst(0),
51 fPHlast(0),
52 fPTot(0),
53 fPx(0),
54 fPy(0),
55 fPz(0),
56 fXref(0),
57 fYref(0),
58 fZref(0)
30178c30 59{
5398f946 60/// Default constructor
30178c30 61}
62
a9e2aefa 63//___________________________________________
5398f946 64AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
65 : AliHit(shunt, track),
5398f946 66 fDetElemId(vol[0]),
67 fParticle(hits[0]),
68 fTheta(hits[4]),
69 fPhi(hits[5]),
70 fTlength(hits[6]),
71 fEloss(hits[7]),
72 fAge(hits[14]),
73 fPHfirst((Int_t)hits[8]),
74 fPHlast((Int_t)hits[9]),
75 fPTot(hits[10]),
76 fPx(hits[11]),
77 fPy(hits[12]),
78 fPz(hits[13]),
79 fXref(0),
80 fYref(0),
81 fZref(0)
d59b2ec3 82{
5398f946 83/// Constructor
d59b2ec3 84
d59b2ec3 85 fX = hits[1];
86 fY = hits[2];
87 fZ = hits[3];
d59b2ec3 88}
89
d59b2ec3 90//___________________________________________
91AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
92 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
be7a6875 93 Float_t theta, Float_t phi, Float_t length, Float_t destep)
5398f946 94 : AliHit(shunt, track),
5398f946 95 fDetElemId(detElemId),
96 fParticle(idpart),
97 fTheta(theta),
98 fPhi(phi),
99 fTlength(length),
100 fEloss(destep),
101 fAge(tof),
102 fPHfirst(0),
103 fPHlast(0),
104 fPTot(momentum),
105 fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
106 fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
107 fPz(momentum * TMath::Cos(theta)),
108 fXref(0),
109 fYref(0),
110 fZref(0)
d59b2ec3 111{
5398f946 112/// Constructor
d59b2ec3 113 fX = X;
114 fY = Y;
115 fZ = Z;
d59b2ec3 116}
117
1391e633 118//-----------------------------------------------------------------------------------------------
d59b2ec3 119AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
120 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
121 Float_t theta, Float_t phi, Float_t length, Float_t destep,
be7a6875 122 Float_t Xref,Float_t Yref,Float_t Zref)
5398f946 123 : AliHit(shunt, track),
5398f946 124 fDetElemId(detElemId),
125 fParticle(idpart),
126 fTheta(theta),
127 fPhi(phi),
128 fTlength(length),
129 fEloss(destep),
130 fAge(tof),
131 fPHfirst(0),
132 fPHlast(0),
133 fPTot(momentum),
134 fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
135 fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
136 fPz(momentum * TMath::Cos(theta)),
137 fXref(Xref),
138 fYref(Yref),
139 fZref(Zref)
d59b2ec3 140{
5398f946 141/// Constructor
142
d59b2ec3 143 fX = X;
144 fY = Y;
145 fZ = Z;
5398f946 146}
147
148//-----------------------------------------------------------------------------------------------
149AliMUONHit::~AliMUONHit()
150{
151/// Dectructor
d59b2ec3 152}
153
d59b2ec3 154//-----------------------------------------------------------------------------------------------
155Int_t AliMUONHit::Chamber() const
156{
5398f946 157/// Return chamber ID
d59b2ec3 158
be7a6875 159 return AliMpDEManager::GetChamberId(fDetElemId) + 1;
d59b2ec3 160}
a9e2aefa 161
be7a6875 162//-----------------------------------------------------------------------------------------------
6464217e 163void AliMUONHit::Print(Option_t* opt) const
164{
be7a6875 165/// Printing hit information
166/// "full" option for printing all the information about the hit
167
6464217e 168 TString sopt(opt);
169 sopt.ToUpper();
170
171 if ( sopt.Contains("FULL") ) {
172 cout <<"<AliMUONHit>: Geant track=" << setw(4) << Track() <<
173 ", DetEle=" << setw(4) << DetElemId() <<
174 ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<
175 " )cm, Delta E=" << setw(8) << setprecision(3) << Eloss() << " GeV" << endl;
176 }
177 else {
178 cout << "<AliMUONHit>: DetEle=" << setw(4) << DetElemId() <<
179 ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<
180 " ) cm" <<endl;
181 }
182
183}