CbmRoot
Loading...
Searching...
No Matches
CbmCaTrackFitQa.h
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10
11#pragma once
12
13#include "CaDefs.h"
14#include "CaEnumArray.h"
15#include "CbmL1DetectorID.h"
16#include "CbmQaIO.h"
17#include "KfFieldRegion.h"
18#include "KfTrackParam.h"
19
20#include <array>
21
22// Forward declarations
23namespace cbm::ca::tools
24{
25 class MCData;
26 class MCPoint;
27} // namespace cbm::ca::tools
28class CbmL1Track;
30
31class TFolder;
32class TH1F;
33class TProfile;
34class CbmQaCanvas;
35
36namespace cbm::ca
37{
40
43 enum class ETrackParType
44 {
45 kX,
46 kY,
47 kTX,
48 kTY,
49 kQP,
50 kTIME,
51 kVI,
52 END,
53 BEGIN = 0
54 };
55
58
61
62
64 template<typename T>
66
71 class TrackFitQa : public CbmQaIO {
72 public:
77 TrackFitQa(const char* pointTag, const char* prefix, std::shared_ptr<ObjList_t> pObjList);
78
80 ~TrackFitQa() = default;
81
83 TrackFitQa(const TrackFitQa&) = delete;
84
87
89 TrackFitQa& operator=(const TrackFitQa&) = delete;
90
93
95 const char* GetTitle() const { return fsTitle; }
96
98 void Init();
99
104 void Fill(const cbm::algo::kf::TrackParamV& trPar, const tools::MCPoint& mcPoint, bool bTimeMeasured,
105 double weight = 1);
106
109 void SetParticleMass(double mass) { fMass = mass; }
110
113 void SetTitle(const char* title) { fsTitle = title; }
114
117
120
123
125 CbmQaCanvas* CreateResolutionPlot() { return nullptr; }
126
132 void SetResidualHistoProperties(ETrackParType type, int nBins, double lo, double up);
133
139 void SetPullHistoProperties(ETrackParType type, int nBins, double lo, double up);
140
141 // ************************
142 // ** List of histograms **
143 // ************************
144
145
146 TH1F* fph_res_x = nullptr;
147 TH1F* fph_res_y = nullptr;
148 TH1F* fph_res_tx = nullptr;
149 TH1F* fph_res_ty = nullptr;
150 TH1F* fph_res_qp = nullptr;
151 TH1F* fph_res_t = nullptr;
152 TH1F* fph_res_vi = nullptr;
153
154 // ** Pulls **
155 TH1F* fph_pull_x = nullptr;
156 TH1F* fph_pull_y = nullptr;
157 TH1F* fph_pull_tx = nullptr;
158 TH1F* fph_pull_ty = nullptr;
159 TH1F* fph_pull_qp = nullptr;
160 TH1F* fph_pull_t = nullptr;
161 TH1F* fph_pull_vi = nullptr;
162
163 // ** Resolution profiles **
164 TProfile* fph_res_p_pMC = nullptr;
165 TProfile* fph_res_phi_phiMC = nullptr;
166 TProfile* fph_res_theta_thetaMC = nullptr;
167
168 // **************************
169 // ** Histogram properties **
170 // **************************
171
172 // ** Binning **
173 static constexpr int kCXSIZEPX = 600;
174 static constexpr int kCYSIZEPX = 600;
175
176 private:
179
180 using FnVal_t = std::function<double()>;
186 void FillResAndPull(ETrackParType type, double recoVal, double recoErr, double trueVal);
187
190
192
193 // ** Distribution properties **
197
201
202 TString fsTitle = "";
203
204 double fMass = constants::phys::MuonMass;
205
207 };
208
209} // namespace cbm::ca
Compile-time constants definition for the CA tracking algorithm.
Implementation of cbm::algo::ca::EnumArray class.
Implementation of L1DetectorID enum class for CBM.
Module for ROOT objects IO interface (header)
Magnetic flux density interpolation along the track vs. z-coordinate (header)
ROOT object IO interface for QA.
Definition CbmQaIO.h:44
Class of arrays, which can be accessed by an enum class entry as an index.
Set of histograms to monitor track parameters.
static constexpr int kCXSIZEPX
Canvas size along x-axis [px].
~TrackFitQa()=default
Destructor.
TrackParArray_t< double > fvRUp
Upper boundary, residuals.
void SetParticleMass(double mass)
Sets particle mass, used for fitting a track.
TrackParArray_t< TH1F * > fvphResiduals
Residuals for different track parameters.
TrackParArray_t< double > fvRLo
Lower boundary, residuals.
std::function< double()> FnVal_t
TrackFitQa(const char *pointTag, const char *prefix, std::shared_ptr< ObjList_t > pObjList)
Constructor.
TH1F * fph_pull_vi
Pull of inverse speed.
TH1F * fph_res_qp
Residual of q/p [ec/GeV].
TrackParArray_t< int > fvPBins
Number of bins, pulls.
TrackFitQa(TrackFitQa &&)=delete
Move constructor.
TH1F * fph_res_x
Residual of x-coordinate [cm].
TProfile * fph_res_theta_thetaMC
Resolution of polar angle [rad].
TrackParArray_t< TH1F * > fvphPulls
Pulls for different track parameters.
void SetTitle(const char *title)
Sets title, which is to be reflected on legends and titles.
TH1F * fph_pull_ty
Pull of slope along y-axis.
void FitHistograms()
Fit histograms.
TString fsTitle
Title of the point.
void Init()
Initializes histograms.
TrackFitQa & operator=(TrackFitQa &&)=delete
Move assignment operator.
TH1F * fph_pull_t
Pull of time.
static constexpr int kCYSIZEPX
Canvas size along y-axis [px].
TH1F * fph_res_vi
Residual of inverse speed [1/c].
void SetDefaultProperties()
Sets default histogram and track parameter properties.
TH1F * fph_pull_qp
Pull of q/p.
TH1F * fph_pull_tx
Pull of slope along x-axis.
TProfile * fph_res_phi_phiMC
Resolution of azimuthal angle [rad].
CbmQaCanvas * CreateResolutionPlot()
Creates resolutionis plot.
TH1F * fph_pull_y
Pull of y-coordinate.
TH1F * fph_res_ty
Residual of slope along y-axis.
ClassDefNV(TrackFitQa, 0)
Mass of particle.
const char * GetTitle() const
Gets title of fit parameters.
TrackParArray_t< bool > fvbParIgnored
Flag: true - parameter is ignored.
TH1F * fph_res_tx
Residual of slope along x-axis.
TrackParArray_t< int > fvRBins
Number of bins, residuals.
TH1F * fph_res_y
Residual of y-coordinate [cm].
void FillResAndPull(ETrackParType type, double recoVal, double recoErr, double trueVal)
Fills residual and pull for a given track parameter.
TrackFitQa & operator=(const TrackFitQa &)=delete
Copy assignment operator.
CbmQaCanvas * CreatePullPlot()
Creates pulls plot.
TrackFitQa(const TrackFitQa &)=delete
Copy constructor.
TH1F * fph_res_t
Residual of time [ns].
void SetPullHistoProperties(ETrackParType type, int nBins, double lo, double up)
Sets properties for a pull histogram.
TH1F * fph_pull_x
Pull of x-coordinate.
TrackParArray_t< double > fvPUp
Upper boundary, pulls.
TrackParArray_t< double > fvPLo
Lower boundary, pulls.
void Fill(const cbm::algo::kf::TrackParamV &trPar, const tools::MCPoint &mcPoint, bool bTimeMeasured, double weight=1)
Fills pull and residual histograms.
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.
Class describes a unified MC-point, used in CA tracking QA analysis.
Physics constants.
Definition CaDefs.h:72
ETrackParType
Enumeration for track parameter type.
@ BEGIN
begin of enumeration
@ kVI
inverse speed
@ kQP
charge over total momentum
@ kTY
slope along y-axis
@ kTX
slope along x-axis
ETrackParType operator++(ETrackParType &type)
Prefix increment operator for ETrackParType.