Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef MBD_BBCPMTINFOV1_H
0002 #define MBD_BBCPMTINFOV1_H
0003 
0004 #include <calobase/TowerInfo.h>
0005 
0006 #include <phool/PHObject.h>
0007 
0008 #include <limits>
0009 
0010 class BbcPmtInfoV1 : public TowerInfo
0011 {
0012  public:
0013   BbcPmtInfoV1() = default;
0014   // BbcPmtInfoV1(TowerInfo& tower);
0015   ~BbcPmtInfoV1() override = default;
0016   void Reset() override;
0017 
0018   //! Clear is used by TClonesArray to reset the tower to initial state without calling destructor/constructor
0019   void Clear(Option_t* = "") override;
0020 
0021   //! Prints out exact identity of object
0022   void identify(std::ostream& out = std::cout) const override;
0023 
0024   //! isValid returns non zero if object contains vailid data
0025   virtual int isValid() const override
0026   {
0027     if (bq == std::numeric_limits<Float_t>::quiet_NaN()) return 0;
0028     return 1;
0029   }
0030 
0031   // short get_time() override { return get_t(); } // deprecated for MBD since MBD returns time in ns
0032   Float_t get_energy() override { return get_q(); }
0033 
0034   // void set_time(short t) override;  // too simple to be used for MBD
0035   void set_energy(float energy) override { set_q(energy); }
0036 
0037   Short_t get_pmt() { return bpmt; }
0038   Float_t get_q() { return bq; }
0039   Float_t get_t() { return btq; }
0040   Float_t get_tt() { return btt; }
0041   Float_t get_tq() { return btq; }
0042 
0043   void set_pmt(const Short_t pmt) { bpmt = pmt; }
0044   void set_q(const Float_t q) { bq = q; }
0045   void set_tt(const Float_t t) { btt = t; }
0046   void set_tq(const Float_t t) { btq = t; }
0047   void set_pmt(const Short_t pmt, const Float_t q, const Float_t tt, const Float_t tq)
0048   {
0049     bpmt = pmt;
0050     bq = q;
0051     btt = tt;
0052     btq = tq;
0053   }
0054 
0055  private:
0056   Short_t bpmt{-1};  ///
0057   Float_t bq{std::numeric_limits<Float_t>::quiet_NaN()};
0058   Float_t btt{std::numeric_limits<Float_t>::quiet_NaN()};
0059   Float_t btq{std::numeric_limits<Float_t>::quiet_NaN()};
0060 
0061   ClassDefOverride(BbcPmtInfoV1, 1);
0062 };
0063 
0064 #endif  // __BBCPMTINFOV1_H__