Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef MBD_MBDRAWCONTAINERV1_H__
0002 #define MBD_MBDRAWCONTAINERV1_H__
0003 
0004 #include "MbdRawContainer.h"
0005 
0006 #include <iostream>
0007 
0008 #include <TClonesArray.h>
0009 
0010 ///
0011 class MbdRawContainerV1 : public MbdRawContainer
0012 {
0013 public:
0014   /// ctor
0015   MbdRawContainerV1();
0016 
0017   /// dtor
0018   virtual ~MbdRawContainerV1();
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   /** Add Mbd data containing evt, clk, and femclk
0032       @param ievt   Event number
0033       @param iclk    XMIT clock
0034       @param ifemclk FEM clock
0035    */
0036   virtual void set_clocks(const Int_t ievt, const UShort_t iclk, const UShort_t ifemclk) override;
0037 
0038   /** get Event Number
0039    */
0040   virtual Int_t get_evt() const override;
0041 
0042   /** get XMIT Clock Counter
0043    */
0044   virtual UShort_t get_clock() const override;
0045 
0046   /** get FEM Clock Counter
0047    */
0048   virtual UShort_t get_femclock() const override;
0049 
0050   /** set number of pmts for Mbd
0051       @param ival Number of Mbd Pmt's
0052    */
0053   void set_npmt(const Short_t ival) override
0054   {
0055     npmt = ival;
0056     return;
0057   }
0058 
0059   /// get Number of Mbd Pmt's
0060   Short_t get_npmt() const override { return MbdRawHits->GetEntries(); }
0061 
0062   /** get MbdRawPmt of Pmt iPmt in TClonesArray
0063       @param iPmt no of Pmt in TClonesArray
0064    */
0065   MbdRawHit *get_pmt(const int iPmt) const override { return (MbdRawHit*)MbdRawHits->ConstructedAt(iPmt); }
0066 
0067 private:
0068   TClonesArray *GetMbdRawHits() const { return MbdRawHits; }
0069 
0070   Int_t evt{-1};
0071   UShort_t clk{0};
0072   UShort_t femclk{0};
0073   Short_t npmt = 0;
0074   TClonesArray *MbdRawHits = nullptr;
0075 
0076   ClassDefOverride(MbdRawContainerV1, 1)
0077 };
0078 
0079 #endif