39 using namespace CLHEP;
55 fieldShape(MedicalBeam::SQUARE),
77 dr= std::sqrt(
sqr(fieldXY[0]/2.)+
sqr(fieldXY[1]/2.));
92 xmax= fieldXY[0]/2./SSD;
93 ymax= fieldXY[1]/2./SSD;
98 while(! (std::abs(x)< xmax && std::abs(y)< ymax) ) {
99 dcos= RandFlat::shoot(cos0, 1.);
100 dsin= std::sqrt(1.-
sqr(dcos));
101 dphi= RandFlat::shoot(0.,
twopi);
103 x= std::cos(dphi)*dsin*dcos;
104 y= std::sin(dphi)*dsin*dcos;
116 if(particle==0)
return;
122 G4double mass= particle-> GetPDGMass();
130 vertex-> SetPrimary(primary);
133 anEvent-> AddPrimaryVertex(vertex);