Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /**
0002  * @file trackbase/TrkrHit.h
0003  * @author D. McGlinchey
0004  * @date 4 June 2018
0005  * @brief Base class for hit object
0006  */
0007 #ifndef TRACKBASE_TRKRHITV2_H
0008 #define TRACKBASE_TRKRHITV2_H
0009 
0010 #include "TrkrDefs.h"
0011 #include "TrkrHit.h"
0012 
0013 #include <phool/PHObject.h>
0014 
0015 #include <iostream>
0016 
0017 /**
0018  * @brief Base class for hit object
0019  *
0020  * This is the empyt virtual base class for a hit object.
0021  * Each subsystem should implement an inherited version
0022  * which contains the actual storage information.
0023  */
0024 class TrkrHitv2 : public TrkrHit
0025 {
0026  public:
0027   //! ctor
0028   explicit TrkrHitv2() = default;
0029 
0030   //! dtor
0031   ~TrkrHitv2() override = default;
0032 
0033   // PHObject virtual overloads
0034   void identify(std::ostream& os = std::cout) const override
0035   {
0036     os << "TrkrHitv2 class with adc = " << m_adc << std::endl;
0037   }
0038   void Reset() override {}
0039   int isValid() const override { return 0; }
0040 
0041   //! import PHObject CopyFrom, in order to avoid clang warning
0042   using PHObject::CopyFrom;
0043 
0044   //! copy content from base class
0045   void CopyFrom(const TrkrHit&) override;
0046 
0047   //! copy content from base class
0048   void CopyFrom(TrkrHit* source) override
0049   {
0050     CopyFrom(*source);
0051   }
0052 
0053   // these set and get the energy before digitization
0054   void addEnergy(const double edep) override;
0055   double getEnergy() const override;
0056 
0057   // after digitization, these are the adc values
0058   void setAdc(const unsigned int adc) override;
0059   unsigned int getAdc() const override;
0060 
0061  protected:
0062   unsigned short m_adc = 0;
0063   ClassDefOverride(TrkrHitv2, 1);
0064 };
0065 
0066 #endif  // TRACKBASE_TRKRHITV2_H