PVertex.hh
// -*- C++ -*-
#ifndef RIVET_PVertex_HH
#define RIVET_PVertex_HH
#include "Rivet/Projection.hh"
#include "Rivet/Event.hh"
#include "Rivet/Particle.hh"
namespace Rivet {
class PVertex : public Projection {
public:
PVertex()
: _thePVertex(0)
{
setName("PVertex");
}
virtual const Projection* clone() const {
return new PVertex(*this);
}
const Vector3 position() const {
if (_thePVertex != 0) return Vector3(_thePVertex->position());
return Vector3(0,0,0);
}
protected:
void project(const Event& e);
int compare(const Projection& UNUSED(p)) const {
return EQUIVALENT;
}
private:
GenVertex* _thePVertex;
};
}
#endif
Rivet::Projection::setName
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:120
Rivet::Event
Definition: Event.hh:22
Rivet::PVertex
Get the position of the primary vertex of an event.
Definition: PVertex.hh:23
Rivet::PVertex::PVertex
PVertex()
The default constructor.
Definition: PVertex.hh:30
Rivet::PVertex::clone
virtual const Projection * clone() const
Clone on the heap.
Definition: PVertex.hh:37
Rivet::PVertex::project
void project(const Event &e)
Do the projection.
Definition: PVertex.cc:10
Rivet::Projection
Base class for all Rivet projections.
Definition: Projection.hh:28
Rivet::Vector3
Three-dimensional specialisation of Vector.
Definition: Vector3.hh:26
Rivet::PVertex::compare
int compare(const Projection &UNUSED(p)) const
Compare projections.
Definition: PVertex.hh:57
Rivet::PVertex::position
const Vector3 position() const
Get the primary vertex position.
Definition: PVertex.hh:44