Rivet  1.8.0
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