Skip to content
Snippets Groups Projects
Commit d0b5b6d5 authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

Fix #153: avoid to use the assign operator of MCParticleCollection.

parent 85bdbe5d
No related branches found
No related tags found
No related merge requests found
#include "GenEvent.h" #include "GenEvent.h"
#include "edm4hep/MCParticleCollection.h"//plico #include "edm4hep/MCParticleCollection.h"//plico
using namespace std; // using namespace std;
namespace MyHepMC{ namespace MyHepMC{
...@@ -17,7 +17,7 @@ GenEvent::GenEvent(edm4hep::MCParticleCollection& mcCol) ...@@ -17,7 +17,7 @@ GenEvent::GenEvent(edm4hep::MCParticleCollection& mcCol)
} }
GenEvent::~GenEvent(){} 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_event_id = event_id_;
m_run_id = run_id_; m_run_id = run_id_;
m_time = time_; m_time = time_;
...@@ -28,8 +28,9 @@ void GenEvent::SetMCCollection(edm4hep::MCParticleCollection vec_){ ...@@ -28,8 +28,9 @@ void GenEvent::SetMCCollection(edm4hep::MCParticleCollection vec_){
m_mc_vec = vec_; m_mc_vec = vec_;
} }
*/ */
edm4hep::MCParticleCollection GenEvent::getMCVec(){
return m_mc_vec; edm4hep::MCParticleCollection& GenEvent::getMCVec(){
return m_mc_vec;
} }
long GenEvent::getID(){ long GenEvent::getID(){
......
...@@ -10,17 +10,18 @@ class GenEvent{ ...@@ -10,17 +10,18 @@ class GenEvent{
//GenEvent(); //GenEvent();
GenEvent(edm4hep::MCParticleCollection& mcCol); GenEvent(edm4hep::MCParticleCollection& mcCol);
~GenEvent(); ~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_); //void SetMCCollection(edm4hep::MCParticleCollection vec_);
long getID(); long getID();
long getRun(); long getRun();
long getTime(); long getTime();
void ReSet(); void ReSet();
std::string getName(); std::string getName();
edm4hep::MCParticleCollection getMCVec(); edm4hep::MCParticleCollection& getMCVec();
edm4hep::MCParticleCollection& m_mc_vec; edm4hep::MCParticleCollection& m_mc_vec;
//edm4hep::MCParticleCollection m_mc_vec; //edm4hep::MCParticleCollection m_mc_vec;
private: private:
long m_event_id; long m_event_id;
long m_run_id; long m_run_id;
float m_time; float m_time;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment