CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/AnalysisDataFormats/TopObjects/src/TtEventPartons.cc

Go to the documentation of this file.
00001 #include "AnalysisDataFormats/TopObjects/interface/TtEventPartons.h"
00002 
00003 void
00004 TtEventPartons::expand(std::vector<int>& vec)
00005 {
00006   std::vector<int>::iterator vecIter = vec.begin();
00007   for(unsigned i=0; i<ignorePartons_.size(); i++) {
00008     if(ignorePartons_[i]) {
00009       vecIter = vec.insert(vecIter, -3);
00010     }
00011     ++vecIter;
00012   }
00013 }
00014 
00015 void 
00016 TtEventPartons::prune(std::vector<const reco::Candidate*>& vec)
00017 {
00018   unsigned int nIgnoredPartons = 0;
00019   for(unsigned i=0; i<ignorePartons_.size(); i++) {
00020     if(ignorePartons_[i]) {
00021       vec.erase(vec.begin()+(i-nIgnoredPartons));
00022       nIgnoredPartons++;
00023     }
00024   }
00025 }