CMS 3D CMS Logo

InputGenJetsParticleSelector.h
Go to the documentation of this file.
1 #ifndef __InputGenJetsParticleSelector__
2 #define __InputGenJetsParticleSelector__
3 
4 /* \class InputGenJetsParticleSelector
5  *
6  * Selects particles for the GenJet input.
7  * Deselect specified particles, also radiation from resoances.
8  * Or only select partonic final state.
9  * The algorithm is based on code of Christophe Saout.
10  *
11  * \author: Andreas Oehler
12  *
13  *
14  */
15 
20 
22 
26 
28  // collection type
29 public:
30  typedef std::vector<bool> ParticleBitmap;
31  typedef std::vector<const reco::Candidate *> ParticleVector;
32 
35  // select object from a collection and
36  // possibly event content
37  void produce(edm::StreamID, edm::Event &evt, const edm::EventSetup &evtSetup) const override;
38 
39  bool getPartonicFinalState() const { return partonicFinalState; }
40  bool getExcludeResonances() const { return excludeResonances; }
41  bool getTausAndJets() const { return tausAsJets; }
42  double getPtMin() const { return ptMin; }
43  const std::vector<unsigned int> &getIgnoredParticles() const { return ignoreParticleIDs; }
44 
47  void setTausAsJets(bool flag = true) { tausAsJets = flag; }
48  void setPtMin(double ptMin) { this->ptMin = ptMin; }
49  bool isParton(int pdgId) const;
50  static bool isHadron(int pdgId);
51  static bool isResonance(int pdgId);
52 
53  bool isIgnored(int pdgId) const;
54  bool hasPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const;
55 
58 
59  // iterators over selected objects: collection begin
60 
61 private:
62  //container selected_; //container required by selector
63  InputGenJetsParticleSelector() {} //should not be used!
64 
67  int testPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const;
68 
69  std::vector<unsigned int> ignoreParticleIDs;
70  std::vector<unsigned int> excludeFromResonancePids;
71  void setExcludeFromResonancePids(const std::vector<unsigned int> &particleIDs);
72  void setIgnoredParticles(const std::vector<unsigned int> &particleIDs);
73  bool isExcludedFromResonance(int pdgId) const;
74 
77  bool tausAsJets;
78  bool isMiniAOD;
79  double ptMin;
80 
83 };
84 
85 #endif
edm::StreamID
Definition: StreamID.h:30
InputGenJetsParticleSelector::~InputGenJetsParticleSelector
~InputGenJetsParticleSelector() override
Definition: InputGenJetsParticleSelector.cc:76
InputGenJetsParticleSelector::getExcludeResonances
bool getExcludeResonances() const
Definition: InputGenJetsParticleSelector.h:40
InputGenJetsParticleSelector::input_genpartcoll_token_
edm::EDGetTokenT< reco::CandidateView > input_genpartcoll_token_
Definition: InputGenJetsParticleSelector.h:81
edm::EDGetTokenT
Definition: EDGetToken.h:33
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
InputGenJetsParticleSelector::fromResonance
ResonanceState fromResonance(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
Definition: InputGenJetsParticleSelector.cc:172
InputGenJetsParticleSelector::testPartonChildren
int testPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
Definition: InputGenJetsParticleSelector.cc:147
InputGenJetsParticleSelector::isParton
bool isParton(int pdgId) const
Definition: InputGenJetsParticleSelector.cc:88
InputGenJetsParticleSelector::isHadron
static bool isHadron(int pdgId)
Definition: InputGenJetsParticleSelector.cc:95
InputGenJetsParticleSelector::setExcludeResonances
void setExcludeResonances(bool flag=true)
Definition: InputGenJetsParticleSelector.h:46
InputGenJetsParticleSelector::kDirect
Definition: InputGenJetsParticleSelector.h:56
InputGenJetsParticleSelector::InputGenJetsParticleSelector
InputGenJetsParticleSelector()
Definition: InputGenJetsParticleSelector.h:63
InputGenJetsParticleSelector::getIgnoredParticles
const std::vector< unsigned int > & getIgnoredParticles() const
Definition: InputGenJetsParticleSelector.h:43
InputGenJetsParticleSelector::ignoreParticleIDs
std::vector< unsigned int > ignoreParticleIDs
Definition: InputGenJetsParticleSelector.h:69
CTPPSpixelLocalTrackReconstructionInfo::invalid
InputGenJetsParticleSelector::input_prunedgenpartcoll_token_
edm::EDGetTokenT< reco::CandidateView > input_prunedgenpartcoll_token_
Definition: InputGenJetsParticleSelector.h:82
CandidateFwd.h
InputGenJetsParticleSelector::excludeFromResonancePids
std::vector< unsigned int > excludeFromResonancePids
Definition: InputGenJetsParticleSelector.h:70
InputGenJetsParticleSelector::setPartonicFinalState
void setPartonicFinalState(bool flag=true)
Definition: InputGenJetsParticleSelector.h:45
InputGenJetsParticleSelector::produce
void produce(edm::StreamID, edm::Event &evt, const edm::EventSetup &evtSetup) const override
Definition: InputGenJetsParticleSelector.cc:217
InputGenJetsParticleSelector::kNo
Definition: InputGenJetsParticleSelector.h:56
InputGenJetsParticleSelector::setIgnoredParticles
void setIgnoredParticles(const std::vector< unsigned int > &particleIDs)
Definition: InputGenJetsParticleSelector.cc:78
Provenance.h
InputGenJetsParticleSelector::setExcludeFromResonancePids
void setExcludeFromResonancePids(const std::vector< unsigned int > &particleIDs)
Definition: InputGenJetsParticleSelector.cc:83
InputGenJetsParticleSelector::setTausAsJets
void setTausAsJets(bool flag=true)
Definition: InputGenJetsParticleSelector.h:47
InputGenJetsParticleSelector::hasPartonChildren
bool hasPartonChildren(ParticleBitmap &invalid, const ParticleVector &p, const reco::Candidate *particle) const
Definition: InputGenJetsParticleSelector.cc:209
InputGenJetsParticleSelector::isResonance
static bool isResonance(int pdgId)
Definition: InputGenJetsParticleSelector.cc:100
InputGenJetsParticleSelector::kIndirect
Definition: InputGenJetsParticleSelector.h:56
InputGenJetsParticleSelector
Definition: InputGenJetsParticleSelector.h:27
InputGenJetsParticleSelector::partonicFinalState
bool partonicFinalState
Definition: InputGenJetsParticleSelector.h:75
InputGenJetsParticleSelector::getTausAndJets
bool getTausAndJets() const
Definition: InputGenJetsParticleSelector.h:41
edm::global::EDProducer
Definition: EDProducer.h:32
InputGenJetsParticleSelector::isMiniAOD
bool isMiniAOD
Definition: InputGenJetsParticleSelector.h:78
InputGenJetsParticleSelector::ResonanceState
ResonanceState
Definition: InputGenJetsParticleSelector.h:56
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
EgammaValidation_cff.pdgId
pdgId
Definition: EgammaValidation_cff.py:118
InputGenJetsParticleSelector::ParticleBitmap
std::vector< bool > ParticleBitmap
Definition: InputGenJetsParticleSelector.h:30
edm::EventSetup
Definition: EventSetup.h:58
reco::Candidate
Definition: Candidate.h:27
InputGenJetsParticleSelector::tausAsJets
bool tausAsJets
Definition: InputGenJetsParticleSelector.h:77
InputGenJetsParticleSelector::inTag
edm::InputTag inTag
Definition: InputGenJetsParticleSelector.h:65
InputGenJetsParticleSelector::isIgnored
bool isIgnored(int pdgId) const
Definition: InputGenJetsParticleSelector.cc:106
InputGenJetsParticleSelector::getPtMin
double getPtMin() const
Definition: InputGenJetsParticleSelector.h:42
InputGenJetsParticleSelector::setPtMin
void setPtMin(double ptMin)
Definition: InputGenJetsParticleSelector.h:48
InputGenJetsParticleSelector::ptMin
double ptMin
Definition: InputGenJetsParticleSelector.h:79
InputGenJetsParticleSelector::excludeResonances
bool excludeResonances
Definition: InputGenJetsParticleSelector.h:76
Candidate.h
ParameterSet.h
EDProducer.h
InputGenJetsParticleSelector::ParticleVector
std::vector< const reco::Candidate * > ParticleVector
Definition: InputGenJetsParticleSelector.h:31
edm::Event
Definition: Event.h:73
InputGenJetsParticleSelector::isExcludedFromResonance
bool isExcludedFromResonance(int pdgId) const
Definition: InputGenJetsParticleSelector.cc:113
EDProductfwd.h
edm::InputTag
Definition: InputTag.h:15
InputGenJetsParticleSelector::prunedInTag
edm::InputTag prunedInTag
Definition: InputGenJetsParticleSelector.h:66
InputGenJetsParticleSelector::getPartonicFinalState
bool getPartonicFinalState() const
Definition: InputGenJetsParticleSelector.h:39
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116