Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef __MBD_MBDRAWHITV1_H__
0002 #define __MBD_MBDRAWHITV1_H__
0003 
0004 #include "MbdRawHit.h"
0005 
0006 #include <cmath>
0007 #include <iostream>
0008 #include <limits>
0009 
0010 class MbdRawHitV1 : public MbdRawHit
0011 {
0012  public:
0013   MbdRawHitV1() = default;
0014   ~MbdRawHitV1() override = default;
0015 
0016   //! Just does a clear
0017   void Reset() override;
0018 
0019   //! Clear is used by TClonesArray to reset the tower to initial state without calling destructor/constructor
0020   void Clear(Option_t* = "") override;
0021 
0022   //! PMT number
0023   Short_t get_pmt() const override { return bpmt; }
0024 
0025   //! ADC
0026   Float_t get_adc() const override { return badc; }
0027 
0028   //! TDC from time channel
0029   Float_t get_ttdc() const override { return bttdc; }
0030 
0031   //! TDC from charge channel
0032   Float_t get_qtdc() const override { return bqtdc; }
0033 
0034   void set_pmt(const Short_t pmt, const Float_t a, const Float_t tt, const Float_t tq) override
0035   {
0036     bpmt = pmt;
0037     badc = a;
0038     bttdc = tt;
0039     bqtdc = tq;
0040   }
0041 
0042   //! Prints out exact identity of object
0043   void identify(std::ostream& out = std::cout) const override;
0044 
0045   //! isValid returns non zero if object contains valid data
0046   virtual int isValid() const override
0047   {
0048     if (std::isnan(get_ttdc())) return 0;
0049     return 1;
0050   }
0051 
0052  private:
0053   Short_t bpmt;
0054   Float_t badc;
0055   Float_t bttdc;
0056   Float_t bqtdc;
0057 
0058   ClassDefOverride(MbdRawHitV1, 1)
0059 };
0060 
0061 #endif