57 std::map<const std::string, std::vector<float>>
maps_;
66 "seedEt",
"seedEnergy",
"seedEnergyEE",
"seedEnergyFH",
"seedEnergyBH",
67 "pcaEig1",
"pcaEig2",
"pcaEig3",
"pcaSig1",
"pcaSig2",
68 "pcaSig3",
"sigmaUU",
"sigmaVV",
"sigmaEE",
"sigmaPP",
69 "nLayers",
"firstLayer",
"lastLayer",
"e4oEtot",
"layerEfrac10",
70 "layerEfrac90",
"measuredDepth",
"expectedDepth",
"expectedSigma",
"depthCompatibility",
71 "caloIsoRing0",
"caloIsoRing1",
"caloIsoRing2",
"caloIsoRing3",
"caloIsoRing4",
76 radius_(iConfig.getParameter<double>(
"pcaRadius")) {
79 produces<edm::ValueMap<float>>(
key);
95 for (
auto&& kv :
maps_) {
97 kv.second.reserve(photonsH->size());
103 for (
const auto& pho : *photonsH) {
106 for (
auto&& kv : maps_) {
107 kv.second.push_back(0.);
114 for (
auto&& kv : maps_) {
115 kv.second.push_back(0.);
121 float measuredDepth, expectedDepth, expectedSigma;
122 float depthCompatibility =
123 phoIDHelper_->clusterDepthCompatibility(ld, measuredDepth, expectedDepth, expectedSigma);
128 float seed_tot_energy = ld.energyEE() + ld.energyFH() + ld.energyBH();
129 const double div_cosh_eta =
130 pho.superCluster()->seed()->position().rho() / pho.superCluster()->seed()->position().r();
131 maps_[
"seedEt"].push_back(seed_tot_energy * div_cosh_eta);
132 maps_[
"seedEnergy"].push_back(seed_tot_energy);
133 maps_[
"seedEnergyEE"].push_back(ld.energyEE());
134 maps_[
"seedEnergyFH"].push_back(ld.energyFH());
135 maps_[
"seedEnergyBH"].push_back(ld.energyBH());
139 maps_[
"pcaEig1"].push_back(
phoIDHelper_->eigenValues()(0));
140 maps_[
"pcaEig2"].push_back(
phoIDHelper_->eigenValues()(1));
141 maps_[
"pcaEig3"].push_back(
phoIDHelper_->eigenValues()(2));
153 maps_[
"nLayers"].push_back(ld.nLayers());
154 maps_[
"firstLayer"].push_back(ld.firstLayer());
155 maps_[
"lastLayer"].push_back(ld.lastLayer());
156 maps_[
"e4oEtot"].push_back(ld.e4oEtot());
157 maps_[
"layerEfrac10"].push_back(ld.layerEfrac10());
158 maps_[
"layerEfrac90"].push_back(ld.layerEfrac90());
161 maps_[
"measuredDepth"].push_back(measuredDepth);
162 maps_[
"expectedDepth"].push_back(expectedDepth);
163 maps_[
"expectedSigma"].push_back(expectedSigma);
164 maps_[
"depthCompatibility"].push_back(depthCompatibility);
167 maps_[
"caloIsoRing0"].push_back(
phoIDHelper_->getIsolationRing(0));
168 maps_[
"caloIsoRing1"].push_back(
phoIDHelper_->getIsolationRing(1));
169 maps_[
"caloIsoRing2"].push_back(
phoIDHelper_->getIsolationRing(2));
170 maps_[
"caloIsoRing3"].push_back(
phoIDHelper_->getIsolationRing(3));
171 maps_[
"caloIsoRing4"].push_back(
phoIDHelper_->getIsolationRing(4));
179 <<
"We have a miscoded value map producer, since map size changed";
182 for (
auto&& kv : maps_) {
184 if (kv.second.size() != photonsH->size()) {
186 <<
"We have a miscoded value map producer, since the variable " << kv.first <<
" wasn't filled.";
189 auto out = std::make_unique<edm::ValueMap<float>>();
191 filler.insert(photonsH, kv.second.begin(), kv.second.end());
209 desc.
add<
double>(
"pcaRadius", 3.0);
211 desc.
add<std::vector<double>>(
"dEdXWeights")
212 ->setComment(
"This must be copied from dEdX_weights in RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi");
213 desc.
add<
unsigned int>(
"isoNRings", 5);
214 desc.
add<
double>(
"isoDeltaR", 0.15);
215 desc.
add<
double>(
"isoDeltaRmin", 0.0);
219 descriptions.
add(
"hgcalPhotonIDValueMap", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~HGCalPhotonIDValueMapProducer() override
std::unique_ptr< HGCalEgammaIDHelper > phoIDHelper_
void produce(edm::Event &, const edm::EventSetup &) override
HGCalPhotonIDValueMapProducer(const edm::ParameterSet &)
void beginStream(edm::StreamID) override
#define DEFINE_FWK_MODULE(type)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static const std::vector< std::string > valuesProduced_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< edm::View< reco::Photon > > photonsToken_
std::map< const std::string, std::vector< float > > maps_
void endStream() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)