Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4RTRun Class Reference

#include <G4RTRun.hh>

Inheritance diagram for G4RTRun:
Collaboration 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 ()
 
G4int GetRunID () const
 
G4int GetNumberOfEvent () const
 
G4int GetNumberOfEventToBeProcessed () const
 
const G4HCtableGetHCtable () const
 
const G4DCtableGetDCtable () const
 
const G4StringGetRandomNumberStatus () const
 
void SetRunID (G4int id)
 
void SetNumberOfEventToBeProcessed (G4int n_ev)
 
void SetHCtable (G4HCtable *HCtbl)
 
void SetDCtable (G4DCtable *DCtbl)
 
void SetRandomNumberStatus (G4String &st)
 
void StoreEvent (G4Event *evt)
 
const std::vector< const
G4Event * > * 
GetEventVector () const
 

Additional Inherited Members

- Protected Attributes inherited from G4Run
G4int runID
 
G4int numberOfEvent
 
G4int numberOfEventToBeProcessed
 
G4HCtableHCtable
 
G4DCtableDCtable
 
G4String randomNumberStatus
 
std::vector< const G4Event * > * eventVector
 

Detailed Description

Definition at line 51 of file G4RTRun.hh.

Constructor & Destructor Documentation

G4RTRun::G4RTRun ( )

Definition at line 48 of file G4RTRun.cc.

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

Definition at line 57 of file G4RTRun.cc.

58 {
59  colorMap->clear();
60  delete colorMap;
61 }
void clear()
Definition: G4THitsMap.hh:267

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 64 of file G4RTRun.hh.

64 { return colorMap; }

Here is the caller graph for this function:

void G4RTRun::Merge ( const G4Run aLocalRun)
virtual

Reimplemented from G4Run.

Definition at line 90 of file G4RTRun.cc.

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

Here is the call graph for this function:

void G4RTRun::RecordEvent ( const G4Event evt)
virtual

Reimplemented from G4Run.

Definition at line 63 of file G4RTRun.cc.

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

Here is the call graph for this function:


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