306 double sintheta = TMath::Sqrt(1-costheta*costheta);
307 double cosphi = TMath::Cos(phi);
308 double sinphi = TMath::Sin(phi);
311 double z = rad * costheta;
312 double y = rad * sintheta * cosphi;
313 double x = rad * sintheta * sinphi;
318 TVector3 dvec1 = vec.Orthogonal();
319 TVector3 dvec2 = dvec1;
320 dvec2.Rotate(-
kPi/2.0,vec);
325 dvec1.SetMag(TMath::Sqrt(random)*rad_trans*TMath::Cos(psi));
326 dvec2.SetMag(TMath::Sqrt(random)*rad_trans*TMath::Sin(psi));
327 x += dvec1.X() + dvec2.X();
328 y += dvec1.Y() + dvec2.Y();
329 z += dvec1.Z() + dvec2.Z();
334 double pz = Enu * costheta;
335 double py = Enu * sintheta * sinphi;
336 double px = Enu * sintheta * cosphi;
337 TVector3 p3(-px,-py,-pz);
342 TVector3 Hit3(0,0,0);
345 bool HitFound =
false;
347 TVector3 unit(0,0,0);
349 double unitx = unit.X();
350 double unity = unit.Y();
351 double unitz = unit.Z();
354 if (
x3.Z() < -l/2 && unitz > 0 && !HitFound){
355 while (temp3.Z() < -l/2){
358 if ( -l/2<temp3.X() && l/2>temp3.X() && -l/2<temp3.Y() && l/2>temp3.Y() ){
359 Hit3.SetXYZ(temp3.X(),temp3.Y(),-l/2);
366 if (
x3.X() > l/2 && unitx < 0 && !HitFound){
367 while (temp3.X() > l/2){
370 if ( -l/2<temp3.Y() && l/2>temp3.Y() && -l/2<temp3.Z() && l/2>temp3.Z() ){
371 Hit3.SetXYZ(l/2,temp3.Y(),temp3.Z());
378 if (
x3.Y() > l/2 && unity < 0 && !HitFound){
379 while (temp3.Y() > l/2){
382 if ( -l/2<temp3.X() && l/2>temp3.X() && -l/2<temp3.Z() && l/2>temp3.Z() ){
383 Hit3.SetXYZ(temp3.X(),l/2,temp3.Z());
390 if (
x3.X() < -l/2 && unitx > 0 && !HitFound){
391 while (temp3.X() < -l/2){
394 if ( -l/2<temp3.Y() && l/2>temp3.Y() && -l/2<temp3.Z() && l/2>temp3.Z() ){
395 Hit3.SetXYZ(-l/2,temp3.Y(),temp3.Z());
402 if (
x3.Y() < -l/2 && unity > 0 && !HitFound){
403 while (temp3.Y() < -l/2){
406 if ( -l/2<temp3.X() && l/2>temp3.X() && -l/2<temp3.Z() && l/2>temp3.Z() ){
407 Hit3.SetXYZ(temp3.X(),-l/2,temp3.Z());
static constexpr double rad
A singleton holding random number generator classes. All random number generation in GENIE should tak...
TRandom3 & RndFlux(void) const
rnd number generator used by flux drivers