File indexing completed on 2026-10-16 08:27:49
0001 #ifndef __MBD_MBDPMTHITV2_H__
0002 #define __MBD_MBDPMTHITV2_H__
0003
0004 #include "MbdPmtHit.h"
0005
0006 #include <cmath>
0007 #include <iostream>
0008 #include <limits>
0009
0010 class MbdPmtHitV2 : public MbdPmtHit
0011 {
0012 public:
0013 MbdPmtHitV2() = default;
0014 ~MbdPmtHitV2() override = default;
0015
0016
0017 void Reset() override;
0018
0019
0020 void Clear(Option_t* = "") override;
0021
0022
0023 Short_t get_pmt() const override { return bpmt; }
0024
0025
0026 Float_t get_q() const override { return bq; }
0027
0028
0029 Float_t get_time() const override
0030 {
0031 if ( !std::isnan(btq) && std::isnan(btt) )
0032 {
0033 return btq;
0034 }
0035 return btt;
0036 }
0037
0038
0039 Float_t get_tt() const override { return btt; }
0040
0041
0042 Float_t get_tq() const override { return btq; }
0043
0044
0045 Float_t get_chi2ndf() const override { return (fitstat&0xfff)/100.; }
0046
0047
0048 UShort_t get_fitinfo() const override { return ((fitstat&0x7000)>>12); }
0049
0050
0051 UShort_t get_badtdc() const override
0052 {
0053 if ( (fitstat&0x8000) != 0 )
0054 {
0055 return true;
0056 }
0057 return false;
0058 }
0059
0060
0061 UShort_t get_fitstat() const override { return fitstat; }
0062
0063 void set_pmt(const Short_t pmt, const Float_t q, const Float_t tt, const Float_t tq) override
0064 {
0065 bpmt = pmt;
0066 bq = q;
0067 btt = tt;
0068 btq = tq;
0069 }
0070
0071 void set_fitstat(const UShort_t f) override { fitstat = f; }
0072
0073
0074 void identify(std::ostream& out = std::cout) const override;
0075
0076
0077 virtual int isValid() const override
0078 {
0079 if (std::isnan(get_time())) return 0;
0080 return 1;
0081 }
0082
0083 private:
0084 Short_t bpmt;
0085 UShort_t fitstat;
0086 Float_t bq;
0087 Float_t btt;
0088 Float_t btq;
0089
0090 ClassDefOverride(MbdPmtHitV2, 1)
0091 };
0092
0093 #endif