Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JFIT::JFit Class Reference

Data structure for track fit results with history and optional associated values. More...

#include <JEvt.hh>

Inheritance diagram for JFIT::JFit:
TObject JFIT::JHistory std::vector< JEvent >

Public Member Functions

 JFit ()
 Default constructor.
 
 JFit (const JHistory &history, const double x, const double y, const double z, const double dx, const double dy, const double dz, const double t, const double Q, const int NDF, const double E=0.0, const int status=JRECONSTRUCTION::SINGLE_STAGE)
 Constructor.
 
 JFit (const JHistory &history, const double x, const double y, const double z, const int status=JRECONSTRUCTION::SINGLE_STAGE)
 Constructor for storing position only.
 
JFitadd (const int type)
 Add event to history.
 
double getX () const
 Get X-position.
 
double getY () const
 Get Y-position.
 
double getZ () const
 Get Z-position.
 
double getDX () const
 Get X-slope.
 
double getDY () const
 Get Y-slope.
 
double getDZ () const
 Get Z-slope.
 
double getT () const
 Get time.
 
double getQ () const
 Get quality.
 
int getNDF () const
 Get number of degrees of freedom.
 
double getE () const
 Get energy.
 
int getStatus () const
 Get status of the fit; negative values should refer to a bad fit.
 
void setStatus (const int status)
 Set status of the fit.
 
void move (const double step, const double velocity)
 Move vertex along this track with given velocity.
 
void setE (const double E)
 Set energy.
 
size_t getDimensionOfErrorMatrix () const
 Get dimension of error matrix.
 
const std::vector< double > & getV () const
 Get error matrix.
 
double getV (const size_t row, const size_t col) const
 Get element of error matrix.
 
template<class T >
void setV (const size_t size, const T &data)
 Set error matrix.
 
const std::vector< double > & getW () const
 Get associated values.
 
void setW (const std::vector< double > &W)
 Set associated values.
 
int getN () const
 Get number of associated values.
 
bool hasW (const int i) const
 Check availability of value.
 
double getW (const int i) const
 Get associated value.
 
double getW (const int i, const double value) const
 Get associated value.
 
void setW (const int i, const double value)
 Set associated value.
 
 ClassDef (JFit, 7)
 
const JHistorygetHistory () const
 Get history.
 
JHistorygetHistory ()
 Get history.
 
bool has (const int type) const
 Has event in history.
 
bool getStatus (const std::vector< int > &types) const
 Get status.
 
bool hasParentUUID () const
 Has parent UUID.
 
const JUUIDgetUUID () const
 Get UUID.
 
const JUUIDgetParentUUID () const
 Get parent UUID.
 
 ClassDef (JHistory, 2)
 

Protected Attributes

double __x
 
double __y
 
double __z
 
double __dx
 
double __dy
 
double __dz
 
double __t
 
double __Q
 
int __NDF
 
std::vector< double > V
 
std::vector< double > W
 
double __E
 
int __status
 

Detailed Description

Data structure for track fit results with history and optional associated values.

Definition at line 34 of file JReconstruction/JEvt.hh.

Constructor & Destructor Documentation

◆ JFit() [1/3]

JFIT::JFit::JFit ( )
inline

Default constructor.

Parameters are initialized with non physical values.

Definition at line 44 of file JReconstruction/JEvt.hh.

44 :
45 __x(std::numeric_limits<double>::lowest()),
46 __y(std::numeric_limits<double>::lowest()),
47 __z(std::numeric_limits<double>::lowest()),
48 __dx(0.0),
49 __dy(0.0),
50 __dz(0.0),
51 __t(std::numeric_limits<double>::lowest()),
52 __Q(std::numeric_limits<double>::lowest()),
53 __NDF(-1),
54 __E(0.0),
56 {}

◆ JFit() [2/3]

JFIT::JFit::JFit ( const JHistory & history,
const double x,
const double y,
const double z,
const double dx,
const double dy,
const double dz,
const double t,
const double Q,
const int NDF,
const double E = 0.0,
const int status = JRECONSTRUCTION::SINGLE_STAGE )
inline

Constructor.

Parameters
historyhistory
xX-position
yY-position
zZ-position
dxX-slope
dyY-slope
dzZ-slope
ttime
Qquality
NDFnumber of degrees of freedom
Eenergy
statusstatus

Definition at line 75 of file JReconstruction/JEvt.hh.

86 :
87 JHistory(history)
88 {
89 __x = x;
90 __y = y;
91 __z = z;
92 __dx = dx;
93 __dy = dy;
94 __dz = dz;
95 __t = t;
96 __Q = Q;
97 __NDF = NDF;
98 __E = E;
99 __status = status;
100 }
JHistory()
Default constructor.
Definition JHistory.hh:229

◆ JFit() [3/3]

JFIT::JFit::JFit ( const JHistory & history,
const double x,
const double y,
const double z,
const int status = JRECONSTRUCTION::SINGLE_STAGE )
inline

Constructor for storing position only.

Note that the type of fit can be obtained via the history information.

Parameters
historyhistory
xX-position
yY-position
zZ-position
statusstatus

Definition at line 114 of file JReconstruction/JEvt.hh.

118 :
119 JHistory(history)
120 {
121 __x = x;
122 __y = y;
123 __z = z;
124 __dx = 0.0;
125 __dy = 0.0;
126 __dz = 0.0;
127 __t = 0.0;
128 __Q = 0.0;
129 __NDF = -1;
130 __E = 0.0;
131 __status = status;
132 }

Member Function Documentation

◆ add()

JFit & JFIT::JFit::add ( const int type)
inline

Add event to history.

Parameters
typeapplication type
Returns
this fit

Definition at line 141 of file JReconstruction/JEvt.hh.

142 {
143 getHistory().add(type);
144
145 return *this;
146 }
const JHistory & getHistory() const
Get history.
Definition JHistory.hh:280
JHistory & add(const int type)
Add event to history.
Definition JHistory.hh:346

◆ getX()

double JFIT::JFit::getX ( ) const
inline

Get X-position.

Definition at line 149 of file JReconstruction/JEvt.hh.

◆ getY()

double JFIT::JFit::getY ( ) const
inline

Get Y-position.

Definition at line 150 of file JReconstruction/JEvt.hh.

◆ getZ()

double JFIT::JFit::getZ ( ) const
inline

Get Z-position.

Definition at line 151 of file JReconstruction/JEvt.hh.

◆ getDX()

double JFIT::JFit::getDX ( ) const
inline

Get X-slope.

Definition at line 152 of file JReconstruction/JEvt.hh.

◆ getDY()

double JFIT::JFit::getDY ( ) const
inline

Get Y-slope.

Definition at line 153 of file JReconstruction/JEvt.hh.

◆ getDZ()

double JFIT::JFit::getDZ ( ) const
inline

Get Z-slope.

Definition at line 154 of file JReconstruction/JEvt.hh.

◆ getT()

double JFIT::JFit::getT ( ) const
inline

Get time.

Definition at line 155 of file JReconstruction/JEvt.hh.

◆ getQ()

double JFIT::JFit::getQ ( ) const
inline

Get quality.

Definition at line 156 of file JReconstruction/JEvt.hh.

◆ getNDF()

int JFIT::JFit::getNDF ( ) const
inline

Get number of degrees of freedom.

Definition at line 157 of file JReconstruction/JEvt.hh.

◆ getE()

double JFIT::JFit::getE ( ) const
inline

Get energy.

Definition at line 158 of file JReconstruction/JEvt.hh.

◆ getStatus() [1/2]

int JFIT::JFit::getStatus ( ) const
inline

Get status of the fit; negative values should refer to a bad fit.

Definition at line 159 of file JReconstruction/JEvt.hh.

◆ setStatus()

void JFIT::JFit::setStatus ( const int status)
inline

Set status of the fit.

Parameters
statusstatus

Definition at line 167 of file JReconstruction/JEvt.hh.

168 {
169 this->__status = status;
170 }

◆ move()

void JFIT::JFit::move ( const double step,
const double velocity )
inline

Move vertex along this track with given velocity.

Parameters
stepstep
velocityvelocity

Definition at line 179 of file JReconstruction/JEvt.hh.

180 {
181 __x += step * __dx;
182 __y += step * __dy;
183 __z += step * __dz;
184 __t += step / velocity;
185 }

◆ setE()

void JFIT::JFit::setE ( const double E)
inline

Set energy.

Parameters
Eenergy

Definition at line 193 of file JReconstruction/JEvt.hh.

194 {
195 __E = E;
196 }

◆ getDimensionOfErrorMatrix()

size_t JFIT::JFit::getDimensionOfErrorMatrix ( ) const
inline

Get dimension of error matrix.

Returns
dimension

Definition at line 204 of file JReconstruction/JEvt.hh.

205 {
206 return ((size_t) sqrt(1.0 + 8.0*V.size()) - 1) / 2;
207 }
std::vector< double > V

◆ getV() [1/2]

const std::vector< double > & JFIT::JFit::getV ( ) const
inline

Get error matrix.

Note that only the lower-half of the matrix is returned.

Returns
error matrix

Definition at line 217 of file JReconstruction/JEvt.hh.

218 {
219 return V;
220 }

◆ getV() [2/2]

double JFIT::JFit::getV ( const size_t row,
const size_t col ) const
inline

Get element of error matrix.

Parameters
rowrow (0 <= row < dimension)
colcol (0 <= col < dimension)
Returns
value

Definition at line 230 of file JReconstruction/JEvt.hh.

231 {
232 using namespace std;
233
234 const size_t __row = max(row, col) + 1;
235 const size_t __col = min(row, col);
236
237 return V.at((__row * (__row + 1)) / 2 - __row + __col);
238 }

◆ setV()

template<class T >
void JFIT::JFit::setV ( const size_t size,
const T & data )
inline

Set error matrix.

The given size corresponds to the dimension of a 2D-array of which the elements should be accessible via the usual array operators.
Note that only the lower-half of the given matrix is stored.

Parameters
sizesize
datamatrix

Definition at line 252 of file JReconstruction/JEvt.hh.

253 {
254 V.clear();
255
256 for (size_t row = 0; row != size; ++row) {
257 for (size_t col = 0; col <= row; ++col) {
258 V.push_back(data[row][col]);
259 }
260 }
261 }

◆ getW() [1/3]

const std::vector< double > & JFIT::JFit::getW ( ) const
inline

Get associated values.

Returns
values

Definition at line 269 of file JReconstruction/JEvt.hh.

270 {
271 return this->W;
272 }
std::vector< double > W

◆ setW() [1/2]

void JFIT::JFit::setW ( const std::vector< double > & W)
inline

Set associated values.

Parameters
Wvalues

Definition at line 280 of file JReconstruction/JEvt.hh.

281 {
282 this->W = W;
283 }

◆ getN()

int JFIT::JFit::getN ( ) const
inline

Get number of associated values.

Returns
number of values

Definition at line 291 of file JReconstruction/JEvt.hh.

292 {
293 return W.size();
294 }

◆ hasW()

bool JFIT::JFit::hasW ( const int i) const
inline

Check availability of value.

Parameters
iindex
Returns
true if available; else false

Definition at line 303 of file JReconstruction/JEvt.hh.

304 {
305 return (i >= 0 && i < (int) W.size());
306 }

◆ getW() [2/3]

double JFIT::JFit::getW ( const int i) const
inline

Get associated value.

Parameters
iindex
Returns
value

Definition at line 315 of file JReconstruction/JEvt.hh.

316 {
317 return W.at(i);
318 }

◆ getW() [3/3]

double JFIT::JFit::getW ( const int i,
const double value ) const
inline

Get associated value.

Parameters
iindex
valuedefault value
Returns
value

Definition at line 328 of file JReconstruction/JEvt.hh.

329 {
330 if (hasW(i))
331 return W.at(i);
332 else
333 return value;
334 }
bool hasW(const int i) const
Check availability of value.

◆ setW() [2/2]

void JFIT::JFit::setW ( const int i,
const double value )
inline

Set associated value.

Parameters
iindex
valuevalue

Definition at line 343 of file JReconstruction/JEvt.hh.

344 {
345 if (i >= (int) W.size()) {
346 W.resize(i + 1, 0.0);
347 }
348
349 W[i] = value;
350 }

◆ ClassDef() [1/2]

JFIT::JFit::ClassDef ( JFit ,
7  )

◆ getHistory() [1/2]

const JHistory & JFIT::JHistory::getHistory ( ) const
inlineinherited

Get history.

Returns
histtory

Definition at line 280 of file JHistory.hh.

281 {
282 return static_cast<const JHistory&>(*this);
283 }

◆ getHistory() [2/2]

JHistory & JFIT::JHistory::getHistory ( )
inlineinherited

Get history.

Returns
histtory

Definition at line 291 of file JHistory.hh.

292 {
293 return static_cast<JHistory&>(*this);
294 }

◆ has()

bool JFIT::JHistory::has ( const int type) const
inlineinherited

Has event in history.

Parameters
typeapplication type
Returns
true if given event in history; else false

Definition at line 303 of file JHistory.hh.

304 {
305 for (const_iterator i = this->begin(); i != this->end(); ++i) {
306 if (i->type == type) {
307 return true;
308 }
309 }
310
311 return false;
312 }

◆ getStatus() [2/2]

bool JFIT::JHistory::getStatus ( const std::vector< int > & types) const
inlineinherited

Get status.

Parameters
typesapplication types
Returns
true if history matches appplication types; else false

Definition at line 321 of file JHistory.hh.

322 {
323 if (this->size() == types.size()) {
324
325 for (size_t i = 0; i != this->size(); ++i) {
326 if ((*this)[i].type != types[i]) {
327 return false;
328 }
329 }
330
331 return true;
332
333 } else {
334
335 return false;
336 }
337 }

◆ hasParentUUID()

bool JFIT::JHistory::hasParentUUID ( ) const
inlineinherited

Has parent UUID.

Definition at line 357 of file JHistory.hh.

358 {
359 return this->size() >= 2u;
360 }

◆ getUUID()

const JUUID & JFIT::JHistory::getUUID ( ) const
inlineinherited

Get UUID.

Definition at line 366 of file JHistory.hh.

367 {
368 return this->at(this->size() - 1).uuid;
369 }

◆ getParentUUID()

const JUUID & JFIT::JHistory::getParentUUID ( ) const
inlineinherited

Get parent UUID.

Definition at line 375 of file JHistory.hh.

376 {
377 return this->at(this->size() - 2).uuid;
378 }

◆ ClassDef() [2/2]

JFIT::JHistory::ClassDef ( JHistory ,
2  )
inherited

Member Data Documentation

◆ __x

double JFIT::JFit::__x
protected

Definition at line 356 of file JReconstruction/JEvt.hh.

◆ __y

double JFIT::JFit::__y
protected

Definition at line 357 of file JReconstruction/JEvt.hh.

◆ __z

double JFIT::JFit::__z
protected

Definition at line 358 of file JReconstruction/JEvt.hh.

◆ __dx

double JFIT::JFit::__dx
protected

Definition at line 359 of file JReconstruction/JEvt.hh.

◆ __dy

double JFIT::JFit::__dy
protected

Definition at line 360 of file JReconstruction/JEvt.hh.

◆ __dz

double JFIT::JFit::__dz
protected

Definition at line 361 of file JReconstruction/JEvt.hh.

◆ __t

double JFIT::JFit::__t
protected

Definition at line 362 of file JReconstruction/JEvt.hh.

◆ __Q

double JFIT::JFit::__Q
protected

Definition at line 363 of file JReconstruction/JEvt.hh.

◆ __NDF

int JFIT::JFit::__NDF
protected

Definition at line 364 of file JReconstruction/JEvt.hh.

◆ V

std::vector<double> JFIT::JFit::V
protected

Definition at line 365 of file JReconstruction/JEvt.hh.

◆ W

std::vector<double> JFIT::JFit::W
protected

Definition at line 366 of file JReconstruction/JEvt.hh.

◆ __E

double JFIT::JFit::__E
protected

Definition at line 367 of file JReconstruction/JEvt.hh.

◆ __status

int JFIT::JFit::__status
protected

Definition at line 368 of file JReconstruction/JEvt.hh.


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