20 for (
int i = 0;
i < 9; ++
i) {
23 reader->AddVariable(
"E" + std::to_string(
i + 1) +
"/(E1+E2+E3+E4+E6+E7+E8+E9)", &(
mx_.
rEn[
i]));
25 reader->AddVariable(
"E1+E2+E3+E4+E6+E7+E8+E9", &(
mx_.
sumE8));
26 for (
int i = 0;
i < 9; ++
i)
27 reader->AddVariable(
"iEta" + std::to_string(
i + 1), &(
mx_.
ieta[
i]));
28 for (
int i = 0;
i < 9; ++
i)
29 reader->AddVariable(
"iPhi" + std::to_string(
i + 1), &(
mx_.
iphi[
i]));
33 readerNoCrack = std::unique_ptr<TMVA::Reader>(
new TMVA::Reader(
"!Color:!Silent"));
34 readerCrack = std::unique_ptr<TMVA::Reader>(
new TMVA::Reader(
"!Color:!Silent"));
71 double neighTotEn = 0.;
75 std::vector<DetId> m3x3aroundDC = EcalClusterTools::matrixDetId(
topology_,
id, 1);
76 if (m3x3aroundDC.size() < 9) {
83 for (
auto const &theCells : m3x3aroundDC) {
87 int iPhiCentral = cell.
iphi();
89 if (iEtaCentral < 2 ||
std::abs(iEtaCentral - 25) < 2 ||
std::abs(iEtaCentral - 45) < 2 ||
90 std::abs(iEtaCentral - 65) < 2 || iEtaCentral > 83 || (
int(iPhiCentral + 0.5) % 20 == 0))
95 if (goS_it != hit_collection.
end() && cell !=
id) {
96 if (goS_it->energy() < single8Cut) {
100 neighTotEn += goS_it->energy();
101 mx_.
rEn[cellIndex] = goS_it->energy();
106 }
else if (cell ==
id) {
118 if (cellIndex > 0 && neighTotEn >= single8Cut * 8. && neighTotEn >= sum8Cut) {
119 bool allneighs =
true;
121 for (
unsigned int icell = 0; icell < 9; icell++) {
122 if (
mx_.
rEn[icell] < single8Cut && icell != 4) {
127 if (allneighs ==
true) {
std::array< float, 9 > iphi
T getParameter(std::string const &) const
void setParameters(const edm::ParameterSet &ps)
edm::FileInPath bdtWeightFileCracks_
constexpr bool null() const
is this a null id ?
edm::FileInPath bdtWeightFileNoCracks_
std::vector< EcalRecHit >::const_iterator const_iterator
const CaloTopology * topology_
int iphi() const
get the crystal iphi
EcalDeadChannelRecoveryBDTG()
Abs< T >::type abs(const T &t)
std::unique_ptr< TMVA::Reader > readerCrack
int ieta() const
get the crystal ieta
const_iterator end() const
std::array< float, 9 > ieta
TMVA::IMethod * loadTMVAWeights(TMVA::Reader *reader, const std::string &method, const std::string &weightFile, bool verbose=false)
double recover(const DetIdT id, const EcalRecHitCollection &hit_collection, double single8Cut, double sum8Cut, bool *acceptFlag)
iterator find(key_type k)
~EcalDeadChannelRecoveryBDTG()
std::string fullPath() const
std::unique_ptr< TMVA::Reader > readerNoCrack
void addVariables(TMVA::Reader *reader)
std::array< float, 9 > rEn