79 template<
typename HandleType,
typename ValType>
83 auto valMap = std::make_unique<edm::ValueMap<ValType> >();
85 filler.insert(objHandle,vals.begin(),vals.end());
122 desc.
add<
double>(
"minEtToCalibrate",5.0);
123 desc.
add<
bool>(
"produceCalibratedObjs",
true);
124 desc.
add<
bool>(
"semiDeterministic",
true);
125 std::vector<std::string> valMapsProduced;
127 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");
144 std::unique_ptr<std::vector<T>>
out = std::make_unique<std::vector<T>>();
146 size_t nrObj = inHandle->size();
148 for(
auto&
res : results)
res.reserve(nrObj);
153 for (
const auto& pho : *inHandle) {
154 out->emplace_back(pho);
162 results[
index].push_back(uncertainties[
index]);
166 auto fillAndStore = [&](
auto handle){
175 fillAndStore(inHandle);
184 if(obj.superCluster().isNonnull()){
T getParameter(std::string const &) const
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::unique_ptr< TRandom > semiDeterministicRng_
void initPrivateRng(TRandom *rnd)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static const std::string & name(size_t index)
void produce(edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
PhotonEnergyCalibrator energyCorrector_
void setSemiDetRandomSeed(const edm::Event &iEvent, const T &obj, size_t nrObjs, size_t objNr)
CalibratedPhotonProducerT(const edm::ParameterSet &)
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEEToken_
static constexpr size_t kNrSysErrs
uint32_t getRandomSeedFromObj(const edm::Event &iEvent, const T &obj, size_t nrObjs, size_t objNr)
~CalibratedPhotonProducerT() override
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEBToken_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T const * product() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< edm::View< T > > photonToken_
uint32_t getRandomSeedFromSC(const edm::Event &iEvent, const reco::SuperClusterRef scRef)
StreamID streamID() const
static const std::vector< int > valMapsToStore_
bool produceCalibratedObjs_
std::array< float, EGEnergySysIndex::kNrSysErrs > calibrate(reco::Photon &photon, const unsigned int runNumber, const EcalRecHitCollection *recHits, edm::StreamID const &id, const EventType eventType) const