BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/TrkReco/include/TrkReco/TCircle.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TCircle.h,v 1.13 2012/05/28 05:16:29 maoh Exp $
3//-----------------------------------------------------------------------------
4// Filename : TCircle.h
5// Section : Tracking
6// Owner : Yoshi Iwasaki
7// Email : yoshihito.iwasaki@kek.jp
8//-----------------------------------------------------------------------------
9// Description : A class to represent a circle in tracking.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#ifndef TCircle_FLAG_
14#define TCircle_FLAG_
15
16#ifdef TRKRECO_DEBUG_DETAIL
17# ifndef TRKRECO_DEBUG
18# define TRKRECO_DEBUG
19# endif
20#endif
21
22#include <string>
23
24// #define HEP_SHORT_NAMES
25
26#ifndef CLHEP_POINT3D_H
27# include "CLHEP/Geometry/Point3D.h"
28#endif
29#ifndef ENABLE_BACKWARDS_COMPATIBILITY
30typedef HepGeom::Point3D<double> HepPoint3D;
31#endif
32using HepGeom::Point3D;
33
34#include "TrkReco/TCircleFitter.h"
35#include "TrkReco/TMDCUtil.h"
36#include "TrkReco/TTrackBase.h"
37// #include "lpav/Lpav.h"
38// #include "TrkReco/Lpav.h"
39#include "TrackUtil/Lpav.h"
40
41/// A class to represent a circle in tracking.
42class TCircle : public TTrackBase {
43
44public:
45 /// Constructor.
47
48 /// Destructor
49 virtual ~TCircle();
50
51public: // Selectors
52 /// returns type.
53 virtual unsigned objectType( void ) const;
54
55 /// dumps debug information.
56 void dump( const std::string& message = std::string( "" ),
57 const std::string& prefix = std::string( "" ) ) const;
58
59 /// returns position of center.
60 const HepPoint3D& center( void ) const;
61
62 /// returns radius.
63 double radius( void ) const;
64
65 /// returns Pt.
66 double pt( void ) const;
67
68 /// returns impact parameter to the origin.
69 double impact( void ) const;
70
71 /// returns charge.
72 double charge( void ) const;
73
74 /// returns weight of TMLink in order to fit and make a circle.
75 double weight( const TMLink& l ) const;
76
77public: // Modifiers
78 /// fits itself. Error was happened if return value is not zero.
79 // int fitx(void);
80
81 /// fits itself only for curl finder. Error was happened if return value is not zero.
82 int fitForCurl( int ipConst = 0 );
83
84 /// sets circle properties.
85 void property( double charge, double radius, HepPoint3D center );
86
87private: // Updated when fitted
88 Lpav _circle;
89 double _charge;
90 double _radius;
91 HepPoint3D _center;
92 static const TCircleFitter _fitter;
93};
94
95//-----------------------------------------------------------------------------
96
97#ifdef TCircle_NO_INLINE
98# define inline
99#else
100# undef inline
101# define TCircle_INLINE_DEFINE_HERE
102#endif
103
104#ifdef TCircle_INLINE_DEFINE_HERE
105
106inline const HepPoint3D& TCircle::center( void ) const {
107# ifdef TRKRECO_DEBUG
108 if ( !_fitted ) std::cout << "TCircle::center !!! fit not performed" << std::endl;
109# endif
110 return _center;
111}
112
113inline double TCircle::radius( void ) const {
114# ifdef TRKRECO_DEBUG
115 if ( !_fitted ) std::cout << "TCircle::radius !!! fit not performed" << std::endl;
116# endif
117 return _radius;
118}
119
120inline double TCircle::pt( void ) const {
121# ifdef TRKRECO_DEBUG
122 if ( !_fitted ) std::cout << "TCircle::pt !!! fit not performed" << std::endl;
123# endif
124 // return fabs(_radius) / Helix::ConstantAlpha;
125 return fabs( _radius ) / 333.564095;
126}
127
128inline double TCircle::impact( void ) const {
129# ifdef TRKRECO_DEBUG
130 if ( !_fitted ) std::cout << "TCircle::impact !!! fit not performed" << std::endl;
131# endif
132 return fabs( sqrt( _center.x() * _center.x() + _center.y() * _center.y() ) -
133 fabs( _radius ) );
134}
135
136inline double TCircle::charge( void ) const {
137# ifdef TRKRECO_DEBUG
138 if ( !_fitted ) std::cout << "TCircle::charge !!! fit not performed" << std::endl;
139# endif
140 return _charge;
141}
142
143inline void TCircle::property( double c, double r, HepPoint3D e ) {
144 _charge = c;
145 _radius = r;
146 _center = e;
147}
148
149inline unsigned TCircle::objectType( void ) const { return Circle; }
150
151#endif
152
153#undef inline
154
155#endif /* TCircle_FLAG_ */
HepGeom::Point3D< double > HepPoint3D
HepGeom::Point3D< double > HepPoint3D
A class to fit a TTrackBase object to a circle.
A class to represent a circle in tracking.
virtual unsigned objectType(void) const
returns type.
TCircle(const AList< TMLink > &links)
Constructor.
virtual unsigned objectType(void) const
returns type.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
double weight(const TMLink &l) const
returns weight of TMLink in order to fit and make a circle.
double radius(void) const
returns radius.
virtual ~TCircle()
Destructor.
double impact(void) const
returns impact parameter to the origin.
double pt(void) const
returns Pt.
const HepPoint3D & center(void) const
returns position of center.
void property(double charge, double radius, HepPoint3D center)
sets circle properties.
double charge(void) const
returns charge.
int fitForCurl(int ipConst=0)
fits itself. Error was happened if return value is not zero.
A virtual class for a track class in tracking.
const AList< TMLink > & links(unsigned mask=0) const