Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /**
0002  * @file trackbase/TrkrClusterv3.h
0003  * @author J. Osborn
0004  * @date October 2021
0005  * @brief Version 3 of TrkrCluster
0006  */
0007 #ifndef TRACKBASE_TRKRCLUSTERV3_H
0008 #define TRACKBASE_TRKRCLUSTERV3_H
0009 
0010 #include <iostream>
0011 #include "TrkrCluster.h"
0012 #include "TrkrDefs.h"
0013 
0014 class PHObject;
0015 
0016 /**
0017  * @brief Version 3 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 TrkrClusterv3 : public TrkrCluster
0023 {
0024  public:
0025   //! ctor
0026   TrkrClusterv3();
0027 
0028   //! dtor
0029   ~TrkrClusterv3() 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 TrkrClusterv3(*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 getPosition(int coor) const override { return m_local[coor]; }
0050   void setPosition(int coor, float xi) override { m_local[coor] = xi; }
0051   float getLocalX() const override { return m_local[0]; }
0052   void setLocalX(float loc0) override { m_local[0] = loc0; }
0053   float getLocalY() const override { return m_local[1]; }
0054   void setLocalY(float loc1) override { m_local[1] = loc1; }
0055 
0056   /// Acts functions, for Acts module use only
0057   void setActsLocalError(unsigned int i, unsigned int j, float value) override;
0058   float getActsLocalError(unsigned int i, unsigned int j) const override { return m_actsLocalErr[i][j]; }
0059   TrkrDefs::subsurfkey getSubSurfKey() const override { return m_subsurfkey; }
0060   void setSubSurfKey(TrkrDefs::subsurfkey id) override { m_subsurfkey = id; }
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   //
0069   // convenience interface
0070   //
0071   float getRPhiError() const override;
0072   float getZError() const override;
0073 
0074   /// deprecated global funtions with a warning
0075   float getX() const override
0076   {
0077     std::cout << "Deprecated getx trkrcluster function!" << std::endl;
0078     return NAN;
0079   }
0080   float getY() const override
0081   {
0082     std::cout << "Deprecated gety trkrcluster function!" << std::endl;
0083     return NAN;
0084   }
0085   float getZ() const override
0086   {
0087     std::cout << "Deprecated getz trkrcluster function!" << std::endl;
0088     return NAN;
0089   }
0090   void setX(float) override
0091   {
0092     std::cout << "Deprecated setx trkrcluster function!" << std::endl;
0093   }
0094   void setY(float) override
0095   {
0096     std::cout << "Deprecated sety trkrcluster function!" << std::endl;
0097   }
0098   void setZ(float) override
0099   {
0100     std::cout << "Deprecated setz trkrcluster function!" << std::endl;
0101   }
0102   float getSize(unsigned int, unsigned int) const override
0103   {
0104     std::cout << "Deprecated getsize trkrcluster function!" << std::endl;
0105     return NAN;
0106   }
0107   void setSize(unsigned int, unsigned int, float) override
0108   {
0109     std::cout << "Deprecated setsize trkrcluster function!" << std::endl;
0110   }
0111   float getError(unsigned int, unsigned int) const override
0112   {
0113     std::cout << "Deprecated geterr trkrcluster function!" << std::endl;
0114     return NAN;
0115   }
0116   void setError(unsigned int, unsigned int, float) override
0117   {
0118     std::cout << "Deprecated seterr trkrcluster function!" << std::endl;
0119   }
0120   float getPhiSize() const override
0121   {
0122     std::cout << "Deprecated size function" << std::endl;
0123     return NAN;
0124   }
0125   float getZSize() const override
0126   {
0127     std::cout << "Deprecated size function" << std::endl;
0128     return NAN;
0129   }
0130   float getPhiError() const override
0131   {
0132     std::cout << "Deprecated getPhiError function" << std::endl;
0133     return NAN;
0134   }
0135 
0136  protected:
0137   TrkrDefs::cluskey m_cluskey;        //< unique identifier within container
0138   TrkrDefs::subsurfkey m_subsurfkey;  //< unique identifier for hitsetkey-surface maps
0139 
0140   unsigned int m_adc;  //< cluster sum adc (D. McGlinchey - Do we need this?)
0141 
0142   float m_local[2]{};            //< 2D local position [cm]
0143   float m_actsLocalErr[2][2]{};  //< 2D local error for Acts [cm]
0144 
0145   ClassDefOverride(TrkrClusterv3, 2)
0146 };
0147 
0148 #endif  // TRACKBASE_TRKRCLUSTERV3_H