Changeset 1448 for trunk/WuerzburgSoft/Thomas/mphys/MParticle.cc
- Timestamp:
- 07/26/02 14:49:58 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WuerzburgSoft/Thomas/mphys/MParticle.cc
r1430 r1448 198 198 199 199 MParticle::MParticle(ParticleType_t t, const char *name, const char *title) 200 : fPType(t), fZ(0), fR(0), fPhi(0), fTheta(0), fPsi(0) 200 : fPType(t), fZ(0), fR(0), fPhi(0), fTheta(0), fPsi(0), fX(0) 201 201 { 202 202 // … … 259 259 x(2) = cos(fTheta); 260 260 261 x *= dr;262 263 261 // ------------------------------ 264 262 265 263 const Double_t R = RofZ(&fZ); 266 264 267 if (x(2) > R*cos(fTheta)) 265 const Double_t dx = R - dr*x(2); 266 267 if (dx < 0) 268 268 { 269 x *= R/dr;269 dr = R/x(2); // R>0 --> x(2)>0 270 270 rc = kFALSE; 271 271 } 272 else 273 fX += dr*(1.-x(2)); 274 275 x *= dr; 272 276 273 277 // ------------------------------ … … 283 287 r -= x; 284 288 285 fR = sqrt(r(0)*r(0)+r(1)*r(1)); 286 fPhi = atan2(r(1), r(0)); 287 fZ = ZofR(&r(2)); 289 if (fR!=0) 290 fPhi = atan2(r(1), r(0)); 291 292 fR = sqrt(r(0)*r(0)+r(1)*r(1)); 293 fZ = ZofR(&r(2)); 288 294 289 295 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.