53 mvaFileXgbB_(
config.getParameter<
edm::FileInPath>(
"mvaFileXgbB")),
54 mvaFileXgbE_(
config.getParameter<
edm::FileInPath>(
"mvaFileXgbE")),
55 mvaNTreeLimitB_(
config.getParameter<unsigned
int>(
"mvaNTreeLimitB")),
56 mvaNTreeLimitE_(
config.getParameter<unsigned
int>(
"mvaNTreeLimitE")),
57 mvaThresholdEt_(
config.getParameter<double>(
"mvaThresholdEt")) {
60 produces<reco::RecoEcalCandidateIsolationMap>();
69 edm::InputTag(
"hltEgammaClusterShapeUnseeded",
"sigmaIEtaIEta5x5NoiseCleaned"));
73 "mvaFileXgbB",
edm::FileInPath(
"RecoEgamma/PhotonIdentification/data/XGBoost/Photon_NTL_168_Barrel_v1.bin"));
75 "mvaFileXgbE",
edm::FileInPath(
"RecoEgamma/PhotonIdentification/data/XGBoost/Photon_NTL_158_Endcap_v1.bin"));
76 desc.add<
unsigned int>(
"mvaNTreeLimitB", 168);
77 desc.add<
unsigned int>(
"mvaNTreeLimitE", 158);
78 desc.add<
double>(
"mvaThresholdEt", 0);
83 const auto& recCollection =
event.getHandle(
candToken_);
89 const auto& hoEMap =
event.getHandle(
tokenHoE_);
95 const auto& e2x2Map =
event.getHandle(
tokenE2x2_);
98 const auto& isoMap =
event.getHandle(
tokenIso_);
103 for (
size_t i = 0;
i < recCollection->size();
i++) {
106 float etaSC = ref->eta();
108 float scEnergy = ref->superCluster()->energy();
109 float r9 = (*r9Map).find(ref)->val;
110 float hoe = (*hoEMap).find(ref)->val / scEnergy;
111 float siEtaiEta = (*sigmaiEtaiEtaMap).find(ref)->val;
112 float e2x2 = (*e2x2Map).find(ref)->val;
113 float s4 = e2x2 / scEnergy;
114 float iso = (*isoMap).find(ref)->val;
116 float rawEnergy = ref->superCluster()->rawEnergy();
117 float etaW = ref->superCluster()->etaWidth();
118 float phiW = ref->superCluster()->phiWidth();
120 float scEt = scEnergy / cosh(etaSC);
124 float xgbScore = -100.;
132 mvaScoreMap.
insert(ref, xgbScore);
134 event.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(mvaScoreMap));
std::unique_ptr< PhotonXGBoostEstimator > mvaEstimatorB_
~PhotonXGBoostProducer()=default
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< reco::RecoEcalCandidateIsolationMap > tokenR9_
const edm::FileInPath mvaFileXgbB_
edm::AssociationMap< edm::OneToValue< std::vector< reco::RecoEcalCandidate >, float > > RecoEcalCandidateIsolationMap
const edm::EDGetTokenT< reco::RecoEcalCandidateIsolationMap > tokenSigmaiEtaiEta_
const unsigned mvaNTreeLimitB_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::FileInPath mvaFileXgbE_
const unsigned mvaNTreeLimitE_
const double mvaThresholdEt_
PhotonXGBoostProducer(edm::ParameterSet const &)
Abs< T >::type abs(const T &t)
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const override
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< reco::RecoEcalCandidateIsolationMap > tokenE2x2_
std::unique_ptr< PhotonXGBoostEstimator > mvaEstimatorE_
void insert(const key_type &k, const data_type &v)
insert an association
const edm::EDGetTokenT< reco::RecoEcalCandidateIsolationMap > tokenIso_
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > candToken_
const edm::EDGetTokenT< reco::RecoEcalCandidateIsolationMap > tokenHoE_