PVertex.hh

Go to the documentation of this file.
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 
00029     /// The default constructor.
00030     PVertex()
00031       : _thePVertex(0)
00032     {
00033       setName("PVertex");
00034     }
00035 
00036     /// Clone on the heap.
00037     virtual const Projection* clone() const {
00038       return new PVertex(*this);
00039     }
00040     //@}
00041 
00042 
00043     /// Get the primary vertex position.
00044     const Vector3 position() const {
00045       if (_thePVertex != 0) return Vector3(_thePVertex->position());
00046       return Vector3(0,0,0);
00047     }
00048 
00049 
00050   protected:
00051 
00052     /// Do the projection.
00053     void project(const Event& e);
00054 
00055 
00056     /// Compare projections.
00057     int compare(const Projection& UNUSED(p)) const {
00058       return EQUIVALENT;
00059     }
00060 
00061 
00062   private:
00063 
00064     /// The Primary Vertex in the current collision.
00065     GenVertex* _thePVertex;
00066 
00067   };
00068 
00069 }
00070 
00071 #endif