Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef TRACKBASE_TRKRTRUTHTRACKV1_H
0002 #define TRACKBASE_TRKRTRUTHTRACKV1_H
0003 /**
0004  * @file g4tpc/TrkrTruthTrackv1.h
0005  * @author D. Stewart
0006  * @date September 2022
0007  * @brief Version 1 of TrkrTruthTrack
0008  */
0009 #include "TrkrTruthTrack.h"
0010 
0011 #include <limits>
0012 
0013 class PHG4Particle;
0014 class PHG4VtxPoint;
0015 
0016 class TrkrTruthTrackv1 : public TrkrTruthTrack
0017 {
0018  public:
0019   //! ctor
0020   TrkrTruthTrackv1() = default;
0021   TrkrTruthTrackv1(unsigned int, PHG4Particle*, PHG4VtxPoint*);
0022 
0023   //! dtor
0024   ~TrkrTruthTrackv1() override = default;
0025 
0026   unsigned int getTrackid() const override { return trackid; };
0027   float getX0() const override { return X0; };
0028   float getY0() const override { return Y0; };
0029   float getZ0() const override { return Z0; };
0030 
0031   float getPseudoRapidity() const override { return pseudoRapidity; };
0032   float getPt() const override { return pt; };
0033   float getPhi() const override { return phi; };
0034 
0035   std::vector<TrkrDefs::cluskey>& getClusters() override { return clusters; };
0036   void addCluster(TrkrDefs::cluskey) override;
0037 
0038   bool has_hitsetkey(TrkrDefs::hitsetkey) const override;  // note, only works when the data is sorted
0039   bool has_hitsetkey(TrkrDefs::cluskey) const override;
0040   std::pair<bool, TrkrDefs::cluskey> get_cluskey(TrkrDefs::hitsetkey) const override;  // bool is if there is the key, and
0041 
0042   void setTrackid(unsigned int _) override { trackid = _; };
0043 
0044   void setX0(float _) override { X0 = _; };
0045   void setY0(float _) override { Y0 = _; };
0046   void setZ0(float _) override { Z0 = _; };
0047 
0048   void setPseudoRapity(float _) override { pseudoRapidity = _; };
0049   void setPt(float _) override { pt = _; };
0050   void setPhi(float _) override { phi = _; };
0051 
0052   void identify(std::ostream& os = std::cout) const override;
0053 
0054   struct CompHitSetKey
0055   {
0056     bool operator()(const TrkrDefs::cluskey& lhs, const TrkrDefs::cluskey& rhs)
0057     {
0058       return TrkrDefs::getHitSetKeyFromClusKey(lhs) < TrkrDefs::getHitSetKeyFromClusKey(rhs);
0059     };
0060     bool operator()(const TrkrDefs::cluskey& lhs, const TrkrDefs::hitsetkey& rhs)
0061     {
0062       return TrkrDefs::getHitSetKeyFromClusKey(lhs) < rhs;
0063     };
0064     bool operator()(const TrkrDefs::hitsetkey& lhs, const TrkrDefs::cluskey& rhs)
0065     {
0066       return lhs < TrkrDefs::getHitSetKeyFromClusKey(rhs);
0067     };
0068   };
0069 
0070  protected:
0071   unsigned int trackid{std::numeric_limits<unsigned int>::max()};
0072   float X0{std::numeric_limits<float>::quiet_NaN()};
0073   float Y0{std::numeric_limits<float>::quiet_NaN()};
0074   float Z0{std::numeric_limits<float>::quiet_NaN()};
0075 
0076   float pseudoRapidity{std::numeric_limits<float>::quiet_NaN()};
0077   float pt{std::numeric_limits<float>::quiet_NaN()};
0078   float phi{std::numeric_limits<float>::quiet_NaN()};
0079 
0080   std::vector<TrkrDefs::cluskey> clusters;
0081   ClassDefOverride(TrkrTruthTrackv1, 1)
0082 };
0083 #endif