BOSS 7.0.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
 
 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 ()
 
virtual TrkHitOnTrkclone (TrkRep *parentRep, const TrkDifTraj *trkTraj=0) const =0
 
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
 
virtual TrkEnums::TrkViewInfo whatView () const =0
 
virtual unsigned layerNumber () const =0
 
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
 
virtual const TrajectoryhitTraj () const =0
 
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
 
virtual bool timeResid (double &resid, double &error) const =0
 
virtual bool timeAbsolute (double &time, double &error) const =0
 
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
 
 TrkHitOnTrk (const TrkFundHit *, double tolerance)
 
virtual ~TrkHitOnTrk ()
 
virtual TrkHitOnTrkclone (TrkRep *parentRep, const TrkDifTraj *trkTraj=0) const =0
 
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
 
virtual TrkEnums::TrkViewInfo whatView () const =0
 
virtual unsigned layerNumber () const =0
 
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
 
virtual const TrajectoryhitTraj () const =0
 
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
 
virtual bool timeResid (double &resid, double &error) const =0
 
virtual bool timeAbsolute (double &time, double &error) const =0
 
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 ()
 
 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 ()
 
virtual TrkErrCode updateMeasurement (const TrkDifTraj *traj, bool maintainAmbiguity)=0
 
TrkErrCode updatePoca (const TrkDifTraj *trkTraj, bool maintainAmbiguity)
 
 TrkHitOnTrk (const TrkHitOnTrk &hitToBeCopied, TrkRep *newRep, const TrkDifTraj *trkTraj=0)
 
void setHitResid (double newResid)
 
TrkRepparentRep () const
 
void setHitLen (double h)
 
void setUsedHit ()
 
void setUnusedHit ()
 
virtual TrkErrCode updateMeasurement (const TrkDifTraj *traj, bool maintainAmbiguity)=0
 
TrkErrCode updatePoca (const TrkDifTraj *trkTraj, bool maintainAmbiguity)
 

Static Protected Member Functions

static const TrkLineTraj FindBeamTrajectory (const HepPoint3D &point, const HepSymMatrix &error)
 
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
 
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

Constructor & Destructor Documentation

◆ TrkBmSpotOnTrk() [1/4]

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)

◆ ~TrkBmSpotOnTrk() [1/2]

TrkBmSpotOnTrk::~TrkBmSpotOnTrk ( )

Definition at line 44 of file TrkBmSpotOnTrk.cxx.

45{ }

◆ TrkBmSpotOnTrk() [2/4]

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{}

◆ TrkBmSpotOnTrk() [3/4]

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

◆ ~TrkBmSpotOnTrk() [2/2]

TrkBmSpotOnTrk::~TrkBmSpotOnTrk ( )

◆ TrkBmSpotOnTrk() [4/4]

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

Member Function Documentation

◆ clone() [1/2]

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

Implements TrkHitOnTrk.

Definition at line 48 of file TrkBmSpotOnTrk.cxx.

◆ clone() [2/2]

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

Implements TrkHitOnTrk.

◆ FindBeamTrajectory() [1/2]

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}

◆ FindBeamTrajectory() [2/2]

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

◆ GetRms() [1/2]

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
Definition: HelloServer.cpp:11
virtual Hep3Vector direction(double) const =0
virtual const TrkDifTraj & traj() const =0

Referenced by updateMeasurement().

◆ GetRms() [2/2]

double TrkBmSpotOnTrk::GetRms ( )
protected

◆ hitTraj() [1/2]

const Trajectory * TrkBmSpotOnTrk::hitTraj ( ) const
virtual

Implements TrkHitOnTrk.

Definition at line 79 of file TrkBmSpotOnTrk.cxx.

80{
81 return &_beamTraj;
82}

◆ hitTraj() [2/2]

const Trajectory * TrkBmSpotOnTrk::hitTraj ( ) const
virtual

Implements TrkHitOnTrk.

◆ ip() [1/2]

const HepPoint3D & TrkBmSpotOnTrk::ip ( ) const

Definition at line 85 of file TrkBmSpotOnTrk.cxx.

86{
87 return _ip;
88}

◆ ip() [2/2]

const HepPoint3D & TrkBmSpotOnTrk::ip ( ) const

◆ layerNumber() [1/2]

virtual unsigned TrkBmSpotOnTrk::layerNumber ( ) const
inlinevirtual

Implements TrkHitOnTrk.

Definition at line 36 of file InstallArea/include/TrkFitter/TrkFitter/TrkBmSpotOnTrk.h.

36{ return 0; }

◆ layerNumber() [2/2]

virtual unsigned TrkBmSpotOnTrk::layerNumber ( ) const
inlinevirtual

◆ timeAbsolute() [1/2]

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

Implements TrkHitOnTrk.

Definition at line 43 of file InstallArea/include/TrkFitter/TrkFitter/TrkBmSpotOnTrk.h.

43{ return false; }

◆ timeAbsolute() [2/2]

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

Implements TrkHitOnTrk.

Definition at line 43 of file Reconstruction/MdcPatRec/TrkFitter/TrkFitter-00-01-11/TrkFitter/TrkBmSpotOnTrk.h.

43{ return false; }

◆ timeResid() [1/2]

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

Implements TrkHitOnTrk.

Definition at line 42 of file InstallArea/include/TrkFitter/TrkFitter/TrkBmSpotOnTrk.h.

42{ return false; }

◆ timeResid() [2/2]

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

Implements TrkHitOnTrk.

Definition at line 42 of file Reconstruction/MdcPatRec/TrkFitter/TrkFitter-00-01-11/TrkFitter/TrkBmSpotOnTrk.h.

42{ return false; }

◆ updateMeasurement() [1/2]

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}
TrkErrCode updatePoca(const TrkDifTraj *trkTraj, bool maintainAmbiguity)

◆ updateMeasurement() [2/2]

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

Implements TrkHitOnTrk.

◆ whatView() [1/2]

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

Implements TrkHitOnTrk.

Definition at line 73 of file TrkBmSpotOnTrk.cxx.

◆ whatView() [2/2]

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

Implements TrkHitOnTrk.


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