CMS 3D CMS Logo

GenHIEvent.cc
Go to the documentation of this file.
1 
3 using namespace edm;
4 
6  subevents_.reserve(nhard_);
7  for(int i = 0; i < nhard_; ++i){
8  std::vector<reco::GenParticleRef> refs;
9  subevents_.push_back(refs);
10  }
11 
12  for(unsigned int i = 0; i < input->size(); ++i){
13  reco::GenParticleRef ref(input,i);
14  subevents_[ref->collisionId()].push_back(ref);
15  }
16 }
17 
18 const std::vector<reco::GenParticleRef> GenHIEvent::getSubEvent(unsigned int sub_id) const {
19 
20  if(sub_id > subevents_.size()){ // sub_id >= 0, since sub_id is unsigned
21  }
22 
23  return subevents_[sub_id];
24 }
25 
26 
27 
28 
29 
30 
31 
32 
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
void setGenParticles(const reco::GenParticleCollection *)
Definition: GenHIEvent.cc:5
const std::vector< reco::GenParticleRef > getSubEvent(unsigned int sub_id) const
Definition: GenHIEvent.cc:18
static std::string const input
Definition: EdmProvDump.cc:44
SubEventCollection subevents_
Definition: GenHIEvent.h:74
HLT enums.