Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:20:45

0001 /*
0002  * SvtxTrack_FastSim_v1.h
0003  */
0004 
0005 #ifndef TRACKBASEHISTORIC_SVTXTRACKFASTSIMV1_H
0006 #define TRACKBASEHISTORIC_SVTXTRACKFASTSIMV1_H
0007 
0008 #include "SvtxTrack_FastSim.h"
0009 
0010 // SvtxTrack_FastSim with recording of associated G4hits
0011 class SvtxTrack_FastSim_v1 final : public SvtxTrack_FastSim
0012 {
0013  public:
0014   //* constructor
0015   SvtxTrack_FastSim_v1() = default;
0016 
0017   //* base class copy constructor
0018   SvtxTrack_FastSim_v1(const SvtxTrack&);
0019 
0020   //* destructor
0021   ~SvtxTrack_FastSim_v1() override = default;
0022 
0023   // copy content from base class
0024   using PHObject::CopyFrom;  // avoid warning for not implemented CopyFrom methods
0025   void CopyFrom(const SvtxTrack&) override;
0026   void CopyFrom(SvtxTrack* source) override
0027   {
0028     CopyFrom(*source);
0029   }
0030 
0031   // The "standard PHObject response" functions...
0032   void identify(std::ostream& os = std::cout) const override;
0033   void Reset() override
0034   {
0035     *this = SvtxTrack_FastSim_v1();
0036   }
0037 
0038   int isValid() const override;
0039 
0040   PHObject* CloneMe() const override
0041   {
0042     return new SvtxTrack_FastSim_v1(*this);
0043   }
0044 
0045   //!@name accessors
0046   //@{
0047 
0048   const HitIdMap& g4hit_ids() const override
0049   {
0050     return _g4hit_ids;
0051   }
0052 
0053   bool empty_g4hit_id() const override
0054   {
0055     return _g4hit_ids.empty();
0056   }
0057 
0058   size_t size_g4hit_id() const override
0059   {
0060     return _g4hit_ids.size();
0061   }
0062 
0063   SvtxTrack::HitIdConstIter begin_g4hit_id() const override
0064   {
0065     return _g4hit_ids.begin();
0066   }
0067 
0068   SvtxTrack::HitIdConstIter end_g4hit_id() const override
0069   {
0070     return _g4hit_ids.end();
0071   }
0072 
0073   SvtxTrack::HitIdConstIter find_g4hit_id(int volume) const override
0074   {
0075     return _g4hit_ids.find(volume);
0076   }
0077 
0078   //@}
0079 
0080   //!@name modifiers
0081   //@{
0082 
0083   void add_g4hit_id(int volume, PHG4HitDefs::keytype id) override
0084   {
0085     _g4hit_ids[volume].insert(id);
0086   }
0087 
0088   size_t remove_g4hit_id(int volume, PHG4HitDefs::keytype id) override
0089   {
0090     return _g4hit_ids[volume].erase(id);
0091   }
0092 
0093   size_t remove_g4hit_volume(int volume) override
0094   {
0095     return _g4hit_ids.erase(volume);
0096   }
0097 
0098   SvtxTrack::HitIdIter begin_g4hit_id() override
0099   {
0100     return _g4hit_ids.begin();
0101   }
0102 
0103   SvtxTrack::HitIdIter end_g4hit_id() override
0104   {
0105     return _g4hit_ids.end();
0106   }
0107 
0108   SvtxTrack::HitIdIter find_g4hit_id(int volume) override
0109   {
0110     return _g4hit_ids.find(volume);
0111   }
0112 
0113   void clear_g4hit_id() override
0114   {
0115     return _g4hit_ids.clear();
0116   }
0117 
0118   //@}
0119 
0120  private:
0121   HitIdMap _g4hit_ids;
0122 
0123   ClassDefOverride(SvtxTrack_FastSim_v1, 1)
0124 };
0125 
0126 #endif /* __SVTXTRACK_FAST_SIMV1_H__ */