14 rho_(consumes<double>(conf.getParameter<
edm::InputTag>(
"rho"))),
15 names_(conf.getParameter<
std::vector<
std::
string> >(
"ModelNames")),
16 passThrough_(conf.getParameter<
bool>(
"PassThrough")),
17 minPtThreshold_(conf.getParameter<double>(
"MinPtThreshold")),
18 maxPtThreshold_(conf.getParameter<double>(
"MaxPtThreshold"))
21 produces< edm::ValueMap<float> >(
name);
35 event.getByToken(
rho_,rho);
44 std::vector< std::vector<float> >
output;
45 for (
unsigned int iname = 0; iname <
names_.size(); ++iname ) {
46 output.push_back( std::vector<float>(gsfElectrons->size(),-999.) );
48 for (
unsigned int iele = 0; iele < gsfElectrons->size(); iele++ ) {
51 for (
unsigned int iname = 0; iname <
names_.size(); ++iname ) {
52 output[iname][iele] = globalCache()->eval(
names_[iname], ele, *rho );
57 for (
unsigned int iname = 0; iname <
names_.size(); ++iname ) {
60 filler.
insert(gsfElectrons, output[iname].
begin(), output[iname].
end());
75 desc.
add< std::vector<std::string> >(
"ModelNames",std::vector<std::string>());
76 desc.
add< std::vector<std::string> >(
"ModelWeights",std::vector<std::string>());
77 desc.
add< std::vector<double> >(
"ModelThresholds",std::vector<double>());
78 desc.
add<
bool>(
"PassThrough",
false);
79 desc.
add<
double>(
"MinPtThreshold",0.5);
80 desc.
add<
double>(
"MaxPtThreshold",15.);
81 descriptions.
add(
"defaultLowPtGsfElectronID",desc);
static void fillDescriptions(edm::ConfigurationDescriptions &)
#define DEFINE_FWK_MODULE(type)
LowPtGsfElectronIDProducer(const edm::ParameterSet &, const lowptgsfeleid::HeavyObjectCache *)
void insert(const H &h, I begin, I end)
def setup(process, global_tag, zero_tesla=False)
const std::vector< std::string > names_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
~LowPtGsfElectronIDProducer() override
const edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectrons_
void produce(edm::Event &, const edm::EventSetup &) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< double > rho_
void add(std::string const &label, ParameterSetDescription const &psetDescription)