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.
29 #include "AliMUONHit.h"
30 #include "AliMUONVGeometryDEIndexing.h"
35 //___________________________________________
36 AliMUONHit::AliMUONHit()
39 // Default constructor
42 //___________________________________________
43 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
49 fIsDetElemId = kFALSE;
59 fPHfirst = (Int_t) hits[8];
60 fPHlast = (Int_t) hits[9];
71 //___________________________________________
72 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits,
73 Bool_t /*isDetElemId*/) :
88 fPHfirst = (Int_t) hits[8];
89 fPHlast = (Int_t) hits[9];
100 //___________________________________________
101 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t iChamber, Int_t idpart,
102 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
103 Float_t theta, Float_t phi, Float_t length, Float_t destep):
109 fIsDetElemId = kFALSE;
110 fDetElemId = iChamber;
122 fPx = momentum * TMath::Sin(theta) * TMath::Cos(phi);
123 fPy = momentum * TMath::Sin(theta) * TMath::Sin(phi);
124 fPz = momentum * TMath::Cos(theta) ;
131 //___________________________________________
132 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
133 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
134 Float_t theta, Float_t phi, Float_t length, Float_t destep,
135 Bool_t /*isDetElemId*/):
139 fIsDetElemId = kTRUE;
140 fDetElemId = detElemId;
152 fPx = momentum * TMath::Sin(theta) * TMath::Cos(phi);
153 fPy = momentum * TMath::Sin(theta) * TMath::Sin(phi);
154 fPz = momentum * TMath::Cos(theta) ;
161 //-----------------------------------------------------------------------------------------------
162 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t iChamber, Int_t idpart,
163 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
164 Float_t theta, Float_t phi, Float_t length, Float_t destep,
165 Float_t Xref,Float_t Yref,Float_t Zref):
171 fIsDetElemId = kFALSE;
172 fDetElemId = iChamber;
184 fPx = momentum * TMath::Sin(theta) * TMath::Cos(phi);
185 fPy = momentum * TMath::Sin(theta) * TMath::Sin(phi);
186 fPz = momentum * TMath::Cos(theta) ;
192 //-----------------------------------------------------------------------------------------------
193 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
194 Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum,
195 Float_t theta, Float_t phi, Float_t length, Float_t destep,
196 Float_t Xref,Float_t Yref,Float_t Zref,
197 Bool_t /*isDetElemId*/):
201 fIsDetElemId = kTRUE;
202 fDetElemId = detElemId;
214 fPx = momentum * TMath::Sin(theta) * TMath::Cos(phi);
215 fPy = momentum * TMath::Sin(theta) * TMath::Sin(phi);
216 fPz = momentum * TMath::Cos(theta) ;
223 //-----------------------------------------------------------------------------------------------
224 Int_t AliMUONHit::DetElemId()const
226 // Return detection element ID
229 AliWarning("Detection element Id is not defined.");
237 //-----------------------------------------------------------------------------------------------
238 Int_t AliMUONHit::Chamber() const
245 return AliMUONVGeometryDEIndexing::GetModuleId(fDetElemId);