1#ifndef __JRECONSTRUCTION__JEVT__
2#define __JRECONSTRUCTION__JEVT__
45 __x(
std::numeric_limits<double>::lowest()),
46 __y(
std::numeric_limits<double>::lowest()),
47 __z(
std::numeric_limits<double>::lowest()),
51 __t(
std::numeric_limits<double>::lowest()),
52 __Q(
std::numeric_limits<double>::lowest()),
179 void move(
const double step,
const double velocity)
184 __t += step / velocity;
206 return ((
size_t) sqrt(1.0 + 8.0*
V.size()) - 1) / 2;
230 double getV(
const size_t row,
const size_t col)
const
234 const size_t __row = max(row, col) + 1;
235 const size_t __col = min(row, col);
237 return V.at((__row * (__row + 1)) / 2 - __row + __col);
252 void setV(
const size_t size,
const T& data)
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]);
305 return (i >= 0 && i < (
int)
W.size());
328 double getW(
const int i,
const double value)
const
343 void setW(
const int i,
const double value)
345 if (i >= (
int)
W.size()) {
346 W.resize(i + 1, 0.0);
395 for (
const auto& fit : evt) {
408 template<
class JSelector_t>
415 iterator __end = partition(this->begin(), this->end(), selector);
417 this->erase(__end, this->end());
428 template<
class JComparator_t>
430 const JComparator_t& comparator)
438 if (number_of_fits > 0 && number_of_fits < this->size()) {
440 advance(__end = this->begin(), number_of_fits);
442 partial_sort(this->begin(), __end, this->end(), comparator);
446 sort(this->begin(), __end, comparator);
449 this->erase(__end, this->end());
465 out <<
"Event: " << endl;
467 for (JEvt::const_iterator fit = event.begin(); fit != event.end(); ++fit) {
Definition for fit results.
JROOT::JTreeParameters getTreeParameters(JLANG::JType< JRECONSTRUCTION::JEvt >)
Get TTree parameters for given data type.
std::ostream & operator<<(std::ostream &out, const JRECONSTRUCTION::JFit &fit)
Write fit results to output.
Data structure for set of track fit results.
friend std::ostream & operator<<(std::ostream &out, const JEvt &event)
Write event to output.
JEvt & operator+=(const JEvt &evt)
Add event.
JEvt()
Default constructor.
void select(const JSelector_t &selector)
Select fits.
void select(const size_t number_of_fits, const JComparator_t &comparator)
Select fits.
Data structure for track fit results with history and optional associated values.
void setW(const std::vector< double > &W)
Set associated values.
void move(const double step, const double velocity)
Move vertex along this track with given velocity.
double getDZ() const
Get Z-slope.
double getV(const size_t row, const size_t col) const
Get element of error matrix.
double getDY() const
Get Y-slope.
JFit & add(const int type)
Add event to history.
double getZ() const
Get Z-position.
double getE() const
Get energy.
int getStatus() const
Get status of the fit; negative values should refer to a bad fit.
JFit(const JHistory &history, const double x, const double y, const double z, const int status=JRECONSTRUCTION::SINGLE_STAGE)
Constructor for storing position only.
double getDX() const
Get X-slope.
size_t getDimensionOfErrorMatrix() const
Get dimension of error matrix.
double getY() const
Get Y-position.
void setW(const int i, const double value)
Set associated value.
double getW(const int i) const
Get associated value.
double getQ() const
Get quality.
const std::vector< double > & getW() const
Get associated values.
double getT() const
Get time.
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.
int getN() const
Get number of associated values.
double getW(const int i, const double value) const
Get associated value.
JFit()
Default constructor.
const std::vector< double > & getV() const
Get error matrix.
void setE(const double E)
Set energy.
void setStatus(const int status)
Set status of the fit.
void setV(const size_t size, const T &data)
Set error matrix.
int getNDF() const
Get number of degrees of freedom.
bool hasW(const int i) const
Check availability of value.
double getX() const
Get X-position.
Data structure for TTree parameters.
Auxiliary classes and methods for linear and iterative data regression.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Container for historical events.
const JHistory & getHistory() const
Get history.
JHistory & add(const int type)
Add event to history.
Auxiliary class for a type holder.