|
|
Go to the documentation of this file.
45 const std::vector<std::string>
names_;
49 std::vector<std::unique_ptr<const GBRForest> >
models_;
57 : usePAT_(conf.getParameter<
bool>(
"usePAT")),
60 rho_(consumes<double>(conf.getParameter<
edm::
InputTag>(
"rho"))),
63 passThrough_(conf.getParameter<
bool>(
"PassThrough")),
64 minPtThreshold_(conf.getParameter<double>(
"MinPtThreshold")),
65 maxPtThreshold_(conf.getParameter<double>(
"MaxPtThreshold")),
66 thresholds_(conf.getParameter<
std::
vector<double> >(
"ModelThresholds")),
67 version_(conf.getParameter<
std::
string>(
"Version")) {
79 <<
"'ModelNames' size (" <<
names_.size() <<
") != 'ModelWeights' size (" <<
models_.size() <<
").\n";
83 <<
"'ModelWeights' size (" <<
models_.size() <<
") != 'ModelThresholds' size (" <<
thresholds_.size() <<
").\n";
89 produces<edm::ValueMap<float> >(
name);
104 if (!
rho.isValid()) {
105 std::ostringstream os;
106 os <<
"Problem accessing rho collection for low-pT electrons" << std::endl;
126 std::vector<std::vector<float> >
output;
128 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
133 for (
unsigned int iele = 0; iele <
nElectrons; iele++) {
138 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
143 for (
unsigned int iele = 0; iele <
nElectrons; iele++) {
148 const auto&
gsf = ele->
core()->gsfTrack();
153 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
160 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
178 if (iter !=
names_.end()) {
180 std::vector<float>
inputs;
188 throw cms::Exception(
"Unknown model name") <<
"'Name given: '" <<
name <<
"'. Check against configuration file.\n";
197 desc.add<
bool>(
"usePAT",
false);
201 desc.add<std::vector<std::string> >(
"ModelNames", {
""});
202 desc.add<std::vector<std::string> >(
203 "ModelWeights", {
"RecoEgamma/ElectronIdentification/data/LowPtElectrons/LowPtElectrons_ID_2020Nov28.root"});
204 desc.add<std::vector<double> >(
"ModelThresholds", {-99.});
205 desc.add<
bool>(
"PassThrough",
false);
206 desc.add<
double>(
"MinPtThreshold", 0.5);
207 desc.add<
double>(
"MaxPtThreshold", 15.);
209 descriptions.
add(
"defaultLowPtGsfElectronID",
desc);
LowPtGsfElectronIDProducer(const edm::ParameterSet &)
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
std::vector< float > features_V1(reco::GsfElectron const &ele, float rho, float unbiased, float field_z)
bool isNull() const
Checks for null.
constexpr bool isUninitialized() const noexcept
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 &)
float electronID(const std::string &name) const
Returns a specific electron ID associated to the pat::Electron given its name.
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< reco::GsfElectronCollection > electrons_
const std::vector< double > thresholds_
edm::EDGetTokenT< edm::ValueMap< float > > unbiased_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
std::vector< float > features_V0(reco::GsfElectron const &ele, float rho, float unbiased)
const double maxPtThreshold_
double eval(const std::string &name, const edm::Ptr< reco::GsfElectron > &, double rho, float unbiased, float field_z) const
bool isElectronIDAvailable(const std::string &name) const
Returns true if a specific ID is available in this pat::Electron.
const edm::EDGetTokenT< double > rho_
T getParameter(std::string const &) const
const double minPtThreshold_
const std::vector< std::string > names_
const std::string version_
edm::EDGetTokenT< pat::ElectronCollection > patElectrons_