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);
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());
149 maps_[
"pcaEig1"].push_back(
eIDHelper_->eigenValues()(0));
150 maps_[
"pcaEig2"].push_back(
eIDHelper_->eigenValues()(1));
151 maps_[
"pcaEig3"].push_back(
eIDHelper_->eigenValues()(2));
152 maps_[
"pcaSig1"].push_back(
eIDHelper_->sigmas()(0));
153 maps_[
"pcaSig2"].push_back(
eIDHelper_->sigmas()(1));
154 maps_[
"pcaSig3"].push_back(
eIDHelper_->sigmas()(2));
155 maps_[
"pcaAxisX"].push_back(
eIDHelper_->axis().x());
156 maps_[
"pcaAxisY"].push_back(
eIDHelper_->axis().y());
157 maps_[
"pcaAxisZ"].push_back(
eIDHelper_->axis().z());
158 maps_[
"pcaPositionX"].push_back(
eIDHelper_->barycenter().x());
159 maps_[
"pcaPositionY"].push_back(
eIDHelper_->barycenter().y());
160 maps_[
"pcaPositionZ"].push_back(
eIDHelper_->barycenter().z());
163 maps_[
"sigmaUU"].push_back(
eIDHelper_->sigmaUU());
164 maps_[
"sigmaVV"].push_back(
eIDHelper_->sigmaVV());
165 maps_[
"sigmaEE"].push_back(
eIDHelper_->sigmaEE());
166 maps_[
"sigmaPP"].push_back(
eIDHelper_->sigmaPP());
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);
183 maps_[
"caloIsoRing0"].push_back(
eIDHelper_->getIsolationRing(0));
184 maps_[
"caloIsoRing1"].push_back(
eIDHelper_->getIsolationRing(1));
185 maps_[
"caloIsoRing2"].push_back(
eIDHelper_->getIsolationRing(2));
186 maps_[
"caloIsoRing3"].push_back(
eIDHelper_->getIsolationRing(3));
187 maps_[
"caloIsoRing4"].push_back(
eIDHelper_->getIsolationRing(4));
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);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
~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)
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
static const std::vector< std::string > valuesProduced_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronsToken_
HGCalElectronIDValueMapProducer(const edm::ParameterSet &)
tuple key
prepare the HTCondor submission files and eventually submit them
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void beginStream(edm::StreamID) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void produce(edm::Event &, const edm::EventSetup &) override