Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-10-16 08:27:49

0001 #ifndef MBD_MBDPMTCONTAINERV2_H__
0002 #define MBD_MBDPMTCONTAINERV2_H__
0003 
0004 #include "MbdPmtContainer.h"
0005 
0006 #include <iostream>
0007 
0008 #include <TClonesArray.h>
0009 
0010 ///
0011 class MbdPmtContainerV2 : public MbdPmtContainer
0012 {
0013 public:
0014   /// ctor
0015   MbdPmtContainerV2();
0016 
0017   /// dtor
0018   virtual ~MbdPmtContainerV2();
0019 
0020   /// Clear Event
0021   void Reset() override;
0022 
0023   /** identify Function from PHObject
0024       @param os Output Stream
0025    */
0026   void identify(std::ostream &out = std::cout) const override;
0027 
0028   /// isValid returns non zero if object contains vailid data
0029   int isValid() const override;
0030 
0031   /** set number of pmts for Mbd
0032       @param ival Number of Mbd Pmt's
0033    */
0034   void set_npmt(const Short_t ival) override
0035   {
0036     npmt = ival;
0037     MbdPmtHits->ExpandCreate( ival );
0038     return;
0039   }
0040 
0041   /// get Number of Mbd Pmt's
0042   Short_t get_npmt() const override { return MbdPmtHits->GetEntries(); }
0043 
0044   /** get MbdHitPmt of Pmt iPmt in TClonesArray
0045       @param iPmt no of Pmt in TClonesArray
0046    */
0047   MbdPmtHit *get_pmt(const int iPmt) const override { return (MbdPmtHit*)MbdPmtHits->ConstructedAt(iPmt); }
0048 
0049   /// whether this event had a bad TDC
0050   int get_badtdc() const override;
0051 
0052 private:
0053   TClonesArray *GetMbdPmtHits() const { return MbdPmtHits; }
0054 
0055   Short_t npmt = 0;
0056   TClonesArray *MbdPmtHits = nullptr;
0057 
0058   ClassDefOverride(MbdPmtContainerV2, 1)
0059 };
0060 
0061 #endif