Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include "MbdPmtContainerV2.h"
0002 #include "MbdPmtHitV2.h"
0003 #include "MbdReturnCodes.h"
0004 
0005 #include <TClonesArray.h>
0006 
0007 #include <iostream>
0008 
0009 static const int NPMTMBDV2 = 128;
0010 
0011 MbdPmtContainerV2::MbdPmtContainerV2() :
0012   npmt(NPMTMBDV2),
0013   MbdPmtHits(new TClonesArray("MbdPmtHitV2", NPMTMBDV2))
0014 {
0015   // MbdPmtHit is class for single hit (members: pmt,adc,tdc0,tdc1), do not mix
0016   // with TClonesArray *MbdPmtHits
0017 }
0018 
0019 MbdPmtContainerV2::~MbdPmtContainerV2()
0020 {
0021   delete MbdPmtHits;
0022 }
0023 
0024 int MbdPmtContainerV2::get_badtdc() const
0025 {
0026   int has_badtdc = 0;
0027 
0028   for (int ipmt=0; ipmt < get_npmt(); ipmt++)
0029   {
0030     MbdPmtHit* mbdpmt = get_pmt(ipmt);
0031     if ( mbdpmt->get_badtdc() )
0032     {
0033       has_badtdc = 1;
0034       break;
0035     }
0036   }
0037 
0038   return has_badtdc;
0039 }
0040 
0041 int MbdPmtContainerV2::isValid() const
0042 {
0043   if (npmt <= 0)
0044   {
0045     return 0;
0046   }
0047   return 1;
0048 }
0049 
0050 void MbdPmtContainerV2::Reset()
0051 {
0052   MbdPmtHits->Clear();
0053   npmt = 0;
0054 }
0055 
0056 void MbdPmtContainerV2::identify(std::ostream &out) const
0057 {
0058   out << "identify yourself: I am a MbdPmtContainerV2 object" << std::endl;
0059 }