Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrkrClusterv1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrkrClusterv1.h
1 
7 #ifndef TRACKBASE_TRKRCLUSTERV1_H
8 #define TRACKBASE_TRKRCLUSTERV1_H
9 
10 #include "TrkrCluster.h"
11 #include "TrkrDefs.h"
12 
13 #include <iostream>
14 
15 class PHObject;
16 
25 class TrkrClusterv1 : public TrkrCluster
26 {
27  public:
29  TrkrClusterv1();
30 
32  ~TrkrClusterv1() override = default;
33  // PHObject virtual overloads
34  void identify(std::ostream& os = std::cout) const override;
35  void Reset() override {}
36  int isValid() const override;
37  PHObject* CloneMe() const override { return new TrkrClusterv1(*this); }
38 
40  void CopyFrom( const TrkrCluster& ) override;
41 
43  void CopyFrom( TrkrCluster* source ) override
44  { CopyFrom( *source ); }
45 
46  //
47  // cluster position
48  //
49  float getX() const override { return m_pos[0]; }
50  void setX(float x) override { m_pos[0] = x; }
51  float getY() const override { return m_pos[1]; }
52  void setY(float y) override { m_pos[1] = y; }
53  float getZ() const override { return m_pos[2]; }
54  void setZ(float z) override { m_pos[2] = z; }
55  float getPosition(int coor) const override { return m_pos[coor]; }
56  void setPosition(int coor, float xi) override { m_pos[coor] = xi; }
57  void setGlobal() override { m_isGlobal = true; }
58  void setLocal() override { m_isGlobal = false; }
59  bool isGlobal() const override { return m_isGlobal; }
60  //
61  // cluster info
62  //
63  unsigned int getAdc() const override { return m_adc; }
64  void setAdc(unsigned int adc) override { m_adc = adc; }
65  float getSize(unsigned int i, unsigned int j) const override; //< get cluster dimension covar
66  void setSize(unsigned int i, unsigned int j, float value) override; //< set cluster dimension covar
67 
68  float getError(unsigned int i, unsigned int j) const override; //< get cluster error covar
69  void setError(unsigned int i, unsigned int j, float value) override; //< set cluster error covar
70 
71  //
72  // convenience interface
73  //
74  float getPhiSize() const override;
75  float getZSize() const override;
76 
77  float getRPhiError() const override;
78  float getPhiError() const override;
79  float getZError() const override;
80 
81  protected:
82 
83  TrkrDefs::cluskey m_cluskey; //< unique identifier within container
84  float m_pos[3]; //< mean position x,y,z
85  bool m_isGlobal; //< flag for coord sys (true = global)
86  unsigned int m_adc; //< cluster sum adc (D. McGlinchey - Do we need this?)
87  float m_size[6]{}; //< size covariance matrix (packed storage) (+/- cm^2)
88  float m_err[6]{}; //< covariance matrix: rad, arc and z
89 
90  ClassDefOverride(TrkrClusterv1, 1)
91 };
92 
93 #endif //TRACKBASE_TRKRCLUSTERV1_H