Jpp  18.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
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. More...
 
 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. More...
 
 JFit (const JHistory &history, const double x, const double y, const double z, const int status=JRECONSTRUCTION::SINGLE_STAGE)
 Constructor for storing position only. More...
 
JFitadd (const int type)
 Add event to history. More...
 
double getX () const
 Get X-position. More...
 
double getY () const
 Get Y-position. More...
 
double getZ () const
 Get Z-position. More...
 
double getDX () const
 Get X-slope. More...
 
double getDY () const
 Get Y-slope. More...
 
double getDZ () const
 Get Z-slope. More...
 
double getT () const
 Get time. More...
 
double getQ () const
 Get quality. More...
 
int getNDF () const
 Get number of degrees of freedom. More...
 
double getE () const
 Get energy. More...
 
int getStatus () const
 Get status of the fit; negative values should refer to a bad fit. More...
 
void setStatus (const int status)
 Set status of the fit. More...
 
void move (const double step, const double velocity)
 Move vertex along this track with given velocity. More...
 
void setE (const double E)
 Set energy. More...
 
size_t getDimensionOfErrorMatrix () const
 Get dimension of error matrix. More...
 
const std::vector< double > & getV () const
 Get error matrix. More...
 
double getV (const size_t row, const size_t col) const
 Get element of error matrix. More...
 
template<class T >
void setV (const size_t size, const T &data)
 Set error matrix. More...
 
const std::vector< double > & getW () const
 Get associated values. More...
 
void setW (const std::vector< double > &W)
 Set associated values. More...
 
int getN () const
 Get number of associated values. More...
 
bool hasW (const int i) const
 Check availability of value. More...
 
double getW (const int i) const
 Get associated value. More...
 
double getW (const int i, const double value) const
 Get associated value. More...
 
void setW (const int i, const double value)
 Set associated value. More...
 
 ClassDef (JFit, 7)
 
const JHistorygetHistory () const
 Get history. More...
 
JHistorygetHistory ()
 Get history. More...
 
bool has (const int type) const
 Has event in history. More...
 
bool getStatus (const std::vector< int > &types) const
 Get status. More...
 
bool hasParentUUID () const
 Has parent UUID. More...
 
const JUUIDgetUUID () const
 Get UUID. More...
 
const JUUIDgetParentUUID () const
 Get parent UUID. More...
 
 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 35 of file JReconstruction/JEvt.hh.

Constructor & Destructor Documentation

JFIT::JFit::JFit ( )
inline

Default constructor.

Parameters are initialized with non physical values.

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

45  :
46  __x(std::numeric_limits<double>::lowest()),
47  __y(std::numeric_limits<double>::lowest()),
48  __z(std::numeric_limits<double>::lowest()),
49  __dx(0.0),
50  __dy(0.0),
51  __dz(0.0),
52  __t(std::numeric_limits<double>::lowest()),
53  __Q(std::numeric_limits<double>::lowest()),
54  __NDF(-1),
55  __E(0.0),
57  {}
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 76 of file JReconstruction/JEvt.hh.

87  :
88  JHistory(history)
89  {
90  __x = x;
91  __y = y;
92  __z = z;
93  __dx = dx;
94  __dy = dy;
95  __dz = dz;
96  __t = t;
97  __Q = Q;
98  __NDF = NDF;
99  __E = E;
100  __status = status;
101  }
Q(UTCMax_s-UTCMin_s)-livetime_s
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
JHistory()
Default constructor.
Definition: JHistory.hh:186
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 115 of file JReconstruction/JEvt.hh.

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

Member Function Documentation

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

Add event to history.

Parameters
typeapplication type
Returns
this fit

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

143  {
144  getHistory().add(type);
145 
146  return *this;
147  }
JHistory & add(const int type)
Add event to history.
Definition: JHistory.hh:295
const JHistory & getHistory() const
Get history.
Definition: JHistory.hh:229
double JFIT::JFit::getX ( ) const
inline

Get X-position.

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

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

Get Y-position.

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

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

Get Z-position.

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

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

Get X-slope.

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

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

Get Y-slope.

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

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

Get Z-slope.

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

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

Get time.

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

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

Get quality.

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

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

Get number of degrees of freedom.

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

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

Get energy.

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

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

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

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

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

Set status of the fit.

Parameters
statusstatus

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

169  {
170  this->__status = status;
171  }
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 180 of file JReconstruction/JEvt.hh.

181  {
182  __x += step * __dx;
183  __y += step * __dy;
184  __z += step * __dz;
185  __t += step / velocity;
186  }
void JFIT::JFit::setE ( const double  E)
inline

Set energy.

Parameters
Eenergy

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

195  {
196  __E = E;
197  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
size_t JFIT::JFit::getDimensionOfErrorMatrix ( ) const
inline

Get dimension of error matrix.

Returns
dimension

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

206  {
207  return ((size_t) sqrt(1.0 + 8.0*V.size()) - 1) / 2;
208  }
std::vector< double > V
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 218 of file JReconstruction/JEvt.hh.

219  {
220  return V;
221  }
std::vector< double > V
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 231 of file JReconstruction/JEvt.hh.

232  {
233  using namespace std;
234 
235  const size_t __row = max(row, col) + 1;
236  const size_t __col = min(row, col);
237 
238  return V.at((__row * (__row + 1)) / 2 - __row + __col);
239  }
std::vector< double > V
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 253 of file JReconstruction/JEvt.hh.

254  {
255  V.clear();
256 
257  for (size_t row = 0; row != size; ++row) {
258  for (size_t col = 0; col <= row; ++col) {
259  V.push_back(data[row][col]);
260  }
261  }
262  }
std::vector< double > V
const std::vector<double>& JFIT::JFit::getW ( ) const
inline

Get associated values.

Returns
values

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

271  {
272  return this->W;
273  }
std::vector< double > W
void JFIT::JFit::setW ( const std::vector< double > &  W)
inline

Set associated values.

Parameters
Wvalues

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

282  {
283  this->W = W;
284  }
std::vector< double > W
int JFIT::JFit::getN ( ) const
inline

Get number of associated values.

Returns
number of values

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

293  {
294  return W.size();
295  }
std::vector< double > W
bool JFIT::JFit::hasW ( const int  i) const
inline

Check availability of value.

Parameters
iindex
Returns
true if available; else false

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

305  {
306  return (i >= 0 && i < (int) W.size());
307  }
std::vector< double > W
double JFIT::JFit::getW ( const int  i) const
inline

Get associated value.

Parameters
iindex
Returns
value

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

317  {
318  return W.at(i);
319  }
std::vector< double > W
double JFIT::JFit::getW ( const int  i,
const double  value 
) const
inline

Get associated value.

Parameters
iindex
valuedefault value
Returns
value

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

330  {
331  if (hasW(i))
332  return W.at(i);
333  else
334  return value;
335  }
std::vector< double > W
bool hasW(const int i) const
Check availability of value.
void JFIT::JFit::setW ( const int  i,
const double  value 
)
inline

Set associated value.

Parameters
iindex
valuevalue

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

345  {
346  if (i >= (int) W.size()) {
347  W.resize(i + 1, 0.0);
348  }
349 
350  W[i] = value;
351  }
std::vector< double > W
JFIT::JFit::ClassDef ( JFit  ,
 
)
const JHistory& JFIT::JHistory::getHistory ( ) const
inlineinherited

Get history.

Returns
histtory

Definition at line 229 of file JHistory.hh.

230  {
231  return static_cast<const JHistory&>(*this);
232  }
Container for historical events.
Definition: JHistory.hh:99
JHistory& JFIT::JHistory::getHistory ( )
inlineinherited

Get history.

Returns
histtory

Definition at line 240 of file JHistory.hh.

241  {
242  return static_cast<JHistory&>(*this);
243  }
Container for historical events.
Definition: JHistory.hh:99
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 252 of file JHistory.hh.

253  {
254  for (const_iterator i = this->begin(); i != this->end(); ++i) {
255  if (i->type == type) {
256  return true;
257  }
258  }
259 
260  return false;
261  }
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 270 of file JHistory.hh.

271  {
272  if (this->size() == types.size()) {
273 
274  for (size_t i = 0; i != this->size(); ++i) {
275  if ((*this)[i].type != types[i]) {
276  return false;
277  }
278  }
279 
280  return true;
281 
282  } else {
283 
284  return false;
285  }
286  }
bool JFIT::JHistory::hasParentUUID ( ) const
inlineinherited

Has parent UUID.

Definition at line 306 of file JHistory.hh.

307  {
308  return this->size() >= 2u;
309  }
double u[N+1]
Definition: JPolint.hh:776
const JUUID& JFIT::JHistory::getUUID ( ) const
inlineinherited

Get UUID.

Definition at line 315 of file JHistory.hh.

316  {
317  return this->at(this->size() - 1).uuid;
318  }
const JUUID& JFIT::JHistory::getParentUUID ( ) const
inlineinherited

Get parent UUID.

Definition at line 324 of file JHistory.hh.

325  {
326  return this->at(this->size() - 2).uuid;
327  }
JFIT::JHistory::ClassDef ( JHistory  ,
 
)
inherited

Member Data Documentation

double JFIT::JFit::__x
protected

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

double JFIT::JFit::__y
protected

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

double JFIT::JFit::__z
protected

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

double JFIT::JFit::__dx
protected

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

double JFIT::JFit::__dy
protected

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

double JFIT::JFit::__dz
protected

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

double JFIT::JFit::__t
protected

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

double JFIT::JFit::__Q
protected

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

int JFIT::JFit::__NDF
protected

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

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

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

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

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

double JFIT::JFit::__E
protected

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

int JFIT::JFit::__status
protected

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


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