Commit b2a76d67 authored by Paul Schuetze's avatar Paul Schuetze
Browse files

Multiplet/Track: Move member for position/kinkAtScatterer to `Track` base class and rename

parent 878017ec
......@@ -49,9 +49,9 @@ void Multiplet::fit() {
// FIXME: Currently asking for direction of "". Should be the last detector plane -> Would enable using more generic
// tracks
m_positionAtScatterer = ((m_downstream->getIntercept(m_scattererPosition) -
(ROOT::Math::XYZPoint(0, 0, 0) - m_upstream->getIntercept(m_scattererPosition))) /
2.);
positionAtScatterer_ = ((m_downstream->getIntercept(m_scattererPosition) -
(ROOT::Math::XYZPoint(0, 0, 0) - m_upstream->getIntercept(m_scattererPosition))) /
2.);
m_offsetAtScatterer = m_downstream->getIntercept(m_scattererPosition) - m_upstream->getIntercept(m_scattererPosition);
// Calculate the angle
......@@ -59,7 +59,7 @@ void Multiplet::fit() {
double slopeYup = m_upstream->getDirection("").Y() / m_upstream->getDirection("").Z();
double slopeXdown = m_downstream->getDirection("").X() / m_downstream->getDirection("").Z();
double slopeYdown = m_downstream->getDirection("").Y() / m_downstream->getDirection("").Z();
m_kinkAtScatterer = ROOT::Math::XYVector(slopeXdown - slopeXup, slopeYdown - slopeYup);
kinkAtScatterer_ = ROOT::Math::XYVector(slopeXdown - slopeXup, slopeYdown - slopeYup);
this->calculateChi2();
this->calculateResiduals();
......@@ -68,7 +68,7 @@ void Multiplet::fit() {
ROOT::Math::XYZPoint Multiplet::getIntercept(double z) const {
return z == m_scattererPosition
? m_positionAtScatterer
? positionAtScatterer_
: (z < m_scattererPosition ? m_upstream->getIntercept(z) : m_downstream->getIntercept(z));
}
......@@ -83,7 +83,7 @@ ROOT::Math::XYZVector Multiplet::getDirection(std::string detectorID) const {
}
void Multiplet::print(std::ostream& out) const {
out << "Multiplet " << this->m_scattererPosition << ", " << this->m_positionAtScatterer << ", "
<< this->m_offsetAtScatterer << ", " << this->m_kinkAtScatterer << ", " << this->chi2_ << ", " << this->ndof_ << ", "
out << "Multiplet " << this->m_scattererPosition << ", " << this->positionAtScatterer_ << ", "
<< this->m_offsetAtScatterer << ", " << this->kinkAtScatterer_ << ", " << this->chi2_ << ", " << this->ndof_ << ", "
<< this->chi2ndof_ << ", " << this->timestamp();
}
......@@ -241,13 +241,13 @@ namespace corryvreckan {
* @brief Get the track intercept at the position of the scatterer
* @return ROOT::Math::XYPoint Track position at scatterer
*/
ROOT::Math::XYZPoint getPositionAtScatterer() { return m_positionAtScatterer; };
ROOT::Math::XYZPoint getPositionAtScatterer() { return positionAtScatterer_; };
/**
* @brief Get the kink angle between up- & downstream tracklet at the position of the scatterer
* @return ROOT::Math::XYVector kink at scatterer
*/
ROOT::Math::XYVector getKinkAtScatterer() { return m_kinkAtScatterer; };
ROOT::Math::XYVector getKinkAtScatterer() { return kinkAtScatterer_; };
/**
* @brief Get the materialBudget of a detector layer
......@@ -264,8 +264,8 @@ namespace corryvreckan {
virtual void setVolumeScatter(double length) = 0;
void setPositionAtScatterer(ROOT::Math::XYZPoint position) { m_positionAtScatterer = position; }
void setKinkAtScatterer(ROOT::Math::XYVector kink) { m_kinkAtScatterer = kink; }
void setPositionAtScatterer(ROOT::Math::XYZPoint position) { positionAtScatterer_ = position; }
void setKinkAtScatterer(ROOT::Math::XYVector kink) { kinkAtScatterer_ = kink; }
protected:
std::vector<TRef> track_clusters_;
......@@ -281,6 +281,8 @@ namespace corryvreckan {
double chi2ndof_;
bool isFitted_{};
double momentum_{-1};
ROOT::Math::XYZPoint positionAtScatterer_;
ROOT::Math::XYVector kinkAtScatterer_;
// ROOT I/O class definition - update version number when you change this class!
ClassDefOverride(Track, 8)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment