33 const EventContext& ctx)
const {
36 if (dc){dc->collect(*
this,
"start");}
44 ATH_MSG_DEBUG(
"read in " << (*in).size() <<
" neighborhoods");
47 ap_int<16> secondMax = 0;
50 CHECK(h_eRatio.
record(std::make_unique<std::vector<float> >()));
52 CHECK(h_eRatioSimple.
record(std::make_unique<std::vector<float> >()));
54 for (
const auto nbhdTOB : *in) {
56 if (msgLevel() <= MSG::DEBUG) {
58 ss <<
"eRatio input: ";
59 for (
const auto& i : c_phi) {
ss << i <<
' ';}
67 if (msgLevel() <= MSG::DEBUG) {
69 ss <<
"eRatio input: ";
70 for (
const auto& i : input) {
ss << i <<
' ';}
75 if(input.size() == 51){
82 std::vector<ap_int<16>> secondPeak;
100 auto result = std::max_element(secondPeak.begin(), secondPeak.end());
102 << std::distance(secondPeak.begin(), result)
103 <<
" has value " << *result);
109 if(peak > 0 || secondMax > 0){
110 auto eRatio =
static_cast< float >(peak - secondMax)/
static_cast< float >(peak + secondMax);
111 h_eRatio->push_back(eRatio);
114 auto eRatioSimple =
static_cast< float >(secondMax)/
static_cast< float >(peak);
115 h_eRatioSimple->push_back(eRatioSimple);
121 if (dc){dc->collect(*
this,
"end");}
123 return StatusCode::SUCCESS;
127 const ap_int<16> peak,
130 const ap_int<16> noiseMargin)
const {
135 ap_int<16> lastEnergy = peak;
136 ap_int<16> secondPeak = 0;
140 if(startCell > endCell) {
147 for (
auto itr = input.begin() + startCell; itr != input.begin() + endCell + direction; itr+=direction){
149 ATH_MSG_DEBUG(
"Input is " << *itr <<
" last energy is " << lastEnergy);
150 if(ascending==0 && *itr>lastEnergy && *itr-lastEnergy > noiseMargin){
151 ATH_MSG_DEBUG(
"We are going up now " << *itr <<
" is more then " << lastEnergy);
155 }
else if(ascending==1 && lastEnergy>*itr && lastEnergy-*itr > noiseMargin){
156 ATH_MSG_DEBUG(
"We are past the top " << *itr <<
" is less than " << lastEnergy);
157 secondPeak = lastEnergy;
171 auto result = std::vector<double>();
185 std::transform(std::begin(phi_high), std::end(phi_high), std::back_inserter(result), [](
const auto& high) {
188 std::transform(std::begin(phi_center), std::end(phi_center), std::back_inserter(result), [](
const auto& center) {
191 std::transform(std::begin(phi_low), std::end(phi_low), std::back_inserter(result), [](
const auto& low) {