CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtEventPartons.cc
Go to the documentation of this file.
2 
3 void
4 TtEventPartons::expand(std::vector<int>& vec)
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 }
14 
15 void
16 TtEventPartons::prune(std::vector<const reco::Candidate*>& 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
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
void expand(std::vector< int > &vec)
insert dummy index -3 for all partons that were chosen to be ignored