35 #include "MedicalBeam.hh"
37 using namespace CLHEP;
42 fSSD(1.*
m), ffieldShape(MedicalBeam::kSQUARE), ffieldR(10.*
cm)
45 fparticle = particleTable-> FindParticle(
"proton");
64 dr = std::sqrt(
sqr(ffieldXY[0]/2.) +
sqr(ffieldXY[1]/2.));
80 xmax = ffieldXY[0]/2./fSSD;
81 ymax = ffieldXY[1]/2./fSSD;
88 dsin = std::sqrt(1.-
sqr(dcos));
91 x = std::cos(dphi)*dsin*dcos;
92 y = std::sin(dphi)*dsin*dcos;
102 if ( fparticle == NULL )
return;
115 vertex-> SetPrimary(primary);
118 anEvent-> AddPrimaryVertex(vertex);