Skip to content
Snippets Groups Projects
Commit 45423eeb authored by Michael Duehrssen-Debling's avatar Michael Duehrssen-Debling
Browse files

FastCaloSim: use keV unit in TFCSEnergyInterpolationSpline

parent 84bbe25e
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,19 @@ ...@@ -13,6 +13,19 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#ifdef __FastCaloSimStandAlone__
namespace Gaudi {
namespace Units {
constexpr double megaelectronvolt = 1.;
constexpr double kiloelectronvolt = 1.e-3 * megaelectronvolt;
constexpr double keV = kiloelectronvolt;
}
}
#else
#include "GaudiKernel/SystemOfUnits.h"
#endif
//============================================= //=============================================
//======= TFCSEnergyInterpolation ========= //======= TFCSEnergyInterpolation =========
//============================================= //=============================================
...@@ -42,7 +55,7 @@ FCSReturnCode TFCSEnergyInterpolationSpline::simulate(TFCSSimulationState& simul ...@@ -42,7 +55,7 @@ FCSReturnCode TFCSEnergyInterpolationSpline::simulate(TFCSSimulationState& simul
if(OnlyScaleEnergy()) Einit=simulstate.E(); if(OnlyScaleEnergy()) Einit=simulstate.E();
else Einit=Ekin; else Einit=Ekin;
//catch very small values of Ekin (use 1 keV here) and fix the spline lookup to the 1keV value //catch very small values of Ekin (use 1 keV here) and fix the spline lookup to the 1keV value
const float logEkin=(Ekin>0.001?TMath::Log(Ekin):TMath::Log(0.001)); const float logEkin=(Ekin>Gaudi::Units::keV?TMath::Log(Ekin):TMath::Log(Gaudi::Units::keV));
if(logEkin<m_spline.GetXmin()) { if(logEkin<m_spline.GetXmin()) {
Emean=m_spline.Eval(m_spline.GetXmin())*Einit; Emean=m_spline.Eval(m_spline.GetXmin())*Einit;
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment