39 #include <Math/VectorUtil.h> 150 :
isMC_(iConfig.getParameter<
bool>(
"isMC")),
151 deltaR_(iConfig.getParameter<double>(
"deltaR")),
152 ptThreshold_(iConfig.getParameter<double>(
"ptThreshold")),
248 std::unique_ptr<noZS::EcalClusterLazyTools> lazyTools;
263 int bx =
pu.getBunchCrossing();
291 for (
auto const& ele :
src->ptrs()) {
297 const auto&
seed = *(ele->superCluster()->seed());
302 eleQ_ = ele->charge();
303 ele3Q_ = ele->chargeInfo().isGsfCtfScPixConsistent;
305 for (
int iVar = 0; iVar <
nVars_; ++iVar) {
329 for (
size_t k = 0; k <
nCats_; ++
k)
345 for (
auto const& particle : genParticles) {
347 if (
std::abs(particle.pdgId()) != 11 || particle.status() != 1)
353 closestElectron = &particle;
357 if (closestElectron ==
nullptr || dR >=
deltaR_)
380 desc.
add<
bool>(
"doEnergyMatrix",
false);
381 desc.
add<
int>(
"energyMatrixSize", 2)->setComment(
"extension of crystals in each direction away from the seed");
382 desc.
add<
bool>(
"isMC",
true);
383 desc.
add<
double>(
"deltaR", 0.1);
384 desc.
add<
double>(
"ptThreshold", 5.0);
385 desc.
add<std::vector<std::string>>(
"eleMVAs", {});
386 desc.
add<std::vector<std::string>>(
"eleMVALabels", {});
387 desc.
add<std::vector<std::string>>(
"eleMVAValMaps", {});
388 desc.
add<std::vector<std::string>>(
"eleMVAValMapLabels", {});
389 desc.
add<std::vector<std::string>>(
"eleMVACats", {});
390 desc.
add<std::vector<std::string>>(
"eleMVACatLabels", {});
static const std::string kSharedResource
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
EventNumber_t event() const
const double ptThreshold_
const std::string & getName(int index) const
const LorentzVector & p4(P4Kind kind) const
std::vector< edm::EDGetTokenT< edm::ValueMap< bool > > > eleMapTokens_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileup_
bool isDirectHardProcessTauDecayProductFinalState() const
edm::LuminosityBlockNumber_t luminosityBlock() const
const edm::EDGetTokenT< EcalRecHitCollection > ebRecHits_
T * make(const Args &...args) const
make new ROOT object
const bool doEnergyMatrix_
float getValue(int index, const ParticleType &particle, const std::vector< float > &auxVariables) const
std::vector< edm::EDGetTokenT< edm::ValueMap< int > > > mvaCatTokens_
const std::vector< std::string > mvaCatBranchNames_
std::vector< float > mvaValues_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > valMapTokens_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const std::vector< std::string > eleMapBranchNames_
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
const std::vector< std::string > valMapTags_
#define DEFINE_FWK_MODULE(type)
const std::vector< std::string > mvaCatTags_
void addDefault(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< std::vector< reco::Vertex > > vertices_
const std::vector< std::string > valMapBranchNames_
std::vector< float > energyMatrix_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< int > mvaPasses_
const MVAVariableHelper variableHelper_
Abs< T >::type abs(const T &t)
std::vector< int > mvaCats_
ElectronMVANtuplizer(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< edm::View< reco::GsfElectron > > src_
const edm::EDGetTokenT< edm::View< reco::GenParticle > > genParticles_
bool fromHardProcessFinalState() const
const std::vector< std::string > eleMapTags_
std::vector< float > vars_
MVAVariableManager< reco::GsfElectron > mvaVarMngr_
void analyze(const edm::Event &, const edm::EventSetup &) override
int matchToTruth(reco::GsfElectron const &electron, edm::View< reco::GenParticle > const &genParticles) const
const std::vector< float > getAuxVariables(const edm::Event &iEvent) const
const edm::EDGetTokenT< EcalRecHitCollection > eeRecHits_
const int energyMatrixSize_