diff --git a/Generator/src/GenEvent.cpp b/Generator/src/GenEvent.cpp index 3e40c65b8476c83a48e98fc4b596e60d15bcab5f..8d8c254253f641fa3a54be063a1a39e210117179 100644 --- a/Generator/src/GenEvent.cpp +++ b/Generator/src/GenEvent.cpp @@ -1,7 +1,7 @@ #include "GenEvent.h" #include "edm4hep/MCParticleCollection.h"//plico -using namespace std; +// using namespace std; namespace MyHepMC{ @@ -17,7 +17,7 @@ GenEvent::GenEvent(edm4hep::MCParticleCollection& mcCol) } GenEvent::~GenEvent(){} -void GenEvent::SetEventHeader(long event_id_, long run_id_, float time_, string det_name_){ +void GenEvent::SetEventHeader(long event_id_, long run_id_, float time_, const std::string& det_name_){ m_event_id = event_id_; m_run_id = run_id_; m_time = time_; @@ -28,8 +28,9 @@ void GenEvent::SetMCCollection(edm4hep::MCParticleCollection vec_){ m_mc_vec = vec_; } */ -edm4hep::MCParticleCollection GenEvent::getMCVec(){ -return m_mc_vec; + +edm4hep::MCParticleCollection& GenEvent::getMCVec(){ + return m_mc_vec; } long GenEvent::getID(){ diff --git a/Generator/src/GenEvent.h b/Generator/src/GenEvent.h index 72895413a5d06438fcffe72495ef56b646921c5c..fd1dbe557e0afac14a3397c53c3978b2c66d7a55 100644 --- a/Generator/src/GenEvent.h +++ b/Generator/src/GenEvent.h @@ -10,17 +10,18 @@ class GenEvent{ //GenEvent(); GenEvent(edm4hep::MCParticleCollection& mcCol); ~GenEvent(); - void SetEventHeader(long event_id_, long run_id_, float time_, std::string det_name_); + void SetEventHeader(long event_id_, long run_id_, float time_, const std::string& det_name_); //void SetMCCollection(edm4hep::MCParticleCollection vec_); long getID(); long getRun(); long getTime(); void ReSet(); std::string getName(); - edm4hep::MCParticleCollection getMCVec(); + edm4hep::MCParticleCollection& getMCVec(); edm4hep::MCParticleCollection& m_mc_vec; //edm4hep::MCParticleCollection m_mc_vec; private: + long m_event_id; long m_run_id; float m_time;