BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkBmSpotOnTrk Class Reference

#include <TrkBmSpotOnTrk.h>

+ Inheritance diagram for TrkBmSpotOnTrk:

Public Member Functions

 TrkBmSpotOnTrk (const HepPoint3D &ip, const HepSymMatrix &size)
 
 ~TrkBmSpotOnTrk ()
 
TrkBmSpotOnTrkclone (TrkRep *, const TrkDifTraj *t=0) const
 
virtual TrkEnums::TrkViewInfo whatView () const
 
virtual unsigned layerNumber () const
 
const TrajectoryhitTraj () const
 
const HepPoint3Dip () const
 
virtual bool timeResid (double &t, double &tErr) const
 
virtual bool timeAbsolute (double &t, double &tErr) const
 
- Public Member Functions inherited from TrkHitOnTrk
 TrkHitOnTrk (const TrkFundHit *, double tolerance)
 
virtual ~TrkHitOnTrk ()
 
const TrkRecoTrkgetParentTrack () const
 
const TrkRepgetParentRep () const
 
PdtPid::PidType particleType () const
 
const TrkFundHithit () const
 
TrkFundHithit ()
 
const TrkDifTrajtrkTraj () const
 
virtual const MdcHitOnTrackmdcHitOnTrack () const
 
virtual const SvtHitOnTrack * svtHitOnTrack () const
 
bool isActive () const
 
bool isUsable () const
 
bool mustUse () const
 
double hitRms () const
 
double weight () const
 
double fltLen () const
 
double hitLen () const
 
virtual int ambig () const
 
virtual void setAmbig (int newambig)
 
bool operator== (const TrkHitOnTrk &) const
 
bool operator< (const TrkHitOnTrk &rhs) const
 
bool hasResidual () const
 
TrkErrCode getFitStuff (HepVector &derivs, double &deltaChi) const
 
TrkErrCode getFitStuff (double &deltaChi) const
 
double resid (bool exclude=false) const
 
bool resid (double &resid, double &residErr, bool exclude=false) const
 
double residual () const
 
TrkRecoTrkparentTrack () const
 
void setActivity (bool turnOn)
 
void setUsability (int usability)
 
void setFltLen (double f)
 
void setHitRms (double newRms)
 
virtual void print (std::ostream &) const
 
virtual void printAll (std::ostream &) const
 

Protected Member Functions

 TrkBmSpotOnTrk (const TrkBmSpotOnTrk &hitToBeCopied, TrkRep *newRep, const TrkDifTraj *trkTraj=0)
 
virtual TrkErrCode updateMeasurement (const TrkDifTraj *traj, bool maintainAmbiguity)
 
double GetRms ()
 
- Protected Member Functions inherited from TrkHitOnTrk
 TrkHitOnTrk (const TrkHitOnTrk &hitToBeCopied, TrkRep *newRep, const TrkDifTraj *trkTraj=0)
 
void setHitResid (double newResid)
 
TrkRepparentRep () const
 
void setHitLen (double h)
 
void setUsedHit ()
 
void setUnusedHit ()
 
TrkErrCode updatePoca (const TrkDifTraj *trkTraj, bool maintainAmbiguity)
 

Static Protected Member Functions

static const TrkLineTraj FindBeamTrajectory (const HepPoint3D &point, const HepSymMatrix &error)
 

Additional Inherited Members

- Public Types inherited from TrkHitOnTrk
typedef std::unary_function< TrkHitOnTrk, boolpredicate_type
 
- Protected Attributes inherited from TrkHitOnTrk
TrkRep_parentRep
 
TrkFundHit_theHit
 
bool _isActive
 
int _isUsable
 
double _hitRms
 
double _trkLen
 
double _hitLen
 
double _resid
 
const TrkDifTraj_trkTraj
 
TrkPoca_poca
 
double _tolerance
 

Detailed Description

Definition at line 28 of file TrkBmSpotOnTrk.h.

Constructor & Destructor Documentation

◆ TrkBmSpotOnTrk() [1/2]

TrkBmSpotOnTrk::TrkBmSpotOnTrk ( const HepPoint3D & ip,
const HepSymMatrix & size )

Definition at line 28 of file TrkBmSpotOnTrk.cxx.

29 : TrkHitOnTrk(0,0.5e-4),
30 _beamTraj(FindBeamTrajectory(ip,size)),
31 _ip(ip),
32 _size(size)
33{}
const HepPoint3D & ip() const
static const TrkLineTraj FindBeamTrajectory(const HepPoint3D &point, const HepSymMatrix &error)
TrkHitOnTrk(const TrkFundHit *, double tolerance)

Referenced by clone().

◆ ~TrkBmSpotOnTrk()

TrkBmSpotOnTrk::~TrkBmSpotOnTrk ( )

Definition at line 44 of file TrkBmSpotOnTrk.cxx.

45{ }

◆ TrkBmSpotOnTrk() [2/2]

TrkBmSpotOnTrk::TrkBmSpotOnTrk ( const TrkBmSpotOnTrk & hitToBeCopied,
TrkRep * newRep,
const TrkDifTraj * trkTraj = 0 )
protected

Definition at line 36 of file TrkBmSpotOnTrk.cxx.

37 : TrkHitOnTrk(hot,newRep,trkTraj),
38 _beamTraj(hot._beamTraj),
39 _ip(hot.ip()),
40 _size(hot._size)
41{}
const TrkDifTraj * trkTraj() const
Definition TrkHitOnTrk.h:77

Member Function Documentation

◆ clone()

TrkBmSpotOnTrk * TrkBmSpotOnTrk::clone ( TrkRep * rep,
const TrkDifTraj * t = 0 ) const
virtual

Implements TrkHitOnTrk.

Definition at line 48 of file TrkBmSpotOnTrk.cxx.

49{
50 return new TrkBmSpotOnTrk(*this,rep,trkTraj);
51}
TrkBmSpotOnTrk(const HepPoint3D &ip, const HepSymMatrix &size)

◆ FindBeamTrajectory()

const TrkLineTraj TrkBmSpotOnTrk::FindBeamTrajectory ( const HepPoint3D & point,
const HepSymMatrix & error )
staticprotected

Definition at line 156 of file TrkBmSpotOnTrk.cxx.

158{
159 int ifail;
160 HepSymMatrix cover(error.inverse(ifail));
161
162 if (ifail) {
163#ifdef MDCPATREC_FATAL
164 std::cout<<"ErrMsg(fatal) TrkLineTraj: "
165 <<"Error inverting beamspot error matrix" << std::endl;
166#endif
167 }
168 double dx = -cover.fast(3,1)/cover.fast(1,1);
169 double dy = -cover.fast(3,2)/cover.fast(2,2);
170
171 HepPoint3D p1 = point + Hep3Vector(-dx,-dy,-1);
172 HepPoint3D p2 = point + Hep3Vector(+dx,+dy,+1);
173
174 return TrkLineTraj( p1, p2 );
175}
double p1[4]
double p2[4]
@ error
Definition Core.h:24

◆ GetRms()

double TrkBmSpotOnTrk::GetRms ( )
protected

Definition at line 102 of file TrkBmSpotOnTrk.cxx.

103{
104 //
105 // Get direction
106 //
107 const TrkDifTraj& trkTraj = getParentRep()->traj();
108 Hep3Vector trkDir = trkTraj.direction(fltLen());
109
110 //
111 // Get errors (assume no correlation)
112 //
113 double Mxx = 1.0/_size.fast(1,1);
114 double Myy = 1.0/_size.fast(2,2);
115
116 //
117 // Normalized track directions in x/y
118 //
119 double vx = trkDir[0];
120 double vy = trkDir[1];
121 double normxy = (vx*vx + vy*vy);
122 if (normxy <= 0) return 999.9;
123 normxy = sqrt(normxy);
124
125 vx /= normxy;
126 vy /= normxy;
127
128 //
129 // Solve for point of least chi2
130 //
131 double s = vx*vy*(Mxx-Myy)/(vx*vx*Mxx + vy*vy*Myy);
132
133 double dx = (-vy + s*vx);
134 double dy = (+vx + s*vy);
135
136 double chi2 = dx*dx*Mxx + dy*dy*Myy;
137
138 return chi2 <= 0 ? 0.0 : (1.0/sqrt(chi2));
139}
XmlRpcServer s
virtual Hep3Vector direction(double) const =0
virtual const TrkDifTraj & traj() const =0
double fltLen() const
Definition TrkHitOnTrk.h:91
const TrkRep * getParentRep() const
Definition TrkHitOnTrk.h:73

Referenced by updateMeasurement().

◆ hitTraj()

const Trajectory * TrkBmSpotOnTrk::hitTraj ( ) const
virtual

Implements TrkHitOnTrk.

Definition at line 79 of file TrkBmSpotOnTrk.cxx.

80{
81 return &_beamTraj;
82}

◆ ip()

const HepPoint3D & TrkBmSpotOnTrk::ip ( ) const

Definition at line 85 of file TrkBmSpotOnTrk.cxx.

86{
87 return _ip;
88}

◆ layerNumber()

virtual unsigned TrkBmSpotOnTrk::layerNumber ( ) const
inlinevirtual

Implements TrkHitOnTrk.

Definition at line 36 of file TrkBmSpotOnTrk.h.

36{ return 0; }

◆ timeAbsolute()

virtual bool TrkBmSpotOnTrk::timeAbsolute ( double & t,
double & tErr ) const
inlinevirtual

Implements TrkHitOnTrk.

Definition at line 43 of file TrkBmSpotOnTrk.h.

43{ return false; }

◆ timeResid()

virtual bool TrkBmSpotOnTrk::timeResid ( double & t,
double & tErr ) const
inlinevirtual

Implements TrkHitOnTrk.

Definition at line 42 of file TrkBmSpotOnTrk.h.

42{ return false; }

◆ updateMeasurement()

TrkErrCode TrkBmSpotOnTrk::updateMeasurement ( const TrkDifTraj * traj,
bool maintainAmbiguity )
protectedvirtual

Implements TrkHitOnTrk.

Definition at line 55 of file TrkBmSpotOnTrk.cxx.

56{
57 TrkErrCode status=updatePoca(traj,x);
58 if (status.success()) {
59 assert(_poca!=0);
62 } else {
63#ifdef MDCPATREC_WARNING
64 std::cout<<"ErrMsg(warning) TrkBmSpotOnTrk::updateMeasurement failed" << std::endl;
65#endif
66 setHitResid(9999.9);
67 setHitRms(9999.9);
68 }
69 return status;
70}
int success() const
Definition TrkErrCode.h:62
void setHitResid(double newResid)
TrkErrCode updatePoca(const TrkDifTraj *trkTraj, bool maintainAmbiguity)
void setHitRms(double newRms)
TrkPoca * _poca
double doca() const
Definition TrkPoca.h:56

◆ whatView()

TrkEnums::TrkViewInfo TrkBmSpotOnTrk::whatView ( ) const
virtual

Implements TrkHitOnTrk.

Definition at line 73 of file TrkBmSpotOnTrk.cxx.

74{
75 return TrkEnums::xyView;
76}

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