CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/SimDataFormats/HiGenData/src/GenHIEvent.cc

Go to the documentation of this file.
00001 
00002 #include "SimDataFormats/HiGenData/interface/GenHIEvent.h"
00003 using namespace edm;
00004 
00005 void GenHIEvent::setGenParticles(const reco::GenParticleCollection* input) const {
00006   subevents_.reserve(nhard_);
00007   for(int i = 0; i < nhard_; ++i){
00008     std::vector<reco::GenParticleRef> refs;
00009     subevents_.push_back(refs);
00010   }
00011 
00012   for(unsigned int i = 0; i < input->size(); ++i){
00013     reco::GenParticleRef ref(input,i);
00014     subevents_[ref->collisionId()].push_back(ref);
00015   }
00016 }
00017 
00018 const std::vector<reco::GenParticleRef> GenHIEvent::getSubEvent(unsigned int sub_id) const {
00019 
00020   if(sub_id > subevents_.size()){ // sub_id >= 0, since sub_id is unsigned
00021   }
00022 
00023   return subevents_[sub_id];
00024 }
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032