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

Move kink/positionAtScatter back to Multiplet & rename & de-bump Track version

parent 24f7b48e
......@@ -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
positionAtScatterer_ = ((m_downstream->getIntercept(m_scattererPosition) -
(ROOT::Math::XYZPoint(0, 0, 0) - m_upstream->getIntercept(m_scattererPosition))) /
2.);
m_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();
kinkAtScatterer_ = ROOT::Math::XYVector(slopeXdown - slopeXup, slopeYdown - slopeYup);
m_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
? positionAtScatterer_
? m_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->positionAtScatterer_ << ", "
<< this->m_offsetAtScatterer << ", " << this->kinkAtScatterer_ << ", " << this->chi2_ << ", " << this->ndof_ << ", "
out << "Multiplet " << this->m_scattererPosition << ", " << this->m_positionAtScatterer << ", "
<< this->m_offsetAtScatterer << ", " << this->m_kinkAtScatterer << ", " << this->chi2_ << ", " << this->ndof_ << ", "
<< this->chi2ndof_ << ", " << this->timestamp();
}
......@@ -69,12 +69,27 @@ namespace corryvreckan {
*/
void setScattererPosition(double scattererPosition) { m_scattererPosition = scattererPosition; };
/**
* @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; };
/**
* @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; };
std::shared_ptr<Track> getUpstreamTracklet() { return m_upstream; };
std::shared_ptr<Track> getDownstreamTracklet() { return m_downstream; };
ROOT::Math::XYPoint getKinkAt(std::string) const override;
void setVolumeScatter(double) override{};
void setPositionAtScatterer(ROOT::Math::XYZPoint position) { m_positionAtScatterer = position; }
void setKinkAtScatterer(ROOT::Math::XYVector kink) { m_kinkAtScatterer = kink; }
private:
std::shared_ptr<Track> m_upstream;
std::shared_ptr<Track> m_downstream;
......@@ -84,6 +99,8 @@ namespace corryvreckan {
double m_scattererPosition;
ROOT::Math::XYVector m_offsetAtScatterer;
ROOT::Math::XYZPoint m_positionAtScatterer;
ROOT::Math::XYVector m_kinkAtScatterer;
// ROOT I/O class definition - update version number when you change this class!
ClassDefOverride(Multiplet, 1)
......
......@@ -237,18 +237,6 @@ namespace corryvreckan {
*/
virtual ROOT::Math::XYPoint getKinkAt(std::string detectorID) const = 0;
/**
* @brief Get the track intercept at the position of the scatterer
* @return ROOT::Math::XYPoint Track position at scatterer
*/
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 kinkAtScatterer_; };
/**
* @brief Get the materialBudget of a detector layer
* @param detectorID
......@@ -264,9 +252,6 @@ namespace corryvreckan {
virtual void setVolumeScatter(double length) = 0;
void setPositionAtScatterer(ROOT::Math::XYZPoint position) { positionAtScatterer_ = position; }
void setKinkAtScatterer(ROOT::Math::XYVector kink) { kinkAtScatterer_ = kink; }
protected:
std::vector<TRef> track_clusters_;
std::vector<TRef> associated_clusters_;
......@@ -281,11 +266,9 @@ 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, 9)
ClassDefOverride(Track, 8)
};
// Vector type declaration
using TrackVector = std::vector<std::shared_ptr<Track>>;
......
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