63 template <
typename HandleType,
typename ValType>
66 const std::vector<ValType>& vals,
68 auto valMap = std::make_unique<edm::ValueMap<ValType>>();
70 filler.insert(objHandle, vals.begin(), vals.end());
79 energyCorrector_(conf.getParameter<
std::
string>(
"correctionFile")),
82 produceCalibratedObjs_(conf.getParameter<
bool>(
"produceCalibratedObjs")) {
91 produces<std::vector<T>>();
105 desc.
add<
double>(
"minEtToCalibrate", 5.0);
106 desc.
add<
bool>(
"produceCalibratedObjs",
true);
107 desc.
add<
bool>(
"semiDeterministic",
true);
108 std::vector<std::string> valMapsProduced;
109 for (
auto varToStore : valMapsToStore_)
111 desc.
add<std::vector<std::string>>(
"valueMapsStored", valMapsProduced)
113 "provides to python configs the list of valuemaps stored, can not be overriden in the python config");
117 template <
typename T>
120 iEvent.getByToken(photonToken_, inHandle);
125 iEvent.getByToken(recHitCollectionEBToken_, recHitCollectionEBHandle);
126 iEvent.getByToken(recHitCollectionEEToken_, recHitCollectionEEHandle);
128 std::unique_ptr<std::vector<T>>
out = std::make_unique<std::vector<T>>();
130 size_t nrObj = inHandle->size();
138 for (
const auto& pho : *inHandle) {
139 out->emplace_back(pho);
141 if (semiDeterministicRng_)
142 setSemiDetRandomSeed(
iEvent, pho, nrObj,
out->size());
145 (pho.isEB()) ? recHitCollectionEBHandle.
product() : recHitCollectionEEHandle.
product();
146 std::array<float, EGEnergySysIndex::kNrSysErrs> uncertainties =
154 auto fillAndStore = [&](
auto handle) {
155 for (
const auto& mapToStore : valMapsToStore_) {
160 if (produceCalibratedObjs_) {
163 fillAndStore(inHandle);
168 template <
typename T>
173 if (
obj.superCluster().isNonnull()) {