CMS 3D CMS Logo

TopDecaySubset.h
Go to the documentation of this file.
1 #include <memory>
2 #include <string>
3 #include <vector>
4 #include <map>
5 
9 
13 
15 
29 public:
32  enum FillMode { kStable, kME };
36  enum RunMode { kRun1, kRun2 };
37 
39  explicit TopDecaySubset(const edm::ParameterSet& cfg);
41  ~TopDecaySubset() override;
43  void produce(edm::Event& event, const edm::EventSetup& setup) override;
44 
45 private:
47  std::vector<const reco::GenParticle*> findTops(const reco::GenParticleCollection& parts);
50  std::vector<const reco::GenParticle*> findPrimalTops(const reco::GenParticleCollection& parts);
53  std::vector<const reco::GenParticle*> findDecayingTops(const reco::GenParticleCollection& parts);
59  // const reco::GenParticle* findDecayingW(const reco::GenParticle* top);
66  ShowerModel checkShowerModel(const std::vector<const reco::GenParticle*>& tops) const;
69  void checkWBosons(std::vector<const reco::GenParticle*>& tops) const;
71  void fillListing(const std::vector<const reco::GenParticle*>& tops, reco::GenParticleCollection& target);
73  void fillListing(const std::vector<const reco::GenParticle*>& primalTops,
74  const std::vector<const reco::GenParticle*>& decayingTops,
76 
78  void clearReferences();
82  reco::Particle::LorentzVector p4(const std::vector<const reco::GenParticle*>::const_iterator top, int statusFlag);
86  void addDaughters(int& idx,
89  bool recursive = true);
92  void addRadiation(int& idx, const reco::GenParticle* part, reco::GenParticleCollection& target);
93 
94 private:
108 
114  std::map<int, std::vector<int> > refs_;
115 };
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
void addDaughters(int &idx, const reco::GenParticle::const_iterator part, reco::GenParticleCollection &target, bool recursive=true)
recursively fill vector for all further decay particles of a given particle
std::map< int, std::vector< int > > refs_
management of daughter indices for fillRefs
ShowerModel checkShowerModel(const std::vector< const reco::GenParticle * > &tops) const
check the decay chain for the used shower model
ShowerModel showerModel_
parton shower mode (filled in checkShowerModel)
void addRadiation(int &idx, const reco::GenParticle::const_iterator part, reco::GenParticleCollection &target)
fill vector including all radiations from quarks originating from W/top
RunMode
supported modes to run the code
std::vector< const reco::GenParticle * > findTops(const reco::GenParticleCollection &parts)
find top quarks in list of input particles
void clearReferences()
clear references
edm::EDGetTokenT< GenEventInfoProduct > genEventInfo_srcToken_
input tag for the genEventInfo source
~TopDecaySubset() override
default destructor
reco::Particle::LorentzVector p4(const std::vector< const reco::GenParticle * >::const_iterator top, int statusFlag)
calculate lorentz vector from input (dedicated to top reconstruction)
void checkWBosons(std::vector< const reco::GenParticle * > &tops) const
check whether W bosons are contained in the original gen particle listing
bool addRadiation_
add radiation or not?
ShowerModel
classification of potential shower types
void produce(edm::Event &event, const edm::EventSetup &setup) override
write output into the event
std::vector< const reco::GenParticle * > findDecayingTops(const reco::GenParticleCollection &parts)
edm::EDGetTokenT< reco::GenParticleCollection > srcToken_
input tag for the genParticle source
void fillReferences(const reco::GenParticleRefProd &refProd, reco::GenParticleCollection &target)
fill references for output vector
std::vector< const reco::GenParticle * > findPrimalTops(const reco::GenParticleCollection &parts)
part
Definition: HCALResponse.h:20
TopDecaySubset(const edm::ParameterSet &cfg)
default constructor
RunMode runMode_
run mode (Run1 || Run2)
void fillListing(const std::vector< const reco::GenParticle * > &tops, reco::GenParticleCollection &target)
fill output vector for full decay chain
FillMode fillMode_
Module to produce the subset of generator particles directly contained in top decay chains...
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
Definition: event.py:1
const reco::GenParticle * findPrimalW(const reco::GenParticle *top)
const reco::GenParticle * findLastParticleInChain(const reco::GenParticle *p)