37 {
39
40
41
42 auto in =
44 ctx);
46
47 ATH_MSG_DEBUG(
"read in " << (*in).size() <<
" neighborhoods");
48
49 SG::WriteHandle<std::vector<float> > h_BDTScore(
m_BDTScoreKey, ctx);
50 CHECK(h_BDTScore.record(std::make_unique<std::vector<float> >()));
51
52
53 auto eEmEg1BDTTOBs = std::make_unique<IOBitwise::eEmEg1BDTTOBContainer>();
54
55 for (const auto nbhdTOB : *in) {
57 if (c_phi.empty()) {continue;}
59
61 ap_int<BDT_ouput_width>* c_input = &
input[0];
62
64
65
66 bdt.decision_function(c_input, scores);
67 if (msgLevel() <= MSG::DEBUG) {
70 for (
const auto& i : input) {
ss <<
i <<
' ';}
72 }
73
74 if (msgLevel() <= MSG::DEBUG) {
76 ss <<
"C BDT output: ";
77 for (
const auto& i : scores) {
ss <<
i <<
' ';}
79 }
80
81
82 std::bitset<BDT_ouput_width> BDT_bits;
83 for (
int i=0;
i<scores[0].length();
i++){
84 BDT_bits[
i] = scores[0][
i];
85 }
87
88
89 std::bitset<eEmEg1BDTTOB::s_eGamma1BDT_width>
result;
90
93
94 if(BDT_int >= 128) {
95
96 result = std::bitset<eEmEg1BDTTOB::s_eGamma1BDT_width>{0xFF};
97 } else if (BDT_int < -128) {
98
99 result = std::bitset<eEmEg1BDTTOB::s_eGamma1BDT_width>{0x00};
100 } else {
101
102
106 }
107 }
108
111
112
113 h_BDTScore->push_back(
result.to_ulong());
114 eEmEg1BDTTOBs->push_back(std::make_unique<IOBitwise::eEmEg1BDTTOB>(*nbhdTOB, result));
115 }
116
117
119 CHECK(h_eEmEg1BDTTOBs.record(std::move(eEmEg1BDTTOBs)));
120
121 return StatusCode::SUCCESS;
122 }
static const std::size_t s_eGamma1BDT_width
constexpr int fn_classes(int n_classes)
static const BDT::BDT< n_trees, n_classes, input_arr_t, score_t, threshold_t > bdt
static const int n_features
ap_fixed< 10, 5 > score_t
static const int n_classes
static std::vector< ap_int< 10 > > digitize10(const std::vector< double > &v)