42 ATH_MSG_DEBUG(
"read in " << (*in).size() <<
" neighborhoods");
45 ap_int<16> secondMax = 0;
48 CHECK(h_eRatioResult.record(std::make_unique<IOBitwise::IeEmEg1eRatioTOBContainer>()));
50 CHECK(h_eRatio.record(std::make_unique<std::vector<int> >()));
52 CHECK(h_eRatioSimple.record(std::make_unique<std::vector<float> >()));
54 for (
const auto nbhdTOB : *in) {
58 ss <<
"eRatio input: ";
59 for (
const auto&
i : c_phi) {
ss <<
i <<
' ';}
69 ss <<
"eRatio input: ";
70 for (
const auto&
i :
input) {
ss <<
i <<
' ';}
80 std::vector<ap_int<16>> secondPeak;
98 auto result = std::max_element(secondPeak.begin(), secondPeak.end());
101 <<
" has value " << *
result);
107 if(peak > 0 || secondMax > 0){
108 auto eRatio =
static_cast< float >(peak - secondMax)/
static_cast< float >(peak + secondMax);
112 auto eRatioSimple =
static_cast< float >(secondMax)/
static_cast< float >(peak);
113 h_eRatioSimple->push_back(eRatioSimple);
117 std::bitset<IOBitwise::IeEmEg1eRatioTOB::s_eGamma1eRatio_width>
result = 0;
119 if(eRatio >= 0. && eRatio <= 1.0){
122 h_eRatio->push_back((
int)(eRatio*eRatioPower));
127 h_eRatioResult->push_back(std::make_unique<IOBitwise::eEmEg1eRatioTOB>(*nbhdTOB,
result));
131 return StatusCode::SUCCESS;