CbmRoot
Loading...
Searching...
No Matches
KfpV0FinderQa.cxx
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#include "kfp/KfpV0FinderQa.h"
11
12#include "global/RecoResults.h"
13#include "kfp/KfpV0Finder.h"
14
15
17
18// ---------------------------------------------------------------------------------------------------------------------
19//
21{
22 using qa::CanvasConfig;
23 using qa::H1D;
24 using qa::PadConfig;
25
26 //* Histogram initialisation
28 MakeObj<H1D>("kfp_mass_lambda", "Mass of #Lambda-candidates;m [GeV/c^{2}];Counts", kMassB, kMassL, kMassU);
29 fvphMassAll = MakeObj<H1D>("kfp_mass_all", "Mass of particles;m [GeV/c^{2}];Counts", 300, 0., 1.5);
30 fvphDcaAll = MakeObj<H1D>("kfp_dca_all", "DCA of tracks to origin;DCA [cm];Counts", kDcaB, kDcaL, kDcaU);
31 fvphBetaAll = MakeObj<H1D>("kfp_beta_all", "Speed of tracks;#beta;Counts", kBetaB, kBetaL, kBetaU);
32 fvphBetaPion = MakeObj<H1D>("kfp_beta_pion", "Speed of #pi-candidates;#beta;Counts", kBetaB, kBetaL, kBetaU);
33 fvphBetaProton = MakeObj<H1D>("kfp_beta_proton", "Speed of proton-candidates;#beta;Counts", kBetaB, kBetaL, kBetaU);
34 fvphMomAll = MakeObj<H1D>("kfp_mom_all", "Momentum of tracks;p [GeV/c];Counts", kBetaB, kBetaL, kBetaU);
35 fvphMomPion = MakeObj<H1D>("kfp_mom_pion", "Momentum of #pi-candidates;p [GeV/c];Counts", kBetaB, kBetaL, kBetaU);
37 MakeObj<H1D>("kfp_mom_proton", "Momentum of proton-candidates;p [GeV/c];Counts", kBetaB, kBetaL, kBetaU);
38
39 //* Canvas initialisation
40 auto canv = CanvasConfig("kfp_lambda", "Lambda-trigger summary QA", 3, 2);
41 canv.AddPadConfig(PadConfig(fvphMassLambdaCand, "hist")); // (0, 0)
42 canv.AddPadConfig(PadConfig(fvphDcaAll, "hist")); // (0, 1)
43 canv.AddPadConfig(PadConfig(fvphBetaAll, "hist"));
44 canv.AddPadConfig(PadConfig(fvphBetaPion, "hist"));
45 canv.AddPadConfig(PadConfig(fvphBetaProton, "hist"));
46 AddCanvasConfig(canv);
47}
48
49// ---------------------------------------------------------------------------------------------------------------------
50//
51void V0FinderQa::Exec(const RecoResults& recoEvent, const V0Finder& v0Finder)
52{
53 //* Fill track distributions
54 const auto& tracks{recoEvent.tracks};
55 if (v0Finder.GetT0s().size() == 1) {
56 for (uint32_t iTrk = 0; iTrk < tracks.size(); ++iTrk) {
57 const auto& particleInfo{v0Finder.GetParticleInfo()[iTrk]};
58 const auto& trkParFst{(v0Finder.GetTrackAssignedParams()[iTrk]).first};
59 bool bPdgDefined = (particleInfo.fPdg != V0Finder::kUndefPdg);
60 // All particles with defined DCA (primaries + secondary pions and protons)
61 fvphDcaAll->Fill(std::isnan(particleInfo.fDca) ? -999 : particleInfo.fDca);
62 fvphBetaAll->Fill(particleInfo.fBeta);
63 if (bPdgDefined) {
64 if (particleInfo.fPdg == -211) {
65 fvphBetaPion->Fill(particleInfo.fBeta);
66 fvphMomPion->Fill(trkParFst.GetP());
67 }
68 else if (particleInfo.fPdg == 2212) {
69 fvphBetaProton->Fill(particleInfo.fBeta);
70 fvphMomProton->Fill(trkParFst.GetP());
71 }
72 }
73 }
74 }
75 else {
76 for (uint32_t iTrk = 0; iTrk < tracks.size(); ++iTrk) {
77 const auto& particleInfo{v0Finder.GetParticleInfo()[iTrk]};
78 bool bPdgDefined = (particleInfo.fPdg != V0Finder::kUndefPdg);
79 fvphDcaAll->Fill(std::isnan(particleInfo.fDca) ? -999 : particleInfo.fDca);
80 fvphBetaAll->Fill(-9999);
81 if (bPdgDefined) {
82 if (particleInfo.fPdg == -211) {
83 fvphBetaPion->Fill(-9999);
84 fvphMomPion->Fill(-9999);
85 }
86 else if (particleInfo.fPdg == 2212) {
87 fvphBetaProton->Fill(-9999);
88 }
89 }
90 }
91 }
92
93 //* Fill particle distributions
94 const auto& particles = v0Finder.GetTopoReconstructor()->GetParticles();
95 for (const auto& particle : particles) {
96 fvphMassAll->Fill(particle.GetMass());
97 if (particle.GetPDG() == 3122) {
98 fvphMassLambdaCand->Fill(particle.GetMass());
99 }
100 }
101}
TClonesArray * tracks
A V0 finding algorithm QA.
A V0 finding algorithm.
A structure for reconstructed results: digi-events, hits and tracks.
A QA-task for the V0-finding algorithm.
qa::H1D * fvphMassLambdaCand
Mass of Lambda-candidates.
static constexpr int kDcaB
DCA to origin: number of bins.
qa::H1D * fvphMomAll
Speed of all particles.
qa::H1D * fvphBetaAll
Speed of all particles.
static constexpr int kBetaB
Speed of particle: number of bins.
void Init()
Initialized the task.
void Exec(const RecoResults &recoEvent, const V0Finder &v0Finder)
Executes the task, fills the histograms.
static constexpr double kDcaU
DCA to origin: upper bound [cm].
static constexpr double kBetaU
Speed of particle: upper bound [c].
qa::H1D * fvphBetaPion
Speed of pion-candidates.
qa::H1D * fvphMomPion
Speed of pion-candidates.
qa::H1D * fvphDcaAll
DCA of particles to origin.
static constexpr double kDcaL
DCA to origin: lower bound [cm].
static constexpr double kMassL
Lambda-candidate mass: lower bound [GeV/c2].
qa::H1D * fvphBetaProton
Speed of proton-candidates.
qa::H1D * fvphMomProton
Speed of proton-candidates.
static constexpr double kBetaL
Speed of particle: lower bound [c].
static constexpr double kMassU
Lambda-candidate mass: upper bound [GeV/c2].
qa::H1D * fvphMassAll
Mass of all particles in the topology.
static constexpr int kMassB
Lambda-candidate mass: number of bins.
A V0-finding algorithm.
Definition KfpV0Finder.h:25
const std::unique_ptr< KFParticleTopoReconstructor > & GetTopoReconstructor() const
Accessor to topology reconstructor.
Definition KfpV0Finder.h:93
const std::vector< ParticleInfo > & GetParticleInfo() const
Gets a vector of particle info.
Definition KfpV0Finder.h:80
static constexpr int32_t kUndefPdg
PDG for tracks, which PID cannot be inferred.
Definition KfpV0Finder.h:43
const auto & GetTrackAssignedParams() const
Gets track parameters.
Definition KfpV0Finder.h:96
const std::vector< double > & GetT0s() const
Gets found t0s.
Definition KfpV0Finder.h:90
A canvas configuration for the histogram server.
1D-histogram
int Fill(double x, double w=1.)
Fills histogram.
Definition Histogram.h:474
A pad configuration for the histogram server.
Definition PadConfig.h:26
void AddCanvasConfig(const CanvasConfig &canvas)
Adds a canvas configuration.
Obj * MakeObj(Args... args)
Creates a QA-object and returns the pointer to it.
ca::Vector< ca::Track > tracks
Definition RecoResults.h:49