Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef MBD_MBDPMTSIMHITV1_H
0002 #define MBD_MBDPMTSIMHITV1_H
0003 
0004 #include "MbdPmtHit.h"
0005 
0006 #include <cmath>
0007 #include <iostream>
0008 #include <limits>
0009 
0010 class MbdPmtSimHitV1 : public MbdPmtHit
0011 {
0012  public:
0013   MbdPmtSimHitV1() = default;
0014   ~MbdPmtSimHitV1() 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   //! Effective Nch in PMT
0026   Float_t get_q() const override { return bq; }
0027 
0028   //! Time from time channel
0029   Float_t get_tt() const override { return btt; }
0030   Float_t get_time() const override { return btt; }
0031 
0032   //! Time from charge channel
0033   Float_t get_tq() const override { return btq; }
0034 
0035   //! n.p.e. from sim
0036   Float_t get_npe() const override { return bnpe; }
0037 
0038   void set_pmt(const Short_t ipmt, const Float_t q, const Float_t tt, const Float_t tq) override
0039   {
0040     bpmt = ipmt;
0041     bq = q;
0042     btt = tt;
0043     btq = tq;
0044   }
0045 
0046   void set_simpmt(const Float_t npe) override
0047   {
0048     bnpe = npe;
0049   }
0050 
0051   void set_npe(const Float_t npe) override
0052   {
0053     bnpe = npe;
0054   }
0055 
0056   //! Prints out exact identity of object
0057   void identify(std::ostream& out = std::cout) const override;
0058 
0059   //! isValid returns non zero if object contains valid data
0060   virtual int isValid() const override
0061   {
0062     if (std::isnan(get_time())) return 0;
0063     return 1;
0064   }
0065 
0066  private:
0067   Short_t bpmt{-1};
0068   Float_t bq{std::numeric_limits<float>::quiet_NaN()};
0069   Float_t btt{std::numeric_limits<float>::quiet_NaN()};
0070   Float_t btq{std::numeric_limits<float>::quiet_NaN()};
0071   Float_t bnpe{std::numeric_limits<float>::quiet_NaN()};
0072 
0073   ClassDefOverride(MbdPmtSimHitV1, 1)
0074 };
0075 
0076 #endif