EDepSimUniformPositionGenerator.cc
Go to the documentation of this file.
1 #include <EDepSimLog.hh>
2 
4 
7 
9 
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 }
19 
21  return true;
22 }
static QCString name
Definition: declinfo.cpp:673
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.
Construct a module from components.
Definition: TG4HitSegment.h:10
#define EDepSimError(outStream)
Definition: EDepSimLog.hh:503
virtual G4LorentzVector GetPosition()
Return a candidate vertex.