6 if(err.size()!=0 && err.size()!=v.size())
7 throw std::runtime_error(
"ERROR in FlashHypothesisVectorSetter: Vector sizes not equal");
30 if(
GetTotalPEs() < std::numeric_limits<float>::epsilon() )
return;
32 const float PE_ratio = totalPE_target/
GetTotalPEs();
33 for(
size_t i_opdet=0; i_opdet<
_NPEs_Vector.size(); i_opdet++){
63 _total_hyp = _prompt_hyp + _late_hyp;
67 _prompt_hyp.Normalize(totalPE_target*_prompt_frac);
68 _late_hyp.Normalize(totalPE_target*(1.-_prompt_frac));
74 if ( std::abs(f-0.0) < std::numeric_limits<float>::epsilon() ||
75 std::abs(f-1.0) < std::numeric_limits<float>::epsilon() ||
79 throw std::runtime_error(
"ERROR in FlashHypothesisCollection: Input fraction is not in valid range.");
84 _total_hyp = _prompt_hyp + _late_hyp;
85 const float total_pe = _total_hyp.GetTotalPEs();
86 if(total_pe > std::numeric_limits<float>::epsilon())
87 _prompt_frac = _prompt_hyp.GetTotalPEs() / total_pe;
94 std::cout <<
"PromptHyp:" << std::endl;
96 std::cout <<
"LateHyp:" << std::endl;
98 std::cout <<
"TotalHyp:" << std::endl;
100 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)
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)
void Normalize(float totalPEs)