** Warning **

Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle dbname=lxr at /lxr/lib/LXR/Common.pm line 1103.

Last-Modified: Sun, 25 Mar 2023 03:10:35 GMT Content-Type: text/html; charset=utf-8 /CMSSW_13_1_X_2023-03-24-2300/SimDataFormats/HiGenData/src/GenHIEvent.cc
Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:24:02

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()) {  // sub_id >= 0, since sub_id is unsigned
0020   }
0021 
0022   return subevents_[sub_id];
0023 }