46 rekey_(conf.getParameter<bool>(
"rekey")),
51 std::vector<edm::InputTag>
tags = conf.
getParameter<std::vector<edm::InputTag> >(
"floatValueMaps");
52 for (
const auto&
tag : tags) {
56 produces<edm::ValueMap<float> >(tag.
instance());
63 produces<edm::ValueMap<float> >(
name);
82 std::vector<std::vector<float> >
output;
83 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
84 output.push_back(std::vector<float>(gsfTracks->size(), -999.));
86 auto const& gsfTracksV = *gsfTracks;
87 for (
unsigned int igsf = 0; igsf < gsfTracksV.size(); igsf++) {
94 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
95 output[iname][igsf] = preid->mva(iname);
103 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
106 filler.
insert(gsfTracks, output[iname].
begin(), output[iname].
end());
119 for (
unsigned int idx = 0; idx <
names_.size(); ++idx) {
124 std::vector<float>
output(gsfElectrons->size(), -99.);
125 auto const& gsfElectronsV = *gsfElectrons;
126 for (
unsigned int iele = 0; iele < gsfElectronsV.size(); iele++) {
129 output[iele] = floatValueMap[gsf];
134 filler.
insert(gsfElectrons, output.begin(), output.end());
147 desc.
add<std::vector<std::string> >(
"ModelNames", {
"unbiased",
"ptbiased"});
148 desc.
add<
bool>(
"rekey",
false);
150 desc.
add<std::vector<edm::InputTag> >(
"floatValueMaps", std::vector<edm::InputTag>());
151 descriptions.
add(
"lowPtGsfElectronSeedValueMaps", desc);
bool isNonnull() const
Checks for non-null.
const TrackExtraRef & extra() const
reference to "extra" object
edm::EDGetTokenT< edm::ValueMap< reco::PreIdRef > > preIdsValueMap_
edm::EDGetTokenT< reco::GsfTrackCollection > gsfTracks_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > floatValueMaps_
#define DEFINE_FWK_MODULE(type)
void insert(const H &h, I begin, I end)
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
std::vector< std::string > names_
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
ParameterDescriptionBase * add(U const &iLabel, T const &value)
LowPtGsfElectronSeedValueMapsProducer(const edm::ParameterSet &)
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectrons_
static void fillDescriptions(edm::ConfigurationDescriptions &)
void produce(edm::Event &, const edm::EventSetup &) override