Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:10

0001 /**
0002  * @file trackbase/TpcTpotEventInfo.h
0003  * @author Thomas Marshall
0004  * @date September 2023
0005  * @brief Base class for TPC and TPOT event level information
0006  */
0007 #ifndef TRACKBASE_TPCTPOTEVENTINFO_H
0008 #define TRACKBASE_TPCTPOTEVENTINFO_H
0009 
0010 #include "TrkrDefs.h"
0011 
0012 #include <phool/PHObject.h>
0013 
0014 #include <climits>
0015 #include <cmath>
0016 #include <iostream>
0017 #include <memory>
0018 
0019 /**
0020  * @brief Base class for TPC and TPOT event level information
0021  *
0022  * Virtual base class for TPC and TPOT event level information for
0023  * use in error checking and debugging
0024  */
0025 class TpcTpotEventInfo : public PHObject
0026 {
0027  public:
0028   //! dtor
0029   ~TpcTpotEventInfo() override = default;
0030 
0031   // PHObject virtual overloads
0032   void identify(std::ostream& os = std::cout) const override
0033   {
0034     os << "TpcTpotEventInfo base class" << std::endl;
0035   }
0036   void Reset() override {}
0037   int isValid() const override { return 0; }
0038 
0039   //! import PHObject CopyFrom, in order to avoid clang warning
0040   using PHObject::CopyFrom;
0041 
0042   //! copy content from base class
0043   virtual void CopyFrom(const TpcTpotEventInfo&)
0044   {
0045   }
0046 
0047   //! copy content from base class
0048   virtual void CopyFrom(TpcTpotEventInfo*)
0049   {
0050   }
0051 
0052   //
0053   // event tagger info
0054   //
0055 
0056   enum SectorID
0057   {
0058     kTPCSector0 = 0,
0059     kTPCSector1,
0060     kTPCSector2,
0061     kTPCSector3,
0062     kTPCSector4,
0063     kTPCSector5,
0064     kTPCSector6,
0065     kTPCSector7,
0066     kTPCSector8,
0067     kTPCSector9,
0068     kTPCSector10,
0069     kTPCSector11,
0070     kTPCSector12,
0071     kTPCSector13,
0072     kTPCSector14,
0073     kTPCSector15,
0074     kTPCSector16,
0075     kTPCSector17,
0076     kTPCSector18,
0077     kTPCSector19,
0078     kTPCSector20,
0079     kTPCSector21,
0080     kTPCSector22,
0081     kTPCSector23,
0082     kTPOT = 24
0083   };
0084   // TPC has sectors 0..23, TPOT uses index 24 in this storage
0085   enum PCIeEndPointID
0086   {
0087     kEndPoint0 = 0,
0088     kEndPoint1 = 1
0089   };
0090   enum TaggerID
0091   {
0092     kLVL1Tagger = 0,
0093     kEnDatTagger = 1
0094   };
0095 
0096   virtual void checkIndexes(SectorID, PCIeEndPointID, TaggerID)
0097   {
0098   }
0099 
0100   virtual uint64_t getBCO(SectorID, PCIeEndPointID, TaggerID) const { return UINT64_MAX; }
0101   virtual void setBCO(uint64_t, SectorID, PCIeEndPointID, TaggerID) {}
0102   virtual uint32_t getLevel1Count(SectorID, PCIeEndPointID, TaggerID) const { return UINT32_MAX; }
0103   virtual void setLevel1Count(uint32_t, SectorID, PCIeEndPointID, TaggerID) {}
0104   virtual uint32_t getEnDatCount(SectorID, PCIeEndPointID, TaggerID) const { return UINT32_MAX; }
0105   virtual void setEnDatCount(uint32_t, SectorID, PCIeEndPointID, TaggerID) {}
0106   virtual uint64_t getLastBCO(SectorID, PCIeEndPointID, TaggerID) const { return UINT64_MAX; }
0107   virtual void setLastBCO(uint64_t, SectorID, PCIeEndPointID, TaggerID) {}
0108   virtual uint8_t getModebits(SectorID, PCIeEndPointID, TaggerID) const { return UINT8_MAX; }
0109   virtual void setModebits(uint8_t, SectorID, PCIeEndPointID, TaggerID) {}
0110 
0111  protected:
0112   TpcTpotEventInfo() = default;
0113   ClassDefOverride(TpcTpotEventInfo, 1)
0114 };
0115 
0116 #endif  // TRACKBASE_TRKRCLUSTER_H