Belle II Software  release-08-01-10
TRGCDCTrack.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 //-----------------------------------------------------------------------------
10 // Description : A class to represent a reconstructed charged track in TRGCDC.
11 //-----------------------------------------------------------------------------
12 
13 #ifndef TRGCDCTrack_FLAG_
14 #define TRGCDCTrack_FLAG_
15 
16 #include "trg/cdc/TrackBase.h"
17 #include "trg/cdc/Helix.h"
18 
19 #ifdef TRGCDC_SHORT_NAMES
20 #define TCTrack TRGCDCTrack
21 #endif
22 
23 //...Definition of status...
24 #define TCTrack_2DTrack 1
25 #define TCTrack_2DTrackFitted 2
26 #define TCTrack_3DTrack 4
27 #define TCTrack_3DTrackFitted 8
28 
29 namespace Belle2 {
35  class TRGCDCCircle;
36 
38  class TRGCDCTrack : public TRGCDCTrackBase {
39 
40  public:
42  enum EDebugValueType { fit2D = 1 << 3,
43  find3D = 1 << 4,
44  fit3D = 1 << 5,
45  any = fit2D | find3D | fit3D
46  };
47 
48 
50  static std::vector<const TRGCDCTrack*> list(void);
51 
53  TRGCDCTrack();
54 
56  explicit TRGCDCTrack(const TRGCDCCircle&);
57 
59  virtual ~TRGCDCTrack();
60 
62  const TRGCDCHelix& helix(void) const;
63 
65  void setHelix(const TRGCDCHelix& helix);
66 
68  int approach(TRGCDCLink&, bool sagCorrection = false) const;
69 
71  virtual const CLHEP::Hep3Vector& p(void) const override;
72 
74  virtual double pt(void) const override;
75 
77  virtual const CLHEP::Hep3Vector& x(void) const override;
78 
80  void set2DFitChi2(double);
81 
83  double get2DFitChi2(void) const;
84 
86  void set3DFitChi2(double);
87 
89  double get3DFitChi2(void) const;
90 
92  void setDebugValue(EDebugValueType const& moduleName, bool flag);
93 
95  int getDebugValue(EDebugValueType const& moduleName) const;
96 
97  public:
98 
100  std::vector<HepGeom::Point3D<double> > perfectPosition(void) const;
101 
102  private:// static members
103 
105  static std::vector<const TRGCDCTrack*> _list;
106 
107  private:
108 
111 
113  mutable CLHEP::Hep3Vector _p;
114 
116  mutable CLHEP::Hep3Vector _x;
117 
119  double m_2DFitChi2;
120 
122  double m_3DFitChi2;
123 
126  };
127 
128 //-----------------------------------------------------------------------------
129 
130 // inline
131 // unsigned
132 // TRGCDCTrack::id(void) const{
133 // if (_list.size()) {
134 // for (unsigned i = 0; i < _list.size(); i++)
135 // if (_list[i] == this)
136 // return unsigned(i);
137 // }
138 // return 999;
139 // }
140 
141  inline
142  const TRGCDCHelix&
143  TRGCDCTrack::helix(void) const
144  {
145  return _helix;
146  }
147 
148  inline
149  void
151  {
152  _helix = helix;
153  }
154 
155  inline
156  const CLHEP::Hep3Vector&
157  TRGCDCTrack::p(void) const
158  {
159  _p = _helix.momentum();
160  return _p;
161  }
162 
163  inline
164  double
165  TRGCDCTrack::pt(void) const
166  {
167  _p = _helix.momentum();
168  return _p.perp();
169  }
170 
171  inline
172  const CLHEP::Hep3Vector&
173  TRGCDCTrack::x(void) const
174  {
175  _x = _helix.x();
176  return _x;
177  }
178 
179  inline
180  void TRGCDCTrack::set2DFitChi2(double in2DFitChi2)
181  {
182  m_2DFitChi2 = in2DFitChi2;
183  }
184 
185  inline
186  double TRGCDCTrack::get2DFitChi2(void) const
187  {
188  return m_2DFitChi2;
189  }
190 
191  inline
192  void TRGCDCTrack::set3DFitChi2(double in3DFitChi2)
193  {
194  m_3DFitChi2 = in3DFitChi2;
195  }
196 
197  inline
198  double TRGCDCTrack::get3DFitChi2(void) const
199  {
200  return m_3DFitChi2;
201  }
202 
203  inline
204  void TRGCDCTrack::setDebugValue(EDebugValueType const& moduleName, bool flag)
205  {
206  if (flag) m_debugValue |= moduleName;
207  else m_debugValue &= ~moduleName;
208  }
209 
210  inline
211  int TRGCDCTrack::getDebugValue(EDebugValueType const& moduleName) const
212  {
213  return m_debugValue & moduleName;
214  }
215 
216 
217 
219 } // namespace Belle2
220 
221 #endif /* TRGCDCTrack_FLAG_ */
A class to represent a circle.
Definition: Circle.h:33
TRGCDCHelix parameter class.
Definition: Helix.h:34
A class to represent a track object in TRGCDC.
Definition: TrackBase.h:40
A class to represent a reconstructed charged track in TRGCDC.
Definition: TRGCDCTrack.h:38
int m_debugValue
Debugging variable.
Definition: TRGCDCTrack.h:125
double m_2DFitChi2
2D fit chi2
Definition: TRGCDCTrack.h:119
CLHEP::Hep3Vector _p
Momentum.
Definition: TRGCDCTrack.h:113
TRGCDCHelix _helix
Helix parameter.
Definition: TRGCDCTrack.h:110
CLHEP::Hep3Vector _x
Position.
Definition: TRGCDCTrack.h:116
double m_3DFitChi2
3D fit chi2
Definition: TRGCDCTrack.h:122
EDebugValueType
Enum for returnValue types.
Definition: TRGCDCTrack.h:42
const TRGCDCHelix & helix(void) const
returns helix parameter.
Definition: TRGCDCTrack.h:143
HepGeom::Point3D< double > x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.
Definition: Helix.cc:135
TRGCDCTrack()
Constructor.
Definition: TRGCDCTrack.cc:37
int approach(TRGCDCLink &, bool sagCorrection=false) const
calculates the closest approach to a wire in real space. Results are stored in TLink....
Definition: TRGCDCTrack.cc:94
virtual const CLHEP::Hep3Vector & p(void) const override
returns momentum vector.
Definition: TRGCDCTrack.h:157
void set2DFitChi2(double)
Set 2D fit chi2.
Definition: TRGCDCTrack.h:180
static std::vector< const TRGCDCTrack * > _list
a vector to keep all TRGCDCTrack objects.
Definition: TRGCDCTrack.h:105
std::vector< HepGeom::Point3D< double > > perfectPosition(void) const
returns perfect position from GEANT.
Definition: TRGCDCTrack.cc:259
int getDebugValue(EDebugValueType const &moduleName) const
Get debug value.
Definition: TRGCDCTrack.h:211
double get2DFitChi2(void) const
Returns 2D fit chi2.
Definition: TRGCDCTrack.h:186
virtual const CLHEP::Hep3Vector & x(void) const override
returns position vector.
Definition: TRGCDCTrack.h:173
double get3DFitChi2(void) const
Returns 3D fit chi2.
Definition: TRGCDCTrack.h:198
void set3DFitChi2(double)
Set 3D fit chi2.
Definition: TRGCDCTrack.h:192
void setHelix(const TRGCDCHelix &helix)
Set helix parameter.
Definition: TRGCDCTrack.h:150
void setDebugValue(EDebugValueType const &moduleName, bool flag)
Set debug value.
Definition: TRGCDCTrack.h:204
virtual double pt(void) const override
returns Pt.
Definition: TRGCDCTrack.h:165
static std::vector< const TRGCDCTrack * > list(void)
returns a list of TRGCDCTrack's.
Definition: TRGCDCTrack.cc:86
virtual ~TRGCDCTrack()
Destructor.
Definition: TRGCDCTrack.cc:76
CLHEP::Hep3Vector momentum(double dPhi=0.) const
returns momentum vector after rotating angle dPhi in phi direction.
Definition: Helix.cc:194
Abstract base class for different kinds of events.