Rivet  1.8.3
PVertex.hh
1 // -*- C++ -*-
2 #ifndef RIVET_PVertex_HH
3 #define RIVET_PVertex_HH
4 
5 #include "Rivet/Projection.hh"
6 #include "Rivet/Event.hh"
7 #include "Rivet/Particle.hh"
8 
9 namespace Rivet {
10 
11 
23  class PVertex : public Projection {
24  public:
25 
27 
28 
31  : _thePVertex(0)
32  {
33  setName("PVertex");
34  }
35 
37  virtual const Projection* clone() const {
38  return new PVertex(*this);
39  }
41 
42 
44  const Vector3 position() const {
45  if (_thePVertex != 0) return Vector3(_thePVertex->position());
46  return Vector3(0,0,0);
47  }
48 
49 
50  protected:
51 
53  void project(const Event& e);
54 
55 
57  int compare(const Projection& UNUSED(p)) const {
58  return EQUIVALENT;
59  }
60 
61 
62  private:
63 
65  GenVertex* _thePVertex;
66 
67  };
68 
69 }
70 
71 #endif
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:120
Definition: MC_JetAnalysis.hh:9
const Vector3 position() const
Get the primary vertex position.
Definition: PVertex.hh:44
virtual const Projection * clone() const
Clone on the heap.
Definition: PVertex.hh:37
int compare(const Projection &UNUSED(p)) const
Compare projections.
Definition: PVertex.hh:57
Definition: Event.hh:22
Get the position of the primary vertex of an event.
Definition: PVertex.hh:23
PVertex()
The default constructor.
Definition: PVertex.hh:30
void project(const Event &e)
Do the projection.
Definition: PVertex.cc:10
Base class for all Rivet projections.
Definition: Projection.hh:28
Three-dimensional specialisation of Vector.
Definition: Vector3.hh:26