CMS 3D CMS Logo

TopGenEvent.h
Go to the documentation of this file.
1 #ifndef TopObjects_TopGenEvent_h
2 #define TopObjects_TopGenEvent_h
3 
6 
7 namespace TopDecayID {
10  static const int stable = 2;
11  static const int unfrag = 3;
12  static const int tID = 6;
13  static const int bID = 5;
14  static const int glueID = 21;
15  static const int photID = 22;
16  static const int ZID = 23;
17  static const int WID = 24;
18  static const int elecID = 11;
19  static const int muonID = 13;
20  static const int tauID = 15;
21 } // namespace TopDecayID
22 
23 namespace WDecay {
28 } // namespace WDecay
29 
40 class TopGenEvent {
41 public:
47  virtual ~TopGenEvent(){};
48 
50  const reco::GenParticleCollection& particles() const { return *parts_; }
54  std::vector<const reco::GenParticle*> radiatedGluons(int pdgId) const;
56  std::vector<const reco::GenParticle*> lightQuarks(bool includingBQuarks = false) const;
58  int numberOfLeptons(bool fromWBoson = true) const;
60  int numberOfLeptons(WDecay::LeptonType type, bool fromWBoson = true) const;
62  int numberOfBQuarks(bool fromTopQuark = true) const;
64  std::vector<const reco::GenParticle*> topSisters() const;
66  const reco::GenParticle* daughterQuarkOfTop(bool invertCharge = false) const;
70  const reco::GenParticle* daughterQuarkOfWPlus(bool invertQuarkCharge = false, bool invertBosonCharge = false) const;
72  const reco::GenParticle* daughterQuarkOfWMinus() const { return daughterQuarkOfWPlus(false, true); };
74  const reco::GenParticle* daughterQuarkBarOfWPlus() const { return daughterQuarkOfWPlus(true, false); };
76  const reco::GenParticle* daughterQuarkBarOfWMinus() const { return daughterQuarkOfWPlus(true, true); };
77 
79  const reco::GenParticle* candidate(int id, unsigned int parentId = 0) const;
101  const reco::GenParticle* top() const { return candidate(TopDecayID::tID); }
103  const reco::GenParticle* topBar() const { return candidate(-TopDecayID::tID); }
104 
107  void print() const;
108 
109 protected:
114 };
115 
116 #endif
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
const reco::GenParticle * b() const
return b quark if available; 0 else
Definition: TopGenEvent.h:97
int numberOfBQuarks(bool fromTopQuark=true) const
return number of b quarks in the decay chain
Definition: TopGenEvent.cc:99
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:111
const reco::GenParticle * wMinus() const
return W minus if available; 0 else
Definition: TopGenEvent.h:93
static const int bID
Definition: TopGenEvent.h:13
const reco::GenParticle * daughterQuarkOfTop(bool invertCharge=false) const
return daughter quark of top quark (which can have flavor b, s or d)
Definition: TopGenEvent.cc:132
static const int glueID
Definition: TopGenEvent.h:14
static const int unfrag
Definition: TopGenEvent.h:11
static const int stable
Definition: TopGenEvent.h:10
const reco::GenParticleCollection & particles() const
return particles of decay chain
Definition: TopGenEvent.h:50
int numberOfLeptons(bool fromWBoson=true) const
return number of leptons in the decay chain
Definition: TopGenEvent.cc:41
const reco::GenParticle * daughterQuarkOfTopBar() const
return daughter quark of anti-top quark (which can have flavor b, s or d)
Definition: TopGenEvent.h:68
const reco::GenParticle * topBar() const
return anti-top if available; 0 else
Definition: TopGenEvent.h:103
TopGenEvent()
empty constructor
Definition: TopGenEvent.h:43
const reco::GenParticle * bBar() const
return anti-b quark if available; 0 else
Definition: TopGenEvent.h:99
const reco::GenParticle * daughterQuarkOfWPlus(bool invertQuarkCharge=false, bool invertBosonCharge=false) const
return quark daughter quark of W boson
Definition: TopGenEvent.cc:150
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:113
static const int tID
Definition: TopGenEvent.h:12
static const int tauID
Definition: TopGenEvent.h:20
std::vector< const reco::GenParticle * > radiatedGluons(int pdgId) const
return radiated gluons from particle with pdgId
Definition: TopGenEvent.cc:177
std::vector< const reco::GenParticle * > lightQuarks(bool includingBQuarks=false) const
return all light quarks or all quarks including b&#39;s
Definition: TopGenEvent.cc:164
const reco::GenParticle * tauPlus() const
return anti-tau if available; 0 else
Definition: TopGenEvent.h:91
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:14
std::vector< const reco::GenParticle * > topSisters() const
return number of top anti-top sisters
Definition: TopGenEvent.cc:117
const reco::GenParticle * top() const
return top if available; 0 else
Definition: TopGenEvent.h:101
const reco::GenParticle * wPlus() const
return W plus if available; 0 else
Definition: TopGenEvent.h:95
static const int ZID
Definition: TopGenEvent.h:16
const reco::GenParticle * daughterQuarkBarOfWMinus() const
return anti-quark daughter of anti-W boson
Definition: TopGenEvent.h:76
static const int muonID
Definition: TopGenEvent.h:19
const reco::GenParticle * tauMinus() const
return tau if available; 0 else
Definition: TopGenEvent.h:89
Base class to hold information for reduced top generator information.
Definition: TopGenEvent.h:40
static const int WID
Definition: TopGenEvent.h:17
const reco::GenParticle * eMinus() const
return electron if available; 0 else
Definition: TopGenEvent.h:81
const reco::GenParticle * muMinus() const
return muon if available; 0 else
Definition: TopGenEvent.h:85
const reco::GenParticleCollection & initialPartons() const
return particles of initial partons
Definition: TopGenEvent.h:52
static const int elecID
Definition: TopGenEvent.h:18
void print() const
Definition: TopGenEvent.cc:27
static const int photID
Definition: TopGenEvent.h:15
const reco::GenParticle * daughterQuarkOfWMinus() const
return quark daughter of anti-W boson
Definition: TopGenEvent.h:72
const reco::GenParticle * daughterQuarkBarOfWPlus() const
return anti-quark daughter of W boson
Definition: TopGenEvent.h:74
const reco::GenParticle * ePlus() const
return positron if available; 0 else
Definition: TopGenEvent.h:83
virtual ~TopGenEvent()
default destructor
Definition: TopGenEvent.h:47
const reco::GenParticle * muPlus() const
return anti-muon if available; 0 else
Definition: TopGenEvent.h:87