00001
00002 #include "Rivet/Particle.hh"
00003 #include "Rivet/RivetCLHEP.hh"
00004
00005
00006 namespace Rivet {
00007
00008 Particle::Particle(const GenParticle& gp)
00009 : _original(&gp), _id(gp.pdg_id()), _momentum(0) {
00010 _momentum = new CLHEP::LorentzVector(gp.momentum().x(), gp.momentum().y(),
00011 gp.momentum().z(), gp.momentum().t());
00012 _mass = gp.momentum().m();
00013 }
00014
00015
00016 Particle::Particle(const Particle& p)
00017 : _original(p._original), _id(p._id),
00018 _momentum(new CLHEP::LorentzVector(*p._momentum)),
00019 _mass(p._mass)
00020 { }
00021
00022
00023 Particle::~Particle() {
00024 delete _momentum;
00025 }
00026
00027
00028 Particle& Particle::operator=(const Particle& p) {
00029 if (&p != this) {
00030 _original = p._original;
00031 _id = p._id;
00032 _momentum = new CLHEP::LorentzVector(*p._momentum);
00033 _mass = p._mass;
00034 }
00035 return *this;
00036 }
00037
00038
00039 }