Line data Source code
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;
41 : /// \cond CLASSIMP
42 16 : ClassImp(AliMUONHit)
43 : /// \endcond
44 :
45 : //___________________________________________
46 : AliMUONHit::AliMUONHit()
47 60 : : AliHit(),
48 60 : fDetElemId(0),
49 60 : fParticle(0),
50 60 : fTheta(0),
51 60 : fPhi(0),
52 60 : fTlength(0),
53 60 : fEloss(0),
54 60 : fAge(0),
55 60 : fPHfirst(0),
56 60 : fPHlast(0),
57 60 : fPTot(0),
58 60 : fPx(0),
59 60 : fPy(0),
60 60 : fPz(0),
61 60 : fXref(0),
62 60 : fYref(0),
63 60 : fZref(0)
64 300 : {
65 : /// Default constructor
66 120 : }
67 :
68 : //___________________________________________
69 : AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
70 0 : : AliHit(shunt, track),
71 0 : fDetElemId(vol[0]),
72 0 : fParticle(hits[0]),
73 0 : fTheta(hits[4]),
74 0 : fPhi(hits[5]),
75 0 : fTlength(hits[6]),
76 0 : fEloss(hits[7]),
77 0 : fAge(hits[14]),
78 0 : fPHfirst((Int_t)hits[8]),
79 0 : fPHlast((Int_t)hits[9]),
80 0 : fPTot(hits[10]),
81 0 : fPx(hits[11]),
82 0 : fPy(hits[12]),
83 0 : fPz(hits[13]),
84 0 : fXref(0),
85 0 : fYref(0),
86 0 : fZref(0)
87 0 : {
88 : /// Constructor
89 :
90 0 : fX = hits[1];
91 0 : fY = hits[2];
92 0 : fZ = hits[3];
93 0 : }
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 0 : : AliHit(shunt, track),
100 0 : fDetElemId(detElemId),
101 0 : fParticle(idpart),
102 0 : fTheta(theta),
103 0 : fPhi(phi),
104 0 : fTlength(length),
105 0 : fEloss(destep),
106 0 : fAge(tof),
107 0 : fPHfirst(0),
108 0 : fPHlast(0),
109 0 : fPTot(momentum),
110 0 : fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
111 0 : fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
112 0 : fPz(momentum * TMath::Cos(theta)),
113 0 : fXref(0),
114 0 : fYref(0),
115 0 : fZref(0)
116 0 : {
117 : /// Constructor
118 0 : fX = x;
119 0 : fY = y;
120 0 : fZ = z;
121 0 : }
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 115 : : AliHit(shunt, track),
129 115 : fDetElemId(detElemId),
130 115 : fParticle(idpart),
131 115 : fTheta(theta),
132 115 : fPhi(phi),
133 115 : fTlength(length),
134 115 : fEloss(destep),
135 115 : fAge(tof),
136 115 : fPHfirst(0),
137 115 : fPHlast(0),
138 115 : fPTot(momentum),
139 115 : fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
140 115 : fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
141 115 : fPz(momentum * TMath::Cos(theta)),
142 115 : fXref(xref),
143 115 : fYref(yref),
144 115 : fZref(zref)
145 575 : {
146 : /// Constructor
147 :
148 115 : fX = x;
149 115 : fY = y;
150 115 : fZ = z;
151 230 : }
152 :
153 : //-----------------------------------------------------------------------------------------------
154 : AliMUONHit::~AliMUONHit()
155 530 : {
156 : /// Dectructor
157 645 : }
158 :
159 : //-----------------------------------------------------------------------------------------------
160 : Int_t AliMUONHit::Chamber() const
161 : {
162 : /// Return chamber ID
163 :
164 230 : return AliMpDEManager::GetChamberId(fDetElemId) + 1;
165 : }
166 :
167 : //-----------------------------------------------------------------------------
168 : const char*
169 : AliMUONHit::GetName() const
170 : {
171 : /// Generate hit name
172 :
173 0 : return Form("%s-DE%04d",ClassName(),DetElemId());
174 : }
175 :
176 : //-----------------------------------------------------------------------------------------------
177 : void AliMUONHit::Print(Option_t* opt) const
178 : {
179 : /// Printing hit information
180 : /// "full" option for printing all the information about the hit
181 :
182 0 : TString sopt(opt);
183 0 : sopt.ToUpper();
184 :
185 0 : if ( sopt.Contains("FULL") ) {
186 0 : cout <<"<AliMUONHit>: Geant track=" << setw(4) << Track() <<
187 0 : ", DetEle=" << setw(4) << DetElemId() <<
188 0 : ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<
189 0 : " )cm, Delta E=" << setw(8) << setprecision(3) << Eloss() << " GeV" << endl;
190 : }
191 : else {
192 0 : cout << "<AliMUONHit>: DetEle=" << setw(4) << DetElemId() <<
193 0 : ", (x,y,z)=(" << setw(7) << setprecision(5) << X() << "," << setw(7) << setprecision(5) << Y() << "," << setw(7) << setprecision(5) << Z() <<
194 0 : " ) cm" <<endl;
195 : }
196 :
197 0 : }
|