00001 // -*- C++ -*- 00002 #ifndef RIVET_PVertex_HH 00003 #define RIVET_PVertex_HH 00004 00005 #include "Rivet/Projection.hh" 00006 #include "Rivet/Event.hh" 00007 #include "Rivet/Particle.hh" 00008 00009 namespace Rivet { 00010 00011 00012 /// @brief Get the position of the primary vertex of an event. 00013 /// 00014 /// HepMC doesn't reliably return the signal process vertex, so 00015 /// we have to use the "decay vertex" of the beam particles. 00016 /// This gives the right position, within experimental resolution, 00017 /// but ISR effects can mean that the actual vertex is not right. 00018 /// Hence, we don't expose the HepMC GenVertex directly - if it were 00019 /// available, people might try to e.g. look at the \f$ p_T \f$ 00020 /// of the vertex children, which would be extremely unreliable. 00021 /// 00022 /// @deprecated This should hardly ever be required for MC studies, and is not necessarily reliable! 00023 class PVertex : public Projection { 00024 public: 00025 00026 /// @name Standard constructors and destructors. 00027 //@{ 00028 /// The default constructor. 00029 PVertex() 00030 : _thePVertex(0) 00031 { 00032 setName("PVertex"); 00033 } 00034 00035 /// Clone on the heap. 00036 virtual const Projection* clone() const { 00037 return new PVertex(*this); 00038 } 00039 //@} 00040 00041 00042 /// Get the primary vertex position. 00043 const Vector3 position() const { 00044 if (_thePVertex != 0) return Vector3(_thePVertex->position()); 00045 return Vector3(0,0,0); 00046 } 00047 00048 00049 protected: 00050 00051 /// Do the projection. 00052 void project(const Event& e); 00053 00054 00055 /// Compare projections. 00056 int compare(const Projection& UNUSED(p)) const { 00057 return EQUIVALENT; 00058 } 00059 00060 00061 private: 00062 00063 /// The Primary Vertex in the current collision. 00064 GenVertex* _thePVertex; 00065 00066 }; 00067 00068 } 00069 00070 #endif