Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:13

0001 #ifndef TRACKBASE_TrkrHitSetTpc_H
0002 #define TRACKBASE_TrkrHitSetTpc_H
0003 
0004 #include "TpcDefs.h"
0005 #include "TrkrDefs.h"
0006 #include "TrkrHitSet.h"
0007 
0008 #include <utility>  // for pair
0009 #include <vector>
0010 
0011 // forward declaration
0012 class TrkrHit;
0013 
0014 //! Generalized interface class for vectorized TPC data time frame storage
0015 class TrkrHitSetTpc : public TrkrHitSet
0016 {
0017  public:
0018   typedef std::vector<std::vector<TpcDefs::ADCDataType> > TimeFrameADCDataType;
0019 
0020   TrkrHitSetTpc() = default;
0021 
0022   TrkrHitSetTpc(const uint16_t /*n_pad*/, const uint16_t /*n_tbin*/) {}
0023 
0024   ~TrkrHitSetTpc() override
0025   {
0026   }
0027 
0028   virtual void identify(std::ostream& os = std::cout) const override;
0029 
0030   //! resize to fit getNPads and getNTBins
0031   virtual void Resize() {}
0032 
0033   //! global -> local conversion
0034   std::pair<uint16_t, uint16_t> getLocalPhiTBin(const TrkrDefs::hitkey) const;
0035 
0036   //! local -> global conversion
0037   TrkrDefs::hitkey getHitKeyfromLocalBin(const uint16_t /*local_pad*/, const uint16_t /*local_tbin*/) const;
0038 
0039   TpcDefs::ADCDataType& getTpcADC(const TrkrDefs::hitkey);
0040 
0041   const TpcDefs::ADCDataType& getTpcADC(const TrkrDefs::hitkey) const;
0042 
0043   virtual TpcDefs::ADCDataType& getTpcADC(const uint16_t /*local_pad*/, const uint16_t /*local_tbin*/)
0044   {
0045     static TpcDefs::ADCDataType v = 0;
0046     return v;
0047   };
0048 
0049   virtual const TpcDefs::ADCDataType& getTpcADC(const uint16_t /*local_pad*/, const uint16_t /*local_tbin*/) const
0050   {
0051     static TpcDefs::ADCDataType v = 0;
0052     return v;
0053   };
0054 
0055   virtual uint16_t getNPads() const
0056   {
0057     return 0;
0058   }
0059 
0060   virtual void setNPads(uint16_t /*nPads*/)
0061   {
0062   }
0063 
0064   virtual const TimeFrameADCDataType& getTimeFrameAdcData() const
0065   {
0066     static TimeFrameADCDataType tmp;
0067 
0068     return tmp;
0069   }
0070   virtual  TimeFrameADCDataType& getTimeFrameAdcData()
0071   {
0072     static TimeFrameADCDataType tmp;
0073 
0074     return tmp;
0075   }
0076 
0077   virtual void setTimeFrameAdcData(const TimeFrameADCDataType&)
0078   {
0079   }
0080 
0081   virtual uint16_t getNTBins() const
0082   {
0083     return 0;
0084   }
0085 
0086   virtual void setNTBins(uint16_t /*tBins*/)
0087   {
0088   }
0089 
0090   virtual uint16_t getPadIndexStart() const
0091   {
0092     return 0;
0093   }
0094 
0095   virtual void setPadIndexStart(uint16_t )
0096   {
0097   }
0098 
0099   virtual TpcDefs::BCODataType getStartingBco() const
0100   {
0101     return 0;
0102   }
0103 
0104   virtual void setStartingBco(TpcDefs::BCODataType )
0105   {
0106   }
0107 
0108   virtual uint16_t getTBinIndexStart() const
0109   {
0110     return 0;
0111   }
0112 
0113   virtual void setTBinIndexStart(uint16_t)
0114   {
0115   }
0116 
0117  private:
0118   ClassDefOverride(TrkrHitSetTpc, 1);
0119 };
0120 
0121 #endif  // TRACKBASE_TrkrHitSetTpc_H