Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /**
0002  * @file trackbase/TrkrClusterv2.h
0003  * @author J. Osborn
0004  * @date March 2021
0005  * @brief Version 2 of TrkrCluster
0006  */
0007 #ifndef TRACKBASE_TRKRCLUSTERV2_H
0008 #define TRACKBASE_TRKRCLUSTERV2_H
0009 
0010 #include <iostream>
0011 #include "TrkrCluster.h"
0012 #include "TrkrDefs.h"
0013 
0014 class PHObject;
0015 
0016 /**
0017  * @brief Version 2 of TrkrCluster
0018  *
0019  * This version of TrkrCluster contains Acts source link objects
0020  * as member variables, to join the Svtx and Acts worlds
0021  */
0022 class TrkrClusterv2 : public TrkrCluster
0023 {
0024  public:
0025   //! ctor
0026   TrkrClusterv2();
0027 
0028   //! dtor
0029   ~TrkrClusterv2() override = 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 TrkrClusterv2(*this); }
0036 
0037   //! copy content from base class
0038   void CopyFrom(const TrkrCluster&) override;
0039 
0040   //! copy content from base class
0041   void CopyFrom(TrkrCluster* 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   float getPosition(int coor) const override { return m_pos[coor]; }
0056   void setPosition(int coor, float xi) override { m_pos[coor] = xi; }
0057   void setGlobal() override { m_isGlobal = true; }
0058   void setLocal() override { m_isGlobal = false; }
0059   bool isGlobal() const override { return m_isGlobal; }
0060 
0061   float getLocalX() const override { return m_local[0]; }
0062   void setLocalX(float loc0) override { m_local[0] = loc0; }
0063   float getLocalY() const override { return m_local[1]; }
0064   void setLocalY(float loc1) override { m_local[1] = loc1; }
0065 
0066   /// Acts functions, for Acts module use only
0067   void setActsLocalError(unsigned int i, unsigned int j, float value) override;
0068   float getActsLocalError(unsigned int i, unsigned int j) const override { return m_actsLocalErr[i][j]; }
0069   TrkrDefs::subsurfkey getSubSurfKey() const override { return m_subsurfkey; }
0070   void setSubSurfKey(TrkrDefs::subsurfkey id) override { m_subsurfkey = id; }
0071 
0072   //
0073   // cluster info
0074   //
0075   unsigned int getAdc() const override { return m_adc; }
0076   void setAdc(unsigned int adc) override { m_adc = adc; }
0077   float getSize(unsigned int i, unsigned int j) const override;        //< get cluster dimension covar
0078   void setSize(unsigned int i, unsigned int j, float value) override;  //< set cluster dimension covar
0079 
0080   float getError(unsigned int i, unsigned int j) const override;        //< get cluster error covar
0081   void setError(unsigned int i, unsigned int j, float value) override;  //< set cluster error covar
0082 
0083   //
0084   // convenience interface
0085   //
0086   float getPhiSize() const override;
0087   float getZSize() const override;
0088 
0089   float getRPhiError() const override;
0090   float getPhiError() const override;
0091   float getZError() const override;
0092 
0093  protected:
0094   TrkrDefs::cluskey m_cluskey;        //< unique identifier within container
0095   TrkrDefs::subsurfkey m_subsurfkey;  //< unique identifier for hitsetkey-surface maps
0096   float m_pos[3]{};                   //< mean position x,y,z
0097   bool m_isGlobal;                    //< flag for coord sys (true = global)
0098   unsigned int m_adc;                 //< cluster sum adc (D. McGlinchey - Do we need this?)
0099   float m_size[6]{};                  //< size covariance matrix (packed storage) (+/- cm^2)
0100   float m_err[6]{};                   //< covariance matrix: rad, arc and z
0101 
0102   float m_local[2]{};            //< 2D local position [cm]
0103   float m_actsLocalErr[2][2]{};  //< 2D local error for Acts [cm]
0104 
0105   ClassDefOverride(TrkrClusterv2, 2)
0106 };
0107 
0108 #endif  // TRACKBASE_TRKRCLUSTERV2_H