22 m_useEqualSpacing(false) {
30 std::cerr <<
m_className <<
"::SetClusterDensity:\n"
31 <<
" Cluster density (number of clusters per cm)"
32 <<
" must be positive.\n";
45 <<
" Stopping power (average energy loss [eV] per cm)"
46 <<
" must be positive.\n";
56 const double t0,
const double dx0,
const double dy0,
62 <<
" Sensor is not defined.\n";
71 std::cerr <<
" No medium at initial position.\n";
84 const double d = sqrt(dx0 * dx0 + dy0 * dy0 + dz0 * dz0);
97 double& tcls,
int& n,
double& e,
double& extra) {
125 std::cout <<
m_className <<
"::GetCluster: Particle left the medium.\n";
Abstract base class for media.
bool GetMedium(const double x, const double y, const double z, Medium *&medium)
Get the medium at (x, y, z).
void SetStoppingPower(const double dedx)
Set the stopping power (dE/dx).
virtual double GetClusterDensity()
virtual bool GetCluster(double &xcls, double &ycls, double &zcls, double &tcls, int &n, double &e, double &extra)
virtual double GetStoppingPower()
Get the stopping power (mean energy loss [eV] per cm).
void SetClusterDensity(const double d)
Set the cluster density (inverse mean free path).
TrackSimple()
Constructor.
virtual bool NewTrack(const double x0, const double y0, const double z0, const double t0, const double dx0, const double dy0, const double dz0)
void RndmDirection(double &dx, double &dy, double &dz, const double length=1.)
Draw a random (isotropic) direction vector.
double RndmUniformPos()
Draw a random number uniformly distributed in the range (0, 1).