CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
TtEventPartons Class Referenceabstract

Common base class for TtFullLepEvtPartons, TtFullHadEvtPartons and TtSemiLepEvtPartons. More...

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

Inheritance diagram for TtEventPartons:
TtFullHadEvtPartons TtFullLepEvtPartons TtSemiLepEvtPartons

Public Member Functions

void expand (std::vector< int > &vec)
 insert dummy index -3 for all partons that were chosen to be ignored More...
 
 TtEventPartons ()
 default constructor More...
 
virtual std::vector< const reco::Candidate * > vec (const TtGenEvent &genEvt)=0
 
virtual ~TtEventPartons ()
 default destructor More...
 

Protected Member Functions

reco::CandidatedummyCandidatePtr () const
 return pointer to an empty reco::Candidate More...
 
void prune (std::vector< const reco::Candidate * > &vec)
 erase partons from vector if they where chosen to be ignored More...
 

Protected Attributes

std::vector< bool > ignorePartons_
 flag partons that were chosen not to be used More...
 

Detailed Description

Common base class for TtFullLepEvtPartons, TtFullHadEvtPartons and TtSemiLepEvtPartons.

Definition at line 19 of file TtEventPartons.h.

Constructor & Destructor Documentation

◆ TtEventPartons()

TtEventPartons::TtEventPartons ( )
inline

default constructor

Definition at line 22 of file TtEventPartons.h.

22 {};

◆ ~TtEventPartons()

virtual TtEventPartons::~TtEventPartons ( )
inlinevirtual

default destructor

Definition at line 24 of file TtEventPartons.h.

24 {};

Member Function Documentation

◆ dummyCandidatePtr()

reco::Candidate* TtEventPartons::dummyCandidatePtr ( ) const
inlineprotected

return pointer to an empty reco::Candidate

Definition at line 35 of file TtEventPartons.h.

35  {
37  };

References GenParticle::GenParticle.

Referenced by TtFullHadEvtPartons::vec(), TtSemiLepEvtPartons::vec(), and TtFullLepEvtPartons::vec().

◆ expand()

void TtEventPartons::expand ( std::vector< int > &  vec)

insert dummy index -3 for all partons that were chosen to be ignored

Definition at line 3 of file TtEventPartons.cc.

3  {
4  std::vector<int>::iterator vecIter = vec.begin();
5  for (unsigned i = 0; i < ignorePartons_.size(); i++) {
6  if (ignorePartons_[i]) {
7  vecIter = vec.insert(vecIter, -3);
8  }
9  ++vecIter;
10  }
11 }

References mps_fire::i, ignorePartons_, and vec().

◆ prune()

void TtEventPartons::prune ( std::vector< const reco::Candidate * > &  vec)
protected

erase partons from vector if they where chosen to be ignored

Definition at line 13 of file TtEventPartons.cc.

13  {
14  unsigned int nIgnoredPartons = 0;
15  for (unsigned i = 0; i < ignorePartons_.size(); i++) {
16  if (ignorePartons_[i]) {
17  vec.erase(vec.begin() + (i - nIgnoredPartons));
18  nIgnoredPartons++;
19  }
20  }
21 }

References mps_fire::i, ignorePartons_, and vec().

Referenced by dirstructure.Directory::prune(), TtFullLepEvtPartons::vec(), TtSemiLepEvtPartons::vec(), and TtFullHadEvtPartons::vec().

◆ vec()

virtual std::vector<const reco::Candidate*> TtEventPartons::vec ( const TtGenEvent genEvt)
pure virtual

return vector of partons in the order defined in the corresponding enum (method implemented in the derived classes)

Implemented in TtFullHadEvtPartons, TtFullLepEvtPartons, and TtSemiLepEvtPartons.

Referenced by expand(), and prune().

Member Data Documentation

◆ ignorePartons_

std::vector<bool> TtEventPartons::ignorePartons_
protected
mps_fire.i
i
Definition: mps_fire.py:355
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
TtEventPartons::ignorePartons_
std::vector< bool > ignorePartons_
flag partons that were chosen not to be used
Definition: TtEventPartons.h:43
TtEventPartons::vec
virtual std::vector< const reco::Candidate * > vec(const TtGenEvent &genEvt)=0
GenParticle.GenParticle
GenParticle
Definition: GenParticle.py:18
reco::Particle::Point
math::XYZPoint Point
point in the space
Definition: Particle.h:25