15 std::cerr <<
m_className <<
"::SetClusterDensity:\n"
16 <<
" Cluster density (number of clusters per cm)"
17 <<
" must be positive.\n";
29 <<
" Stopping power (average energy loss [eV] per cm)"
30 <<
" must be positive.\n";
40 const double t0,
const double dx0,
const double dy0,
45 <<
" Sensor is not defined.\n";
54 std::cerr <<
" No medium at initial position.\n";
67 const double d = sqrt(dx0 * dx0 + dy0 * dy0 + dz0 * dz0);
80 double& tcls,
int& n,
double& e,
double& extra) {
107 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)
Abstract base class for track generation.
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).