51 G4AdjointCrossSurfChecker::G4AdjointCrossSurfChecker()
 
   56 G4AdjointCrossSurfChecker::~G4AdjointCrossSurfChecker()
 
   77   if (r1<=sphere_radius && r2>sphere_radius){
 
   81   else if (r2<=sphere_radius && r1>sphere_radius){
 
   94     c = r12-sphere_radius*sphere_radius;
 
   95     d=std::sqrt(b*b-4.*a*c);
 
   97     if (l > 1.) l=(-b-
d)/2./a;
 
   98     crossing_pos=pos1+l*dr;
 
   99     cos_th = std::abs(dr.cosTheta(crossing_pos));
 
  111   if (step_at_boundary){
 
  114     if (preStepTouchable && postStepTouchable && postStepTouchable->
GetVolume() && preStepTouchable->
GetVolume()){
 
  118         if (post_vol_name == volume_name ){
 
  122         else if (pre_vol_name == volume_name){
 
  139   if (step_at_boundary){
 
  142     if (preStepTouchable && postStepTouchable && postStepTouchable->
GetVolume() && preStepTouchable->
GetVolume()){
 
  147         if (post_vol_name == volume_name && pre_log_vol_name ==  mother_logical_vol_name){
 
  151         else if (pre_vol_name == volume_name && post_log_vol_name ==  mother_logical_vol_name ){
 
  166   G4int ind = FindRegisteredSurface(surface_name);
 
  177    G4String surf_type = ListOfSurfaceType[ind];
 
  178    G4double radius = ListOfSphereRadius[ind];
 
  180    G4String vol1 = ListOfVol1Name[ind];
 
  181    G4String vol2 = ListOfVol2Name[ind];
 
  184    if (surf_type == 
"Sphere"){
 
  185     did_cross = 
CrossingASphere(aStep, radius, center,crossing_pos, cos_to_surface, GoingIn);
 
  187    else if (surf_type == 
"ExternalSurfaceOfAVolume"){
 
  193    else if (surf_type == 
"BoundaryBetweenTwoVolumes"){
 
  205  for (
size_t i=0;i <ListOfSurfaceName.size();i++){
 
  207         surface_name = ListOfSurfaceName[i];
 
  219   if (step_at_boundary){
 
  222     if (preStepTouchable && postStepTouchable){
 
  230         if ( pre_vol_name == vol1_name && post_vol_name == vol2_name){
 
  234         else if (pre_vol_name == vol2_name && post_vol_name == vol1_name){
 
  249   G4int ind = FindRegisteredSurface(SurfaceName);
 
  250   Area= 4.*
pi*radius*radius;
 
  252     ListOfSurfaceType[ind]=
"Sphere";
 
  253     ListOfSphereRadius[ind]=radius;
 
  254     ListOfSphereCenter[ind]=pos;
 
  255     ListOfVol1Name[ind]=
"";
 
  256     ListOfVol2Name[ind]=
"";
 
  257     AreaOfSurface[ind]=Area;
 
  260     ListOfSurfaceName.push_back(SurfaceName);
 
  261     ListOfSurfaceType.push_back(
"Sphere");
 
  262     ListOfSphereRadius.push_back(radius);
 
  263     ListOfSphereCenter.push_back(pos);
 
  264     ListOfVol1Name.push_back(
"");
 
  265     ListOfVol2Name.push_back(
"");
 
  266     AreaOfSurface.push_back(Area);
 
  277   for ( 
unsigned int i=0; i< thePhysVolStore->size();i++){
 
  278     if ((*thePhysVolStore)[i]->GetName() == volume_name){
 
  279         thePhysicalVolume = (*thePhysVolStore)[i];
 
  283   if (thePhysicalVolume){
 
  288         theTransformationFromPhysVolToWorld *=
 
  294         for ( 
unsigned int i=0; i< thePhysVolStore->size();i++){
 
  295             if ((*thePhysVolStore)[i]->GetLogicalVolume() == mother){
 
  296                 daughter = (*thePhysVolStore)[i];
 
  304     G4cout<<
"Center of the spherical surface is at the position: "<<center/
cm<<
" cm"<<std::endl;
 
  308     G4cout<<
"The physical volume with name "<<volume_name<<
" does not exist!!"<<std::endl;
 
  318   G4int ind = FindRegisteredSurface(SurfaceName);
 
  322   for ( 
unsigned int i=0; i< thePhysVolStore->size();i++){
 
  323     if ((*thePhysVolStore)[i]->GetName() == volume_name){
 
  324         thePhysicalVolume = (*thePhysVolStore)[i];
 
  328   if (!thePhysicalVolume){
 
  329     G4cout<<
"The physical volume with name "<<volume_name<<
" does not exist!!"<<std::endl;
 
  336   if (theMother) mother_vol_name= theMother->
GetName();
 
  338     ListOfSurfaceType[ind]=
"ExternalSurfaceOfAVolume";
 
  339     ListOfSphereRadius[ind]=0.;
 
  341     ListOfVol1Name[ind]=volume_name;
 
  342     ListOfVol2Name[ind]=mother_vol_name;
 
  343     AreaOfSurface[ind]=Area;
 
  346     ListOfSurfaceName.push_back(SurfaceName);
 
  347     ListOfSurfaceType.push_back(
"ExternalSurfaceOfAVolume");
 
  348     ListOfSphereRadius.push_back(0.);
 
  350     ListOfVol1Name.push_back(volume_name);
 
  351     ListOfVol2Name.push_back(mother_vol_name);
 
  352     AreaOfSurface.push_back(Area);
 
  360   G4int ind = FindRegisteredSurface(SurfaceName);
 
  363     ListOfSurfaceType[ind]=
"BoundaryBetweenTwoVolumes";
 
  364     ListOfSphereRadius[ind]=0.;
 
  366     ListOfVol1Name[ind]=volume_name1;
 
  367     ListOfVol2Name[ind]=volume_name2;
 
  368     AreaOfSurface[ind]=Area;
 
  372     ListOfSurfaceName.push_back(SurfaceName);
 
  373     ListOfSurfaceType.push_back(
"BoundaryBetweenTwoVolumes");
 
  374     ListOfSphereRadius.push_back(0.);
 
  376     ListOfVol1Name.push_back(volume_name1);
 
  377     ListOfVol2Name.push_back(volume_name2);
 
  378     AreaOfSurface.push_back(Area);
 
  386   ListOfSurfaceName.clear();
 
  387   ListOfSurfaceType.clear();
 
  388   ListOfSphereRadius.clear();
 
  389   ListOfSphereCenter.clear();
 
  390   ListOfVol1Name.clear();
 
  391   ListOfVol2Name.clear();
 
  398  for (
size_t i = 0; i<ListOfSurfaceName.size();i++){
 
  399     if (name == ListOfSurfaceName[i]) {