58 std::map<const std::string, std::vector<float>>
maps_;
67 "ecOrigEt",
"ecOrigEnergy",
"ecEt",
68 "ecEnergy",
"ecEnergyEE",
"ecEnergyFH",
69 "ecEnergyBH",
"pcaEig1",
"pcaEig2",
70 "pcaEig3",
"pcaSig1",
"pcaSig2",
71 "pcaSig3",
"pcaAxisX",
"pcaAxisY",
72 "pcaAxisZ",
"pcaPositionX",
"pcaPositionY",
73 "pcaPositionZ",
"sigmaUU",
"sigmaVV",
74 "sigmaEE",
"sigmaPP",
"nLayers",
75 "firstLayer",
"lastLayer",
"e4oEtot",
76 "layerEfrac10",
"layerEfrac90",
"measuredDepth",
77 "expectedDepth",
"expectedSigma",
"depthCompatibility",
78 "caloIsoRing0",
"caloIsoRing1",
"caloIsoRing2",
79 "caloIsoRing3",
"caloIsoRing4",
83 : electronsToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"electrons"))),
84 radius_(iConfig.getParameter<double>(
"pcaRadius")) {
87 produces<edm::ValueMap<float>>(
key);
90 eIDHelper_ = std::make_unique<HGCalEgammaIDHelper>(iConfig, consumesCollector());
102 for (
auto&& kv :
maps_) {
104 kv.second.reserve(electronsH->size());
110 for (
const auto&
electron : *electronsH) {
113 for (
auto&& kv :
maps_) {
114 kv.second.push_back(0.);
121 for (
auto&& kv :
maps_) {
122 kv.second.push_back(0.);
128 float measuredDepth, expectedDepth, expectedSigma;
129 float depthCompatibility =
eIDHelper_->clusterDepthCompatibility(ld, measuredDepth, expectedDepth, expectedSigma);
134 const auto* eleCluster =
electron.electronCluster().get();
135 const double sinTheta = eleCluster->position().rho() / eleCluster->position().r();
136 maps_[
"ecOrigEt"].push_back(eleCluster->energy() * sinTheta);
137 maps_[
"ecOrigEnergy"].push_back(eleCluster->energy());
140 float ec_tot_energy = ld.energyEE() + ld.energyFH() + ld.energyBH();
141 maps_[
"ecEt"].push_back(ec_tot_energy * sinTheta);
142 maps_[
"ecEnergy"].push_back(ec_tot_energy);
143 maps_[
"ecEnergyEE"].push_back(ld.energyEE());
144 maps_[
"ecEnergyFH"].push_back(ld.energyFH());
145 maps_[
"ecEnergyBH"].push_back(ld.energyBH());
169 maps_[
"nLayers"].push_back(ld.nLayers());
170 maps_[
"firstLayer"].push_back(ld.firstLayer());
171 maps_[
"lastLayer"].push_back(ld.lastLayer());
172 maps_[
"e4oEtot"].push_back(ld.e4oEtot());
173 maps_[
"layerEfrac10"].push_back(ld.layerEfrac10());
174 maps_[
"layerEfrac90"].push_back(ld.layerEfrac90());
177 maps_[
"measuredDepth"].push_back(measuredDepth);
178 maps_[
"expectedDepth"].push_back(expectedDepth);
179 maps_[
"expectedSigma"].push_back(expectedSigma);
180 maps_[
"depthCompatibility"].push_back(depthCompatibility);
194 <<
"We have a miscoded value map producer, since map size changed";
197 for (
auto&& kv :
maps_) {
199 if (kv.second.size() != electronsH->size()) {
201 <<
"We have a miscoded value map producer, since the variable " << kv.first <<
" wasn't filled.";
204 auto out = std::make_unique<edm::ValueMap<float>>();
206 filler.insert(electronsH, kv.second.begin(), kv.second.end());
224 desc.add<
double>(
"pcaRadius", 3.0);
226 desc.add<std::vector<double>>(
"dEdXWeights")
227 ->setComment(
"This must be copied from dEdX_weights in RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi");
228 desc.add<
unsigned int>(
"isoNRings", 5);
229 desc.add<
double>(
"isoDeltaR", 0.15);
230 desc.add<
double>(
"isoDeltaRmin", 0.0);
235 descriptions.
add(
"hgcalElectronIDValueMap",
desc);
~HGCalElectronIDValueMapProducer() override
#define DEFINE_FWK_MODULE(type)
std::unique_ptr< HGCalEgammaIDHelper > eIDHelper_
void endStream() override
std::map< const std::string, std::vector< float > > maps_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static const std::vector< std::string > valuesProduced_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronsToken_
HGCalElectronIDValueMapProducer(const edm::ParameterSet &)
void beginStream(edm::StreamID) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void produce(edm::Event &, const edm::EventSetup &) override