 |
Belle II Software
release-05-02-19
|
24 #ifndef genfit_StateOnPlane_h
25 #define genfit_StateOnPlane_h
27 #include "SharedPlanePtr.h"
28 #include "AbsTrackRep.h"
63 const TVectorD& getState()
const {
return state_;}
64 TVectorD& getState() {
return state_;}
65 const TVectorD& getAuxInfo()
const {
return auxInfo_;}
66 TVectorD& getAuxInfo() {
return auxInfo_;}
70 void setState(
const TVectorD& state) {
if(state_.GetNrows() == 0) state_.ResizeTo(state); state_ = state;}
72 void setStatePlane(
const TVectorD& state,
const SharedPlanePtr& plane) {state_ = state; sharedPlane_ = plane;}
73 void setAuxInfo(
const TVectorD& auxInfo) {
if(auxInfo_.GetNrows() == 0) auxInfo_.ResizeTo(auxInfo); auxInfo_ = auxInfo;}
78 bool stopAtBoundary =
false,
79 bool calcJacobianNoise =
false) {
return rep_->
extrapolateToPlane(*
this, plane, stopAtBoundary, calcJacobianNoise);}
80 double extrapolateToLine(
const TVector3& linePoint,
81 const TVector3& lineDirection,
82 bool stopAtBoundary =
false,
83 bool calcJacobianNoise =
false) {
return rep_->
extrapolateToLine(*
this, linePoint, lineDirection, stopAtBoundary, calcJacobianNoise);}
84 double extrapolateToPoint(
const TVector3& point,
85 bool stopAtBoundary =
false,
86 bool calcJacobianNoise =
false) {
return rep_->
extrapolateToPoint(*
this, point, stopAtBoundary, calcJacobianNoise);}
87 double extrapolateToPoint(
const TVector3& point,
89 bool stopAtBoundary =
false,
90 bool calcJacobianNoise =
false) {
return rep_->
extrapolateToPoint(*
this, point, G, stopAtBoundary, calcJacobianNoise);}
91 double extrapolateToCylinder(
double radius,
92 const TVector3& linePoint = TVector3(0.,0.,0.),
93 const TVector3& lineDirection = TVector3(0.,0.,1.),
94 bool stopAtBoundary =
false,
95 bool calcJacobianNoise =
false) {
return rep_->
extrapolateToCylinder(*
this, radius, linePoint, lineDirection, stopAtBoundary, calcJacobianNoise);}
96 double extrapolateToCone(
double openingAngle,
97 const TVector3& conePoint = TVector3(0.,0.,0.),
98 const TVector3& coneDirection = TVector3(0.,0.,1.),
99 bool stopAtBoundary =
false,
100 bool calcJacobianNoise =
false) {
return rep_->
extrapolateToCone(*
this, openingAngle, conePoint, coneDirection, stopAtBoundary, calcJacobianNoise);}
101 double extrapolateToSphere(
double radius,
102 const TVector3& point = TVector3(0.,0.,0.),
103 bool stopAtBoundary =
false,
104 bool calcJacobianNoise =
false) {
return rep_->
extrapolateToSphere(*
this, radius, point, stopAtBoundary, calcJacobianNoise);}
105 double extrapolateBy(
double step,
106 bool stopAtBoundary =
false,
107 bool calcJacobianNoise =
false) {
return rep_->
extrapolateBy(*
this, step, stopAtBoundary, calcJacobianNoise);}
108 double extrapolateToMeasurement(
const AbsMeasurement* measurement,
109 bool stopAtBoundary =
false,
113 TVector3 getPos()
const {
return rep_->
getPos(*
this);}
114 TVector3 getMom()
const {
return rep_->
getMom(*
this);}
115 TVector3 getDir()
const {
return rep_->
getDir(*
this);}
116 void getPosMom(TVector3& pos, TVector3& mom)
const {
rep_->
getPosMom(*
this, pos, mom);}
117 void getPosDir(TVector3& pos, TVector3& dir)
const {
rep_->
getPosDir(*
this, pos, dir);}
122 double getQop()
const {
return rep_->
getQop(*
this);}
123 double getMass()
const {
return rep_->
getMass(*
this);}
124 double getTime()
const {
return rep_->
getTime(*
this);}
126 void setPosMom(
const TVector3& pos,
const TVector3& mom) {
rep_->
setPosMom(*
this, pos, mom);}
127 void setPosMom(
const TVectorD& state6) {
rep_->
setPosMom(*
this, state6);}
129 void setQop(
double qop) {
rep_->
setQop(*
this, qop);}
130 void setTime(
double time) {
rep_->
setTime(*
this, time);}
133 virtual void Print(Option_t* option =
"")
const;
155 inline StateOnPlane::StateOnPlane(
const AbsTrackRep* rep) :
156 state_(0), auxInfo_(0), sharedPlane_(), rep_(rep)
158 if (rep !=
nullptr) {
159 state_.ResizeTo(rep->
getDim());
164 state_(state), auxInfo_(0), sharedPlane_(plane), rep_(rep)
166 assert(rep !=
nullptr);
167 assert(sharedPlane_.get() !=
nullptr);
170 inline StateOnPlane::StateOnPlane(
const TVectorD& state,
const SharedPlanePtr& plane,
const AbsTrackRep* rep,
const TVectorD& auxInfo) :
171 state_(state), auxInfo_(auxInfo), sharedPlane_(plane), rep_(rep)
173 assert(rep !=
nullptr);
174 assert(sharedPlane_.get() !=
nullptr);
177 inline StateOnPlane& StateOnPlane::operator=(StateOnPlane other) {
182 inline void StateOnPlane::swap(StateOnPlane& other) {
183 this->state_.ResizeTo(other.state_);
184 std::swap(this->state_, other.state_);
185 this->auxInfo_.ResizeTo(other.auxInfo_);
186 std::swap(this->auxInfo_, other.auxInfo_);
187 this->sharedPlane_.swap(other.sharedPlane_);
188 std::swap(this->
rep_, other.rep_);
194 #endif // genfit_StateOnPlane_h
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
virtual double extrapolateToCone(StateOnPlane &state, double radius, const TVector3 &linePoint=TVector3(0., 0., 0.), const TVector3 &lineDirection=TVector3(0., 0., 1.), bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to the cone surface, and returns the extrapolation length and,...
void getPosDir(const StateOnPlane &state, TVector3 &pos, TVector3 &dir) const
Get cartesian position and direction vector of a state.
virtual double extrapolateToPlane(StateOnPlane &state, const genfit::SharedPlanePtr &plane, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to plane, and returns the extrapolation length and, via reference,...
TVector3 getDir(const StateOnPlane &state) const
Get the direction vector of a state.
int getPDG() const
Get the pdg code.
virtual double getMomMag(const StateOnPlane &state) const =0
get the magnitude of the momentum in GeV.
A state with arbitrary dimension defined in a DetPlane.
Defines for I/O streams used for error and debug printing.
const AbsTrackRep * rep_
Shared ownership. '!' in order to silence ROOT, custom streamer writes and reads this.
Abstract base class for a track representation.
virtual double extrapolateBy(StateOnPlane &state, double step, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state by step (cm) and returns the extrapolation length and, via reference,...
virtual void setTime(StateOnPlane &state, double time) const =0
Set time at which the state was defined.
virtual TVectorD get6DState(const StateOnPlane &state) const
Get the 6D state vector (x, y, z, p_x, p_y, p_z).
virtual double getCharge(const StateOnPlane &state) const =0
Get the (fitted) charge of a state.
virtual void setQop(StateOnPlane &state, double qop) const =0
Set charge/momentum.
Contains the measurement and covariance in raw detector coordinates.
virtual double extrapolateToLine(StateOnPlane &state, const TVector3 &linePoint, const TVector3 &lineDirection, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to the POCA to a line, and returns the extrapolation length and,...
virtual double extrapolateToSphere(StateOnPlane &state, double radius, const TVector3 &point=TVector3(0., 0., 0.), bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to the sphere surface, and returns the extrapolation length and,...
virtual double extrapolateToCylinder(StateOnPlane &state, double radius, const TVector3 &linePoint=TVector3(0., 0., 0.), const TVector3 &lineDirection=TVector3(0., 0., 1.), bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to the cylinder surface, and returns the extrapolation length and,...
double getMass(const StateOnPlane &state) const
Get tha particle mass in GeV/c^2.
virtual unsigned int getDim() const =0
Get the dimension of the state vector used by the track representation.
virtual TVector3 getPos(const StateOnPlane &state) const =0
Get the cartesian position of a state.
virtual void setPosMom(StateOnPlane &state, const TVector3 &pos, const TVector3 &mom) const =0
Set position and momentum of state.
virtual void getPosMom(const StateOnPlane &state, TVector3 &pos, TVector3 &mom) const =0
Get cartesian position and momentum vector of a state.
virtual double getQop(const StateOnPlane &state) const =0
Get charge over momentum.
virtual TVector3 getMom(const StateOnPlane &state) const =0
Get the cartesian momentum vector of a state.
double extrapolateToMeasurement(StateOnPlane &state, const AbsMeasurement *measurement, bool stopAtBoundary=false, bool calcJacobianNoise=false) const
extrapolate to an AbsMeasurement
virtual double extrapolateToPoint(StateOnPlane &state, const TVector3 &point, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to the POCA to a point, and returns the extrapolation length and,...
virtual double getTime(const StateOnPlane &) const =0
Get the time corresponding to the StateOnPlane. Extrapolation.
virtual void setChargeSign(StateOnPlane &state, double charge) const =0
Set the sign of the charge according to charge.