Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4RTSteppingAction Class Reference

#include <G4RTSteppingAction.hh>

+ Inheritance diagram for G4RTSteppingAction:

Public Member Functions

 G4RTSteppingAction ()
 
virtual ~G4RTSteppingAction ()
 
virtual void UserSteppingAction (const G4Step *)
 
void SetIgnoreTransparency (G4bool val)
 
G4bool GetIgnoreTransparency () const
 
- Public Member Functions inherited from G4UserSteppingAction
 G4UserSteppingAction ()
 
virtual ~G4UserSteppingAction ()
 
void SetSteppingManagerPointer (G4SteppingManager *pValue)
 
virtual void UserSteppingAction (const G4Step *)
 

Additional Inherited Members

- Protected Attributes inherited from G4UserSteppingAction
G4SteppingManagerfpSteppingManager
 

Detailed Description

Definition at line 52 of file G4RTSteppingAction.hh.

Constructor & Destructor Documentation

◆ G4RTSteppingAction()

G4RTSteppingAction::G4RTSteppingAction ( )

Definition at line 43 of file G4RTSteppingAction.cc.

44{
45 ignoreTransparency=false;
46}

◆ ~G4RTSteppingAction()

virtual G4RTSteppingAction::~G4RTSteppingAction ( )
inlinevirtual

Definition at line 56 of file G4RTSteppingAction.hh.

56{;}

Member Function Documentation

◆ GetIgnoreTransparency()

G4bool G4RTSteppingAction::GetIgnoreTransparency ( ) const
inline

Definition at line 66 of file G4RTSteppingAction.hh.

67 { return ignoreTransparency; }

Referenced by G4RTMessenger::GetCurrentValue().

◆ SetIgnoreTransparency()

void G4RTSteppingAction::SetIgnoreTransparency ( G4bool  val)
inline

Definition at line 64 of file G4RTSteppingAction.hh.

65 { ignoreTransparency = val; }

Referenced by G4RTMessenger::SetNewValue().

◆ UserSteppingAction()

void G4RTSteppingAction::UserSteppingAction ( const G4Step aStep)
virtual

Reimplemented from G4UserSteppingAction.

Definition at line 48 of file G4RTSteppingAction.cc.

49{
50 // Stop the ray particle if it reaches to the coloured volume with its alpha = 1
51 // or coloured volume and the user request to ignore transparency
52
53 G4StepPoint* fpStepPoint = aStep -> GetPostStepPoint();
54 G4VPhysicalVolume* postVolume_phys=fpStepPoint->GetPhysicalVolume();
55
56 if(!postVolume_phys) return; // Reach to out of the world
57
58 const G4LogicalVolume* postVolume_log = postVolume_phys->GetLogicalVolume();
59 const G4VisAttributes* postVisAtt = postVolume_log -> GetVisAttributes();
60 G4VisManager* visManager = G4VisManager::GetInstance();
61 if(visManager) {
62 G4VViewer* viewer = visManager->GetCurrentViewer();
63 if (viewer) {
64 postVisAtt = viewer->GetApplicableVisAttributes(postVisAtt);
65 }
66 }
67 if((!postVisAtt) || (!(postVisAtt->IsVisible()))) return; // Invisible volume, continue tracking
68
69 if((postVisAtt->IsForceDrawingStyle())
70 &&(postVisAtt->GetForcedDrawingStyle()==G4VisAttributes::wireframe)) return;
71 // Wire frame volume, continue tracking
72
73 G4double postAlpha=(postVisAtt->GetColour()).GetAlpha();
74
75 if(postAlpha==1.0 || ignoreTransparency) // Stop stepping
76 {
77 G4Track* currentTrack = aStep -> GetTrack();
78 currentTrack -> SetTrackStatus(fStopAndKill);
79 }
80}
@ fStopAndKill
double G4double
Definition: G4Types.hh:64
G4VPhysicalVolume * GetPhysicalVolume() const
G4LogicalVolume * GetLogicalVolume() const
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
Definition: G4VViewer.cc:78
const G4Colour & GetColour() const
G4bool IsVisible() const
ForcedDrawingStyle GetForcedDrawingStyle() const
G4bool IsForceDrawingStyle() const
G4VViewer * GetCurrentViewer() const

The documentation for this class was generated from the following files: