136 for(
auto&& kv :
maps_) {
138 kv.second.reserve(electronsH->size());
144 for(
const auto&
electron : *electronsH) {
147 for(
auto&& kv : maps_) {
148 kv.second.push_back(0.);
156 for(
auto&& kv : maps_) {
157 kv.second.push_back(0.);
163 float measuredDepth, expectedDepth, expectedSigma;
164 float depthCompatibility =
eIDHelper_->clusterDepthCompatibility(ld, measuredDepth, expectedDepth, expectedSigma);
169 const auto* eleCluster =
electron.electronCluster().get();
170 const double sinTheta = eleCluster->position().rho() / eleCluster->position().r();
171 maps_[
"ecOrigEt"].push_back(eleCluster->energy() * sinTheta );
172 maps_[
"ecOrigEnergy"].push_back(eleCluster->energy());
175 float ec_tot_energy = ld.energyEE() + ld.energyFH() + ld.energyBH();
176 maps_[
"ecEt"].push_back(ec_tot_energy * sinTheta );
177 maps_[
"ecEnergy"].push_back(ec_tot_energy);
178 maps_[
"ecEnergyEE"].push_back(ld.energyEE());
179 maps_[
"ecEnergyFH"].push_back(ld.energyFH());
180 maps_[
"ecEnergyBH"].push_back(ld.energyBH());
184 maps_[
"pcaEig1"].push_back(
eIDHelper_->eigenValues()(0));
185 maps_[
"pcaEig2"].push_back(
eIDHelper_->eigenValues()(1));
186 maps_[
"pcaEig3"].push_back(
eIDHelper_->eigenValues()(2));
187 maps_[
"pcaSig1"].push_back(
eIDHelper_->sigmas()(0));
188 maps_[
"pcaSig2"].push_back(
eIDHelper_->sigmas()(1));
189 maps_[
"pcaSig3"].push_back(
eIDHelper_->sigmas()(2));
190 maps_[
"pcaAxisX"].push_back(
eIDHelper_->axis().x());
191 maps_[
"pcaAxisY"].push_back(
eIDHelper_->axis().y());
192 maps_[
"pcaAxisZ"].push_back(
eIDHelper_->axis().z());
193 maps_[
"pcaPositionX"].push_back(
eIDHelper_->barycenter().x());
194 maps_[
"pcaPositionY"].push_back(
eIDHelper_->barycenter().y());
195 maps_[
"pcaPositionZ"].push_back(
eIDHelper_->barycenter().z());
198 maps_[
"sigmaUU"].push_back(
eIDHelper_->sigmaUU());
199 maps_[
"sigmaVV"].push_back(
eIDHelper_->sigmaVV());
200 maps_[
"sigmaEE"].push_back(
eIDHelper_->sigmaEE());
201 maps_[
"sigmaPP"].push_back(
eIDHelper_->sigmaPP());
204 maps_[
"nLayers"].push_back(ld.nLayers());
205 maps_[
"firstLayer"].push_back(ld.firstLayer());
206 maps_[
"lastLayer"].push_back(ld.lastLayer());
207 maps_[
"e4oEtot"].push_back(ld.e4oEtot());
208 maps_[
"layerEfrac10"].push_back(ld.layerEfrac10());
209 maps_[
"layerEfrac90"].push_back(ld.layerEfrac90());
212 maps_[
"measuredDepth"].push_back(measuredDepth);
213 maps_[
"expectedDepth"].push_back(expectedDepth);
214 maps_[
"expectedSigma"].push_back(expectedSigma);
215 maps_[
"depthCompatibility"].push_back(depthCompatibility);
218 maps_[
"caloIsoRing0"].push_back(
eIDHelper_->getIsolationRing(0));
219 maps_[
"caloIsoRing1"].push_back(
eIDHelper_->getIsolationRing(1));
220 maps_[
"caloIsoRing2"].push_back(
eIDHelper_->getIsolationRing(2));
221 maps_[
"caloIsoRing3"].push_back(
eIDHelper_->getIsolationRing(3));
222 maps_[
"caloIsoRing4"].push_back(
eIDHelper_->getIsolationRing(4));
228 throw cms::Exception(
"HGCalElectronIDValueMapProducer") <<
"We have a miscoded value map producer, since map size changed";
231 for(
auto&& kv : maps_) {
233 if ( kv.second.size() != electronsH->size() ) {
234 throw cms::Exception(
"HGCalElectronIDValueMapProducer") <<
"We have a miscoded value map producer, since the variable " << kv.first <<
" wasn't filled.";
237 auto out = std::make_unique<edm::ValueMap<float>>();
239 filler.insert(electronsH, kv.second.begin(), kv.second.end());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::unique_ptr< HGCalEgammaIDHelper > eIDHelper_
std::map< const std::string, std::vector< float > > maps_
static const std::vector< std::string > valuesProduced_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronsToken_