6 #include "../Utilities/dump.h"
7 #include "../Utilities/dump.icc"
11 #include "../IO/eEmEg1eRatioTOB.h"
16 const std::string&
name,
17 const IInterface*
parent) :
28 return StatusCode::SUCCESS;
42 ATH_MSG_DEBUG(
"read in " << (*in).size() <<
" neighborhoods");
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;
148 if(startCell > endCell) {
155 for (
auto itr = input.begin() + startCell; itr != input.begin() + endCell + direction; itr+=direction){
157 ATH_MSG_DEBUG(
"Input is " << *itr <<
" last energy is " << lastEnergy);
158 if(
ascending==0 && *itr>lastEnergy && *itr-lastEnergy > noiseMargin){
159 ATH_MSG_DEBUG(
"We are going up now " << *itr <<
" is more then " << lastEnergy);
163 }
else if(
ascending==1 && lastEnergy>*itr && lastEnergy-*itr > noiseMargin){
164 ATH_MSG_DEBUG(
"We are past the top " << *itr <<
" is less than " << lastEnergy);
165 if(secondPeak<*itr) secondPeak = lastEnergy;
179 auto result = std::vector<double>();
208 std::stringstream
ss;
209 ss <<
"Egamma1eRatioAlgTool. name: " <<
name() <<
'\n'