42 ATH_MSG_DEBUG(
"read in " << (*in).size() <<
" neighborhoods");
45 ap_int<16> secondMax = 0;
48 CHECK(h_eRatio.
record(std::make_unique<std::vector<float> >()));
50 CHECK(h_eRatioSimple.
record(std::make_unique<std::vector<float> >()));
52 for (
const auto nbhdTOB : *in) {
54 if (msgLevel() <= MSG::DEBUG) {
56 ss <<
"eRatio input: ";
57 for (
const auto& i : c_phi) {
ss << i <<
' ';}
65 if (msgLevel() <= MSG::DEBUG) {
67 ss <<
"eRatio input: ";
68 for (
const auto& i : input) {
ss << i <<
' ';}
73 if(input.size() == 51){
80 std::vector<ap_int<16>> secondPeak;
98 auto result = std::max_element(secondPeak.begin(), secondPeak.end());
100 << std::distance(secondPeak.begin(),
result)
101 <<
" has value " << *
result);
107 if(peak > 0 || secondMax > 0){
108 auto eRatio =
static_cast< float >(peak - secondMax)/
static_cast< float >(peak + secondMax);
109 h_eRatio->push_back(eRatio);
112 auto eRatioSimple =
static_cast< float >(secondMax)/
static_cast< float >(peak);
113 h_eRatioSimple->push_back(eRatioSimple);
119 return StatusCode::SUCCESS;
123 const ap_int<16> peak,
126 const ap_int<16> noiseMargin)
const {
131 ap_int<16> lastEnergy = peak;
132 ap_int<16> secondPeak = 0;
136 if(startCell > endCell) {
143 for (
auto itr = input.begin() + startCell; itr != input.begin() + endCell + direction; itr+=direction){
145 ATH_MSG_DEBUG(
"Input is " << *itr <<
" last energy is " << lastEnergy);
146 if(ascending==0 && *itr>lastEnergy && *itr-lastEnergy > noiseMargin){
147 ATH_MSG_DEBUG(
"We are going up now " << *itr <<
" is more then " << lastEnergy);
151 }
else if(ascending==1 && lastEnergy>*itr && lastEnergy-*itr > noiseMargin){
152 ATH_MSG_DEBUG(
"We are past the top " << *itr <<
" is less than " << lastEnergy);
153 secondPeak = lastEnergy;