Newer
Older
TB_Chris / TbUT / src / .svn / text-base / TbUTTresholdProvider.cpp.svn-base
@iaro iaro on 9 May 2016 901 bytes first attempt of automated anal
  1. /*
  2. * TbUTTresholdProvider.cpp
  3. *
  4. * Created on: Jan 4, 2015
  5. * Author: ADendek
  6. */
  7.  
  8. #include "TbUTTresholdProvider.h"
  9.  
  10. using namespace TbUT;
  11.  
  12. TresholdProvider::TresholdProvider(const std::string& p_noiseFile,
  13. const double& p_lowThresholdMultiplicity,
  14. const double& p_highThresholdMultiplicity):
  15. m_noiseFile(p_noiseFile),
  16. m_lowThresholdMultiplicity(p_lowThresholdMultiplicity),
  17. m_highThresholdMultiplicity(p_highThresholdMultiplicity),
  18. m_noise()
  19. {
  20. }
  21.  
  22. void TresholdProvider::retreiveTresholds()
  23. try{
  24. m_noise.retreiveNoiseFromFile(m_noiseFile);
  25. }catch(Noise::NoiseCalculatorError& err){
  26. throw ThresholdProviderError(err.what());
  27. }
  28.  
  29. double TresholdProvider::getLowClusterThreshold(int p_channel)
  30. {
  31. return (m_noise[p_channel]*m_lowThresholdMultiplicity);
  32. }
  33.  
  34. double TresholdProvider::getHighClusterThreshold(int p_channel)
  35. {
  36. return (m_noise[p_channel]*m_highThresholdMultiplicity);
  37. }