CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

TtEventPartons Class Reference

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

#include <AnalysisDataFormats/TopObjects/interface/TtEventPartons.h>

Inheritance diagram for TtEventPartons:
TtFullHadEvtPartons TtFullLepEvtPartons TtSemiLepEvtPartons

List of all members.

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

Detailed Description

Common base class for TtFullLepEvtPartons, TtFullHadEvtPartons and TtSemiLepEvtPartons.

Definition at line 17 of file TtEventPartons.h.


Constructor & Destructor Documentation

TtEventPartons::TtEventPartons ( ) [inline]

default constructor

Definition at line 22 of file TtEventPartons.h.

{};
virtual TtEventPartons::~TtEventPartons ( ) [inline, virtual]

default destructor

Definition at line 24 of file TtEventPartons.h.

{};

Member Function Documentation

reco::Candidate* TtEventPartons::dummyCandidatePtr ( ) const [inline, protected]
void TtEventPartons::expand ( std::vector< int > &  vec)

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

Definition at line 4 of file TtEventPartons.cc.

References i, and ignorePartons_.

{
  std::vector<int>::iterator vecIter = vec.begin();
  for(unsigned i=0; i<ignorePartons_.size(); i++) {
    if(ignorePartons_[i]) {
      vecIter = vec.insert(vecIter, -3);
    }
    ++vecIter;
  }
}
void TtEventPartons::prune ( std::vector< const reco::Candidate * > &  vec) [protected]

erase partons from vector if they where chosen to be ignored

Definition at line 16 of file TtEventPartons.cc.

References i, and ignorePartons_.

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

{
  unsigned int nIgnoredPartons = 0;
  for(unsigned i=0; i<ignorePartons_.size(); i++) {
    if(ignorePartons_[i]) {
      vec.erase(vec.begin()+(i-nIgnoredPartons));
      nIgnoredPartons++;
    }
  }
}
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.


Member Data Documentation

std::vector<bool> TtEventPartons::ignorePartons_ [protected]