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());
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;
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>
140 std::unique_ptr<std::vector<T>>
out = std::make_unique<std::vector<T>>();
142 size_t nrObj = inHandle->size();
144 for (
auto&
res : results)
150 for (
const auto& ele : *inHandle) {
157 (ele.isEB()) ? recHitCollectionEBHandle.
product() : recHitCollectionEEHandle.
product();
158 std::array<float, EGEnergySysIndex::kNrSysErrs> uncertainties =
162 results[
index].push_back(uncertainties[
index]);
166 auto fillAndStore = [&](
auto handle) {
175 fillAndStore(inHandle);
179 template <
typename T>
184 if (obj.superCluster().isNonnull()) {
T getParameter(std::string const &) const
CalibratedElectronProducerT(const edm::ParameterSet &)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
~CalibratedElectronProducerT() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static const std::string & name(size_t index)
ElectronEnergyCalibrator energyCorrector_
void initPrivateRng(TRandom *rnd)
bool produceCalibratedObjs_
void calibrate(SimpleElectron &electron, edm::StreamID const &)
EpCombinationTool epCombinationTool_
edm::EDGetTokenT< edm::View< T > > electronToken_
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEBToken_
#define DEFINE_FWK_MODULE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static constexpr size_t kNrSysErrs
uint32_t getRandomSeedFromObj(const edm::Event &iEvent, const T &obj, size_t nrObjs, size_t objNr)
void produce(edm::Event &, const edm::EventSetup &) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void setSemiDetRandomSeed(const edm::Event &iEvent, const T &obj, size_t nrObjs, size_t objNr)
T const * product() const
std::unique_ptr< TRandom > semiDeterministicRng_
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEEToken_
uint32_t getRandomSeedFromSC(const edm::Event &iEvent, const reco::SuperClusterRef scRef)
static const std::vector< int > valMapsToStore_
StreamID streamID() const