71 template <
typename HandleType,
typename ValType>
74 const std::vector<ValType>& vals,
76 auto valMap = std::make_unique<edm::ValueMap<ValType>>();
78 filler.insert(objHandle, vals.begin(), vals.end());
87 epCombinationTool_(conf.getParameter<
edm::
ParameterSet>(
"epCombConfig")),
88 energyCorrector_(epCombinationTool_, conf.getParameter<
std::
string>(
"correctionFile")),
91 produceCalibratedObjs_(conf.getParameter<
bool>(
"produceCalibratedObjs")) {
100 produces<std::vector<T>>();
107 template <
typename T>
115 desc.
add<
double>(
"minEtToCalibrate", 5.0);
116 desc.
add<
bool>(
"produceCalibratedObjs",
true);
117 desc.
add<
bool>(
"semiDeterministic",
true);
118 std::vector<std::string> valMapsProduced;
119 for (
auto varToStore : valMapsToStore_)
121 desc.
add<std::vector<std::string>>(
"valueMapsStored", valMapsProduced)
123 "provides to python configs the list of valuemaps stored, can not be overriden in the python config");
127 template <
typename T>
129 epCombinationTool_.setEventContent(iSetup);
132 iEvent.getByToken(electronToken_, inHandle);
137 iEvent.getByToken(recHitCollectionEBToken_, recHitCollectionEBHandle);
138 iEvent.getByToken(recHitCollectionEEToken_, recHitCollectionEEHandle);
140 std::unique_ptr<std::vector<T>>
out = std::make_unique<std::vector<T>>();
142 size_t nrObj = inHandle->size();
150 for (
const auto& ele : *inHandle) {
153 if (semiDeterministicRng_)
154 setSemiDetRandomSeed(
iEvent, ele, nrObj,
out->size());
157 (ele.isEB()) ? recHitCollectionEBHandle.
product() : recHitCollectionEEHandle.
product();
158 std::array<float, EGEnergySysIndex::kNrSysErrs> uncertainties =
166 auto fillAndStore = [&](
auto handle) {
167 for (
const auto& mapToStore : valMapsToStore_) {
172 if (produceCalibratedObjs_) {
175 fillAndStore(inHandle);
179 template <
typename T>
184 if (
obj.superCluster().isNonnull()) {