CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
TopGenEvent Class Reference

Base class to hold information for reduced top generator information. More...

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

Inheritance diagram for TopGenEvent:
StGenEvent TtGenEvent

Public Member Functions

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...
 

Protected Attributes

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

Base class to hold information for reduced top generator information.

The structure holds reference information to the generator particles of the decay chains for each top quark and of the initial partons. It provides access and administration.

Definition at line 41 of file TopGenEvent.h.

Constructor & Destructor Documentation

TopGenEvent::TopGenEvent ( )
inline

empty constructor

Definition at line 46 of file TopGenEvent.h.

References TopDecaySubset_cfi::decaySubset.

46 {};
TopGenEvent::TopGenEvent ( reco::GenParticleRefProd decaySubset,
reco::GenParticleRefProd iniSubset 
)

default constructor

default contructor

Definition at line 9 of file TopGenEvent.cc.

References TopDecaySubset_cfi::decaySubset, initPartons_, TopInitSubset_cfi::initSubset, and parts_.

10 {
13 }
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
virtual TopGenEvent::~TopGenEvent ( )
inlinevirtual

default destructor

Definition at line 50 of file TopGenEvent.h.

50 {};

Member Function Documentation

const reco::GenParticle* TopGenEvent::b ( ) const
inline

return b quark if available; 0 else

Definition at line 100 of file TopGenEvent.h.

References TopDecayID::bID, and TopDecayID::tID.

Referenced by TtDilepEvtSolution::getGenB(), TtHadEvtSolution::getGenHadb(), TtDilepLRSignalSelObservables::operator()(), TtHadEvtSolutionMaker::produce(), TtFullHadEvtPartons::vec(), and TtFullLepEvtPartons::vec().

static const int bID
Definition: TopGenEvent.h:14
static const int tID
Definition: TopGenEvent.h:13
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
const reco::GenParticle* TopGenEvent::bBar ( ) const
inline

return anti-b quark if available; 0 else

Definition at line 102 of file TopGenEvent.h.

References TopDecayID::bID, and TopDecayID::tID.

Referenced by TtDilepEvtSolution::getGenBbar(), TtHadEvtSolution::getGenHadbbar(), TtDilepLRSignalSelObservables::operator()(), TtHadEvtSolutionMaker::produce(), TtFullHadEvtPartons::vec(), and TtFullLepEvtPartons::vec().

static const int bID
Definition: TopGenEvent.h:14
static const int tID
Definition: TopGenEvent.h:13
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
const reco::GenParticle * TopGenEvent::candidate ( int  id,
unsigned int  parentId = 0 
) const

get candidate with given pdg id if available; 0 else

Definition at line 16 of file TopGenEvent.cc.

References funct::abs(), mps_fire::i, triggerObjects_cff::id, createfilelist::int, parts_, and common_cff::pdgId.

17 {
18  const reco::GenParticle* cand=nullptr;
19  const reco::GenParticleCollection & partsColl = *parts_;
20  for( unsigned int i = 0; i < partsColl.size(); ++i ) {
21  if( partsColl[i].pdgId()==id ){
22  if(parentId==0?true:partsColl[i].mother()&&std::abs(partsColl[i].mother()->pdgId())==(int)parentId){
23  cand = &partsColl[i];
24  }
25  }
26  }
27  return cand;
28 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const reco::GenParticle* TopGenEvent::daughterQuarkBarOfWMinus ( ) const
inline

return anti-quark daughter of anti-W boson

Definition at line 79 of file TopGenEvent.h.

Referenced by TtFullHadHypGenMatch::buildHypo(), TtHadEvtSolution::getGenHadk(), TtHadEvtSolutionMaker::produce(), and TtFullHadEvtPartons::vec().

79 { return daughterQuarkOfWPlus(true, true); };
const reco::GenParticle * daughterQuarkOfWPlus(bool invertQuarkCharge=false, bool invertBosonCharge=false) const
return quark daughter quark of W boson
Definition: TopGenEvent.cc:170
const reco::GenParticle* TopGenEvent::daughterQuarkBarOfWPlus ( ) const
inline

return anti-quark daughter of W boson

Definition at line 77 of file TopGenEvent.h.

Referenced by TtFullHadHypGenMatch::buildHypo(), TtHadEvtSolution::getGenHadq(), TtHadEvtSolutionMaker::produce(), and TtFullHadEvtPartons::vec().

77 { return daughterQuarkOfWPlus(true, false); };
const reco::GenParticle * daughterQuarkOfWPlus(bool invertQuarkCharge=false, bool invertBosonCharge=false) const
return quark daughter quark of W boson
Definition: TopGenEvent.cc:170
const reco::GenParticle * TopGenEvent::daughterQuarkOfTop ( bool  invertCharge = false) const

return daughter quark of top quark (which can have flavor b, s or d)

Definition at line 150 of file TopGenEvent.cc.

References funct::abs(), reco::Candidate::begin(), TopDecayID::bID, reco::Candidate::end(), Exception, edm::errors::InvalidReference, parts_, reco::LeafCandidate::pdgId(), TopDecayID::tID, and top().

151 {
152  const reco::GenParticle* cand=nullptr;
153  for(reco::GenParticleCollection::const_iterator top = parts_->begin(); top<parts_->end(); ++top){
154  if( top->pdgId()==(invertCharge?-TopDecayID::tID:TopDecayID::tID) ){
155  for(reco::GenParticle::const_iterator quark = top->begin(); quark<top->end(); ++quark){
156  if( std::abs(quark->pdgId())<= TopDecayID::bID ){
157  cand = dynamic_cast<const reco::GenParticle* > (&(*quark));
158  if(cand == nullptr){
159  throw edm::Exception( edm::errors::InvalidReference, "Not a GenParticle" );
160  }
161  break;
162  }
163  }
164  }
165  }
166  return cand;
167 }
int pdgId() const final
PDG identifier.
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 * top() const
return top if available; 0 else
Definition: TopGenEvent.h:104
static const int tID
Definition: TopGenEvent.h:13
const_iterator end() const
last daughter const_iterator
Definition: Candidate.h:146
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const_iterator begin() const
first daughter const_iterator
Definition: Candidate.h:144
const reco::GenParticle* TopGenEvent::daughterQuarkOfTopBar ( ) const
inline

return daughter quark of anti-top quark (which can have flavor b, s or d)

Definition at line 71 of file TopGenEvent.h.

71 { return daughterQuarkOfTop(true); };
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:150
const reco::GenParticle* TopGenEvent::daughterQuarkOfWMinus ( ) const
inline

return quark daughter of anti-W boson

Definition at line 75 of file TopGenEvent.h.

Referenced by TtFullHadHypGenMatch::buildHypo(), TtHadEvtSolution::getGenHadj(), TtHadEvtSolutionMaker::produce(), and TtFullHadEvtPartons::vec().

75 { return daughterQuarkOfWPlus(false, true); };
const reco::GenParticle * daughterQuarkOfWPlus(bool invertQuarkCharge=false, bool invertBosonCharge=false) const
return quark daughter quark of W boson
Definition: TopGenEvent.cc:170
const reco::GenParticle * TopGenEvent::daughterQuarkOfWPlus ( bool  invertQuarkCharge = false,
bool  invertBosonCharge = false 
) const

return quark daughter quark of W boson

Definition at line 170 of file TopGenEvent.cc.

References funct::abs(), TopDecayID::bID, reco::flavour(), mps_fire::i, parts_, common_cff::pdgId, and TopDecayID::WID.

Referenced by TtFullHadHypGenMatch::buildHypo(), TtHadEvtSolution::getGenHadp(), TtHadEvtSolutionMaker::produce(), and TtFullHadEvtPartons::vec().

171 {
172  const reco::GenParticle* cand=nullptr;
173  const reco::GenParticleCollection & partsColl = *parts_;
174  for (unsigned int i = 0; i < partsColl.size(); ++i) {
175  if(partsColl[i].mother() && partsColl[i].mother()->pdgId()==(invertBosonCharge?-TopDecayID::WID:TopDecayID::WID) &&
176  std::abs(partsColl[i].pdgId())<=TopDecayID::bID && (invertQuarkCharge?reco::flavour(partsColl[i])<0:reco::flavour(partsColl[i])>0)){
177  cand = &partsColl[i];
178  }
179  }
180  return cand;
181 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
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
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
const reco::GenParticle* TopGenEvent::eMinus ( ) const
inline

return electron if available; 0 else

Definition at line 84 of file TopGenEvent.h.

References TopDecayID::elecID, and TopDecayID::WID.

const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
static const int WID
Definition: TopGenEvent.h:18
static const int elecID
Definition: TopGenEvent.h:19
const reco::GenParticle* TopGenEvent::ePlus ( ) const
inline

return positron if available; 0 else

Definition at line 86 of file TopGenEvent.h.

References TopDecayID::elecID, and TopDecayID::WID.

const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
static const int WID
Definition: TopGenEvent.h:18
static const int elecID
Definition: TopGenEvent.h:19
const reco::GenParticleCollection& TopGenEvent::initialPartons ( ) const
inline

return particles of initial partons

Definition at line 55 of file TopGenEvent.h.

References common_cff::pdgId.

55 { return *initPartons_;}
reco::GenParticleRefProd initPartons_
reference to the list of initial partons (has to be kept in the event!)
Definition: TopGenEvent.h:117
std::vector< const reco::GenParticle * > TopGenEvent::lightQuarks ( bool  includingBQuarks = false) const

return all light quarks or all quarks including b's

Definition at line 184 of file TopGenEvent.cc.

References funct::abs(), TopDecayID::bID, Exception, edm::errors::InvalidReference, and parts_.

185 {
186  std::vector<const reco::GenParticle*> lightQuarks;
187  for (reco::GenParticleCollection::const_iterator part = parts_->begin(); part < parts_->end(); ++part) {
188  if( (includingBQuarks && std::abs(part->pdgId())==TopDecayID::bID) || std::abs(part->pdgId())<TopDecayID::bID ) {
189  if( dynamic_cast<const reco::GenParticle*>( &(*part) ) == nullptr){
190  throw edm::Exception( edm::errors::InvalidReference, "Not a GenParticle" );
191  }
192  lightQuarks.push_back( part->clone() );
193  }
194  }
195  return lightQuarks;
196 }
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
std::vector< const reco::GenParticle * > lightQuarks(bool includingBQuarks=false) const
return all light quarks or all quarks including b&#39;s
Definition: TopGenEvent.cc:184
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
part
Definition: HCALResponse.h:20
const reco::GenParticle* TopGenEvent::muMinus ( ) const
inline

return muon if available; 0 else

Definition at line 88 of file TopGenEvent.h.

References TopDecayID::muonID, and TopDecayID::WID.

const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
static const int muonID
Definition: TopGenEvent.h:20
static const int WID
Definition: TopGenEvent.h:18
const reco::GenParticle* TopGenEvent::muPlus ( ) const
inline

return anti-muon if available; 0 else

Definition at line 90 of file TopGenEvent.h.

References TopDecayID::muonID, and TopDecayID::WID.

const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
static const int muonID
Definition: TopGenEvent.h:20
static const int WID
Definition: TopGenEvent.h:18
int TopGenEvent::numberOfBQuarks ( bool  fromTopQuark = true) const

return number of b quarks in the decay chain

Definition at line 112 of file TopGenEvent.cc.

References funct::abs(), TopDecayID::bID, mps_fire::i, parts_, common_cff::pdgId, and TopDecayID::tID.

Referenced by TtDilepLRSignalSelObservables::operator()(), TtSemiLRJetCombObservables::operator()(), and TtSemiEvtSolutionMaker::produce().

113 {
114  int bq=0;
115  const reco::GenParticleCollection & partsColl = *parts_;
116  for (unsigned int i = 0; i < partsColl.size(); ++i) {
117  //depend if radiation qqbar are included or not
118  if(std::abs(partsColl[i].pdgId())==TopDecayID::bID){
119  if(fromTopQuark){
120  if(partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::tID){
121  ++bq;
122  }
123  }
124  else{
125  ++bq;
126  }
127  }
128  }
129  return bq;
130 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
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 tID
Definition: TopGenEvent.h:13
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int TopGenEvent::numberOfLeptons ( bool  fromWBoson = true) const

return number of leptons in the decay chain

Definition at line 48 of file TopGenEvent.cc.

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

Referenced by TopGenEventAnalyzer::analyze(), TtGenEvent::isNumberOfLeptons(), and TtSemiEvtSolutionMaker::produce().

49 {
50  int lep=0;
51  const reco::GenParticleCollection& partsColl = *parts_;
52  for(unsigned int i = 0; i < partsColl.size(); ++i) {
53  if(reco::isLepton(partsColl[i])) {
54  if(fromWBoson){
55  if(partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID){
56  ++lep;
57  }
58  }
59  else{
60  ++lep;
61  }
62  }
63  }
64  return lep;
65 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
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
int TopGenEvent::numberOfLeptons ( WDecay::LeptonType  type,
bool  fromWBoson = true 
) const

return number of leptons in the decay chain

Definition at line 68 of file TopGenEvent.cc.

References funct::abs(), TopDecayID::elecID, mps_fire::i, reco::isLepton(), WDecay::kElec, WDecay::kMuon, WDecay::kNone, WDecay::kTau, objects.autophobj::leptonType, TopDecayID::muonID, parts_, common_cff::pdgId, TopDecayID::tauID, and TopDecayID::WID.

69 {
70  int leptonType=-1;
71  switch(typeRestriction){
72  // resolve whether or not there is
73  // any restriction in lepton types
74  case WDecay::kElec:
75  leptonType=TopDecayID::elecID;
76  break;
77  case WDecay::kMuon:
78  leptonType=TopDecayID::muonID;
79  break;
80  case WDecay::kTau:
81  leptonType=TopDecayID::tauID;
82  break;
83  case WDecay::kNone:
84  break;
85  }
86  int lep=0;
87  const reco::GenParticleCollection & partsColl = *parts_;
88  for(unsigned int i = 0; i < partsColl.size(); ++i) {
89  if(fromWBoson){
90  // restrict to particles originating from the W boson
91  if( !(partsColl[i].mother() && std::abs(partsColl[i].mother()->pdgId())==TopDecayID::WID) ){
92  continue;
93  }
94  }
95  if(leptonType>0){
96  // in case of lepton type restriction
97  if( std::abs(partsColl[i].pdgId())==leptonType ){
98  ++lep;
99  }
100  }
101  else{
102  // take any lepton type into account else
103  if( reco::isLepton(partsColl[i]) ){
104  ++lep;
105  }
106  }
107  }
108  return lep;
109 }
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
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
static const int tauID
Definition: TopGenEvent.h:21
leptonType
LEPTON
Definition: autophobj.py:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int muonID
Definition: TopGenEvent.h:20
static const int WID
Definition: TopGenEvent.h:18
static const int elecID
Definition: TopGenEvent.h:19
const reco::GenParticleCollection& TopGenEvent::particles ( ) const
inline

return particles of decay chain

Definition at line 53 of file TopGenEvent.h.

Referenced by ResolutionCreator::analyze(), and TopDecayChannelFilter< S >::filter().

53 { return *parts_; }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
void TopGenEvent::print ( void  ) const

print content of the top decay chain as formated LogInfo to the MessageLogger output for debugging

Definition at line 31 of file TopGenEvent.cc.

References cmsBatch::log, and parts_.

32 {
33  edm::LogVerbatim log("TopGenEvent");
34  log << "\n"
35  << "--------------------------------------\n"
36  << "- Dump TopGenEvent Content -\n"
37  << "--------------------------------------\n";
38  for (reco::GenParticleCollection::const_iterator part = parts_->begin();
39  part<parts_->end(); ++part) {
40  log << "pdgId:" << std::setw(5) << part->pdgId() << ", "
41  << "mass:" << std::setw(11) << part->p4().mass() << ", "
42  << "energy:" << std::setw(11) << part->energy() << ", "
43  << "pt:" << std::setw(11) << part->pt() << "\n";
44  }
45 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
part
Definition: HCALResponse.h:20
std::vector< const reco::GenParticle * > TopGenEvent::radiatedGluons ( int  pdgId) const

return radiated gluons from particle with pdgId

Definition at line 199 of file TopGenEvent.cc.

References Exception, TopDecayID::glueID, edm::errors::InvalidReference, parts_, and common_cff::pdgId.

Referenced by TtGenEvent::hadronicDecayTopRadiation(), and TtGenEvent::leptonicDecayTopRadiation().

199  {
200  std::vector<const reco::GenParticle*> rads;
201  for (reco::GenParticleCollection::const_iterator part = parts_->begin(); part < parts_->end(); ++part) {
202  if ( part->mother() && part->mother()->pdgId()==pdgId ){
203  if(part->pdgId()==TopDecayID::glueID){
204  if( dynamic_cast<const reco::GenParticle*>( &(*part) ) == nullptr){
205  throw edm::Exception( edm::errors::InvalidReference, "Not a GenParticle" );
206  }
207  }
208  rads.push_back( part->clone() );
209  }
210  }
211  return rads;
212 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
static const int glueID
Definition: TopGenEvent.h:15
part
Definition: HCALResponse.h:20
const reco::GenParticle* TopGenEvent::tauMinus ( ) const
inline

return tau if available; 0 else

Definition at line 92 of file TopGenEvent.h.

References TopDecayID::tauID, and TopDecayID::WID.

static const int tauID
Definition: TopGenEvent.h:21
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
static const int WID
Definition: TopGenEvent.h:18
const reco::GenParticle* TopGenEvent::tauPlus ( ) const
inline

return anti-tau if available; 0 else

Definition at line 94 of file TopGenEvent.h.

References TopDecayID::tauID, and TopDecayID::WID.

static const int tauID
Definition: TopGenEvent.h:21
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
static const int WID
Definition: TopGenEvent.h:18
const reco::GenParticle* TopGenEvent::top ( ) const
inline

return top if available; 0 else

Definition at line 104 of file TopGenEvent.h.

References TopDecayID::tID.

Referenced by TopGenEventAnalyzer::analyze(), daughterQuarkOfTop(), TtDilepEvtSolution::getGenT(), TtGenEvent::isTtBar(), and TtGenEvent::TtGenEvent().

104 { return candidate( TopDecayID::tID );}
static const int tID
Definition: TopGenEvent.h:13
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
const reco::GenParticle* TopGenEvent::topBar ( ) const
inline

return anti-top if available; 0 else

Definition at line 106 of file TopGenEvent.h.

References reco::print(), and TopDecayID::tID.

Referenced by TopGenEventAnalyzer::analyze(), TtDilepEvtSolution::getGenTbar(), TtGenEvent::isTtBar(), and TtGenEvent::TtGenEvent().

106 { return candidate(-TopDecayID::tID );}
static const int tID
Definition: TopGenEvent.h:13
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
std::vector< const reco::GenParticle * > TopGenEvent::topSisters ( ) const

return number of top anti-top sisters

Definition at line 133 of file TopGenEvent.cc.

References funct::abs(), Exception, edm::errors::InvalidReference, parts_, and TopDecayID::tID.

134 {
135  std::vector<const reco::GenParticle*> sisters;
136  for(reco::GenParticleCollection::const_iterator part = parts_->begin(); part<parts_->end(); ++part){
137  if( part->numberOfMothers()==0 && std::abs(part->pdgId())!= TopDecayID::tID){
138  // choose top sister which do not have a
139  // mother and are whether top nor anti-top
140  if( dynamic_cast<const reco::GenParticle*>( &(*part) ) == nullptr){
141  throw edm::Exception( edm::errors::InvalidReference, "Not a GenParticle" );
142  }
143  sisters.push_back( part->clone() );
144  }
145  }
146  return sisters;
147 }
reco::GenParticleRefProd parts_
reference to the top decay chain (has to be kept in the event!)
Definition: TopGenEvent.h:115
static const int tID
Definition: TopGenEvent.h:13
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
part
Definition: HCALResponse.h:20
const reco::GenParticle* TopGenEvent::wMinus ( ) const
inline

return W minus if available; 0 else

Definition at line 96 of file TopGenEvent.h.

References TopDecayID::tID, and TopDecayID::WID.

Referenced by TtDilepEvtSolution::getGenWm().

static const int tID
Definition: TopGenEvent.h:13
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
static const int WID
Definition: TopGenEvent.h:18
const reco::GenParticle* TopGenEvent::wPlus ( ) const
inline

return W plus if available; 0 else

Definition at line 98 of file TopGenEvent.h.

References TopDecayID::tID, and TopDecayID::WID.

Referenced by TtDilepEvtSolution::getGenWp().

static const int tID
Definition: TopGenEvent.h:13
const reco::GenParticle * candidate(int id, unsigned int parentId=0) const
get candidate with given pdg id if available; 0 else
Definition: TopGenEvent.cc:16
static const int WID
Definition: TopGenEvent.h:18

Member Data Documentation

reco::GenParticleRefProd TopGenEvent::initPartons_
protected

reference to the list of initial partons (has to be kept in the event!)

Definition at line 117 of file TopGenEvent.h.

Referenced by TtGenEvent::fromGluonFusion(), TtGenEvent::fromQuarkAnnihilation(), StGenEvent::StGenEvent(), TopGenEvent(), and TtGenEvent::TtGenEvent().

reco::GenParticleRefProd TopGenEvent::parts_
protected