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

#include <G4RTRun.hh>

+ Inheritance diagram for G4RTRun:

Public Member Functions

 G4RTRun ()
 
virtual ~G4RTRun ()
 
virtual void RecordEvent (const G4Event *)
 
virtual void Merge (const G4Run *)
 
G4THitsMap< G4Colour > * GetMap () const
 
- Public Member Functions inherited from G4Run
 G4Run ()
 
virtual ~G4Run ()
 
 G4Run (const G4Run &)=delete
 
G4Runoperator= (const G4Run &)=delete
 
virtual void MergeSubEvent (G4Event *masterEv, const G4Event *subEv)
 
void StoreEvent (G4Event *evt)
 
G4int GetRunID () const
 
G4int GetNumberOfEvent () const
 
G4int GetNumberOfEventToBeProcessed () const
 
const G4HCtableGetHCtable () const
 
const G4DCtableGetDCtable () const
 
const G4StringGetRandomNumberStatus () const
 
std::vector< const G4Event * > * GetEventVector () const
 
void SetRunID (G4int id)
 
void SetNumberOfEventToBeProcessed (G4int n_ev)
 
void SetHCtable (G4HCtable *HCtbl)
 
void SetDCtable (G4DCtable *DCtbl)
 
void SetRandomNumberStatus (G4String &st)
 

Additional Inherited Members

- Public Types inherited from G4Run
using ProfilerConfig = G4ProfilerConfig<G4ProfileType::Run>
 
- Protected Attributes inherited from G4Run
G4int runID = 0
 
G4int numberOfEvent = 0
 
G4int numberOfEventToBeProcessed = 0
 
G4HCtableHCtable = nullptr
 
G4DCtableDCtable = nullptr
 
G4String randomNumberStatus = ""
 
std::vector< const G4Event * > * eventVector = nullptr
 

Detailed Description

Definition at line 50 of file G4RTRun.hh.

Constructor & Destructor Documentation

◆ G4RTRun()

G4RTRun::G4RTRun ( )

Definition at line 46 of file G4RTRun.cc.

47{
48 colorMap = new G4THitsMap<G4Colour>("G4RTRun","ColorMap");
49
50 backgroundColour = G4TheMTRayTracer::theInstance->backgroundColour;
51 lightDirection = G4TheMTRayTracer::theInstance->lightDirection;
52 attenuationLength = G4TheMTRayTracer::theInstance->attenuationLength;
53}
G4ThreeVector lightDirection
G4Colour backgroundColour
G4double attenuationLength

◆ ~G4RTRun()

G4RTRun::~G4RTRun ( )
virtual

Definition at line 55 of file G4RTRun.cc.

56{
57 colorMap->clear();
58 delete colorMap;
59}

Member Function Documentation

◆ GetMap()

G4THitsMap< G4Colour > * G4RTRun::GetMap ( ) const
inline

Definition at line 63 of file G4RTRun.hh.

63{ return colorMap; }

Referenced by G4TheMTRayTracer::CreateBitMap().

◆ Merge()

void G4RTRun::Merge ( const G4Run * aLocalRun)
virtual

Reimplemented from G4Run.

Definition at line 88 of file G4RTRun.cc.

89{
90 const G4RTRun* theLocalRun = static_cast<const G4RTRun*>(aLocalRun);
91 if(theLocalRun) *(colorMap) += *(theLocalRun->colorMap);
92 G4Run::Merge(aLocalRun);
93}
virtual void Merge(const G4Run *)
Definition G4Run.cc:65

◆ RecordEvent()

void G4RTRun::RecordEvent ( const G4Event * evt)
virtual

Reimplemented from G4Run.

Definition at line 61 of file G4RTRun.cc.

62{
63 G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer();
64 if(!trajectoryContainer) return;
65 G4RayTrajectory* trajectory = static_cast<G4RayTrajectory*>( (*trajectoryContainer)[0] );
66 if(!trajectory) return;
67
68 G4int nPoint = trajectory->GetPointEntries();
69 if(nPoint==0) return;
70
71 G4int evId = evt->GetEventID();
72 G4Colour initialCol(backgroundColour);
73 if( trajectory->GetPointC(nPoint-1)->GetPostStepAtt() )
74 { initialCol = GetSurfaceColour(trajectory->GetPointC(nPoint-1)); }
75 G4Colour rayColour = Attenuate(trajectory->GetPointC(nPoint-1),initialCol);
76
77 for(int i=nPoint-2;i>=0;i--)
78 {
79 G4Colour surfaceCol = GetSurfaceColour(trajectory->GetPointC(i));
80 G4double weight = 1.0 - surfaceCol.GetAlpha();
81 G4Colour mixedCol = GetMixedColour(rayColour,surfaceCol,weight);
82 rayColour = Attenuate(trajectory->GetPointC(i),mixedCol);
83 }
84
85 colorMap->add(evId,rayColour);
86}
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
G4double GetAlpha() const
Definition G4Colour.hh:155
G4TrajectoryContainer * GetTrajectoryContainer() const
Definition G4Event.hh:165
G4int GetEventID() const
Definition G4Event.hh:123
const G4VisAttributes * GetPostStepAtt() const
G4RayTrajectoryPoint * GetPointC(G4int i) const
virtual G4int GetPointEntries() const
size_t add(const G4int &key, U *&aHit) const

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