CMS 3D CMS Logo

TtEventPartons.cc
Go to the documentation of this file.
2 
3 void TtEventPartons::expand(std::vector<int>& vec) const {
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) const {
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) const
erase partons from vector if they where chosen to be ignored
std::vector< bool > ignorePartons_
flag partons that were chosen not to be used
void expand(std::vector< int > &vec) const
insert dummy index -3 for all partons that were chosen to be ignored
virtual std::vector< const reco::Candidate * > vec(const TtGenEvent &genEvt) const =0