Skip to content

Commit

Permalink
removed calls to 'clamp' and fixed compiler warnings for non-void fun…
Browse files Browse the repository at this point in the history
…ctions returning void (#153)
  • Loading branch information
infophysics authored May 8, 2022
1 parent 85133c3 commit efa399a
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/LArNEST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ namespace NEST
//-------------------------Alpha Yields-------------------------//
double LArNEST::GetAlphaTotalYields(double energy)
{
return 0;
}
double LArNEST::GetAlphaElectronYields(double efield)
{
Expand Down Expand Up @@ -343,7 +344,12 @@ namespace NEST
{
cerr << "\nWARNING: TEMPERATURE OUT OF RANGE (84-140 K) for vD\n";
cerr << "Using value at closest temp for a drift speed estimate\n";
Kelvin = (double)NESTcalc::clamp(int(Kelvin), 84, 140);
if (Kelvin < 84.) {
Kelvin = 84.;
}
else {
Kelvin = 140.;
}
}
for (size_t i = 0; i < fDriftParameters.A.size() - 1; i++)
{
Expand Down Expand Up @@ -440,7 +446,8 @@ namespace NEST
return LET;
}
std::vector<double> LArNEST::CalculateG2(bool verbosity)
{
{
return std::vector<double>();
}

//------------------------------------Legacy LArNEST------------------------------------//
Expand Down Expand Up @@ -584,7 +591,13 @@ namespace NEST
+ DokeBirksC) * (density / legacy_density_LAr);

//check against unphysicality resulting from rounding errors
return clamp(recombProb, 0., 1.);
if (recombProb < 0.0) {
recombProb = 0.0;
}
if (recombProb > 1.0) {
recombProb = 1.0;
}
return recombProb;
}
double LArNEST::LegacyGetLinearEnergyTransfer(double E)
{
Expand Down

0 comments on commit efa399a

Please sign in to comment.