58 std::map<const std::string, std::vector<float>>
maps_;
102 radius_(iConfig.getParameter<double>(
"pcaRadius"))
106 produces<edm::ValueMap<float>>(
key);
128 for(
auto&& kv :
maps_) {
130 kv.second.reserve(photonsH->size());
136 for(
const auto& pho : *photonsH) {
139 for(
auto&& kv : maps_) {
140 kv.second.push_back(0.);
148 for(
auto&& kv : maps_) {
149 kv.second.push_back(0.);
155 float measuredDepth, expectedDepth, expectedSigma;
156 float depthCompatibility =
phoIDHelper_->clusterDepthCompatibility(ld, measuredDepth, expectedDepth, expectedSigma);
161 float seed_tot_energy = ld.energyEE() + ld.energyFH() + ld.energyBH();
162 const double div_cosh_eta = pho.superCluster()->seed()->position().rho() / pho.superCluster()->seed()->position().r();
163 maps_[
"seedEt"].push_back(seed_tot_energy * div_cosh_eta );
164 maps_[
"seedEnergy"].push_back(seed_tot_energy);
165 maps_[
"seedEnergyEE"].push_back(ld.energyEE());
166 maps_[
"seedEnergyFH"].push_back(ld.energyFH());
167 maps_[
"seedEnergyBH"].push_back(ld.energyBH());
171 maps_[
"pcaEig1"].push_back(
phoIDHelper_->eigenValues()(0));
172 maps_[
"pcaEig2"].push_back(
phoIDHelper_->eigenValues()(1));
173 maps_[
"pcaEig3"].push_back(
phoIDHelper_->eigenValues()(2));
185 maps_[
"nLayers"].push_back(ld.nLayers());
186 maps_[
"firstLayer"].push_back(ld.firstLayer());
187 maps_[
"lastLayer"].push_back(ld.lastLayer());
188 maps_[
"e4oEtot"].push_back(ld.e4oEtot());
189 maps_[
"layerEfrac10"].push_back(ld.layerEfrac10());
190 maps_[
"layerEfrac90"].push_back(ld.layerEfrac90());
193 maps_[
"measuredDepth"].push_back(measuredDepth);
194 maps_[
"expectedDepth"].push_back(expectedDepth);
195 maps_[
"expectedSigma"].push_back(expectedSigma);
196 maps_[
"depthCompatibility"].push_back(depthCompatibility);
199 maps_[
"caloIsoRing0"].push_back(
phoIDHelper_->getIsolationRing(0));
200 maps_[
"caloIsoRing1"].push_back(
phoIDHelper_->getIsolationRing(1));
201 maps_[
"caloIsoRing2"].push_back(
phoIDHelper_->getIsolationRing(2));
202 maps_[
"caloIsoRing3"].push_back(
phoIDHelper_->getIsolationRing(3));
203 maps_[
"caloIsoRing4"].push_back(
phoIDHelper_->getIsolationRing(4));
210 throw cms::Exception(
"HGCalPhotonIDValueMapProducer") <<
"We have a miscoded value map producer, since map size changed";
213 for(
auto&& kv : maps_) {
215 if ( kv.second.size() != photonsH->size() ) {
216 throw cms::Exception(
"HGCalPhotonIDValueMapProducer") <<
"We have a miscoded value map producer, since the variable " << kv.first <<
" wasn't filled.";
219 auto out = std::make_unique<edm::ValueMap<float>>();
221 filler.insert(photonsH, kv.second.begin(), kv.second.end());
245 desc.
add<
double>(
"pcaRadius", 3.0);
247 desc.
add<std::vector<double>>(
"dEdXWeights")->setComment(
"This must be copied from dEdX_weights in RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi");
248 desc.
add<
unsigned int>(
"isoNRings", 5);
249 desc.
add<
double>(
"isoDeltaR", 0.15);
250 desc.
add<
double>(
"isoDeltaRmin", 0.0);
254 descriptions.
add(
"hgcalPhotonIDValueMap", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~HGCalPhotonIDValueMapProducer() override
std::unique_ptr< HGCalEgammaIDHelper > phoIDHelper_
void produce(edm::Event &, const edm::EventSetup &) override
HGCalPhotonIDValueMapProducer(const edm::ParameterSet &)
void beginStream(edm::StreamID) override
#define DEFINE_FWK_MODULE(type)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static const std::vector< std::string > valuesProduced_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< edm::View< reco::Photon > > photonsToken_
std::map< const std::string, std::vector< float > > maps_
void endStream() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)