CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
InputGenJetsParticleSelector Class Reference

#include <InputGenJetsParticleSelector.h>

Inheritance diagram for InputGenJetsParticleSelector:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef std::vector< bool > ParticleBitmap
 
typedef std::vector< const reco::Candidate * > ParticleVector
 
enum  ResonanceState { kNo = 0, kDirect, kIndirect }
 
- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

ResonanceState fromResonance (ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
 
bool getExcludeResonances () const
 
const std::vector< unsigned int > & getIgnoredParticles () const
 
bool getPartonicFinalState () const
 
double getPtMin () const
 
bool getTausAndJets () const
 
bool hasPartonChildren (ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
 
 InputGenJetsParticleSelector (const edm::ParameterSet &)
 
bool isIgnored (int pdgId) const
 
bool isParton (int pdgId) const
 
void produce (edm::StreamID, edm::Event &evt, const edm::EventSetup &evtSetup) const override
 
void setExcludeResonances (bool flag=true)
 
void setPartonicFinalState (bool flag=true)
 
void setPtMin (double ptMin)
 
void setTausAsJets (bool flag=true)
 
 ~InputGenJetsParticleSelector () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static bool isHadron (int pdgId)
 
static bool isResonance (int pdgId)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

 InputGenJetsParticleSelector ()
 
bool isExcludedFromResonance (int pdgId) const
 
void setExcludeFromResonancePids (const std::vector< unsigned int > &particleIDs)
 
void setIgnoredParticles (const std::vector< unsigned int > &particleIDs)
 
int testPartonChildren (ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
 

Private Attributes

std::vector< unsigned int > excludeFromResonancePids
 
bool excludeResonances
 
std::vector< unsigned int > ignoreParticleIDs
 
edm::EDGetTokenT< reco::CandidateViewinput_genpartcoll_token_
 
edm::EDGetTokenT< reco::CandidateViewinput_prunedgenpartcoll_token_
 
edm::InputTag inTag
 
bool isMiniAOD
 
bool partonicFinalState
 
edm::InputTag prunedInTag
 
double ptMin
 
bool tausAsJets
 

Additional Inherited Members

- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 27 of file InputGenJetsParticleSelector.h.

Member Typedef Documentation

◆ ParticleBitmap

Definition at line 30 of file InputGenJetsParticleSelector.h.

◆ ParticleVector

Definition at line 31 of file InputGenJetsParticleSelector.h.

Member Enumeration Documentation

◆ ResonanceState

Constructor & Destructor Documentation

◆ InputGenJetsParticleSelector() [1/2]

InputGenJetsParticleSelector::InputGenJetsParticleSelector ( const edm::ParameterSet params)

Definition at line 49 of file InputGenJetsParticleSelector.cc.

References input_genpartcoll_token_, input_prunedgenpartcoll_token_, inTag, isMiniAOD, edm::InputTag::label(), submitPVValidationJobs::params, partonicFinalState, prunedInTag, setExcludeFromResonancePids(), and setIgnoredParticles().

50  : inTag(params.getParameter<edm::InputTag>("src")),
51  prunedInTag(params.exists("prunedGenParticles") ? params.getParameter<edm::InputTag>("prunedGenParticles")
52  : edm::InputTag("prunedGenParticles")),
53  partonicFinalState(params.getParameter<bool>("partonicFinalState")),
54  excludeResonances(params.getParameter<bool>("excludeResonances")),
55  tausAsJets(params.getParameter<bool>("tausAsJets")),
56  ptMin(0.0) {
57  if (params.exists("ignoreParticleIDs"))
58  setIgnoredParticles(params.getParameter<std::vector<unsigned int> >("ignoreParticleIDs"));
59  setExcludeFromResonancePids(params.getParameter<std::vector<unsigned int> >("excludeFromResonancePids"));
60  isMiniAOD =
61  (params.exists("isMiniAOD") ? params.getParameter<bool>("isMiniAOD") : (inTag.label() == "packedGenParticles"));
62 
64  edm::LogError("PartonicFinalStateFromMiniAOD")
65  << "Partonic final state not supported for MiniAOD. Falling back to the stable particle selection.";
66  partonicFinalState = false;
67  }
68 
69  produces<reco::CandidatePtrVector>();
70 
71  input_genpartcoll_token_ = consumes<reco::CandidateView>(inTag);
72  if (isMiniAOD)
73  input_prunedgenpartcoll_token_ = consumes<reco::CandidateView>(prunedInTag);
74 }
edm::EDGetTokenT< reco::CandidateView > input_genpartcoll_token_
std::string const & label() const
Definition: InputTag.h:36
Log< level::Error, false > LogError
void setIgnoredParticles(const std::vector< unsigned int > &particleIDs)
edm::EDGetTokenT< reco::CandidateView > input_prunedgenpartcoll_token_
void setExcludeFromResonancePids(const std::vector< unsigned int > &particleIDs)

◆ ~InputGenJetsParticleSelector()

InputGenJetsParticleSelector::~InputGenJetsParticleSelector ( )
override

Definition at line 76 of file InputGenJetsParticleSelector.cc.

76 {}

◆ InputGenJetsParticleSelector() [2/2]

InputGenJetsParticleSelector::InputGenJetsParticleSelector ( )
inlineprivate

Definition at line 63 of file InputGenJetsParticleSelector.h.

63 {} //should not be used!

Member Function Documentation

◆ fromResonance()

InputGenJetsParticleSelector::ResonanceState InputGenJetsParticleSelector::fromResonance ( ParticleBitmap invalid,
const ParticleVector p,
const reco::Candidate particle 
) const

Definition at line 172 of file InputGenJetsParticleSelector.cc.

References mps_fire::i, heavyIonCSV_trainingSettings::idx, invalid, isExcludedFromResonance(), isIgnored(), isParton(), isResonance(), kDirect, kIndirect, kNo, reco::Candidate::mother(), reco::Candidate::numberOfMothers(), AlCaHLTBitMon_ParallelJobs::p, partIdx(), reco::Candidate::pdgId(), mps_fire::result, and reco::Candidate::status().

Referenced by produce().

173  {
174  unsigned int idx = partIdx(p, particle);
175  int id = particle->pdgId();
176 
177  if (invalid[idx])
178  return kIndirect;
179 
180  if (isResonance(id) && (particle->status() == 3 || particle->status() == 22)) {
181  return kDirect;
182  }
183 
184  if (!isIgnored(id) && (isParton(id)))
185  return kNo;
186 
187  unsigned int nMo = particle->numberOfMothers();
188  if (!nMo)
189  return kNo;
190 
191  for (unsigned int i = 0; i < nMo; ++i) {
193  switch (result) {
194  case kNo:
195  break;
196  case kDirect:
197  if (particle->mother(i)->pdgId() == id || isResonance(id))
198  return kDirect;
199  if (!isExcludedFromResonance(id))
200  break;
201  [[fallthrough]];
202  case kIndirect:
203  return kIndirect;
204  }
205  }
206  return kNo;
207 }
static unsigned int partIdx(const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *particle)
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
virtual int status() const =0
status word
virtual size_type numberOfMothers() const =0
number of mothers (zero or one in most of but not all the cases)
virtual int pdgId() const =0
PDG identifier.
ResonanceState fromResonance(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const

◆ getExcludeResonances()

bool InputGenJetsParticleSelector::getExcludeResonances ( ) const
inline

◆ getIgnoredParticles()

const std::vector<unsigned int>& InputGenJetsParticleSelector::getIgnoredParticles ( ) const
inline

Definition at line 43 of file InputGenJetsParticleSelector.h.

References ignoreParticleIDs.

43 { return ignoreParticleIDs; }
std::vector< unsigned int > ignoreParticleIDs

◆ getPartonicFinalState()

bool InputGenJetsParticleSelector::getPartonicFinalState ( ) const
inline

◆ getPtMin()

double InputGenJetsParticleSelector::getPtMin ( ) const
inline

Definition at line 42 of file InputGenJetsParticleSelector.h.

References ptMin.

◆ getTausAndJets()

bool InputGenJetsParticleSelector::getTausAndJets ( ) const
inline

Definition at line 41 of file InputGenJetsParticleSelector.h.

References tausAsJets.

◆ hasPartonChildren()

bool InputGenJetsParticleSelector::hasPartonChildren ( ParticleBitmap invalid,
const ParticleVector p,
const reco::Candidate particle 
) const

Definition at line 209 of file InputGenJetsParticleSelector.cc.

References invalid, AlCaHLTBitMon_ParallelJobs::p, and testPartonChildren().

Referenced by produce().

211  {
212  return testPartonChildren(invalid, p, particle) > 0;
213 }
int testPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const

◆ isExcludedFromResonance()

bool InputGenJetsParticleSelector::isExcludedFromResonance ( int  pdgId) const
private

◆ isHadron()

bool InputGenJetsParticleSelector::isHadron ( int  pdgId)
static

Definition at line 95 of file InputGenJetsParticleSelector.cc.

References EgammaValidation_cff::pdgId.

Referenced by testPartonChildren().

95  {
96  pdgId = (pdgId > 0 ? pdgId : -pdgId) % 10000;
97  return (pdgId > 100 && pdgId < 900) || (pdgId > 1000 && pdgId < 9000);
98 }

◆ isIgnored()

bool InputGenJetsParticleSelector::isIgnored ( int  pdgId) const

◆ isParton()

bool InputGenJetsParticleSelector::isParton ( int  pdgId) const

Definition at line 88 of file InputGenJetsParticleSelector.cc.

References EgammaValidation_cff::pdgId, and tausAsJets.

Referenced by fromResonance(), produce(), and testPartonChildren().

88  {
89  pdgId = (pdgId > 0 ? pdgId : -pdgId) % 10000;
90  return (pdgId > 0 && pdgId < 6) || pdgId == 9 || (tausAsJets && pdgId == 15) || pdgId == 21;
91  // tops are not considered "regular" partons
92  // but taus eventually are (since they may hadronize later)
93 }

◆ isResonance()

bool InputGenJetsParticleSelector::isResonance ( int  pdgId)
static

Definition at line 100 of file InputGenJetsParticleSelector.cc.

References EgammaValidation_cff::pdgId.

Referenced by fromResonance().

100  {
101  // gauge bosons and tops
102  pdgId = (pdgId > 0 ? pdgId : -pdgId) % 10000;
103  return (pdgId > 21 && pdgId <= 42) || pdgId == 6 || pdgId == 7 || pdgId == 8; //BUG! was 21. 22=gamma..
104 }

◆ produce()

void InputGenJetsParticleSelector::produce ( edm::StreamID  ,
edm::Event evt,
const edm::EventSetup evtSetup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 217 of file InputGenJetsParticleSelector.cc.

References excludeResonances, fromResonance(), AJJGenJetFilter_cfi::genParticles, edm::Event::getByToken(), hasPartonChildren(), mps_fire::i, heavyIonCSV_trainingSettings::idx, input_genpartcoll_token_, input_prunedgenpartcoll_token_, invalid, invalidateTree(), isIgnored(), isMiniAOD, isParton(), eostools::move(), reco::Candidate::numberOfDaughters(), ecalTrigSettings_cff::particles, partonicFinalState, reco::Candidate::pdgId(), prunedGenParticles_cfi::prunedGenParticles, reco::Candidate::pt(), ptMin, edm::Event::put(), findQualityFiles::size, jetUpdater_cfi::sort, and reco::Candidate::status().

217  {
218  auto selected_ = std::make_unique<reco::CandidatePtrVector>();
219 
221 
223  if (isMiniAOD) {
225 
227  iter != prunedGenParticles->end();
228  ++iter) {
229  if (iter->status() !=
230  1) // to avoid double-counting, skipping stable particles already contained in the collection of PackedGenParticles
231  particles.push_back(&*iter);
232  }
233  }
234 
237 
238  std::map<const reco::Candidate *, size_t> particlePtrIdxMap;
239 
240  for (edm::View<reco::Candidate>::const_iterator iter = genParticles->begin(); iter != genParticles->end(); ++iter) {
241  particles.push_back(&*iter);
242  particlePtrIdxMap[&*iter] = (iter - genParticles->begin());
243  }
244 
245  std::sort(particles.begin(), particles.end());
246  unsigned int size = particles.size();
247 
248  ParticleBitmap selected(size, false);
249  ParticleBitmap invalid(size, false);
250 
251  for (unsigned int i = 0; i < size; i++) {
252  const reco::Candidate *particle = particles[i];
253  if (invalid[i])
254  continue;
255  if (particle->status() == 1) // selecting stable particles
256  selected[i] = true;
257  if (partonicFinalState && isParton(particle->pdgId())) {
258  if (particle->numberOfDaughters() == 0 && particle->status() != 1) {
259  // some brokenness in event...
260  invalid[i] = true;
261  } else if (!hasPartonChildren(invalid, particles, particle)) {
262  selected[i] = true;
263  invalidateTree(invalid, particles, particle); //this?!?
264  }
265  }
266  }
267 
268  for (size_t idx = 0; idx < size; ++idx) {
269  const reco::Candidate *particle = particles[idx];
270  if (!selected[idx] || invalid[idx]) {
271  continue;
272  }
273 
274  if (excludeResonances && fromResonance(invalid, particles, particle)) {
275  invalid[idx] = true;
276  //cout<<"[INPUTSELECTOR] Invalidates FROM RESONANCE!: ["<<setw(4)<<idx<<"] "<<particle->pdgId()<<" "<<particle->pt()<<endl;
277  continue;
278  }
279 
280  if (isIgnored(particle->pdgId())) {
281  continue;
282  }
283 
284  if (particle->pt() >= ptMin) {
285  selected_->push_back(genParticles->ptrAt(particlePtrIdxMap[particle]));
286  //cout<<"Finally we have: ["<<setw(4)<<idx<<"] "<<setw(4)<<particle->pdgId()<<" "<<particle->pt()<<endl;
287  }
288  }
289  evt.put(std::move(selected_));
290 }
size
Write out results.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::EDGetTokenT< reco::CandidateView > input_genpartcoll_token_
virtual double pt() const =0
transverse momentum
virtual int status() const =0
status word
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
bool hasPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
virtual size_type numberOfDaughters() const =0
number of daughters
edm::EDGetTokenT< reco::CandidateView > input_prunedgenpartcoll_token_
virtual int pdgId() const =0
PDG identifier.
static void invalidateTree(InputGenJetsParticleSelector::ParticleBitmap &invalid, const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *particle)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:88
std::vector< const reco::Candidate * > ParticleVector
ResonanceState fromResonance(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
def move(src, dest)
Definition: eostools.py:511

◆ setExcludeFromResonancePids()

void InputGenJetsParticleSelector::setExcludeFromResonancePids ( const std::vector< unsigned int > &  particleIDs)
private

◆ setExcludeResonances()

void InputGenJetsParticleSelector::setExcludeResonances ( bool  flag = true)
inline

◆ setIgnoredParticles()

void InputGenJetsParticleSelector::setIgnoredParticles ( const std::vector< unsigned int > &  particleIDs)
private

Definition at line 78 of file InputGenJetsParticleSelector.cc.

References ignoreParticleIDs, and jetUpdater_cfi::sort.

Referenced by InputGenJetsParticleSelector().

78  {
79  ignoreParticleIDs = particleIDs;
81 }
std::vector< unsigned int > ignoreParticleIDs

◆ setPartonicFinalState()

void InputGenJetsParticleSelector::setPartonicFinalState ( bool  flag = true)
inline

◆ setPtMin()

void InputGenJetsParticleSelector::setPtMin ( double  ptMin)
inline

Definition at line 48 of file InputGenJetsParticleSelector.h.

References ptMin.

◆ setTausAsJets()

void InputGenJetsParticleSelector::setTausAsJets ( bool  flag = true)
inline

◆ testPartonChildren()

int InputGenJetsParticleSelector::testPartonChildren ( InputGenJetsParticleSelector::ParticleBitmap invalid,
const ParticleVector p,
const reco::Candidate particle 
) const
private

Definition at line 147 of file InputGenJetsParticleSelector.cc.

References reco::Candidate::daughter(), mps_fire::i, heavyIonCSV_trainingSettings::idx, invalid, isHadron(), isParton(), npart, reco::Candidate::numberOfDaughters(), AlCaHLTBitMon_ParallelJobs::p, partIdx(), reco::Candidate::pdgId(), and mps_fire::result.

Referenced by hasPartonChildren().

149  {
150  unsigned int npart = particle->numberOfDaughters();
151  if (!npart) {
152  return 0;
153  }
154 
155  for (unsigned int i = 0; i < npart; ++i) {
156  unsigned int idx = partIdx(p, particle->daughter(i));
157  if (invalid[idx])
158  continue;
159  if (isParton((particle->daughter(i)->pdgId()))) {
160  return 1;
161  }
162  if (isHadron((particle->daughter(i)->pdgId()))) {
163  return -1;
164  }
165  int result = testPartonChildren(invalid, p, particle->daughter(i));
166  if (result)
167  return result;
168  }
169  return 0;
170 }
static unsigned int partIdx(const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *particle)
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
double npart
Definition: HydjetWrapper.h:48
virtual size_type numberOfDaughters() const =0
number of daughters
virtual int pdgId() const =0
PDG identifier.
int testPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const

Member Data Documentation

◆ excludeFromResonancePids

std::vector<unsigned int> InputGenJetsParticleSelector::excludeFromResonancePids
private

◆ excludeResonances

bool InputGenJetsParticleSelector::excludeResonances
private

◆ ignoreParticleIDs

std::vector<unsigned int> InputGenJetsParticleSelector::ignoreParticleIDs
private

◆ input_genpartcoll_token_

edm::EDGetTokenT<reco::CandidateView> InputGenJetsParticleSelector::input_genpartcoll_token_
private

Definition at line 81 of file InputGenJetsParticleSelector.h.

Referenced by InputGenJetsParticleSelector(), and produce().

◆ input_prunedgenpartcoll_token_

edm::EDGetTokenT<reco::CandidateView> InputGenJetsParticleSelector::input_prunedgenpartcoll_token_
private

Definition at line 82 of file InputGenJetsParticleSelector.h.

Referenced by InputGenJetsParticleSelector(), and produce().

◆ inTag

edm::InputTag InputGenJetsParticleSelector::inTag
private

Definition at line 65 of file InputGenJetsParticleSelector.h.

Referenced by InputGenJetsParticleSelector().

◆ isMiniAOD

bool InputGenJetsParticleSelector::isMiniAOD
private

Definition at line 78 of file InputGenJetsParticleSelector.h.

Referenced by InputGenJetsParticleSelector(), and produce().

◆ partonicFinalState

bool InputGenJetsParticleSelector::partonicFinalState
private

◆ prunedInTag

edm::InputTag InputGenJetsParticleSelector::prunedInTag
private

Definition at line 66 of file InputGenJetsParticleSelector.h.

Referenced by InputGenJetsParticleSelector().

◆ ptMin

double InputGenJetsParticleSelector::ptMin
private

Definition at line 79 of file InputGenJetsParticleSelector.h.

Referenced by getPtMin(), produce(), and setPtMin().

◆ tausAsJets

bool InputGenJetsParticleSelector::tausAsJets
private

Definition at line 77 of file InputGenJetsParticleSelector.h.

Referenced by getTausAndJets(), isParton(), and setTausAsJets().