91 template<
typename HandleType,
typename ValType>
95 auto valMap = std::make_unique<edm::ValueMap<ValType> >();
97 filler.insert(objHandle,vals.begin(),vals.end());
135 desc.
add<
double>(
"minEtToCalibrate",5.0);
136 desc.
add<
bool>(
"produceCalibratedObjs",
true);
137 desc.
add<
bool>(
"semiDeterministic",
true);
138 std::vector<std::string> valMapsProduced;
140 desc.
add<std::vector<std::string> >(
"valueMapsStored",valMapsProduced)->setComment(
"provides to python configs the list of valuemaps stored, can not be overriden in the python config");
160 std::unique_ptr<std::vector<T>>
out = std::make_unique<std::vector<T>>();
162 size_t nrObj = inHandle->size();
164 for(
auto&
res : results)
res.reserve(nrObj);
170 for (
const auto& ele : *inHandle) {
179 results[
index].push_back(uncertainties[
index]);
183 auto fillAndStore = [&](
auto handle){
192 fillAndStore(inHandle);
200 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)
#define DEFINE_FWK_MODULE(type)
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_
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