CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 17 of file TtEventPartons.h.

Constructor & Destructor Documentation

TtEventPartons::TtEventPartons ( )
inline

default constructor

Definition at line 22 of file TtEventPartons.h.

22 {};
virtual TtEventPartons::~TtEventPartons ( )
inlinevirtual

default destructor

Definition at line 24 of file TtEventPartons.h.

24 {};

Member Function Documentation

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

return pointer to an empty reco::Candidate

Definition at line 36 of file TtEventPartons.h.

References configurableAnalysis::GenParticle.

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

36 { return new reco::GenParticle(0, reco::Particle::LorentzVector(), reco::Particle::Point(), 0, 0, false); };
math::XYZPoint Point
point in the space
Definition: Particle.h:29
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:25
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_.

5 {
6  std::vector<int>::iterator vecIter = vec.begin();
7  for(unsigned i=0; i<ignorePartons_.size(); i++) {
8  if(ignorePartons_[i]) {
9  vecIter = vec.insert(vecIter, -3);
10  }
11  ++vecIter;
12  }
13 }
int i
Definition: DBlmapReader.cc:9
std::vector< bool > ignorePartons_
flag partons that were chosen not to be used
virtual std::vector< const reco::Candidate * > vec(const TtGenEvent &genEvt)=0
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 dirstructure.Directory::prune(), TtFullLepEvtPartons::vec(), TtSemiLepEvtPartons::vec(), and TtFullHadEvtPartons::vec().

17 {
18  unsigned int nIgnoredPartons = 0;
19  for(unsigned i=0; i<ignorePartons_.size(); i++) {
20  if(ignorePartons_[i]) {
21  vec.erase(vec.begin()+(i-nIgnoredPartons));
22  nIgnoredPartons++;
23  }
24  }
25 }
int i
Definition: DBlmapReader.cc:9
std::vector< bool > ignorePartons_
flag partons that were chosen not to be used
virtual std::vector< const reco::Candidate * > vec(const TtGenEvent &genEvt)=0
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