File indexing completed on 2024-04-06 12:29:43
0001
0002 #include "SimDataFormats/HiGenData/interface/GenHIEvent.h"
0003 using namespace edm;
0004
0005 void GenHIEvent::setGenParticles(const reco::GenParticleCollection* input) {
0006 subevents_.reserve(nhard_);
0007 for (int i = 0; i < nhard_; ++i) {
0008 std::vector<reco::GenParticleRef> refs;
0009 subevents_.push_back(refs);
0010 }
0011
0012 for (unsigned int i = 0; i < input->size(); ++i) {
0013 reco::GenParticleRef ref(input, i);
0014 subevents_[ref->collisionId()].push_back(ref);
0015 }
0016 }
0017
0018 const std::vector<reco::GenParticleRef> GenHIEvent::getSubEvent(unsigned int sub_id) const {
0019 if (sub_id > subevents_.size()) {
0020 }
0021
0022 return subevents_[sub_id];
0023 }