40 #include "G4StepPoint.hh"    71   G4ThreeVector pos1=  aStep->GetPreStepPoint()->GetPosition() - sphere_center;
    72   G4ThreeVector pos2=  aStep->GetPostStepPoint()->GetPosition() - sphere_center;
    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));
   109   G4bool step_at_boundary = (aStep->GetPostStepPoint()->GetStepStatus() == fGeomBoundary);
   111   if (step_at_boundary){
   112     const G4VTouchable* postStepTouchable = aStep->GetPostStepPoint()->GetTouchable();
   113     const G4VTouchable* preStepTouchable = aStep->GetPreStepPoint()->GetTouchable();
   114     if (preStepTouchable && postStepTouchable && postStepTouchable->
GetVolume() && preStepTouchable->
GetVolume()){
   118         if (post_vol_name == volume_name ){
   122         else if (pre_vol_name == volume_name){
   137   G4bool step_at_boundary = (aStep->GetPostStepPoint()->GetStepStatus() == fGeomBoundary);
   139   if (step_at_boundary){
   140     const G4VTouchable* postStepTouchable = aStep->GetPostStepPoint()->GetTouchable();
   141     const G4VTouchable* preStepTouchable = aStep->GetPreStepPoint()->GetTouchable();
   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 ){
   184    if (surf_type == 
"Sphere"){
   185     did_cross = 
CrossingASphere(aStep, radius, center,crossing_pos, cos_to_surface, GoingIn);
   187    else if (surf_type == 
"ExternalSurfaceOfAVolume"){
   190     crossing_pos= aStep->GetPostStepPoint()->GetPosition();
   193    else if (surf_type == 
"BoundaryBetweenTwoVolumes"){
   217   G4bool step_at_boundary = (aStep->GetPostStepPoint()->GetStepStatus() == fGeomBoundary);
   219   if (step_at_boundary){
   220     const G4VTouchable* postStepTouchable = aStep->GetPostStepPoint()->GetTouchable();
   221     const G4VTouchable* preStepTouchable = aStep->GetPreStepPoint()->GetTouchable();
   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){
   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;
   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();
 
const G4RotationMatrix * GetFrameRotation() const
 
G4bool AddaSphericalSurface(const G4String &SurfaceName, G4double radius, G4ThreeVector pos, G4double &area)
 
std::vector< G4String > ListOfSurfaceName
 
G4bool GoingInOrOutOfaVolumeByExtSurface(const G4Step *aStep, const G4String &volume_name, const G4String &mother_log_vol_name, G4double &cos_to_surface, G4bool &GoingIn)
 
CLHEP::Hep3Vector G4ThreeVector
 
std::vector< G4double > ListOfSphereRadius
 
std::vector< G4String > ListOfSurfaceType
 
std::vector< G4String > ListOfVol2Name
 
static G4PhysicalVolumeStore * GetInstance()
 
G4bool AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume(const G4String &SurfaceName, G4double radius, const G4String &volume_name, G4ThreeVector ¢er, G4double &area)
 
std::vector< G4ThreeVector > ListOfSphereCenter
 
G4GLOB_DLL std::ostream G4cout
 
const G4String & GetName() const
 
G4bool CrossingASphere(const G4Step *aStep, G4double sphere_radius, G4ThreeVector sphere_center, G4ThreeVector &crossing_pos, G4double &cos_to_surface, G4bool &GoingIn)
 
std::vector< G4String > ListOfVol1Name
 
G4bool GoingInOrOutOfaVolume(const G4Step *aStep, const G4String &volume_name, G4double &cos_to_surface, G4bool &GoingIn)
 
G4int FindRegisteredSurface(const G4String &name)
 
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
 
~G4AdjointCrossSurfChecker()
 
G4bool CrossingAnInterfaceBetweenTwoVolumes(const G4Step *aStep, const G4String &vol1_name, const G4String &vol2_name, G4ThreeVector &crossing_pos, G4double &cos_to_surface, G4bool &GoingIn)
 
G4ThreeVector GetObjectTranslation() const
 
static G4AdjointCrossSurfChecker * GetInstance()
 
const G4String & GetName() const
 
G4bool AddanExtSurfaceOfAvolume(const G4String &SurfaceName, const G4String &volume_name, G4double &area)
 
G4bool CrossingOneOfTheRegisteredSurface(const G4Step *aStep, G4String &surface_name, G4ThreeVector &crossing_pos, G4double &cos_to_surface, G4bool &GoingIn)
 
G4AdjointCrossSurfChecker()
 
static G4ThreadLocal G4AdjointCrossSurfChecker * instance
 
G4LogicalVolume * GetMotherLogical() const
 
void ClearListOfSelectedSurface()
 
G4LogicalVolume * GetLogicalVolume() const
 
G4bool CrossingAGivenRegisteredSurface(const G4Step *aStep, const G4String &surface_name, G4ThreeVector &crossing_pos, G4double &cos_to_surface, G4bool &GoingIn)
 
std::vector< G4double > AreaOfSurface
 
virtual G4double GetSurfaceArea()
 
G4VSolid * GetSolid() const
 
static const G4double pos
 
G4bool AddanInterfaceBetweenTwoVolumes(const G4String &SurfaceName, const G4String &volume_name1, const G4String &volume_name2, G4double &area)