44 #include <Math/VectorUtil.h> 72 template<
class T,
class V>
159 ,
isMC_ (iConfig.getParameter<
bool>(
"isMC"))
160 ,
deltaR_ (iConfig.getParameter<double>(
"deltaR"))
161 ,
ptThreshold_ (iConfig.getParameter<double>(
"ptThreshold"))
223 vars_.push_back(0.0);
292 int bx =
pu.getBunchCrossing();
319 for(
size_t iEle = 0; iEle <
src->size(); ++iEle) {
321 const auto ele =
src->ptrAt(iEle);
323 eleQ_ = ele->charge();
324 ele3Q_ = ele->chargeInfo().isGsfCtfScPixConsistent;
330 for (
int iVar = 0; iVar <
nVars_; ++iVar) {
368 template<
class T,
class V>
379 for(
size_t i=0;
i<genParticles->size();
i++){
380 const auto particle = genParticles->ptrAt(
i);
382 if(
abs(particle->pdgId()) != 11 || particle->status() != 1 )
392 if( genIdx == -1 || dR >=
deltaR_ ) {
396 const auto closestElectron = genParticles->ptrAt(genIdx);
398 if( closestElectron->fromHardProcessFinalState() )
401 if( closestElectron->isDirectHardProcessTauDecayProductFinalState() )
422 desc.
add<
bool>(
"isMC");
423 desc.
add<
double>(
"deltaR", 0.1);
424 desc.
add<
double>(
"ptThreshold", 5.0);
426 desc.
addUntracked<std::vector<std::string>>(
"eleMVALabels");
427 desc.
addUntracked<std::vector<std::string>>(
"eleMVAValMaps");
428 desc.
addUntracked<std::vector<std::string>>(
"eleMVAValMapLabels");
429 desc.
addUntracked<std::vector<std::string>>(
"eleMVACats");
430 desc.
addUntracked<std::vector<std::string>>(
"eleMVACatLabels");
static const std::string kSharedResource
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void setConsumes(edm::ConsumesCollector &&cc)
EventNumber_t event() const
const double ptThreshold_
const std::string & getName(int index) const
MultiTokenT< edm::View< reco::GsfElectron > > src_
edm::Handle< T > getHandle(const edm::Event &iEvent)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
MultiTokenT< std::vector< reco::Vertex > > vertices_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::LuminosityBlockNumber_t luminosityBlock() const
T * make(const Args &...args) const
make new ROOT object
std::vector< edm::EDGetTokenT< edm::ValueMap< int > > > mvaCatTokens_
std::vector< float > mvaValues_
MultiTokenT< edm::View< reco::GenParticle > > genParticles_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
void addDefault(ParameterSetDescription const &psetDescription)
~ElectronMVANtuplizer() override
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< int > mvaPasses_
const std::vector< std::string > valMapBranchNames_
Abs< T >::type abs(const T &t)
std::vector< int > mvaCats_
MultiTokenT< std::vector< PileupSummaryInfo > > pileup_
ElectronMVANtuplizer(const edm::ParameterSet &)
int matchToTruth(const T &el, const V &genParticles, int &genIdx)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::Handle< T > getValidHandle(const edm::Event &iEvent)
const std::vector< std::string > eleMapBranchNames_
std::vector< float > vars_
MVAVariableManager< reco::GsfElectron > mvaVarMngr_
float getValue(int index, const edm::Ptr< ParticleType > &ptclPtr, const edm::EventBase &iEvent) const
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > valMapTokens_
void analyze(const edm::Event &, const edm::EventSetup &) override
const std::vector< std::string > mvaCatTags_
std::vector< edm::EDGetTokenT< edm::ValueMap< bool > > > eleMapTokens_
const std::vector< std::string > mvaCatBranchNames_
const std::vector< std::string > eleMapTags_
const std::vector< std::string > valMapTags_