Geant4-11
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Private Attributes
G4RTSteppingAction Class Reference

#include <G4RTSteppingAction.hh>

Inheritance diagram for G4RTSteppingAction:
G4UserSteppingAction

Public Member Functions

 G4RTSteppingAction ()
 
virtual void SetSteppingManagerPointer (G4SteppingManager *pValue)
 
virtual void UserSteppingAction (const G4Step *)
 
virtual ~G4RTSteppingAction ()
 

Static Public Member Functions

static G4bool GetIgnoreTransparency ()
 
static void SetIgnoreTransparency (G4bool val)
 

Protected Attributes

G4SteppingManagerfpSteppingManager = nullptr
 

Static Private Attributes

static G4bool ignoreTransparency = false
 

Detailed Description

Definition at line 51 of file G4RTSteppingAction.hh.

Constructor & Destructor Documentation

◆ G4RTSteppingAction()

G4RTSteppingAction::G4RTSteppingAction ( )

Definition at line 45 of file G4RTSteppingAction.cc.

46{}

◆ ~G4RTSteppingAction()

virtual G4RTSteppingAction::~G4RTSteppingAction ( )
inlinevirtual

Definition at line 55 of file G4RTSteppingAction.hh.

55{;}

Member Function Documentation

◆ GetIgnoreTransparency()

G4bool G4RTSteppingAction::GetIgnoreTransparency ( )
static

Definition at line 99 of file G4RTSteppingAction.cc.

100{ return ignoreTransparency; }
static G4bool ignoreTransparency

References ignoreTransparency.

Referenced by G4RTMessenger::GetCurrentValue().

◆ SetIgnoreTransparency()

void G4RTSteppingAction::SetIgnoreTransparency ( G4bool  val)
static

Definition at line 97 of file G4RTSteppingAction.cc.

98{ ignoreTransparency = val; }

References ignoreTransparency.

Referenced by G4RTMessenger::SetNewValue().

◆ SetSteppingManagerPointer()

void G4UserSteppingAction::SetSteppingManagerPointer ( G4SteppingManager pValue)
virtualinherited

Reimplemented in G4MultiSteppingAction.

Definition at line 63 of file G4UserSteppingAction.cc.

65{
66 fpSteppingManager = pValue;
67}
G4SteppingManager * fpSteppingManager

References G4UserSteppingAction::fpSteppingManager.

Referenced by G4TrackingManager::SetUserAction().

◆ 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* postStepPoint = aStep -> GetPostStepPoint();
54
55 G4VPhysicalVolume* postVolume_phys=postStepPoint->GetPhysicalVolume();
56 if(!postVolume_phys) return; // Reach to out of the world
57
59 G4RayTracerSceneHandler* sceneHandler =
60 static_cast<G4RayTracerSceneHandler*>(visManager->GetCurrentSceneHandler());
61
62 // Make a path from the touchable
63 const G4VTouchable* postTouchable = postStepPoint->GetTouchable();
64 G4int postDepth = postTouchable->GetHistoryDepth();
65 G4ModelingParameters::PVPointerCopyNoPath localPostPVPointerCopyNoPath;
66 for (G4int i = postDepth; i >= 0; --i) {
67 localPostPVPointerCopyNoPath.push_back
69 (postTouchable->GetVolume(i),postTouchable->GetCopyNumber(i)));
70 }
71
72 // Pick up the vis atts, if any, from the scene handler
73 const auto& sceneVisAttsMap = sceneHandler->GetSceneVisAttsMap();
74 auto postIterator = sceneVisAttsMap.find(localPostPVPointerCopyNoPath);
75 const G4VisAttributes* postVisAtts;
76 if (postIterator != sceneVisAttsMap.end()) {
77 postVisAtts = &postIterator->second;
78 } else {
79 postVisAtts = 0;
80 }
81
82 if((!postVisAtts) || (!(postVisAtts->IsVisible()))) return; // Invisible volume, continue tracking
83
84 if((postVisAtts->IsForceDrawingStyle())
85 &&(postVisAtts->GetForcedDrawingStyle()==G4VisAttributes::wireframe)) return;
86 // Wire frame volume, continue tracking
87
88 G4double postAlpha=(postVisAtts->GetColour()).GetAlpha();
89
90 if(postAlpha==1.0 || ignoreTransparency) // Stop stepping
91 {
92 G4Track* currentTrack = aStep -> GetTrack();
93 currentTrack -> SetTrackStatus(fStopAndKill);
94 }
95}
@ fStopAndKill
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
std::vector< PVPointerCopyNo > PVPointerCopyNoPath
const std::map< G4ModelingParameters::PVPointerCopyNoPath, G4VisAttributes, PathLessThan > & GetSceneVisAttsMap() const
const G4VTouchable * GetTouchable() const
G4VPhysicalVolume * GetPhysicalVolume() const
G4int GetCopyNumber(G4int depth=0) const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
Definition: G4VTouchable.cc:34
virtual G4int GetHistoryDepth() const
Definition: G4VTouchable.cc:74
const G4Colour & GetColour() const
G4bool IsVisible() const
ForcedDrawingStyle GetForcedDrawingStyle() const
G4bool IsForceDrawingStyle() const
G4VSceneHandler * GetCurrentSceneHandler() const
static G4VisManager * GetInstance()

References fStopAndKill, G4VisAttributes::GetColour(), G4VTouchable::GetCopyNumber(), G4VisManager::GetCurrentSceneHandler(), G4VisAttributes::GetForcedDrawingStyle(), G4VTouchable::GetHistoryDepth(), G4VisManager::GetInstance(), G4StepPoint::GetPhysicalVolume(), G4RayTracerSceneHandler::GetSceneVisAttsMap(), G4StepPoint::GetTouchable(), G4VTouchable::GetVolume(), ignoreTransparency, G4VisAttributes::IsForceDrawingStyle(), G4VisAttributes::IsVisible(), and G4VisAttributes::wireframe.

Field Documentation

◆ fpSteppingManager

G4SteppingManager* G4UserSteppingAction::fpSteppingManager = nullptr
protectedinherited

◆ ignoreTransparency

G4bool G4RTSteppingAction::ignoreTransparency = false
staticprivate

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