Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:20:31

0001 /**
0002  * @file trackbase/CMFlashDifferencev1.h
0003  * @author Tony Frawley
0004  * @date January 2022
0005  * @brief Version 1 of CMFLashDifference
0006  */
0007 #ifndef TRACKBASE_CMFLASHDIFFERENCEV1_H
0008 #define TRACKBASE_CMFLASHDIFFERENCEV1_H
0009 
0010 #include "CMFlashDifference.h"
0011 
0012 #include <iostream>
0013 
0014 class PHObject;
0015 
0016 /**
0017  * @brief Version 1 of CMFlashDifference
0018  *
0019  */
0020 class CMFlashDifferencev1 : public CMFlashDifference
0021 {
0022  public:
0023   //! ctor
0024   CMFlashDifferencev1() = default;
0025 
0026   // PHObject virtual overloads
0027   void identify(std::ostream& os = std::cout) const override;
0028   void Reset() override {}
0029   int isValid() const override;
0030   PHObject* CloneMe() const override { return new CMFlashDifferencev1(*this); }
0031 
0032   //! copy content from base class
0033   void CopyFrom(const CMFlashDifference&) override;
0034 
0035   //! copy content from base class
0036   void CopyFrom(CMFlashDifference* source) override
0037   {
0038     CopyFrom(*source);
0039   }
0040 
0041   void setNclusters(unsigned int n) override { m_nclusters = n; }
0042   unsigned int getNclusters() const override { return m_nclusters; }
0043   //
0044   // difference position
0045   //
0046   float getTruthPhi() const override { return m_Phi[0]; }
0047   void setTruthPhi(float phi) override { m_Phi[0] = phi; }
0048 
0049   float getRecoPhi() const override { return m_Phi[1]; }
0050   void setRecoPhi(float phi) override { m_Phi[1] = phi; }
0051 
0052   float getTruthR() const override { return m_R[0]; }
0053   void setTruthR(float r) override { m_R[0] = r; }
0054 
0055   float getRecoR() const override { return m_R[1]; }
0056   void setRecoR(float r) override { m_R[1] = r; }
0057 
0058   float getTruthZ() const override { return m_Z[0]; }
0059   void setTruthZ(float z) override { m_Z[0] = z; }
0060 
0061   float getRecoZ() const override { return m_Z[1]; }
0062   void setRecoZ(float z) override { m_Z[1] = z; }
0063 
0064   /*
0065   float getTruthX() const override { return m_pos_truth[0]; }
0066   void setTruthX(float x) override { m_pos_truth[0] = x; }
0067   float getTruthY() const override { return m_pos_truth[1]; }
0068   void setTruthY(float y) override { m_pos_truth[1] = y; }
0069   float getRecoX() const override { return m_pos_reco[0]; }
0070   void setRecoX(float x) override { m_pos_reco[0] = x; }
0071   float getRecoY() const override { return m_pos_reco[1]; }
0072   void setRecoY(float y) override { m_pos_reco[1] = y; }
0073   */
0074 
0075  protected:
0076   unsigned int m_nclusters = UINT_MAX;
0077 
0078   float m_Phi[2] = {NAN, NAN};  // (truth, reco)
0079   float m_R[2] = {NAN, NAN};
0080   float m_Z[2] = {NAN, NAN};
0081 
0082   ClassDefOverride(CMFlashDifferencev1, 1)
0083 };
0084 
0085 #endif  // TRACKBASE_CMFLASHDIFFERENCEV1_H