13#ifndef BMNATESTTRACK_H
14#define BMNATESTTRACK_H
20#include "TPolyLine3D.h"
24#define BMN_TEST_TRACK_SOLID_COLOR kBlack
25#define BMN_TEST_TRACK_NONSOLID_COLOR kMagenta
26#define BMN_TEST_TRACK_DEF_MAX_Z 500.0
36 SVect3 fVertex, fDirection;
37 Int_t fMaxHits, fHitsCnt{0};
46 BmnATestTrack(Double_t Alpha1Sigma, Double_t Alpha2Min, Double_t Alpha2Max, Int_t nHits);
56 Double_t
X(Double_t z)
const noexcept {
return fAlpha(
iX0) + fAlpha(
iX1) * z; }
57 Double_t
Y(Double_t z)
const noexcept {
return fAlpha(
iY0) + fAlpha(
iY1) * z; }
71 for (Int_t
i = 0;
i < fMaxHits;
i++)
78 fAlpha(
iX0) = BMN_RND.Gaus(0.0, Alpha1Sigma);
79 fAlpha(
iY0) = BMN_RND.Gaus(0.0, Alpha1Sigma);
80 fAlpha(
iX1) = BMN_RND.Uniform(Alpha2Min, Alpha2Max);
81 fAlpha(
iY1) = BMN_RND.Uniform(Alpha2Min, Alpha2Max);
86 for (Int_t
i = 0;
i < fMaxHits;
i++)
92 if (fHitsCnt >= fMaxHits)
93 throw std::runtime_error(
"BmnATestTrack::AddHit: too many hits");
94 fpHits[fHitsCnt++] = &hit;
100 throw std::runtime_error(
"BmnATestTrack::AddResiduals: hits not registered");
101 Double_t z,
delta, omega;
104 for (Int_t
i = 0;
i < fHitsCnt;
i++) {
105 Int_t detectorIdx{
static_cast<Int_t
>(fpHits[
i]->
GetDetectorID())};
106 const SVectGL& A = result.A(detectorIdx);
111 result.AddValueMSE(detectorIdx, omega *
delta *
delta);
113 result.ResidualsX().Fill(
delta);
117 result.AddValueMSE(detectorIdx, omega *
delta *
delta);
119 result.ResidualsY().Fill(
delta);
126 Double_t x[2]{
X(0.0),
X(maxZ)}, y[2]{
Y(0.0),
Y(maxZ)}, z[2]{0.0, maxZ};
128 auto* line =
new TPolyLine3D(2, z, y, x);
133 line->SetLineStyle(2);
138 for (Int_t
i = 0;
i < fHitsCnt;
i++)
#define BMN_TEST_TRACK_DEF_MAX_Z
#define BMN_TEST_TRACK_SOLID_COLOR
#define BMN_TEST_TRACK_NONSOLID_COLOR
ROOT::Math::SVector< Double_t, BMN_GLOBAL_PARAMS_PD > SVectGL
ROOT::Math::SVector< Double_t, 3 > SVect3
ROOT::Math::SVector< Double_t, BMN_LOCAL_PARAMS_PT > SVectLC
const Float_t delta
Distance between GEM-stations.
const SVect3 & GetVertex() const noexcept
const SVectLC & GetAlpha() const noexcept
void AddMSE(BmnAlignerClass *pAligner, Bool_t withResiduals=kFALSE) const
Double_t Y(Double_t z) const noexcept
Double_t X(Double_t z) const noexcept
void Draw(Bool_t solid=kTRUE, Double_t maxZ=BMN_TEST_TRACK_DEF_MAX_Z) const
BmnAligner< BmnATestHit > BmnAlignerClass
const SVect3 & GetDirection() const noexcept
void AddHit(BmnATestHit &hit)
BmnAlignResult * GetCurrentResult() const noexcept
Double_t OmegaScaleFactor() const noexcept
Double_t GetWy() const noexcept
Double_t GetY() const noexcept
Double_t GetX() const noexcept
Int_t GetDetectorID() const noexcept
Double_t GetWx() const noexcept
Double_t GetZ() const noexcept