Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /**
0002  * @file trackbase/CMFlashClusterv2.h
0003  * @author Ben Kimelman
0004  * @date March 2023
0005  * @brief Version 2 of CMFlashCluster
0006  */
0007 #ifndef TRACKBASE_CMFLASHCLUSTERV2_H
0008 #define TRACKBASE_CMFLASHCLUSTERV2_H
0009 
0010 #include "CMFlashCluster.h"
0011 
0012 #include <iostream>
0013 
0014 class PHObject;
0015 
0016 /**
0017  * @brief Version 2 of CMFlashCluster
0018  *
0019  * Adding bool variables to identify if
0020  * meta-cluster contains sub-clusters from
0021  * both sides of sector (phi) or module (R)
0022  * gaps
0023  *
0024  */
0025 class CMFlashClusterv2 : public CMFlashCluster
0026 {
0027  public:
0028   //! ctor
0029   CMFlashClusterv2() = default;
0030 
0031   // PHObject virtual overloads
0032   void identify(std::ostream& os = std::cout) const override;
0033   void Reset() override {}
0034   int isValid() const override;
0035   PHObject* CloneMe() const override { return new CMFlashClusterv2(*this); }
0036 
0037   //! copy content from base class
0038   void CopyFrom(const CMFlashCluster&) override;
0039 
0040   //! copy content from base class
0041   void CopyFrom(CMFlashCluster* source) override
0042   {
0043     CopyFrom(*source);
0044   }
0045 
0046   //
0047   // cluster position
0048   //
0049   float getX() const override { return m_pos[0]; }
0050   void setX(float x) override { m_pos[0] = x; }
0051   float getY() const override { return m_pos[1]; }
0052   void setY(float y) override { m_pos[1] = y; }
0053   float getZ() const override { return m_pos[2]; }
0054   void setZ(float z) override { m_pos[2] = z; }
0055   unsigned int getNclusters() const override { return m_nclusters; }
0056   void setNclusters(unsigned int n) override { m_nclusters = n; }
0057   bool getIsRGap() const override { return m_isRGap; }
0058   void setIsRGap(bool isRGap) override { m_isRGap = isRGap; }
0059   bool getIsPhiGap() const override { return m_isPhiGap; }
0060   void setIsPhiGap(bool isPhiGap) override { m_isPhiGap = isPhiGap; }
0061 
0062   //
0063   // cluster info
0064   //
0065   unsigned int getAdc() const override { return m_adc; }
0066   void setAdc(unsigned int adc) override { m_adc = adc; }
0067 
0068  protected:
0069   /// mean cluster position
0070   float m_pos[3] = {NAN, NAN, NAN};
0071 
0072   /// cluster sum adc
0073   unsigned int m_adc = 0xFFFFFFFF;
0074 
0075   /// number of TPC clusters used to create this central mebrane cluster
0076   unsigned int m_nclusters = UINT_MAX;
0077 
0078   /// bools to identify if meta-cluster is across sector/module gaps
0079   bool m_isRGap = false;
0080   bool m_isPhiGap = false;
0081 
0082   ClassDefOverride(CMFlashClusterv2, 1)
0083 };
0084 
0085 #endif  // TRACKBASE_CMFLASHCLUSTERV2_H