CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
TCircle Class Reference

A class to represent a circle in tracking. More...

#include <TCircle.h>

+ Inheritance diagram for TCircle:

Public Member Functions

 TCircle (const AList< TMLink > &links)
 Constructor.
 
virtual ~TCircle ()
 Destructor.
 
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.
 
const HepPoint3Dcenter (void) const
 returns position of center.
 
double radius (void) const
 returns radius.
 
double pt (void) const
 returns Pt.
 
double impact (void) const
 returns impact parameter to the origin.
 
double charge (void) const
 returns charge.
 
double weight (const TMLink &l) const
 returns weight of TMLink in order to fit and make a circle.
 
int fitForCurl (int ipConst=0)
 fits itself. Error was happened if return value is not zero.
 
void property (double charge, double radius, HepPoint3D center)
 sets circle properties.
 
 TCircle (const AList< TMLink > &links)
 Constructor.
 
virtual ~TCircle ()
 Destructor.
 
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.
 
const HepPoint3Dcenter (void) const
 returns position of center.
 
double radius (void) const
 returns radius.
 
double pt (void) const
 returns Pt.
 
double impact (void) const
 returns impact parameter to the origin.
 
double charge (void) const
 returns charge.
 
double weight (const TMLink &l) const
 returns weight of TMLink in order to fit and make a circle.
 
int fitForCurl (int ipConst=0)
 fits itself. Error was happened if return value is not zero.
 
void property (double charge, double radius, HepPoint3D center)
 sets circle properties.
 
- Public Member Functions inherited from TTrackBase
 TTrackBase ()
 Constructor.
 
 TTrackBase (const AList< TMLink > &links)
 Constructor.
 
virtual ~TTrackBase ()
 Destructor.
 
virtual unsigned objectType (void) const
 returns object type.
 
virtual unsigned type (void) const
 returns type. Definition is depending on an object class.
 
virtual void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
 
const AList< TMLink > & links (unsigned mask=0) const
 returns a list of masked TMLinks assigned to this track. 'mask' will be applied if mask is not 0.
 
unsigned nLinks (unsigned mask=0) const
 returns # of masked TMLinks assigned to this track object.
 
const AList< TMLink > & cores (unsigned mask=0) const
 returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
 
unsigned nCores (unsigned mask=0) const
 returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
 
void update (void) const
 update cache.
 
void append (TMLink &)
 appends a TMLink.
 
void append (const AList< TMLink > &)
 appends TMLinks.
 
void appendByApproach (AList< TMLink > &list, double maxSigma)
 appends TMLinks by approach. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.
 
void appendByDistance (AList< TMLink > &list, double maxDistance)
 appends TMLinks by distance. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.
 
void remove (TMLink &a)
 removes a TMLink.
 
void remove (const AList< TMLink > &)
 removes TMLinks.
 
virtual void refine (AList< TMLink > &list, double maxSigma)
 removes bad points by pull. The bad points are removed from the track, and are returned in 'list'.
 
virtual void refine (double maxSigma)
 removes bad points by pull. The bad points are masked not to be used in fit.
 
virtual int DropWorst ()
 
virtual void removeLinks (void)
 
virtual double distance (const TMLink &) const
 returns distance to a position of TMLink in TMLink space.
 
virtual int approach (TMLink &) const
 calculates the closest approach to a wire in real space. Results are stored in TMLink. Return value is negative if error happened.
 
unsigned testByApproach (const TMLink &list, double sigma) const
 returns # of good hits to be appended.
 
unsigned testByApproach (const AList< TMLink > &list, double sigma) const
 
virtual int fit (void)
 fits itself by a default fitter. Error was happened if return value is not zero.
 
const TMFitter *const fitter (void) const
 returns a pointer to a default fitter.
 
const TMFitter *const fitter (const TMFitter *)
 sets a default fitter.
 
void falseFit ()
 false Fit
 
TMLinkoperator[] (unsigned i) const
 
const TTrackHEP *const hep (void) const
 returns TTrackHEP.
 
unsigned nHeps (void) const
 returns # of contributed TTrackHEP tracks.
 
const TTrackMC *const mc (void) const
 returns a pointer to TTrackMC.
 
bool fitted (void) const
 returns true if fitted.
 
bool fittedWithCathode (void) const
 returns true if fitted with cathode hits(TEMPORARY).
 
 TTrackBase ()
 Constructor.
 
 TTrackBase (const AList< TMLink > &links)
 Constructor.
 
virtual ~TTrackBase ()
 Destructor.
 
virtual unsigned objectType (void) const
 returns object type.
 
virtual unsigned type (void) const
 returns type. Definition is depending on an object class.
 
virtual void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
 
const AList< TMLink > & links (unsigned mask=0) const
 returns a list of masked TMLinks assigned to this track. 'mask' will be applied if mask is not 0.
 
unsigned nLinks (unsigned mask=0) const
 returns # of masked TMLinks assigned to this track object.
 
const AList< TMLink > & cores (unsigned mask=0) const
 returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
 
unsigned nCores (unsigned mask=0) const
 returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
 
void update (void) const
 update cache.
 
void append (TMLink &)
 appends a TMLink.
 
void append (const AList< TMLink > &)
 appends TMLinks.
 
void appendByApproach (AList< TMLink > &list, double maxSigma)
 appends TMLinks by approach. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.
 
void appendByDistance (AList< TMLink > &list, double maxDistance)
 appends TMLinks by distance. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.
 
void remove (TMLink &a)
 removes a TMLink.
 
void remove (const AList< TMLink > &)
 removes TMLinks.
 
virtual void refine (AList< TMLink > &list, double maxSigma)
 removes bad points by pull. The bad points are removed from the track, and are returned in 'list'.
 
virtual void refine (double maxSigma)
 removes bad points by pull. The bad points are masked not to be used in fit.
 
virtual int DropWorst ()
 
virtual void removeLinks (void)
 
virtual double distance (const TMLink &) const
 returns distance to a position of TMLink in TMLink space.
 
virtual int approach (TMLink &) const
 calculates the closest approach to a wire in real space. Results are stored in TMLink. Return value is negative if error happened.
 
unsigned testByApproach (const TMLink &list, double sigma) const
 returns # of good hits to be appended.
 
unsigned testByApproach (const AList< TMLink > &list, double sigma) const
 
virtual int fit (void)
 fits itself by a default fitter. Error was happened if return value is not zero.
 
const TMFitter *const fitter (void) const
 returns a pointer to a default fitter.
 
const TMFitter *const fitter (const TMFitter *)
 sets a default fitter.
 
void falseFit ()
 false Fit
 
TMLinkoperator[] (unsigned i) const
 
const TTrackHEP *const hep (void) const
 returns TTrackHEP.
 
unsigned nHeps (void) const
 returns # of contributed TTrackHEP tracks.
 
const TTrackMC *const mc (void) const
 returns a pointer to TTrackMC.
 
bool fitted (void) const
 returns true if fitted.
 
bool fittedWithCathode (void) const
 returns true if fitted with cathode hits(TEMPORARY).
 

Additional Inherited Members

- Protected Attributes inherited from TTrackBase
AList< TMLink_links
 
bool _fitted
 
bool _fittedWithCathode
 
TTrackMC_mc
 

Detailed Description

A class to represent a circle in tracking.

Definition at line 42 of file InstallArea/include/TrkReco/TrkReco/TCircle.h.

Constructor & Destructor Documentation

◆ TCircle() [1/2]

TCircle::TCircle ( const AList< TMLink > &  links)

Constructor.

Definition at line 22 of file TCircle.cxx.

23: TTrackBase(a), _radius(0.), _charge(0.) {
24
25 //...Set a defualt fitter...
26 fitter(& TCircle::_fitter);
27}
const TMFitter *const fitter(void) const
returns a pointer to a default fitter.
TTrackBase()
Constructor.
Definition: TTrackBase.cxx:40

◆ ~TCircle() [1/2]

TCircle::~TCircle ( )
virtual

Destructor.

Definition at line 29 of file TCircle.cxx.

29 {
30}

◆ TCircle() [2/2]

TCircle::TCircle ( const AList< TMLink > &  links)

Constructor.

◆ ~TCircle() [2/2]

virtual TCircle::~TCircle ( )
virtual

Destructor.

Member Function Documentation

◆ center() [1/2]

const HepPoint3D & TCircle::center ( void  ) const
inline

returns position of center.

Definition at line 108 of file InstallArea/include/TrkReco/TrkReco/TCircle.h.

108 {
109#ifdef TRKRECO_DEBUG
110 if (! _fitted) std::cout << "TCircle::center !!! fit not performed" << std::endl;
111#endif
112 return _center;
113}

Referenced by TTrack::TTrack().

◆ center() [2/2]

const HepPoint3D & TCircle::center ( void  ) const

returns position of center.

◆ charge() [1/2]

double TCircle::charge ( void  ) const
inline

returns charge.

Definition at line 147 of file InstallArea/include/TrkReco/TrkReco/TCircle.h.

147 {
148#ifdef TRKRECO_DEBUG
149 if (! _fitted) std::cout << "TCircle::charge !!! fit not performed" << std::endl;
150#endif
151 return _charge;
152
153}

◆ charge() [2/2]

double TCircle::charge ( void  ) const

returns charge.

◆ dump() [1/2]

void TCircle::dump ( const std::string &  message = std::string(""),
const std::string &  prefix = std::string("") 
) const
virtual

dumps debug information.

Reimplemented from TTrackBase.

Definition at line 33 of file TCircle.cxx.

33 {
34 bool def = false;
35 if (msg == "") def = true;
36
37 if (def || msg.find("circle") != std::string::npos || msg.find("detail") != std::string::npos) {
38 std::cout << pre;
39 std::cout << "#links=" << _links.length();
40 if (_fitted) {
41 std::cout << ",charge=" << _charge;
42 std::cout << ",center=" << _center;
43 std::cout << ",radius=" << _radius;
44 std::cout << std::endl << pre;
45 std::cout << "pt=" << pt();
46 std::cout << ",impact=" << impact();
47 std::cout << std::endl;
48 }
49 else {
50 std::cout << ", not fitted yet" << std::endl;
51 }
52 }
53 if (! def) TTrackBase::dump(msg, pre);
54}
double impact(void) const
returns impact parameter to the origin.
double pt(void) const
returns Pt.
virtual void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition: TTrackBase.cxx:58

Referenced by TBuilder::buildRphi().

◆ dump() [2/2]

void TCircle::dump ( const std::string &  message = std::string(""),
const std::string &  prefix = std::string("") 
) const
virtual

dumps debug information.

Reimplemented from TTrackBase.

◆ fitForCurl() [1/2]

int TCircle::fitForCurl ( int  ipConst = 0)

fits itself. Error was happened if return value is not zero.

fits itself only for curl finder. Error was happened if return value is not zero.

Definition at line 136 of file TCircle.cxx.

136 {
137 unsigned n = _links.length();
138 if (n < 3) return -1;
139
140 //IP check
141 unsigned flagIP = 1;
142 unsigned layerID = _links[0]->hit()->wire()->layerId();
143 for(unsigned i = 0; i < n; i++){
144 if(layerID != _links[i]->hit()->wire()->layerId()){
145 flagIP = 0;
146 break;
147 }
148 }
149 if(ipConst != 0)flagIP = 1;
150 if(flagIP == 1){
151 _circle.add_point(0., 0., 0.5);
152 //++_nPointsForFit;
153 }
154 for (unsigned i = 0; i < n; i++) {
155 TMLink * l = _links[i];
156 if (l == 0) continue;
157
158 const TMDCWireHit * h = l->hit();
159 if (h == 0) continue;
160
161 //...Check next hit...
162 HepPoint3D point;
163 point = h->xyPosition();
164
165 double weight = 1.0;
166 weight = this->weight(* l);
167
168 _circle.add_point(point.x(), point.y(), weight);
169 //++_nPointsForFit;
170 }
171
172 //if (_nPointsForFit < 3) return -1;
173 if(_circle.fit()<0.0 || _circle.kappa()==0.0) return -1;
174 HepVector v(_circle.center());
175 _center.setX(v(1));
176 _center.setY(v(2));
177 _radius = _circle.radius();
178
179 //...Determine charge...Better way???
180 int qSum = 0;
181 for (unsigned i = 0; i < n; i++) {
182 TMLink * l = _links[i];
183 if (l == 0) continue;
184
185 const TMDCWireHit * h = l->hit();
186 if (h == 0) continue;
187
188 float q = (_center.cross(h->xyPosition())).z();
189 if (q > 0.) qSum += 1;
190 else qSum -= 1;
191 }
192 if (qSum >= 0) _charge = +1.;
193 else _charge = -1.;
194 _radius *= _charge;
195
196 _fitted = true;
197 return 0;
198}
const Int_t n
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
Definition: KKsem.h:33
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
Definition: KarFin.h:34
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35
void add_point(double x, double y, double w=1)
const HepPoint3D & xyPosition(void) const
returns drift time

◆ fitForCurl() [2/2]

int TCircle::fitForCurl ( int  ipConst = 0)

fits itself. Error was happened if return value is not zero.

fits itself only for curl finder. Error was happened if return value is not zero.

◆ impact() [1/2]

double TCircle::impact ( void  ) const
inline

returns impact parameter to the origin.

Definition at line 136 of file InstallArea/include/TrkReco/TrkReco/TCircle.h.

136 {
137#ifdef TRKRECO_DEBUG
138 if (! _fitted) std::cout << "TCircle::impact !!! fit not performed" << std::endl;
139#endif
140 return fabs(sqrt(_center.x() * _center.x() +
141 _center.y() * _center.y())
142 - fabs(_radius));
143}

Referenced by dump(), and TMSelector::select().

◆ impact() [2/2]

double TCircle::impact ( void  ) const

returns impact parameter to the origin.

◆ objectType() [1/2]

unsigned TCircle::objectType ( void  ) const
inlinevirtual

returns type.

Reimplemented from TTrackBase.

Definition at line 165 of file InstallArea/include/TrkReco/TrkReco/TCircle.h.

165 {
166 return Circle;
167}

◆ objectType() [2/2]

virtual unsigned TCircle::objectType ( void  ) const
virtual

returns type.

Reimplemented from TTrackBase.

◆ property() [1/2]

void TCircle::property ( double  charge,
double  radius,
HepPoint3D  center 
)
inline

sets circle properties.

Definition at line 157 of file InstallArea/include/TrkReco/TrkReco/TCircle.h.

157 {
158 _charge = c;
159 _radius = r;
160 _center = e;
161}

◆ property() [2/2]

void TCircle::property ( double  charge,
double  radius,
HepPoint3D  center 
)

sets circle properties.

◆ pt() [1/2]

double TCircle::pt ( void  ) const
inline

returns Pt.

Definition at line 126 of file InstallArea/include/TrkReco/TrkReco/TCircle.h.

126 {
127#ifdef TRKRECO_DEBUG
128 if (! _fitted) std::cout << "TCircle::pt !!! fit not performed" << std::endl;
129#endif
130 // return fabs(_radius) / Helix::ConstantAlpha;
131 return fabs(_radius) / 333.564095;
132}

Referenced by dump(), and TMSelector::select().

◆ pt() [2/2]

double TCircle::pt ( void  ) const

returns Pt.

◆ radius() [1/2]

double TCircle::radius ( void  ) const
inline

returns radius.

Definition at line 117 of file InstallArea/include/TrkReco/TrkReco/TCircle.h.

117 {
118#ifdef TRKRECO_DEBUG
119 if (! _fitted) std::cout << "TCircle::radius !!! fit not performed" << std::endl;
120#endif
121 return _radius;
122}

Referenced by TTrack::TTrack().

◆ radius() [2/2]

double TCircle::radius ( void  ) const

returns radius.

◆ weight() [1/2]

double TCircle::weight ( const TMLink l) const

returns weight of TMLink in order to fit and make a circle.

Definition at line 111 of file TCircle.cxx.

111 {
112
113 //...Axial Wires
114 int maxLink = 0;
115 int localID[6];
116 int layerID[6];
117 int LayerID = l.hit()->wire()->layerId();
118 for(int i=0;i<6;i++){
119 if(l.neighbor(i)){
120 maxLink = i;
121 localID[i] = l.neighbor(i)->hit()->wire()->localId();
122 layerID[i] = l.neighbor(i)->hit()->wire()->layerId();
123 }else{
124 break;
125 }
126 }
127 if(maxLink != 1)return 1.0;
128 if(layerID[0] == LayerID &&
129 layerID[1] == LayerID)return 0.5;
130 if(layerID[0]+layerID[1] != LayerID*2)return 1.0;
131//Liuqg if(localID[0] != localID[1])return 1.5;//1.0 or 2.0 ??
132 return 1.0;
133}
const TMDCWire *const wire(void) const
returns a pointer to a TMDCWire.
unsigned localId(void) const
returns local id in a wire layer.
unsigned layerId(void) const
returns layer id.

◆ weight() [2/2]

double TCircle::weight ( const TMLink l) const

returns weight of TMLink in order to fit and make a circle.


The documentation for this class was generated from the following files: