CbmRoot
Loading...
Searching...
No Matches
CbmKFV0FinderQa.h
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10// FIXME: Later move this class into a separate QA-task
11
12#pragma once
13
14#include "CbmKFV0FinderTask.h"
15#include "CbmQaTask.h"
16
17#include <TString.h>
18
19#include <array>
20#include <string>
21#include <vector>
22
23#include <Math/Vector3D.h> // Radius-vector
24#include <Math/Vector4D.h> // Lorentz vector
25
26class TH1D;
27class TH2D;
28
29// NOTE: works only for Lambda
30// FIXME: generalize for V0
31
32namespace cbm::kfp
33{
36 class V0FinderQa : public CbmQaTask {
37 public:
39 using XVector4_t = ROOT::Math::XYZTVector;
40 using PVector4_t = ROOT::Math::PxPyPzEVector;
41 using Vector3_t = ROOT::Math::XYZVector;
42
47 V0FinderQa(int verbose, bool bUseMc, ECbmRecoMode recoMode = ECbmRecoMode::Timeslice)
48 : CbmQaTask("v0Finder", verbose, bUseMc, recoMode)
49 {
50 }
51
53 ~V0FinderQa() = default;
54
55 V0FinderQa(const V0FinderQa&) = delete;
57 V0FinderQa& operator=(const V0FinderQa&) = delete;
59
61 void Check() {}
62
64 void ExecQa();
65
67 InitStatus InitQa();
68
71 void SetFrom(const V0FinderTask* pFinder);
72
74 void InitHistograms();
75
77 void WriteHistograms(const TString&);
78
79
80 private:
84 TH1D* beta{nullptr};
85 TH1D* dca_rt_origin{nullptr};
86 TH1D* p{nullptr};
87 TH1D* pt{nullptr};
88 };
89
97
101 TH1D* opening_angle{nullptr};
102 TH1D* opening_angle_kf{nullptr};
103 TH1D* dca_rt_pv{nullptr};
104 TH1D* dca_daughters{nullptr};
105 TH1D* decay_length{nullptr};
106 TH1D* decay_vtx_z{nullptr};
107 TH2D* decay_vtx_xy{nullptr};
108 TH1D* chi2ndf_topo{nullptr};
109 TH1D* chi2ndf_geo{nullptr};
110 TH1D* mass{nullptr};
111 };
112
114 void FillParticles();
115
117 void FillTracks();
118
122 template<bool IsMixedEvent>
123 void FillV0Candidates(const KFParticle& v0cand);
124
129 void FillSecondary(RefHistogramsPrt& h, const KFParticle& prt, const V0FinderTask::ParticleInfo& prtInfo);
130
138 void Refit(const XVector4_t& aX, const XVector4_t& bX, XVector4_t& mX, PVector4_t& aP, PVector4_t& bP,
139 PVector4_t& mP);
140
141 //* Control flags
143 bool fbUseMc{false};
144
145 //* Data branches
146 std::shared_ptr<const KFParticleTopoReconstructor> fpTopoReconstructor{nullptr};
147 std::shared_ptr<const Cutter_t> fpCutter{nullptr};
148 const std::vector<V0FinderTask::TrackInfo>* fpTrackInfo{nullptr};
149 const std::vector<V0FinderTask::ParticleInfo>* fpParticleInfo{nullptr};
150 TClonesArray* fpBrRecoEvents{nullptr};
151 TClonesArray* fpBrGlobalTracks{nullptr};
152
153 //* Histogram properties (binning)
154 static constexpr int kBbeta{200};
155 static constexpr double kLbeta{-0.5};
156 static constexpr double kUbeta{+1.5};
157 static constexpr int kBdca_rt_origin{100};
158 static constexpr double kLdca_rt_origin{+0.0};
159 static constexpr double kUdca_rt_origin{+10.};
160 static constexpr int kBp{80};
161 static constexpr double kLp{+0.0};
162 static constexpr double kUp{+4.0};
163 static constexpr int kBpt{80};
164 static constexpr double kLpt{+0.0};
165 static constexpr double kUpt{+4.0};
166
167 static constexpr int kBopening_angle{150};
168 static constexpr double kLopening_angle{+0.0};
169 static constexpr double kUopening_angle{+1.5};
170 static constexpr int kBdca_rt_pv{100};
171 static constexpr double kLdca_rt_pv{+0.0};
172 static constexpr double kUdca_rt_pv{+1.0};
173 static constexpr int kBdca_daughters{100};
174 static constexpr double kLdca_daughters{+0.0};
175 static constexpr double kUdca_daughters{+1.0};
176 static constexpr int kBdecay_length{100};
177 static constexpr double kLdecay_length{0.0};
178 static constexpr double kUdecay_length{30.};
179 static constexpr int kBdecay_vtx_x{200};
180 static constexpr double kLdecay_vtx_x{-25.};
181 static constexpr double kUdecay_vtx_x{+25.};
182 static constexpr int kBdecay_vtx_y{200};
183 static constexpr double kLdecay_vtx_y{-25.};
184 static constexpr double kUdecay_vtx_y{+25.};
185 static constexpr int kBdecay_vtx_z{200};
186 static constexpr double kLdecay_vtx_z{0.0};
187 static constexpr double kUdecay_vtx_z{50.};
188 static constexpr int kBchi2ndf_topo{50};
189 static constexpr double kLchi2ndf_topo{0.0};
190 static constexpr double kUchi2ndf_topo{500.};
191 static constexpr int kBchi2ndf_geo{50};
192 static constexpr double kLchi2ndf_geo{0.0};
193 static constexpr double kUchi2ndf_geo{50.};
194 static constexpr int kBmass{100};
195 static constexpr double kLmass{1.08};
196 static constexpr double kUmass{1.28};
197
198 //* Histograms
209
211 };
212} // namespace cbm::kfp
ECbmRecoMode
Reconstruct the full time slice or event-by-event.
Definition CbmDefs.h:202
A base class for CBM QA task logic.
CbmQaTask(const char *name, int verbose, bool isMCUsed, ECbmRecoMode recoMode=ECbmRecoMode::Timeslice)
Constructor from parameters.
Definition CbmQaTask.cxx:32
Data class with information on a STS local track.
static constexpr int kBdca_rt_pv
DCA rel. to prim. vertex: number of bins.
static constexpr int kBdecay_vtx_y
Decay vertex y-coordinate: number of bins.
static constexpr double kUdecay_vtx_y
Decay vertex y-coordinate: upper bound [cm].
static constexpr int kBbeta
beta: number of bins
static constexpr double kUchi2ndf_geo
chi2/NDF geometry: upper bound
static constexpr int kBdca_rt_origin
DCA rel. to origin: number of bins.
static constexpr double kLdca_rt_origin
DCA rel. to origin: lower bound [cm].
std::shared_ptr< const KFParticleTopoReconstructor > fpTopoReconstructor
static constexpr double kLpt
transverse momentum : lower bound [GeV/c]
static constexpr double kLdecay_length
Decay length: lower bound [cm].
V0FinderQa(int verbose, bool bUseMc, ECbmRecoMode recoMode=ECbmRecoMode::Timeslice)
Constructor from parameters.
V0FinderQa(const V0FinderQa &)=delete
void WriteHistograms(const TString &)
Writes histograms into file.
static constexpr double kLdecay_vtx_z
Decay vertex z-coordinate: lower bound [cm].
const std::vector< V0FinderTask::ParticleInfo > * fpParticleInfo
void FillSecondary(RefHistogramsPrt &h, const KFParticle &prt, const V0FinderTask::ParticleInfo &prtInfo)
Fills secondary distributions.
const std::vector< V0FinderTask::TrackInfo > * fpTrackInfo
static constexpr double kUmass
Invariant mass: upper bound [GeV/c2].
static constexpr double kLdecay_vtx_y
Decay vertex y-coordinate: lower bound [cm].
RefHistograms fhRefTracksBefore
Track distributions before track selection.
static constexpr double kUp
abs. momentum : upper bound [GeV/c]
static constexpr int kBopening_angle
opening angle: number of bins
V0FinderQa & operator=(const V0FinderQa &)=delete
RefHistograms fhRefDaughtersAfter
Daughter particle distribution after cuts on v0.
static constexpr double kUdca_rt_origin
DCA rel. to origin: upper bound [cm].
static constexpr int kBdecay_vtx_x
Decay vertex x-coordinate: number of bins.
static constexpr double kLchi2ndf_topo
chi2/NDF topology: lower bound
ROOT::Math::XYZVector Vector3_t
static constexpr double kLopening_angle
opening angle: lower bound [radians]
static constexpr double kLp
abs. momentum : lower bound [GeV/c]
static constexpr int kBchi2ndf_topo
chi2/NDF topology: number of bins
static constexpr double kLdca_rt_pv
DCA rel. to prim. vertex: lower bound [cm].
static constexpr double kUbeta
beta: upper bound [c]
void FillV0Candidates(const KFParticle &v0cand)
Fills v0 distributions.
ClassDef(V0FinderQa, 0)
static constexpr double kUdecay_vtx_z
Decay vertex z-coordinate: upper bound [cm].
void Check()
Checks QA.
static constexpr double kLmass
Invariant mass: lower bound [GeV/c2].
static constexpr int kBdca_daughters
DCA between daughters: number of bins.
static constexpr double kLdca_daughters
DCA between daughters: lower bound [cm].
static constexpr int kBdecay_length
Decay length: number of bins.
ROOT::Math::XYZTVector XVector4_t
static constexpr double kUdca_rt_pv
DCA rel. to prim. vertex: upper bound [cm].
RefHistograms fhRefDaughtersBefore
Daughter particle distribution before cuts on v0.
typename V0FinderTask::Cutter_t Cutter_t
V0FinderQa & operator=(V0FinderQa &&)=delete
static constexpr double kLbeta
beta: lower bound [c]
RefHistogramsV0 fhRefV0After
V0 distributions after cuts.
RefHistograms fhRefSecondaryUnused
Secondary particles, which were not attached to any v0.
RefHistograms fhRefTracksAfter
Track distributions after track selection.
static constexpr double kLdecay_vtx_x
Decay vertex x-coordinate: lower bound [cm].
RefHistogramsV0 fhRefV0Before
V0 distributions before cuts.
static constexpr double kUchi2ndf_topo
chi2/NDF topology: upper bound
static constexpr double kUdecay_length
Decay length: upper bound [cm].
V0FinderQa(V0FinderQa &&)=delete
static constexpr int kBmass
Invariant mass: number of bins.
void Refit(const XVector4_t &aX, const XVector4_t &bX, XVector4_t &mX, PVector4_t &aP, PVector4_t &bP, PVector4_t &mP)
Refits 4-momenta of daughters.
static constexpr double kUdca_daughters
DCA between daughters: upper bound [cm].
static constexpr int kBdecay_vtx_z
Decay vertex z-coordinate: number of bins.
static constexpr double kUpt
transverse momentum : upper bound [GeV/c]
static constexpr double kLchi2ndf_geo
chi2/NDF geometry: lower bound
~V0FinderQa()=default
Destructor.
static constexpr double kUdecay_vtx_x
Decay vertex x-coordinate: upper bound [cm].
RefHistogramsV0 fhRefMeAfter
Mixed-event distributions after cuts.
RefHistogramsV0 fhRefMeBefore
Mixed-event distributions before cuts.
ROOT::Math::PxPyPzEVector PVector4_t
TClonesArray * fpBrRecoEvents
static constexpr int kBp
abs. momentum : number of bins
std::shared_ptr< const Cutter_t > fpCutter
static constexpr double kUopening_angle
opening angle: upper bound [radians]
static constexpr int kBchi2ndf_geo
chi2/NDF geometry: number of bins
TClonesArray * fpBrGlobalTracks
static constexpr int kBpt
transverse momentum : number of bins
RefHistograms fhRefSecondaryStored
Stored secondary particles.
A class to find V0 candidates in mCBM.
V0FinderCutter< EV0Type::Lambda > Cutter_t
A collection of reference histograms for a particle (specific or all)
TH1D * p
absolute value of momentum
A collection of reference histograms for V0 candidates.
TH2D * decay_vtx_xy
x-, y-coordinate of V0 decay vertex
TH1D * chi2ndf_geo
Chi2/NDF geo (w.r.t. origin)
TH1D * mass
Invariant mass distribution.
TH1D * opening_angle_kf
Opening angle of daughters (using KFParticle objects)
TH1D * dca_rt_pv
DCA r.t. primary vertex.
TH1D * decay_vtx_z
z-coordinate of V0 decay vertex
TH1D * dca_daughters
DCA between daughters.
TH1D * chi2ndf_topo
Chi2/NDF topology.
TH1D * opening_angle
Opening angle of daughters.
A collection of reference histograms for different analysis stage.
Extra information on KFParticle, required by the V0 analysis.