8 if(err.size()!=0 && err.size()!=v.size())
9 throw std::runtime_error(
"ERROR in FlashHypothesisVectorSetter: Vector sizes not equal");
32 if(
GetTotalPEs() < std::numeric_limits<float>::epsilon() )
return;
34 const float PE_ratio = totalPE_target/
GetTotalPEs();
35 for(
size_t i_opdet=0; i_opdet<
_NPEs_Vector.size(); i_opdet++){
65 _total_hyp = _prompt_hyp + _late_hyp;
69 _prompt_hyp.Normalize(totalPE_target*_prompt_frac);
70 _late_hyp.Normalize(totalPE_target*(1.-_prompt_frac));
76 if (
std::abs(f-0.0) < std::numeric_limits<float>::epsilon() ||
77 std::abs(f-1.0) < std::numeric_limits<float>::epsilon() ||
81 throw std::runtime_error(
"ERROR in FlashHypothesisCollection: Input fraction is not in valid range.");
86 _total_hyp = _prompt_hyp + _late_hyp;
87 const float total_pe = _total_hyp.GetTotalPEs();
88 if(total_pe > std::numeric_limits<float>::epsilon())
89 _prompt_frac = _prompt_hyp.GetTotalPEs() / total_pe;
102 std::cout <<
"PromptFraction: " << _prompt_frac <<
std::endl;
void SetHypothesisVectorAndErrorVector(std::vector< float > v, std::vector< float > err=std::vector< float >(0))
size_t GetVectorSize() const
float GetTotalPEsError() const
std::vector< float > _NPEs_ErrorVector
void SetHypothesisAndError(size_t i_opdet, float pe, float err=-999)
float GetTotalPEs() const
float const & GetHypothesisError(size_t i_opdet) const
void SetTotalHypAndPromptFraction(const FlashHypothesis &total, float frac)
void SetHypothesisError(size_t i_opdet, float err)
void err(const char *fmt,...)
std::vector< float > _NPEs_Vector
void SetPromptHypAndPromptFraction(const FlashHypothesis &prompt, float frac)
float const & GetHypothesis(size_t i_opdet) const
void Normalize(float const &totalPE_target)
void SetHypothesis(size_t i_opdet, float pe)
QTextStream & endl(QTextStream &s)
void Normalize(float totalPEs)