CMS 3D CMS Logo

TtEventPartons.cc
Go to the documentation of this file.
2 
3 void TtEventPartons::expand(std::vector<int>& vec) {
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 }
12 
13 void TtEventPartons::prune(std::vector<const reco::Candidate*>& vec) {
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 }
void prune(std::vector< const reco::Candidate * > &vec)
erase partons from vector if they where chosen to be ignored
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 expand(std::vector< int > &vec)
insert dummy index -3 for all partons that were chosen to be ignored