|
|
Go to the documentation of this file.
39 const std::vector<std::string>
names_;
43 std::vector<std::unique_ptr<const GBRForest> >
models_;
51 rho_(consumes<double>(conf.getParameter<
edm::
InputTag>(
"rho"))),
54 passThrough_(conf.getParameter<
bool>(
"PassThrough")),
55 minPtThreshold_(conf.getParameter<double>(
"MinPtThreshold")),
56 maxPtThreshold_(conf.getParameter<double>(
"MaxPtThreshold")),
57 thresholds_(conf.getParameter<
std::
vector<double> >(
"ModelThresholds")) {
63 <<
"'ModelNames' size (" <<
names_.size() <<
") != 'ModelWeights' size (" <<
models_.size() <<
").\n";
67 <<
"'ModelWeights' size (" <<
models_.size() <<
") != 'ModelThresholds' size (" <<
thresholds_.size() <<
").\n";
70 produces<edm::ValueMap<float> >(
name);
81 std::ostringstream os;
82 os <<
"Problem accessing rho collection for low-pT electrons" << std::endl;
91 std::ostringstream os;
92 os <<
"Problem accessing low-pT gsfElectrons collection" << std::endl;
101 std::ostringstream os;
102 os <<
"Problem accessing low-pT 'unbiased' ElectronSeed collection" << std::endl;
108 std::vector<std::vector<float> >
output;
109 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
112 for (
unsigned int iele = 0; iele <
gsfElectrons->size(); iele++) {
118 const auto&
gsf = ele->
core()->gsfTrack();
122 float unbiased = (*unbiasedH)[
gsf];
125 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
131 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
145 float unbiased)
const {
147 if (iter !=
names_.end()) {
152 throw cms::Exception(
"Unknown model name") <<
"'Name given: '" <<
name <<
"'. Check against configuration file.\n";
164 desc.add<std::vector<std::string> >(
"ModelNames", {
""});
165 desc.add<std::vector<std::string> >(
167 {
"RecoEgamma/ElectronIdentification/data/LowPtElectrons/RunII_Autumn18_LowPtElectrons_mva_id.xml.gz"});
168 desc.add<std::vector<double> >(
"ModelThresholds", {-10.});
169 desc.add<
bool>(
"PassThrough",
false);
170 desc.add<
double>(
"MinPtThreshold", 0.5);
171 desc.add<
double>(
"MaxPtThreshold", 15.);
172 descriptions.
add(
"lowPtGsfElectronID",
desc);
LowPtGsfElectronIDProducer(const edm::ParameterSet &)
std::vector< float > features(edm::Ptr< reco::GsfElectron > const &ele, float rho, float unbiased)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
bool isNull() const
Checks for null.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
virtual GsfElectronCoreRef core() const
std::vector< std::unique_ptr< const GBRForest > > models_
static void fillDescriptions(edm::ConfigurationDescriptions &)
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const std::vector< double > thresholds_
const edm::EDGetTokenT< edm::View< reco::GsfElectron > > gsfElectrons_
double eval(const std::string &name, const edm::Ptr< reco::GsfElectron > &, double rho, float unbiased) const
const double maxPtThreshold_
Log< level::Error, false > LogError
const edm::EDGetTokenT< double > rho_
T getParameter(std::string const &) const
const edm::EDGetTokenT< edm::ValueMap< float > > unbiased_
const double minPtThreshold_
const std::vector< std::string > names_