|
|
Go to the documentation of this file.
57 if (
params.exists(
"ignoreParticleIDs"))
61 (
params.exists(
"isMiniAOD") ?
params.getParameter<
bool>(
"isMiniAOD") : (
inTag.
label() ==
"packedGenParticles"));
65 <<
"Partonic final state not supported for MiniAOD. Falling back to the stable particle selection.";
69 produces<reco::CandidatePtrVector>();
108 std::vector<unsigned int>::const_iterator
pos =
115 std::vector<unsigned int>::const_iterator
pos =
121 InputGenJetsParticleSelector::ParticleVector::const_iterator
pos =
std::lower_bound(
p.begin(),
p.end(), particle);
122 if (
pos ==
p.end() || *
pos != particle)
123 throw cms::Exception(
"CorruptedData") <<
"reco::GenEvent corrupted: Unlisted particles"
127 return pos -
p.begin();
137 for (
unsigned int i = 0;
i <
npart; ++
i) {
155 for (
unsigned int i = 0;
i <
npart; ++
i) {
175 int id = particle->
pdgId();
191 for (
unsigned int i = 0;
i < nMo; ++
i) {
218 auto selected_ = std::make_unique<reco::CandidatePtrVector>();
229 if (iter->status() !=
238 std::map<const reco::Candidate *, size_t> particlePtrIdxMap;
242 particlePtrIdxMap[&*iter] = (iter -
genParticles->begin());
251 for (
unsigned int i = 0;
i <
size;
i++) {
255 if (particle->
status() == 1)
285 selected_->push_back(
genParticles->ptrAt(particlePtrIdxMap[particle]));
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
~InputGenJetsParticleSelector() override
edm::EDGetTokenT< reco::CandidateView > input_genpartcoll_token_
ResonanceState fromResonance(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
int testPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
bool isParton(int pdgId) const
static bool isHadron(int pdgId)
virtual double pt() const =0
transverse momentum
InputGenJetsParticleSelector()
virtual int status() const =0
status word
std::vector< unsigned int > ignoreParticleIDs
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
edm::EDGetTokenT< reco::CandidateView > input_prunedgenpartcoll_token_
static void invalidateTree(InputGenJetsParticleSelector::ParticleBitmap &invalid, const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *particle)
static unsigned int partIdx(const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *particle)
std::vector< unsigned int > excludeFromResonancePids
virtual size_type numberOfMothers() const =0
number of mothers (zero or one in most of but not all the cases)
void produce(edm::StreamID, edm::Event &evt, const edm::EventSetup &evtSetup) const override
#define DEFINE_FWK_MODULE(type)
void setIgnoredParticles(const std::vector< unsigned int > &particleIDs)
void setExcludeFromResonancePids(const std::vector< unsigned int > &particleIDs)
virtual size_type numberOfDaughters() const =0
number of daughters
bool hasPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static bool isResonance(int pdgId)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< bool > ParticleBitmap
Log< level::Error, false > LogError
virtual int pdgId() const =0
PDG identifier.
bool isIgnored(int pdgId) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
std::vector< const reco::Candidate * > ParticleVector
bool isExcludedFromResonance(int pdgId) const
edm::InputTag prunedInTag