59 std::map<const std::string, std::vector<float>>
maps_;
100 "depthCompatibility",
110 radius_(iConfig.getParameter<double>(
"pcaRadius"))
114 produces<edm::ValueMap<float>>(
key);
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());
263 desc.
add<
double>(
"pcaRadius", 3.0);
265 desc.
add<std::vector<double>>(
"dEdXWeights")->setComment(
"This must be copied from dEdX_weights in RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi");
266 desc.
add<
unsigned int>(
"isoNRings", 5);
267 desc.
add<
double>(
"isoDeltaR", 0.15);
268 desc.
add<
double>(
"isoDeltaRmin", 0.0);
272 descriptions.
add(
"hgcalElectronIDValueMap", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
~HGCalElectronIDValueMapProducer() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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_
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronsToken_
HGCalElectronIDValueMapProducer(const edm::ParameterSet &)
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