76 if (r1<=sphere_radius && r2>sphere_radius){
80 else if (r2<=sphere_radius && r1>sphere_radius){
93 c = r12-sphere_radius*sphere_radius;
94 d=std::sqrt(b*b-4.*a*c);
96 if (l > 1.) l=(-b-
d)/2./a;
97 crossing_pos=pos1+l*dr;
98 cos_th =
std::abs(dr.cosTheta(crossing_pos));
110 if (step_at_boundary){
113 if (preStepTouchable && postStepTouchable && postStepTouchable->
GetVolume() && preStepTouchable->
GetVolume()){
117 if (post_vol_name == volume_name ){
121 else if (pre_vol_name == volume_name){
138 if (step_at_boundary){
141 if (preStepTouchable && postStepTouchable && postStepTouchable->
GetVolume() && preStepTouchable->
GetVolume()){
146 if (post_vol_name == volume_name && pre_log_vol_name == mother_logical_vol_name){
150 else if (pre_vol_name == volume_name && post_log_vol_name == mother_logical_vol_name ){
183 if (surf_type ==
"Sphere"){
184 did_cross =
CrossingASphere(aStep, radius, center,crossing_pos, cos_to_surface, GoingIn);
186 else if (surf_type ==
"ExternalSurfaceOfAVolume"){
192 else if (surf_type ==
"BoundaryBetweenTwoVolumes"){
218 if (step_at_boundary){
221 if (preStepTouchable && postStepTouchable){
229 if ( pre_vol_name == vol1_name && post_vol_name == vol2_name){
233 else if (pre_vol_name == vol2_name && post_vol_name == vol1_name){
276 for (
unsigned int i=0; i< thePhysVolStore->size();i++){
277 if ((*thePhysVolStore)[i]->GetName() == volume_name){
278 thePhysicalVolume = (*thePhysVolStore)[i];
282 if (thePhysicalVolume){
287 theTransformationFromPhysVolToWorld *=
293 for (
unsigned int i=0; i< thePhysVolStore->size();i++){
294 if ((*thePhysVolStore)[i]->GetLogicalVolume() == mother){
295 daughter = (*thePhysVolStore)[i];
303 G4cout<<
"Center of the spherical surface is at the position: "<<center/
cm<<
" cm"<<std::endl;
307 G4cout<<
"The physical volume with name "<<volume_name<<
" does not exist!!"<<std::endl;
321 for (
unsigned int i=0; i< thePhysVolStore->size();i++){
322 if ((*thePhysVolStore)[i]->GetName() == volume_name){
323 thePhysicalVolume = (*thePhysVolStore)[i];
327 if (!thePhysicalVolume){
328 G4cout<<
"The physical volume with name "<<volume_name<<
" does not exist!!"<<std::endl;
335 if (theMother) mother_vol_name= theMother->
GetName();