32 {
34
35
36
37 auto in =
39 ctx);
41
42 ATH_MSG_DEBUG(
"read in " << (*in).size() <<
" neighborhoods");
43
44 ap_int<16> peak = 0;
45 ap_int<16> secondMax = 0;
46
47 SG::WriteHandle<std::vector<float> > h_eRatio(
m_eRatioKey, ctx);
48 CHECK(h_eRatio.record(std::make_unique<std::vector<float> >()));
50 CHECK(h_eRatioSimple.record(std::make_unique<std::vector<float> >()));
51
52 for (const auto nbhdTOB : *in) {
54 if (msgLevel() <= MSG::DEBUG) {
56 ss <<
"eRatio input: ";
57 for (
const auto& i : c_phi) {
ss <<
i <<
' ';}
59 }
60
62
63
64
65 if (msgLevel() <= MSG::DEBUG) {
67 ss <<
"eRatio input: ";
68 for (
const auto& i : input) {
ss <<
i <<
' ';}
70 }
71
72
73 if(
input.size() == 51){
74
77
78
79
80 std::vector<ap_int<16>> secondPeak;
81 secondPeak.resize(6);
82
83
84 int noiseMargin = 1;
85
87
89
91
93
95
97
98 auto result = std::max_element(secondPeak.begin(), secondPeak.end());
100 << std::distance(secondPeak.begin(), result)
101 << " has value " << *result);
102
105
106
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);
111
112 auto eRatioSimple = static_cast< float >(secondMax)/static_cast< float >(peak);
113 h_eRatioSimple->push_back(eRatioSimple);
115 }
116 }
117 }
118
119 return StatusCode::SUCCESS;
120 }
static std::vector< ap_int< 16 > > digitize16(const std::vector< double > &v)