Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-08-31 08:21:22

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef TPCTRACKRECO_TPCMODULETRACK_H
0004 #define TPCTRACKRECO_TPCMODULETRACK_H
0005 
0006 #include <trackbase/TrkrDefs.h>
0007 
0008 #include <phool/PHObject.h>
0009 
0010 #include <iostream>
0011 #include <utility>
0012 #include <vector>
0013 
0014 // A single in-module track.
0015 // It stores only identity/topology and (hitsetkey, hitkey) references into
0016 // TrkrHitSetContainer.  No fit result is stored here; run a separate Tpc_FittingTools
0017 // module if fit parameters are needed downstream.
0018 class Tpc_ModuleTrack : public PHObject
0019 {
0020  public:
0021   Tpc_ModuleTrack() = default;
0022   ~Tpc_ModuleTrack() override = default;
0023 
0024   void identify(std::ostream& os = std::cout) const override
0025   {
0026     os << "Tpc_ModuleTrack base class" << std::endl;
0027   }
0028   int isValid() const override { return 0; }
0029 
0030   // --- Identity ---
0031   virtual unsigned int get_event() const { return 0; }
0032   virtual unsigned int get_track_id() const { return 0; }
0033 
0034   virtual unsigned int get_region() const { return 0; }
0035   virtual unsigned int get_sector() const { return 0; }
0036   virtual int get_side() const { return 0; }
0037 
0038   // --- Topology ---
0039   virtual unsigned int get_nblobs() const { return 0; }
0040   virtual unsigned int get_nrawhits() const { return 0; }
0041 
0042   virtual unsigned int get_first_layer() const { return 0; }
0043   virtual unsigned int get_last_layer() const { return 0; }
0044 
0045   // --- Setters ---
0046   virtual void set_event(unsigned int) {}
0047   virtual void set_track_id(unsigned int) {}
0048 
0049   virtual void set_region(unsigned int) {}
0050   virtual void set_sector(unsigned int) {}
0051   virtual void set_side(int) {}
0052 
0053   virtual void set_nblobs(unsigned int) {}
0054   virtual void set_nrawhits(unsigned int) {}
0055 
0056   virtual void set_first_layer(unsigned int) {}
0057   virtual void set_last_layer(unsigned int) {}
0058 
0059   // --- Hit index access ---
0060   using HitIndex = std::pair<TrkrDefs::hitsetkey, TrkrDefs::hitkey>;
0061 
0062   virtual void add_hit_index(TrkrDefs::hitsetkey /*hsk*/, TrkrDefs::hitkey /*hk*/) {}
0063 
0064   virtual unsigned int size_hit_indices() const { return 0; }
0065 
0066   virtual HitIndex get_hit_index(unsigned int /*i*/) const
0067   {
0068     return {0, 0};
0069   }
0070 
0071   virtual const std::vector<HitIndex>& get_hit_indices() const
0072   {
0073     static const std::vector<HitIndex> empty_indices;
0074     return empty_indices;
0075   }
0076 
0077  private:
0078   ClassDefOverride(Tpc_ModuleTrack, 0)
0079 };
0080 #endif