Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:02

0001 /**
0002  * @file trackbase/TrkrClusterv1.h
0003  * @author D. McGlinchey
0004  * @date June 2018
0005  * @brief Version 1 of TrkrCluster
0006  */
0007 #ifndef TRACKBASE_TRKRCLUSTERV1_H
0008 #define TRACKBASE_TRKRCLUSTERV1_H
0009 
0010 #include "TrkrCluster.h"
0011 #include "TrkrDefs.h"
0012 
0013 #include <iostream>
0014 
0015 class PHObject;
0016 
0017 /**
0018  * @brief Version 1 of TrkrCluster
0019  *
0020  * Note - D. McGlinchey June 2018:
0021  *   CINT does not like "override", so ignore where CINT
0022  *   complains. Should be checked with ROOT 6 once
0023  *   migration occurs.
0024  */
0025 class TrkrClusterv1 : public TrkrCluster
0026 {
0027  public:
0028   //! ctor
0029   TrkrClusterv1();
0030 
0031   //! dtor
0032   ~TrkrClusterv1() override = default;
0033   // PHObject virtual overloads
0034   void identify(std::ostream& os = std::cout) const override;
0035   void Reset() override {}
0036   int isValid() const override;
0037   PHObject* CloneMe() const override { return new TrkrClusterv1(*this); }
0038 
0039   //! copy content from base class
0040   void CopyFrom(const TrkrCluster&) override;
0041 
0042   //! copy content from base class
0043   void CopyFrom(TrkrCluster* source) override
0044   {
0045     CopyFrom(*source);
0046   }
0047 
0048   //
0049   // cluster position
0050   //
0051   float getX() const override { return m_pos[0]; }
0052   void setX(float x) override { m_pos[0] = x; }
0053   float getY() const override { return m_pos[1]; }
0054   void setY(float y) override { m_pos[1] = y; }
0055   float getZ() const override { return m_pos[2]; }
0056   void setZ(float z) override { m_pos[2] = z; }
0057   float getPosition(int coor) const override { return m_pos[coor]; }
0058   void setPosition(int coor, float xi) override { m_pos[coor] = xi; }
0059   void setGlobal() override { m_isGlobal = true; }
0060   void setLocal() override { m_isGlobal = false; }
0061   bool isGlobal() const override { return m_isGlobal; }
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   float getSize(unsigned int i, unsigned int j) const override;        //< get cluster dimension covar
0068   void setSize(unsigned int i, unsigned int j, float value) override;  //< set cluster dimension covar
0069 
0070   float getError(unsigned int i, unsigned int j) const override;        //< get cluster error covar
0071   void setError(unsigned int i, unsigned int j, float value) override;  //< set cluster error covar
0072 
0073   //
0074   // convenience interface
0075   //
0076   float getPhiSize() const override;
0077   float getZSize() const override;
0078 
0079   float getRPhiError() const override;
0080   float getPhiError() const override;
0081   float getZError() const override;
0082 
0083  protected:
0084   TrkrDefs::cluskey m_cluskey;  //< unique identifier within container
0085   float m_pos[3]{};             //< mean position x,y,z
0086   bool m_isGlobal;              //< flag for coord sys (true = global)
0087   unsigned int m_adc;           //< cluster sum adc (D. McGlinchey - Do we need this?)
0088   float m_size[6]{};            //< size covariance matrix (packed storage) (+/- cm^2)
0089   float m_err[6]{};             //< covariance matrix: rad, arc and z
0090 
0091   ClassDefOverride(TrkrClusterv1, 1)
0092 };
0093 
0094 #endif  // TRACKBASE_TRKRCLUSTERV1_H