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<
edm::
View<
reco::GsfElectron>>(iConfig.getParameter<
edm::
InputTag>(
"electrons"))),
84 radius_(iConfig.getParameter<double>(
"pcaRadius")) {
87 produces<edm::ValueMap<float>>(
key);
103 for (
auto&& kv :
maps_) {
105 kv.second.reserve(electronsH->size());
111 for (
const auto&
electron : *electronsH) {
114 for (
auto&& kv :
maps_) {
115 kv.second.push_back(0.);
122 for (
auto&& kv :
maps_) {
123 kv.second.push_back(0.);
129 float measuredDepth, expectedDepth, expectedSigma;
130 float depthCompatibility =
eIDHelper_->clusterDepthCompatibility(ld, measuredDepth, expectedDepth, expectedSigma);
135 const auto* eleCluster =
electron.electronCluster().get();
136 const double sinTheta = eleCluster->position().rho() / eleCluster->position().r();
137 maps_[
"ecOrigEt"].push_back(eleCluster->energy() * sinTheta);
138 maps_[
"ecOrigEnergy"].push_back(eleCluster->energy());
141 float ec_tot_energy = ld.energyEE() + ld.energyFH() + ld.energyBH();
142 maps_[
"ecEt"].push_back(ec_tot_energy * sinTheta);
143 maps_[
"ecEnergy"].push_back(ec_tot_energy);
144 maps_[
"ecEnergyEE"].push_back(ld.energyEE());
145 maps_[
"ecEnergyFH"].push_back(ld.energyFH());
146 maps_[
"ecEnergyBH"].push_back(ld.energyBH());
170 maps_[
"nLayers"].push_back(ld.nLayers());
171 maps_[
"firstLayer"].push_back(ld.firstLayer());
172 maps_[
"lastLayer"].push_back(ld.lastLayer());
173 maps_[
"e4oEtot"].push_back(ld.e4oEtot());
174 maps_[
"layerEfrac10"].push_back(ld.layerEfrac10());
175 maps_[
"layerEfrac90"].push_back(ld.layerEfrac90());
178 maps_[
"measuredDepth"].push_back(measuredDepth);
179 maps_[
"expectedDepth"].push_back(expectedDepth);
180 maps_[
"expectedSigma"].push_back(expectedSigma);
181 maps_[
"depthCompatibility"].push_back(depthCompatibility);
195 <<
"We have a miscoded value map producer, since map size changed";
198 for (
auto&& kv :
maps_) {
200 if (kv.second.size() != electronsH->size()) {
202 <<
"We have a miscoded value map producer, since the variable " << kv.first <<
" wasn't filled.";
205 auto out = std::make_unique<edm::ValueMap<float>>();
207 filler.insert(electronsH, kv.second.begin(), kv.second.end());
225 desc.
add<
double>(
"pcaRadius", 3.0);
227 desc.
add<std::vector<double>>(
"dEdXWeights")
228 ->setComment(
"This must be copied from dEdX_weights in RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi");
229 desc.
add<
unsigned int>(
"isoNRings", 5);
230 desc.
add<
double>(
"isoDeltaR", 0.15);
231 desc.
add<
double>(
"isoDeltaRmin", 0.0);
235 descriptions.
add(
"hgcalElectronIDValueMap", desc);