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 
8 namespace TopDecayID{
11  static const int stable = 2;
12  static const int unfrag = 3;
13  static const int tID = 6;
14  static const int bID = 5;
15  static const int glueID = 21;
16  static const int photID = 22;
17  static const int ZID = 23;
18  static const int WID = 24;
19  static const int elecID = 11;
20  static const int muonID = 13;
21  static const int tauID = 15;
22 }
23 
24 namespace WDecay{
29 }
30 
41 class TopGenEvent {
42 
43  public:
44 
50  virtual ~TopGenEvent(){};
51 
53  const reco::GenParticleCollection& particles() const { return *parts_; }
55  const reco::GenParticleCollection& initialPartons() const { return *initPartons_;}
57  std::vector<const reco::GenParticle*> radiatedGluons(int pdgId) const;
59  std::vector<const reco::GenParticle*> lightQuarks(bool includingBQuarks=false) const;
61  int numberOfLeptons(bool fromWBoson=true) const;
63  int numberOfLeptons(WDecay::LeptonType type, bool fromWBoson=true) const;
65  int numberOfBQuarks(bool fromTopQuark=true) const;
67  std::vector<const reco::GenParticle*> topSisters() const;
69  const reco::GenParticle* daughterQuarkOfTop(bool invertCharge=false) const;
71  const reco::GenParticle* daughterQuarkOfTopBar() const { return daughterQuarkOfTop(true); };
73  const reco::GenParticle* daughterQuarkOfWPlus(bool invertQuarkCharge=false, bool invertBosonCharge=false) const;
75  const reco::GenParticle* daughterQuarkOfWMinus() const { return daughterQuarkOfWPlus(false, true); };
77  const reco::GenParticle* daughterQuarkBarOfWPlus() const { return daughterQuarkOfWPlus(true, false); };
79  const reco::GenParticle* daughterQuarkBarOfWMinus() const { return daughterQuarkOfWPlus(true, true); };
80 
82  const reco::GenParticle* candidate(int id, unsigned int parentId=0) const;
84  const reco::GenParticle* eMinus() const { return candidate( TopDecayID::elecID, TopDecayID::WID );}
86  const reco::GenParticle* ePlus() const { return candidate(-TopDecayID::elecID, TopDecayID::WID );}
88  const reco::GenParticle* muMinus() const { return candidate( TopDecayID::muonID, TopDecayID::WID );}
90  const reco::GenParticle* muPlus() const { return candidate(-TopDecayID::muonID, TopDecayID::WID );}
92  const reco::GenParticle* tauMinus() const { return candidate( TopDecayID::tauID, TopDecayID::WID );}
94  const reco::GenParticle* tauPlus() const { return candidate(-TopDecayID::tauID, TopDecayID::WID );}
96  const reco::GenParticle* wMinus() const { return candidate(-TopDecayID::WID, TopDecayID::tID );}
98  const reco::GenParticle* wPlus() const { return candidate( TopDecayID::WID, TopDecayID::tID );}
100  const reco::GenParticle* b() const { return candidate( TopDecayID::bID, TopDecayID::tID );}
102  const reco::GenParticle* bBar() const { return candidate(-TopDecayID::bID, TopDecayID::tID );}
104  const reco::GenParticle* top() const { return candidate( TopDecayID::tID );}
106  const reco::GenParticle* topBar() const { return candidate(-TopDecayID::tID );}
107 
110  void print() const;
111 
112  protected:
113 
118 };
119 
120 #endif
const reco::GenParticle * wPlus() const
return W plus if available; 0 else
Definition: TopGenEvent.h:98
type
Definition: HCALResponse.h:21
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
const reco::GenParticle * b() const
return b quark if available; 0 else
Definition: TopGenEvent.h:100
const reco::GenParticle * ePlus() const
return positron if available; 0 else
Definition: TopGenEvent.h:86
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
static const int bID
Definition: TopGenEvent.h:14
static const int glueID
Definition: TopGenEvent.h:15
static const int unfrag
Definition: TopGenEvent.h:12
const reco::GenParticle * tauPlus() const
return anti-tau if available; 0 else
Definition: TopGenEvent.h:94
static const int stable
Definition: TopGenEvent.h:11
TopGenEvent()
empty constructor
Definition: TopGenEvent.h:46
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
const reco::GenParticle * muMinus() const
return muon if available; 0 else
Definition: TopGenEvent.h:88
const reco::GenParticle * bBar() const
return anti-b quark if available; 0 else
Definition: TopGenEvent.h:102
const reco::GenParticle * top() const
return top if available; 0 else
Definition: TopGenEvent.h:104
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:117
static const int tID
Definition: TopGenEvent.h:13
static const int tauID
Definition: TopGenEvent.h:21
const reco::GenParticle * tauMinus() const
return tau if available; 0 else
Definition: TopGenEvent.h:92
static const int ZID
Definition: TopGenEvent.h:17
static const int muonID
Definition: TopGenEvent.h:20
Base class to hold information for reduced top generator information.
Definition: TopGenEvent.h:41
const reco::GenParticle * daughterQuarkOfTopBar() const
return daughter quark of anti-top quark (which can have flavor b, s or d)
Definition: TopGenEvent.h:71
static const int WID
Definition: TopGenEvent.h:18
const reco::GenParticle * wMinus() const
return W minus if available; 0 else
Definition: TopGenEvent.h:96
const reco::GenParticleCollection & particles() const
return particles of decay chain
Definition: TopGenEvent.h:53
const reco::GenParticle * daughterQuarkBarOfWMinus() const
return anti-quark daughter of anti-W boson
Definition: TopGenEvent.h:79
static const int elecID
Definition: TopGenEvent.h:19
const reco::GenParticle * daughterQuarkBarOfWPlus() const
return anti-quark daughter of W boson
Definition: TopGenEvent.h:77
const reco::GenParticleCollection & initialPartons() const
return particles of initial partons
Definition: TopGenEvent.h:55
static const int photID
Definition: TopGenEvent.h:16
virtual ~TopGenEvent()
default destructor
Definition: TopGenEvent.h:50
const reco::GenParticle * daughterQuarkOfWMinus() const
return quark daughter of anti-W boson
Definition: TopGenEvent.h:75
const reco::GenParticle * muPlus() const
return anti-muon if available; 0 else
Definition: TopGenEvent.h:90
const reco::GenParticle * topBar() const
return anti-top if available; 0 else
Definition: TopGenEvent.h:106
const reco::GenParticle * eMinus() const
return electron if available; 0 else
Definition: TopGenEvent.h:84