57 std::map<const std::string, std::vector<float>>
maps_;
66 "seedEt",
"seedEnergy",
"seedEnergyEE",
"seedEnergyFH",
"seedEnergyBH",
67 "pcaEig1",
"pcaEig2",
"pcaEig3",
"pcaSig1",
"pcaSig2",
68 "pcaSig3",
"sigmaUU",
"sigmaVV",
"sigmaEE",
"sigmaPP",
69 "nLayers",
"firstLayer",
"lastLayer",
"e4oEtot",
"layerEfrac10",
70 "layerEfrac90",
"measuredDepth",
"expectedDepth",
"expectedSigma",
"depthCompatibility",
71 "caloIsoRing0",
"caloIsoRing1",
"caloIsoRing2",
"caloIsoRing3",
"caloIsoRing4",
75 : photonsToken_(consumes(iConfig.getParameter<edm::
InputTag>(
"photons"))),
76 radius_(iConfig.getParameter<double>(
"pcaRadius")) {
79 produces<edm::ValueMap<float>>(
key);
94 for (
auto&& kv :
maps_) {
96 kv.second.reserve(photonsH->size());
102 for (
const auto& pho : *photonsH) {
105 for (
auto&& kv : maps_) {
106 kv.second.push_back(0.);
113 for (
auto&& kv : maps_) {
114 kv.second.push_back(0.);
120 float measuredDepth, expectedDepth, expectedSigma;
121 float depthCompatibility =
122 phoIDHelper_->clusterDepthCompatibility(ld, measuredDepth, expectedDepth, expectedSigma);
127 float seed_tot_energy = ld.energyEE() + ld.energyFH() + ld.energyBH();
128 const double div_cosh_eta =
129 pho.superCluster()->seed()->position().rho() / pho.superCluster()->seed()->position().r();
130 maps_[
"seedEt"].push_back(seed_tot_energy * div_cosh_eta);
131 maps_[
"seedEnergy"].push_back(seed_tot_energy);
132 maps_[
"seedEnergyEE"].push_back(ld.energyEE());
133 maps_[
"seedEnergyFH"].push_back(ld.energyFH());
134 maps_[
"seedEnergyBH"].push_back(ld.energyBH());
138 maps_[
"pcaEig1"].push_back(
phoIDHelper_->eigenValues()(0));
139 maps_[
"pcaEig2"].push_back(
phoIDHelper_->eigenValues()(1));
140 maps_[
"pcaEig3"].push_back(
phoIDHelper_->eigenValues()(2));
152 maps_[
"nLayers"].push_back(ld.nLayers());
153 maps_[
"firstLayer"].push_back(ld.firstLayer());
154 maps_[
"lastLayer"].push_back(ld.lastLayer());
155 maps_[
"e4oEtot"].push_back(ld.e4oEtot());
156 maps_[
"layerEfrac10"].push_back(ld.layerEfrac10());
157 maps_[
"layerEfrac90"].push_back(ld.layerEfrac90());
160 maps_[
"measuredDepth"].push_back(measuredDepth);
161 maps_[
"expectedDepth"].push_back(expectedDepth);
162 maps_[
"expectedSigma"].push_back(expectedSigma);
163 maps_[
"depthCompatibility"].push_back(depthCompatibility);
166 maps_[
"caloIsoRing0"].push_back(
phoIDHelper_->getIsolationRing(0));
167 maps_[
"caloIsoRing1"].push_back(
phoIDHelper_->getIsolationRing(1));
168 maps_[
"caloIsoRing2"].push_back(
phoIDHelper_->getIsolationRing(2));
169 maps_[
"caloIsoRing3"].push_back(
phoIDHelper_->getIsolationRing(3));
170 maps_[
"caloIsoRing4"].push_back(
phoIDHelper_->getIsolationRing(4));
178 <<
"We have a miscoded value map producer, since map size changed";
181 for (
auto&& kv : maps_) {
183 if (kv.second.size() != photonsH->size()) {
185 <<
"We have a miscoded value map producer, since the variable " << kv.first <<
" wasn't filled.";
188 auto out = std::make_unique<edm::ValueMap<float>>();
190 filler.insert(photonsH, kv.second.begin(), kv.second.end());
208 desc.
add<
double>(
"pcaRadius", 3.0);
210 desc.
add<std::vector<double>>(
"dEdXWeights")
211 ->setComment(
"This must be copied from dEdX_weights in RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi");
212 desc.
add<
unsigned int>(
"isoNRings", 5);
213 desc.
add<
double>(
"isoDeltaR", 0.15);
214 desc.
add<
double>(
"isoDeltaRmin", 0.0);
219 descriptions.
add(
"hgcalPhotonIDValueMap", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
#define DEFINE_FWK_MODULE(type)
~HGCalPhotonIDValueMapProducer() override
std::unique_ptr< HGCalEgammaIDHelper > phoIDHelper_
void produce(edm::Event &, const edm::EventSetup &) override
HGCalPhotonIDValueMapProducer(const edm::ParameterSet &)
void beginStream(edm::StreamID) override
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
tuple key
prepare the HTCondor submission files and eventually submit them
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)