Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:12

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4MAIN_PHG4VTXPOINTV1_H
0004 #define G4MAIN_PHG4VTXPOINTV1_H
0005 
0006 #include "PHG4VtxPoint.h"
0007 
0008 #include <climits>   // for INT_MIN
0009 #include <cmath>     // def of NAN
0010 #include <iostream>  // for cout, ostream
0011 
0012 class PHG4VtxPointv1 : public PHG4VtxPoint
0013 {
0014  public:
0015   PHG4VtxPointv1() = default;
0016 
0017   PHG4VtxPointv1(const PHG4VtxPoint* vtx)
0018     : vx(vtx->get_x())
0019     , vy(vtx->get_y())
0020     , vz(vtx->get_z())
0021     , t0(vtx->get_t())
0022     , id(vtx->get_id())
0023   {
0024   }
0025 
0026   PHG4VtxPointv1(const double x, const double y, const double z, const double t, const int id_value = std::numeric_limits<int>::min())
0027     : vx(x)
0028     , vy(y)
0029     , vz(z)
0030     , t0(t)
0031     , id(id_value)
0032   {
0033   }
0034 
0035   ~PHG4VtxPointv1() override = default;
0036 
0037   // from PHObject
0038   void identify(std::ostream& os = std::cout) const override;
0039 
0040   void set_x(const double r) override { vx = r; }
0041   void set_y(const double r) override { vy = r; }
0042   void set_z(const double r) override { vz = r; }
0043   void set_t(const double r) override { t0 = r; }
0044   void set_id(const int i) override { id = i; }
0045 
0046   double get_x() const override { return vx; }
0047   double get_y() const override { return vy; }
0048   double get_z() const override { return vz; }
0049   double get_t() const override { return t0; }
0050   int get_id() const override { return id; }
0051 
0052  protected:
0053   double vx{std::numeric_limits<double>::quiet_NaN()};
0054   double vy{std::numeric_limits<double>::quiet_NaN()};
0055   double vz{std::numeric_limits<double>::quiet_NaN()};
0056   double t0{std::numeric_limits<double>::quiet_NaN()};
0057 
0058   //! id tag for this vertex
0059   int id{std::numeric_limits<int>::min()};
0060 
0061   ClassDefOverride(PHG4VtxPointv1, 2)
0062 };
0063 
0064 #endif