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) {
14  subevents_[ref->collisionId()].push_back(ref);
15  }
16 }
17 
18 const std::vector<reco::GenParticleRef> GenHIEvent::getSubEvent(unsigned int sub_id) const {
19  if (sub_id > subevents_.size()) { // sub_id >= 0, since sub_id is unsigned
20  }
21 
22  return subevents_[sub_id];
23 }
mps_fire.i
i
Definition: mps_fire.py:428
input
static const std::string input
Definition: EdmProvDump.cc:48
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::GenHIEvent::setGenParticles
void setGenParticles(const reco::GenParticleCollection *)
Definition: GenHIEvent.cc:5
reco::GenParticleCollection
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
Definition: GenParticleFwd.h:13
edm::Ref< GenParticleCollection >
edm::GenHIEvent::nhard_
int nhard_
Definition: GenHIEvent.h:87
edm::GenHIEvent::subevents_
SubEventCollection subevents_
Definition: GenHIEvent.h:81
GenHIEvent.h
edm::GenHIEvent::getSubEvent
const std::vector< reco::GenParticleRef > getSubEvent(unsigned int sub_id) const
Definition: GenHIEvent.cc:18