20 const std::string& name,
21 const IInterface* parent) :
22 base_class(
type, name, parent){
33 return StatusCode::SUCCESS;
47 ATH_MSG_DEBUG(
"read in " << (*in).size() <<
" neighborhoods");
50 CHECK(h_BDTScore.
record(std::make_unique<std::vector<float> >()));
53 auto eEmEg1BDTTOBs = std::make_unique<IOBitwise::eEmEg1BDTTOBContainer>();
55 for (
const auto nbhdTOB : *in) {
57 if (c_phi.empty()) {
continue;}
61 ap_int<BDT_ouput_width>* c_input = &input[0];
66 bdt.decision_function(c_input, scores);
67 if (msgLevel() <= MSG::DEBUG) {
70 for (
const auto& i : input) {
ss << i <<
' ';}
74 if (msgLevel() <= MSG::DEBUG) {
76 ss <<
"C BDT output: ";
77 for (
const auto& i : scores) {
ss << i <<
' ';}
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];
89 std::bitset<eEmEg1BDTTOB::s_eGamma1BDT_width> result;
96 result = std::bitset<eEmEg1BDTTOB::s_eGamma1BDT_width>{0xFF};
97 }
else if (BDT_int < -128) {
99 result = std::bitset<eEmEg1BDTTOB::s_eGamma1BDT_width>{0x00};
105 result[i] = BDT_bits[i];
113 h_BDTScore->push_back(result.to_ulong());
114 eEmEg1BDTTOBs->push_back(std::make_unique<IOBitwise::eEmEg1BDTTOB>(*nbhdTOB, result));
119 CHECK(h_eEmEg1BDTTOBs.
record(std::move(eEmEg1BDTTOBs)));
121 return StatusCode::SUCCESS;
127 return -(bitSet.to_ulong() + 1);
132 auto result = std::vector<double>();
148 result.at(0) = phi_center.at(c).m_e;
150 result.at(1) = std::max(phi_low.at(c).m_e, phi_high.at(c).m_e);
155 std::max({phi_center.at(c-
diff).m_e,
156 phi_center.at(c+
diff).m_e});
159 std::max({phi_low.at(c-
diff).m_e,
160 phi_low.at(c+
diff).m_e,
161 phi_high.at(c-
diff).m_e,
162 phi_high.at(c+
diff).m_e});
172 std::stringstream
ss;
173 ss <<
"Egamma1BDTAlgTool. name: " << name() <<
'\n'
#define CHECK(...)
Evaluate an expression and check for errors.
Header file to be included by clients of the Monitored infrastructure.
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
static const std::size_t s_eGamma1BDT_width
virtual const LArStripNeighborhood & Neighbourhood() const
const StripDataVector & phi_low() const
Returns a vector of strip cell e/eta/phi data for the low phi row of the neighborhood.
const StripDataVector & phi_center() const
Returns a vector of strip cell e/eta/phi data for the central phi row of the neighborhood.
const StripDataVector & phi_high() const
Returns a vector of strip cell e/eta/phi data for the central high row of the neighborhood.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
constexpr int fn_classes(int n_classes)
AlgTool to read in LArStripNeighborhoods, and run the eRatio Algorithm.
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)