Public Member Functions | List of all members
EDepSim::UniformPositionGenerator Class Reference

#include <EDepSimUniformPositionGenerator.hh>

Inheritance diagram for EDepSim::UniformPositionGenerator:
EDepSim::VConstrainedPositionGenerator EDepSim::VPositionGenerator

Public Member Functions

 UniformPositionGenerator (const G4String &name)
 
virtual ~UniformPositionGenerator ()
 
virtual G4LorentzVector GetPosition ()
 Return a candidate vertex. More...
 
virtual bool ForcePosition ()
 
- Public Member Functions inherited from EDepSim::VConstrainedPositionGenerator
 VConstrainedPositionGenerator (const G4String &name)
 
virtual ~VConstrainedPositionGenerator ()
 
void SetVolumeName (const G4String &volume)
 Set the name of the volume to be sampled for a vertex. More...
 
void ClearPositionTests (void)
 Clear the current set of vertex checks. More...
 
void CheckVolumeName (const G4String &name)
 
void CheckNotVolumeName (const G4String &name)
 
void CheckVolumeMaterial (const G4String &name)
 Check that the vertex is inside of a material specified by name. More...
 
void CheckNotVolumeMaterial (const G4String &name)
 Check that the vertex is not inside of a material specified by name. More...
 
void CheckMinX (double x)
 Check that the vertex X position is greater than some value. More...
 
void CheckMaxX (double x)
 Check that the vertex X position is less than some value. More...
 
void CheckMinY (double y)
 Check that the vertex Y position is greater than some value. More...
 
void CheckMaxY (double y)
 Check that the vertex Y position is less than some value. More...
 
void CheckMinZ (double z)
 Check that the vertex Z position is greater than some value. More...
 
void CheckMaxZ (double z)
 Check that the vertex Z position is less than some value. More...
 
- Public Member Functions inherited from EDepSim::VPositionGenerator
 VPositionGenerator (const G4String &name)
 
virtual ~VPositionGenerator ()
 
G4String GetName () const
 Return the name of the generator. More...
 

Additional Inherited Members

- Public Types inherited from EDepSim::VConstrainedPositionGenerator
typedef std::vector< PositionTest * > PositionTests
 
- Protected Member Functions inherited from EDepSim::VConstrainedPositionGenerator
virtual bool ValidPosition (const G4LorentzVector &vtx)
 Return true if the vertex is valid. This is used in the derived class. More...
 
G4LorentzVector TrialPosition ()
 Generate a trial position uniformly in the sample box. More...
 

Detailed Description

Definition at line 8 of file EDepSimUniformPositionGenerator.hh.

Constructor & Destructor Documentation

EDepSim::UniformPositionGenerator::UniformPositionGenerator ( const G4String &  name)
EDepSim::UniformPositionGenerator::~UniformPositionGenerator ( )
virtual

Definition at line 8 of file EDepSimUniformPositionGenerator.cc.

8 {}

Member Function Documentation

bool EDepSim::UniformPositionGenerator::ForcePosition ( )
virtual

Flag if the vertex should be forced to the candidate vertex returned by GetPosition().

Reimplemented from EDepSim::VConstrainedPositionGenerator.

Definition at line 20 of file EDepSimUniformPositionGenerator.cc.

20  {
21  return true;
22 }
G4LorentzVector EDepSim::UniformPositionGenerator::GetPosition ( )
virtual

Return a candidate vertex.

Implements EDepSim::VPositionGenerator.

Definition at line 10 of file EDepSimUniformPositionGenerator.cc.

10  {
11  for (int finiteLoop = 0; finiteLoop<100000; ++finiteLoop) {
12  G4LorentzVector vtx = TrialPosition();
13  if (ValidPosition(vtx)) return vtx;
14  }
15  EDepSimError("EDepSim::UniformPositionGenerator::GetPosition:"
16  << " No valid position found");
17  throw;
18 }
virtual bool ValidPosition(const G4LorentzVector &vtx)
Return true if the vertex is valid. This is used in the derived class.
G4LorentzVector TrialPosition()
Generate a trial position uniformly in the sample box.
#define EDepSimError(outStream)
Definition: EDepSimLog.hh:503

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