AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONHit.cxx
Go to the documentation of this file.
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 
16 /* $Id$ */
17 
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 //-----------------------------------------------------------------------------
27 
28 #include "AliMUONHit.h"
29 #include "AliMpDEManager.h"
30 
31 #include "AliLog.h"
32 
33 #include <Riostream.h>
34 #include <TMath.h>
35 #include <TString.h>
36 
37 using std::endl;
38 using std::cout;
39 using std::setw;
40 using std::setprecision;
44 
45 //___________________________________________
47  : AliHit(),
48  fDetElemId(0),
49  fParticle(0),
50  fTheta(0),
51  fPhi(0),
52  fTlength(0),
53  fEloss(0),
54  fAge(0),
55  fPHfirst(0),
56  fPHlast(0),
57  fPTot(0),
58  fPx(0),
59  fPy(0),
60  fPz(0),
61  fXref(0),
62  fYref(0),
63  fZref(0)
64 {
66 }
67 
68 //___________________________________________
69 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
70  : AliHit(shunt, track),
71  fDetElemId(vol[0]),
72  fParticle(hits[0]),
73  fTheta(hits[4]),
74  fPhi(hits[5]),
75  fTlength(hits[6]),
76  fEloss(hits[7]),
77  fAge(hits[14]),
78  fPHfirst((Int_t)hits[8]),
79  fPHlast((Int_t)hits[9]),
80  fPTot(hits[10]),
81  fPx(hits[11]),
82  fPy(hits[12]),
83  fPz(hits[13]),
84  fXref(0),
85  fYref(0),
86  fZref(0)
87 {
89 
90  fX = hits[1];
91  fY = hits[2];
92  fZ = hits[3];
93 }
94 
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),
101  fParticle(idpart),
102  fTheta(theta),
103  fPhi(phi),
104  fTlength(length),
105  fEloss(destep),
106  fAge(tof),
107  fPHfirst(0),
108  fPHlast(0),
109  fPTot(momentum),
110  fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
111  fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
112  fPz(momentum * TMath::Cos(theta)),
113  fXref(0),
114  fYref(0),
115  fZref(0)
116 {
118  fX = x;
119  fY = y;
120  fZ = z;
121 }
122 
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),
130  fParticle(idpart),
131  fTheta(theta),
132  fPhi(phi),
133  fTlength(length),
134  fEloss(destep),
135  fAge(tof),
136  fPHfirst(0),
137  fPHlast(0),
138  fPTot(momentum),
139  fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
140  fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
141  fPz(momentum * TMath::Cos(theta)),
142  fXref(xref),
143  fYref(yref),
144  fZref(zref)
145 {
147 
148  fX = x;
149  fY = y;
150  fZ = z;
151 }
152 
153 //-----------------------------------------------------------------------------------------------
155 {
157 }
158 
159 //-----------------------------------------------------------------------------------------------
160 Int_t AliMUONHit::Chamber() const
161 {
163 
165 }
166 
167 //-----------------------------------------------------------------------------
168 const char*
170 {
172 
173  return Form("%s-DE%04d",ClassName(),DetElemId());
174 }
175 
176 //-----------------------------------------------------------------------------------------------
177 void AliMUONHit::Print(Option_t* opt) const
178 {
181 
182  TString sopt(opt);
183  sopt.ToUpper();
184 
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;
190  }
191  else {
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() <<
194  " ) cm" <<endl;
195  }
196 
197 }
Int_t fDetElemId
Detection element ID.
Definition: AliMUONHit.h:70
Float_t Eloss() const
Return Ionisation energy loss in gas.
Definition: AliMUONHit.h:52
virtual ~AliMUONHit()
Definition: AliMUONHit.cxx:154
AliTPCfastTrack * track
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
static Int_t GetChamberId(Int_t detElemId, Bool_t warn=true)
Int_t Chamber() const
Definition: AliMUONHit.cxx:160
virtual void Print(Option_t *opt="") const
Definition: AliMUONHit.cxx:177
Int_t DetElemId() const
Return detection element ID.
Definition: AliMUONHit.h:43
MonteCarlo hit.
Definition: AliMUONHit.h:24
virtual const char * GetName() const
Definition: AliMUONHit.cxx:169