Jpp  pmt_effective_area_update
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=-1)
 Constructor. More...
 
 JFit (const JHistory &history, const double x, const double y, const double z, const int status=-1)
 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 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, 6)
 
const JHistorygetHistory () const
 Get history. More...
 
JHistorygetHistory ()
 Get history. More...
 
 ClassDef (JHistory, 1)
 

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 33 of file JReconstruction/JEvt.hh.

Constructor & Destructor Documentation

JFIT::JFit::JFit ( )
inline

Default constructor.

Parameters are initialized with non physical values.

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

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

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

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

Member Function Documentation

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

Add event to history.

Parameters
typeapplication type
Returns
this fit

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

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

Get X-position.

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

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

Get Y-position.

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

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

Get Z-position.

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

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

Get X-slope.

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

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

Get Y-slope.

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

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

Get Z-slope.

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

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

Get time.

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

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

Get quality.

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

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

Get number of degrees of freedom.

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

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

Get energy.

Definition at line 157 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 158 of file JReconstruction/JEvt.hh.

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 167 of file JReconstruction/JEvt.hh.

168  {
169  __x += step * __dx;
170  __y += step * __dy;
171  __z += step * __dz;
172  __t += step / velocity;
173  }
void JFIT::JFit::setE ( const double  E)
inline

Set energy.

Parameters
Eenergy

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

182  {
183  __E = E;
184  }
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:36
size_t JFIT::JFit::getDimensionOfErrorMatrix ( ) const
inline

Get dimension of error matrix.

Returns
dimension

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

193  {
194  return ((size_t) sqrt(1.0 + 8.0*V.size()) - 1) / 2;
195  }
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 205 of file JReconstruction/JEvt.hh.

206  {
207  return V;
208  }
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 218 of file JReconstruction/JEvt.hh.

219  {
220  using namespace std;
221 
222  const size_t __row = max(row, col) + 1;
223  const size_t __col = min(row, col);
224 
225  return V.at((__row * (__row + 1)) / 2 - __row + __col);
226  }
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 240 of file JReconstruction/JEvt.hh.

241  {
242  V.clear();
243 
244  for (size_t row = 0; row != size; ++row) {
245  for (size_t col = 0; col <= row; ++col) {
246  V.push_back(data[row][col]);
247  }
248  }
249  }
std::vector< double > V
const std::vector<double>& JFIT::JFit::getW ( ) const
inline

Get associated values.

Returns
values

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

258  {
259  return this->W;
260  }
std::vector< double > W
void JFIT::JFit::setW ( const std::vector< double > &  W)
inline

Set associated values.

Parameters
Wvalues

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

269  {
270  this->W = W;
271  }
std::vector< double > W
int JFIT::JFit::getN ( ) const
inline

Get number of associated values.

Returns
number of values

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

280  {
281  return W.size();
282  }
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 291 of file JReconstruction/JEvt.hh.

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

Get associated value.

Parameters
iindex
Returns
value

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

304  {
305  return W.at(i);
306  }
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 316 of file JReconstruction/JEvt.hh.

317  {
318  if (hasW(i))
319  return W.at(i);
320  else
321  return value;
322  }
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 331 of file JReconstruction/JEvt.hh.

332  {
333  if (i >= (int) W.size()) {
334  W.resize(i + 1, 0.0);
335  }
336 
337  W[i] = value;
338  }
std::vector< double > W
JFIT::JFit::ClassDef ( JFit  ,
 
)
const JHistory& JFIT::JHistory::getHistory ( ) const
inlineinherited

Get history.

Returns
histtory

Definition at line 228 of file JHistory.hh.

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

Get history.

Returns
histtory

Definition at line 239 of file JHistory.hh.

240  {
241  return static_cast<JHistory&>(*this);
242  }
Container for historical events.
Definition: JHistory.hh:98
JFIT::JHistory::ClassDef ( JHistory  ,
 
)
inherited

Member Data Documentation

double JFIT::JFit::__x
protected

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

double JFIT::JFit::__y
protected

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

double JFIT::JFit::__z
protected

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

double JFIT::JFit::__dx
protected

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

double JFIT::JFit::__dy
protected

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

double JFIT::JFit::__dz
protected

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

double JFIT::JFit::__t
protected

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

double JFIT::JFit::__Q
protected

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

int JFIT::JFit::__NDF
protected

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

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

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

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

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

double JFIT::JFit::__E
protected

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

int JFIT::JFit::__status
protected

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


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