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>
40 using std::setprecision;
45 //___________________________________________
46 AliMUONHit::AliMUONHit()
65 /// Default constructor
68 //___________________________________________
69 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
70 : AliHit(shunt, track),
78 fPHfirst((Int_t)hits[8]),
79 fPHlast((Int_t)hits[9]),
95 //___________________________________________
96 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
97 Float_t x, Float_t y, Float_t z, Float_t tof, Float_t momentum,
98 Float_t theta, Float_t phi, Float_t length, Float_t destep)
99 : AliHit(shunt, track),
100 fDetElemId(detElemId),
110 fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
111 fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
112 fPz(momentum * TMath::Cos(theta)),
123 //-----------------------------------------------------------------------------------------------
124 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
125 Float_t x, Float_t y, Float_t z, Float_t tof, Float_t momentum,
126 Float_t theta, Float_t phi, Float_t length, Float_t destep,
127 Float_t xref,Float_t yref,Float_t zref)
128 : AliHit(shunt, track),
129 fDetElemId(detElemId),
139 fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
140 fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
141 fPz(momentum * TMath::Cos(theta)),
153 //-----------------------------------------------------------------------------------------------
154 AliMUONHit::~AliMUONHit()
159 //-----------------------------------------------------------------------------------------------
160 Int_t AliMUONHit::Chamber() const
162 /// Return chamber ID
164 return AliMpDEManager::GetChamberId(fDetElemId) + 1;
167 //-----------------------------------------------------------------------------
169 AliMUONHit::GetName() const
171 /// Generate hit name
173 return Form("%s-DE%04d",ClassName(),DetElemId());
176 //-----------------------------------------------------------------------------------------------
177 void AliMUONHit::Print(Option_t* opt) const
179 /// Printing hit information
180 /// "full" option for printing all the information about the hit
185 if ( sopt.Contains("FULL") ) {
186 cout <<"<AliMUONHit>: Geant track=" << setw(4) << Track() <<
187 ", DetEle=" << setw(4) << DetElemId() <<
188 ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<
189 " )cm, Delta E=" << setw(8) << setprecision(3) << Eloss() << " GeV" << endl;
192 cout << "<AliMUONHit>: DetEle=" << setw(4) << DetElemId() <<
193 ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<