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 //-----------------------------------------------------------------------------
19 // MUON class for MonteCarlo Hits, inherited from AliHit for the
20 // In addition to the ALiHit data member fX, fY, fZ and fTrack, AliMUONHit contains some info about the particle crossing the chamber:
21 // Impulsion: fPtot, fPx, fPy and fPz
22 // Reference position at the center of the chamber (wire plane) fXref, fYref and fZref
23 // Cumulated path along the active volume fTlength for spliting of hits for very inclined tracks
24 // Energy loss of the particle inside the gas active volume.
25 // Incident fTheta and fPhi angle with respect of the wire plane of the chamber.
26 //-----------------------------------------------------------------------------
28 #include "AliMUONHit.h"
29 #include "AliMpDEManager.h"
33 #include <Riostream.h>
41 //___________________________________________
42 AliMUONHit::AliMUONHit()
61 /// Default constructor
64 //___________________________________________
65 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
66 : AliHit(shunt, track),
74 fPHfirst((Int_t)hits[8]),
75 fPHlast((Int_t)hits[9]),
91 //___________________________________________
92 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
93 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
94 Float_t theta, Float_t phi, Float_t length, Float_t destep)
95 : AliHit(shunt, track),
96 fDetElemId(detElemId),
106 fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
107 fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
108 fPz(momentum * TMath::Cos(theta)),
119 //-----------------------------------------------------------------------------------------------
120 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
121 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
122 Float_t theta, Float_t phi, Float_t length, Float_t destep,
123 Float_t Xref,Float_t Yref,Float_t Zref)
124 : AliHit(shunt, track),
125 fDetElemId(detElemId),
135 fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
136 fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
137 fPz(momentum * TMath::Cos(theta)),
149 //-----------------------------------------------------------------------------------------------
150 AliMUONHit::~AliMUONHit()
155 //-----------------------------------------------------------------------------------------------
156 Int_t AliMUONHit::Chamber() const
158 /// Return chamber ID
160 return AliMpDEManager::GetChamberId(fDetElemId) + 1;
163 //-----------------------------------------------------------------------------
165 AliMUONHit::GetName() const
167 /// Generate hit name
169 return Form("%s-DE%04d",ClassName(),DetElemId());
172 //-----------------------------------------------------------------------------------------------
173 void AliMUONHit::Print(Option_t* opt) const
175 /// Printing hit information
176 /// "full" option for printing all the information about the hit
181 if ( sopt.Contains("FULL") ) {
182 cout <<"<AliMUONHit>: Geant track=" << setw(4) << Track() <<
183 ", DetEle=" << setw(4) << DetElemId() <<
184 ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<
185 " )cm, Delta E=" << setw(8) << setprecision(3) << Eloss() << " GeV" << endl;
188 cout << "<AliMUONHit>: DetEle=" << setw(4) << DetElemId() <<
189 ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<