Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:59

0001 #ifndef TPC_RAWHIT_H
0002 #define TPC_RAWHIT_H
0003 
0004 #include <trackbase/RawHit.h>
0005 
0006 #include <trackbase/TrkrDefs.h>
0007 
0008 #include <phool/PHObject.h>
0009 
0010 #include <climits>
0011 #include <cmath>
0012 #include <iomanip>
0013 #include <iostream>
0014 
0015 /**
0016  * @brief TPC raw hit class
0017  *
0018  * mlp - first attempt to get something going
0019  */
0020 class TPC_RawHit : public RawHit
0021 {
0022  public:
0023   TPC_RawHit(const unsigned int phi, const unsigned int samplenr, const unsigned int adc)
0024   {
0025     m_phi = phi;
0026     m_samplenr = samplenr;
0027     m_adc = adc;
0028   }
0029 
0030   ~TPC_RawHit() override {}
0031   // PHObject virtual overloads
0032   void identify(std::ostream& os = std::cout) const override
0033   {
0034     os << "phi: " << std::setw(4) << m_phi
0035        << " sample: " << std::setw(5) << m_samplenr
0036        << " ADC: " << std::setw(5) << m_adc
0037        << std::endl;
0038   }
0039   void Reset() override { m_adc = m_phi = m_samplenr = 0; }
0040   int isValid() const override { return 1; }
0041 
0042   // after digitization, these are the adc values
0043   virtual void setAdc(const unsigned int v) override { m_adc = v; }
0044   virtual unsigned int getAdc() override { return m_adc; }
0045 
0046   virtual void setPhiBin(const unsigned int v) override { m_phi = v; }
0047   virtual unsigned int getPhiBin() override { return m_phi; }
0048 
0049   virtual void setTBin(const unsigned int bv) override { m_samplenr = bv; }
0050   virtual unsigned int getTBin() override { return m_samplenr; }
0051 
0052  protected:
0053   unsigned int m_adc;
0054   unsigned int m_phi;
0055   unsigned int m_samplenr;
0056 
0057   ClassDefOverride(TPC_RawHit, 1);
0058 };
0059 
0060 #endif  // TRACKBASE_RAWHIT_H