test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
StGenEvent Class Reference

Class derived from the TopGenEvent for single-top events. More...

#include "AnalysisDataFormats/TopObjects/interface/StGenEvent.h"

Inheritance diagram for StGenEvent:
TopGenEvent

Public Member Functions

const reco::GenParticleassociatedB () const
 return associated b More...
 
const reco::GenParticledecayB () const
 return decay b More...
 
const reco::GenParticlesingleLepton () const
 return single lepton if available; 0 else More...
 
const reco::GenParticlesingleNeutrino () const
 return single neutrino if available; 0 else More...
 
const reco::GenParticlesingleTop () const
 return single Top More...
 
const reco::GenParticlesingleW () const
 return single W More...
 
 StGenEvent ()
 empty constructor More...
 
 StGenEvent (reco::GenParticleRefProd &, reco::GenParticleRefProd &)
 default constructor More...
 
virtual ~StGenEvent ()
 default destructor More...
 
- Public Member Functions inherited from TopGenEvent
const reco::GenParticleb () const
 return b quark if available; 0 else More...
 
const reco::GenParticlebBar () const
 return anti-b quark if available; 0 else More...
 
const reco::GenParticlecandidate (int id, unsigned int parentId=0) const
 get candidate with given pdg id if available; 0 else More...
 
const reco::GenParticledaughterQuarkBarOfWMinus () const
 return anti-quark daughter of anti-W boson More...
 
const reco::GenParticledaughterQuarkBarOfWPlus () const
 return anti-quark daughter of W boson More...
 
const reco::GenParticledaughterQuarkOfTop (bool invertCharge=false) const
 return daughter quark of top quark (which can have flavor b, s or d) More...
 
const reco::GenParticledaughterQuarkOfTopBar () const
 return daughter quark of anti-top quark (which can have flavor b, s or d) More...
 
const reco::GenParticledaughterQuarkOfWMinus () const
 return quark daughter of anti-W boson More...
 
const reco::GenParticledaughterQuarkOfWPlus (bool invertQuarkCharge=false, bool invertBosonCharge=false) const
 return quark daughter quark of W boson More...
 
const reco::GenParticleeMinus () const
 return electron if available; 0 else More...
 
const reco::GenParticleePlus () const
 return positron if available; 0 else More...
 
const reco::GenParticleCollectioninitialPartons () const
 return particles of initial partons More...
 
std::vector< const
reco::GenParticle * > 
lightQuarks (bool includingBQuarks=false) const
 return all light quarks or all quarks including b's More...
 
const reco::GenParticlemuMinus () const
 return muon if available; 0 else More...
 
const reco::GenParticlemuPlus () const
 return anti-muon if available; 0 else More...
 
int numberOfBQuarks (bool fromTopQuark=true) const
 return number of b quarks in the decay chain More...
 
int numberOfLeptons (bool fromWBoson=true) const
 return number of leptons in the decay chain More...
 
int numberOfLeptons (WDecay::LeptonType type, bool fromWBoson=true) const
 return number of leptons in the decay chain More...
 
const reco::GenParticleCollectionparticles () const
 return particles of decay chain More...
 
void print () const
 
std::vector< const
reco::GenParticle * > 
radiatedGluons (int pdgId) const
 return radiated gluons from particle with pdgId More...
 
const reco::GenParticletauMinus () const
 return tau if available; 0 else More...
 
const reco::GenParticletauPlus () const
 return anti-tau if available; 0 else More...
 
const reco::GenParticletop () const
 return top if available; 0 else More...
 
const reco::GenParticletopBar () const
 return anti-top if available; 0 else More...
 
 TopGenEvent ()
 empty constructor More...
 
 TopGenEvent (reco::GenParticleRefProd &decaySubset, reco::GenParticleRefProd &iniSubset)
 default constructor More...
 
std::vector< const
reco::GenParticle * > 
topSisters () const
 return number of top anti-top sisters More...
 
const reco::GenParticlewMinus () const
 return W minus if available; 0 else More...
 
const reco::GenParticlewPlus () const
 return W plus if available; 0 else More...
 
virtual ~TopGenEvent ()
 default destructor More...
 

Additional Inherited Members

- Protected Attributes inherited from TopGenEvent
reco::GenParticleRefProd initPartons_
 reference to the list of initial partons (has to be kept in the event!) More...
 
reco::GenParticleRefProd parts_
 reference to the top decay chain (has to be kept in the event!) More...
 

Detailed Description

Class derived from the TopGenEvent for single-top events.

The structure holds reference information to the generator particles of the decay chains for each top quark and of the initial partons and provides access and administration. The derived class contains a few additional getters with respect to its base class.

Definition at line 17 of file StGenEvent.h.

Constructor & Destructor Documentation

StGenEvent::StGenEvent ( )

empty constructor

Definition at line 9 of file StGenEvent.cc.

10 {
11 }
StGenEvent::StGenEvent ( reco::GenParticleRefProd parts,
reco::GenParticleRefProd inits 
)

default constructor

Definition at line 13 of file StGenEvent.cc.

References TopGenEvent::initPartons_, contentValuesFiles::parts, and TopGenEvent::parts_.

14 {
15  parts_ = parts;
16  initPartons_= inits;
17 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:117
StGenEvent::~StGenEvent ( )
virtual

default destructor

Definition at line 19 of file StGenEvent.cc.

20 {
21 }

Member Function Documentation

const reco::GenParticle * StGenEvent::associatedB ( ) const

return associated b

Definition at line 42 of file StGenEvent.cc.

References funct::abs(), TopDecayID::bID, reco::flavour(), i, TopGenEvent::parts_, SingleMuPt40Fwdv2_cfi_GEN_SIM::pdgId, and singleLepton().

43 {
44  const reco::GenParticle* cand=0;
45  if (singleLepton()) {
46  const reco::GenParticleCollection & partsColl = *parts_;
47  const reco::GenParticle & singleLep = *singleLepton();
48  for (unsigned int i = 0; i < parts_->size(); ++i) {
49  if (std::abs(partsColl[i].pdgId())==TopDecayID::bID &&
50  reco::flavour(singleLep)== reco::flavour(partsColl[i])) {
51  // ... but it should be the opposite!
52  cand = &partsColl[i];
53  }
54  }
55  }
56  return cand;
57 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
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
const reco::GenParticle * singleLepton() const
return single lepton if available; 0 else
Definition: StGenEvent.cc:60
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * StGenEvent::decayB ( ) const

return decay b

Definition at line 24 of file StGenEvent.cc.

References funct::abs(), TopDecayID::bID, reco::flavour(), i, TopGenEvent::parts_, SingleMuPt40Fwdv2_cfi_GEN_SIM::pdgId, and singleLepton().

25 {
26  const reco::GenParticle* cand=0;
27  if (singleLepton()) {
28  const reco::GenParticleCollection & partsColl = *parts_;
29  const reco::GenParticle & singleLep = *singleLepton();
30  for (unsigned int i = 0; i < parts_->size(); ++i) {
31  if (std::abs(partsColl[i].pdgId())==TopDecayID::bID &&
32  reco::flavour(singleLep)== - reco::flavour(partsColl[i])) {
33  // ... but it should be the opposite!
34  cand = &partsColl[i];
35  }
36  }
37  }
38  return cand;
39 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
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
const reco::GenParticle * singleLepton() const
return single lepton if available; 0 else
Definition: StGenEvent.cc:60
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * StGenEvent::singleLepton ( ) const

return single lepton if available; 0 else

Definition at line 60 of file StGenEvent.cc.

References funct::abs(), i, reco::isLepton(), TopGenEvent::parts_, SingleMuPt40Fwdv2_cfi_GEN_SIM::pdgId, and TopDecayID::WID.

Referenced by associatedB(), decayB(), singleTop(), and singleW().

61 {
62  const reco::GenParticle* cand = 0;
63  const reco::GenParticleCollection& partsColl = *parts_;
64  for (unsigned int i = 0; i < partsColl.size(); ++i) {
65  if (reco::isLepton(partsColl[i]) && partsColl[i].mother() &&
66  std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) {
67  cand = &partsColl[i];
68  }
69  }
70  return cand;
71 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
bool isLepton(const Candidate &part)
Definition: pdgIdUtils.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int WID
Definition: TopGenEvent.h:18
const reco::GenParticle * StGenEvent::singleNeutrino ( ) const

return single neutrino if available; 0 else

Definition at line 74 of file StGenEvent.cc.

References funct::abs(), i, reco::isNeutrino(), TopGenEvent::parts_, SingleMuPt40Fwdv2_cfi_GEN_SIM::pdgId, and TopDecayID::WID.

75 {
76  const reco::GenParticle* cand=0;
77  const reco::GenParticleCollection & partsColl = *parts_;
78  for (unsigned int i = 0; i < partsColl.size(); ++i) {
79  if (reco::isNeutrino(partsColl[i]) && partsColl[i].mother() &&
80  std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) {
81  cand = &partsColl[i];
82  }
83  }
84  return cand;
85 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
bool isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:25
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int WID
Definition: TopGenEvent.h:18
const reco::GenParticle * StGenEvent::singleTop ( ) const

return single Top

Definition at line 106 of file StGenEvent.cc.

References funct::abs(), reco::flavour(), i, TopGenEvent::parts_, SingleMuPt40Fwdv2_cfi_GEN_SIM::pdgId, singleLepton(), and TopDecayID::tID.

107 {
108  const reco::GenParticle* cand=0;
109  if (singleLepton()) {
110  const reco::GenParticleCollection & partsColl = *parts_;
111  const reco::GenParticle & singleLep = *singleLepton();
112  for (unsigned int i = 0; i < partsColl.size(); ++i) {
113  if (std::abs(partsColl[i].pdgId())==TopDecayID::tID &&
114  reco::flavour(singleLep)!=reco::flavour(partsColl[i])) {
115  cand = &partsColl[i];
116  }
117  }
118  }
119  return cand;
120 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
const reco::GenParticle * singleLepton() const
return single lepton if available; 0 else
Definition: StGenEvent.cc:60
static const int tID
Definition: TopGenEvent.h:13
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
const reco::GenParticle * StGenEvent::singleW ( ) const

return single W

Definition at line 88 of file StGenEvent.cc.

References funct::abs(), reco::flavour(), i, TopGenEvent::parts_, SingleMuPt40Fwdv2_cfi_GEN_SIM::pdgId, singleLepton(), and TopDecayID::WID.

89 {
90  const reco::GenParticle* cand=0;
91  if (singleLepton()) {
92  const reco::GenParticleCollection & partsColl = *parts_;
93  const reco::GenParticle & singleLep = *singleLepton();
94  for (unsigned int i = 0; i < partsColl.size(); ++i) {
95  if (std::abs(partsColl[i].pdgId())==TopDecayID::WID &&
96  reco::flavour(singleLep) == - reco::flavour(partsColl[i])){
97  // PDG Id:13=mu- 24=W+ (+24)->(-13) (-24)->(+13) opposite sign
98  cand = &partsColl[i];
99  }
100  }
101  }
102  return cand;
103 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
const reco::GenParticle * singleLepton() const
return single lepton if available; 0 else
Definition: StGenEvent.cc:60
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int WID
Definition: TopGenEvent.h:18
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31