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 // MUON classe for MonteCarlo Hits, inherited from AliHit for the
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.
26 #include "Riostream.h"
32 #include "AliMUONHit.h"
33 #include "AliMUONGeometryStore.h"
38 //___________________________________________
39 AliMUONHit::AliMUONHit()
42 // Default constructor
45 //___________________________________________
46 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
52 fIsDetElemId = kFALSE;
62 fPHfirst = (Int_t) hits[8];
63 fPHlast = (Int_t) hits[9];
74 //___________________________________________
75 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits,
76 Bool_t /*isDetElemId*/) :
91 fPHfirst = (Int_t) hits[8];
92 fPHlast = (Int_t) hits[9];
103 //___________________________________________
104 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t iChamber, Int_t idpart,
105 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
106 Float_t theta, Float_t phi, Float_t length, Float_t destep):
112 fIsDetElemId = kFALSE;
113 fDetElemId = iChamber;
125 fPx = momentum * TMath::Sin(theta) * TMath::Cos(phi);
126 fPy = momentum * TMath::Sin(theta) * TMath::Sin(phi);
127 fPz = momentum * TMath::Cos(theta) ;
134 //___________________________________________
135 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
136 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
137 Float_t theta, Float_t phi, Float_t length, Float_t destep,
138 Bool_t /*isDetElemId*/):
142 fIsDetElemId = kTRUE;
143 fDetElemId = detElemId;
155 fPx = momentum * TMath::Sin(theta) * TMath::Cos(phi);
156 fPy = momentum * TMath::Sin(theta) * TMath::Sin(phi);
157 fPz = momentum * TMath::Cos(theta) ;
164 //-----------------------------------------------------------------------------------------------
165 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t iChamber, Int_t idpart,
166 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
167 Float_t theta, Float_t phi, Float_t length, Float_t destep,
168 Float_t Xref,Float_t Yref,Float_t Zref):
174 fIsDetElemId = kFALSE;
175 fDetElemId = iChamber;
187 fPx = momentum * TMath::Sin(theta) * TMath::Cos(phi);
188 fPy = momentum * TMath::Sin(theta) * TMath::Sin(phi);
189 fPz = momentum * TMath::Cos(theta) ;
195 //-----------------------------------------------------------------------------------------------
196 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
197 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
198 Float_t theta, Float_t phi, Float_t length, Float_t destep,
199 Float_t Xref,Float_t Yref,Float_t Zref,
200 Bool_t /*isDetElemId*/):
204 fIsDetElemId = kTRUE;
205 fDetElemId = detElemId;
217 fPx = momentum * TMath::Sin(theta) * TMath::Cos(phi);
218 fPy = momentum * TMath::Sin(theta) * TMath::Sin(phi);
219 fPz = momentum * TMath::Cos(theta) ;
226 //-----------------------------------------------------------------------------------------------
227 Int_t AliMUONHit::DetElemId()const
229 // Return detection element ID
232 AliWarning("Detection element Id is not defined.");
240 //-----------------------------------------------------------------------------------------------
241 Int_t AliMUONHit::Chamber() const
248 return AliMUONGeometryStore::GetModuleId(fDetElemId)+1;
251 void AliMUONHit::Print(Option_t* opt) const
254 // Printing hit information
255 // "full" option for printing all the information about the hit
260 if ( sopt.Contains("FULL") ) {
261 cout <<"<AliMUONHit>: Geant track=" << setw(4) << Track() <<
262 ", DetEle=" << setw(4) << DetElemId() <<
263 ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<
264 " )cm, Delta E=" << setw(8) << setprecision(3) << Eloss() << " GeV" << endl;
267 cout << "<AliMUONHit>: DetEle=" << setw(4) << DetElemId() <<
268 ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<