38 :
CbmQaIO(Form(
"%s_%s", prefix, pointTag), pObjList)
76 auto fit = TF1(
"fitpull",
"[0] * TMath::Exp(TMath::ASinH(-0.5*[3]*((x-[1])/[2])**2)/[3])", -10., 10.);
77 fit.SetParameters(100, 0., 1., .3);
78 fit.SetParLimits(3, 0., 2.);
93 double res = recoVal - trueVal;
94 double pull = res / recoErr;
96 res = (recoVal / trueVal - 1.);
106 auto CreateResidualHisto = [&](
ETrackParType t,
const char* name,
const char* title) {
110 TString sPrefix = (
fsTitle.Length() > 0) ?
fsTitle +
" point residual for " :
"residual for ";
114 auto CreatePullHisto = [&](
ETrackParType t,
const char* name,
const char* title) {
118 TString sPrefix = (
fsTitle.Length() > 0) ?
fsTitle +
" point pull for " :
"pull for ";
122 CreateResidualHisto(
ETrackParType::kX,
"res_x",
"x-coordinate;x^{reco} - x^{MC} [cm]");
123 CreateResidualHisto(
ETrackParType::kY,
"res_y",
"y-coordinate;y^{reco} - y^{MC} [cm]");
124 CreateResidualHisto(
ETrackParType::kTX,
"res_tx",
"slope along x-axis;T_{x}^{reco} - T_{x}^{MC}");
125 CreateResidualHisto(
ETrackParType::kTY,
"res_ty",
"slope along y-axis;T_{y}^{reco} - T_{y}^{MC}");
126 CreateResidualHisto(
ETrackParType::kQP,
"res_P",
"momentum; (p^{reco} - p^{MC})/p^{MC} []");
128 CreateResidualHisto(
ETrackParType::kVI,
"res_vi",
"inverse speed;v^{-1}_{reco} - v^{-1}_{MC} [c^{-1}]");
130 CreatePullHisto(
ETrackParType::kX,
"pull_x",
"x-coordinate;(x^{reco} - x^{MC})/#sigma_{x}");
131 CreatePullHisto(
ETrackParType::kY,
"pull_y",
"y-coordinate;(y^{reco} - y^{MC})/#sigma_{y}");
132 CreatePullHisto(
ETrackParType::kTX,
"pull_tx",
"slope along x-axis;(T_{x}^{reco} - T_{x}^{MC})/#sigma_{T_{x}}");
133 CreatePullHisto(
ETrackParType::kTY,
"pull_ty",
"slope along y-axis;(T_{y}^{reco} - T_{y}^{MC})/#sigma_{T_{y}}");
134 CreatePullHisto(
ETrackParType::kQP,
"pull_qp",
"charge over mom.;((q/p)^{reco} - (q/p)^{MC})/#sigma_{q/p}");
136 CreatePullHisto(
ETrackParType::kVI,
"pull_vi",
"inverse speed;(v^{-1}_{reco} - v^{-1}_{MC})/#sigma_{v^{-1}}");
147 TString sPrefix = (
fsTitle.Length() > 0) ?
fsTitle +
" point " :
"";
148 fph_res_p_pMC->SetTitle(sPrefix +
" resolution of momentum;p^{MC} [GeV/c];#delta p [GeV/c]");
149 fph_res_phi_phiMC->SetTitle(sPrefix +
" resolution of polar angle;#phi^{MC} [rad];#delta#phi [rad]");
150 fph_res_theta_thetaMC->SetTitle(sPrefix +
" resolution of polar angle;#theta^{MC} [rad];#delta#theta [rad]");
157 if (fabs(trPar.
GetZ()) - fabs(mcPoint.
GetZ()) > 1.e-3) {
158 LOG(error) <<
"TrackFitQa::Fill: Track z-coordinate " << trPar.
GetZ() <<
" does not match MC point z-coordinate "
159 << mcPoint.
GetZ() <<
". Skipping track.";
179 double resP = recoP - mcPoint.
GetP();
182 double mcPhi = mcPoint.
GetPhi();
183 double recoTx = trPar.
Tx();
184 double recoTy = trPar.
Ty();
185 double resPhi = atan2(recoTx *
cos(mcPhi) + recoTy *
sin(mcPhi), -recoTx *
cos(mcPhi) + recoTy *
sin(mcPhi));
190 resPhi = std::atan2(std::sin(resPhi), std::cos(resPhi));
Internal class describing a MC point for CA tracking QA and performance (header)
QA submodule for track fit results (residuals and puls) at selected z-coordinate (header)
Definition of the CbmQaCanvas class.
Useful utilities for CBM QA tasks.
friend fvec cos(const fvec &a)
friend fvec sin(const fvec &a)
T * MakeQaObject(TString sName, TString sTitle, Args... args)
TString fsPrefix
Unique prefix for all writeable root.
CbmQaIO(TString prefixName, std::shared_ptr< ObjList_t > pObjList=nullptr)
Constructor.
@ kSAMEDIR
Objects of different type will be stored to root directory.
EStoringMode fStoringMode
Objects storing mode.
TrackFitQa(const char *pointTag, const char *prefix, std::shared_ptr< ObjList_t > pObjList)
Constructor.
Class describes a unified MC-point, used in CA tracking QA analysis.
int GetInvSpeed() const
Gets inverse speed at reference z of station [ns/cm].
double GetPhi() const
Gets track azimuthal angle at reference z of station [rad].
double GetTime() const
Gets time [ns].
double GetP() const
Gets track momentum absolute value at reference z of station [GeV/c].
double GetY() const
Gets y coordinate at reference z of station [cm].
double GetQp() const
Gets track charge over momentum at reference z of station [ec/GeV].
double GetCharge() const
Gets charge of the particle [e].
double GetX() const
Gets x coordinate at reference z of station [cm].
double GetTx() const
Gets slope along x-axis at reference z of station.
double GetTheta() const
Gets polar angle at reference z of station [rad].
double GetZ() const
Gets z coordinate at reference z of station [cm].
double GetTy() const
Gets slope along x-axis at reference z of station.
T GetTxError() const
Gets error of slope along x-axis.
T GetVi() const
Gets inverse velocity [ns/cm] in downstream direction.
T GetXError() const
Gets x position error [cm].
T GetYError() const
Gets y position error [cm].
T GetTy() const
Gets slope along y-axis.
T GetTimeError() const
Gets time error [ns].
T GetZ() const
Gets z position [cm].
T Tx() const
Gets slope along x-axis.
T GetTime() const
Gets time [ns].
T GetTyError() const
Gets error of slope along y-axis.
T GetTheta() const
Gets polar angle [rad].
T GetTx() const
Gets slope along x-axis.
T GetViError() const
Gets inverse velocity error [ns/cm].
T GetQp() const
Gets charge over momentum [ec/GeV].
T GetNdf() const
Gets NDF of track fit model.
T GetQpError() const
Gets error of charge over momentum [ec/GeV].
T GetY() const
Gets y position [cm].
T GetChiSq() const
Gets Chi-square of track fit model.
T Ty() const
Gets slope along y-axis.
T GetX() const
Gets x position [cm].
Set of histograms to monitor track parameters.
static constexpr int kCXSIZEPX
Canvas size along x-axis [px].
TrackParArray_t< double > fvRUp
Upper boundary, residuals.
TrackParArray_t< TH1F * > fvphResiduals
Residuals for different track parameters.
TrackParArray_t< double > fvRLo
Lower boundary, residuals.
TH1F * fph_chiSqNdf
Chi^2/ndf of the track fit.
void Fill(const cbm::algo::kf::TrackParamD &trPar, const McPoint &mcPoint, bool bTimeMeasured, double weight=1)
Fills pull and residual histograms.
TrackParArray_t< int > fvPBins
Number of bins, pulls.
TProfile * fph_res_theta_thetaMC
Resolution of polar angle [rad].
TrackParArray_t< TH1F * > fvphPulls
Pulls for different track parameters.
TString fsTitle
Title of the point.
void Init()
Initializes histograms.
static constexpr int kCYSIZEPX
Canvas size along y-axis [px].
void SetDefaultProperties()
Sets default histogram and track parameter properties.
TProfile * fph_res_phi_phiMC
Resolution of azimuthal angle [rad].
TrackParArray_t< bool > fvbParIgnored
Flag: true - parameter is ignored.
TrackParArray_t< int > fvRBins
Number of bins, residuals.
void FillResAndPull(ETrackParType type, double recoVal, double recoErr, double trueVal)
Fills residual and pull for a given track parameter.
CbmQaCanvas * CreatePullPlot()
Creates pulls plot.
void SetPullHistoProperties(ETrackParType type, int nBins, double lo, double up)
Sets properties for a pull histogram.
TrackParArray_t< double > fvPUp
Upper boundary, pulls.
TrackParArray_t< double > fvPLo
Lower boundary, pulls.
void SetResidualHistoProperties(ETrackParType type, int nBins, double lo, double up)
Sets properties for a residual histogram.
TProfile * fph_res_p_pMC
Resolution of momentum [GeV/c].
CbmQaCanvas * CreateResidualPlot()
Creates residuals plot.
TH1F * fph_prob
prob() of the track fit
TODO: SZh 8.11.2022: add selection of parameterisation.
TrackParam< double > TrackParamD
ETrackParType
Enumeration for track parameter type.
@ BEGIN
begin of enumeration
@ kQP
charge over total momentum
std::tuple< double, double > FitKaniadakisGaussian(TH1 *pHist)
Fit a histogram with Kaniadakis Gaussian Distribution.