CbmRoot
Loading...
Searching...
No Matches
KfpV0FinderCutter.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#ifndef KfpV0FinderCutter_h
11#define KfpV0FinderCutter_h 0
12
13#include "CbmYaml.h"
15
16#include <array>
17#include <string>
18
19class KFParticleFinder;
20
21namespace cbm::algo::kfp
22{
32 template<EV0Type V0Type>
34 public:
35 template<typename T>
36 using Range_t = std::array<T, 2>;
37
38 //* Different structures to store cut values
39
42 struct TrackPidCuts {
45
47 yaml::Property(&TrackPidCuts::pid, "pid", "Particle identifier"),
48 yaml::Property(&TrackPidCuts::beta, "beta", "Speed [c]", YAML::Flow));
49 };
50
53 // FIXME: account for different particles (pi-, pi+, proton, anti-proton, .....)
54 // provided a vector/map to access the properties of each particle
55 struct TrackCuts {
56 std::vector<TrackPidCuts> pidCuts;
57
58 CBM_YAML_PROPERTIES(yaml::Property(&TrackCuts::pidCuts, "pidCuts", "Track properties vs. PID", YAML::Flow));
59 };
60
68
70 yaml::Property(&KfpFinderCuts::minDecayLength, "minDecayLength", "Min. decay length of particles [cm]"),
71 yaml::Property(&KfpFinderCuts::minDecayLDL, "minDecayLDL", "Min. length to decay length error ratio"),
72 yaml::Property(&KfpFinderCuts::maxChi2NdfPrim, "maxChi2NdfPrim", "Max. chi2/NDF for primary particles"),
73 yaml::Property(&KfpFinderCuts::maxChi2NdfGeo, "maxChi2NdfGeo", "Max. chi2/NDF for V0 candidates"));
74 };
75
77 struct DaughterCuts {
80
82 yaml::Property(&DaughterCuts::dcaRelToOrigin, "dcaRelToOrigin", "DCA rel. to origin [cm]", YAML::Flow),
83 yaml::Property(&DaughterCuts::beta, "beta", "Speed [c]", YAML::Flow));
84 };
85
88 struct ParticleCuts {
98
100 yaml::Property(&ParticleCuts::daughterA, "daughterA", "Individual cuts for daughter \"a\""),
101 yaml::Property(&ParticleCuts::daughterB, "daughterB", "Individual cuts for daughter \"b\""),
102 yaml::Property(&ParticleCuts::maxDcaRelToPrimVertex, "maxDcaRelToPrimVertex", "Max. DCA relative to primary vertex [cm]"),
103 yaml::Property(&ParticleCuts::maxDcaBetweenDaughters, "maxDcaBetweenDaughters", "Max. DCA between two daughters [cm]"),
104 yaml::Property(&ParticleCuts::decayLength, "decayLength", "Decay length of particle (afterburner?) [cm]", YAML::Flow),
105 yaml::Property(&ParticleCuts::daughterVtxZ, "daughterVtxZ", "z-coordinate of daughter vertex [cm]", YAML::Flow),
106 yaml::Property(&ParticleCuts::minOpeningAngle, "minOpeningAngle", "Min. opening angle between daughters [radians]"),
107 yaml::Property(&ParticleCuts::chi2NdfTopo, "chi2NdfTopo", "Topology chi2/NDF (with reconstructed PV)", YAML::Flow),
108 yaml::Property(&ParticleCuts::chi2NdfGeo, "chi2NdfGeo", "chi2/NDF (with respect to origin)", YAML::Flow));
109 };
110
113 struct CutValues {
118 yaml::Property(&CutValues::trackCuts, "trackCuts", "Cuts on tracks at pre-selection stage"),
119 yaml::Property(&CutValues::kfpFinderCuts, "kfpFinderCuts", "Internal KFParticleFinder cuts"),
120 yaml::Property(&CutValues::particleCuts, "particleCuts", "Cuts on the final V0 candidates selection")
121 );
122
124 void Init();
125 };
126
127 //* Different structures to store intermediate track/particle properties for performing the selection
128
136
140 double beta;
141 };
142
155
156 //* Class public methods
157
159 V0FinderCutter() = default;
160
163 V0FinderCutter(const std::string& filename);
164
167
170
172 ~V0FinderCutter() = default;
173
176
179
182 void ApplyCutsToKFParticleFinder(KFParticleFinder* pFinder) const;
183
186 void ReadCutsFromYaml(const std::string& filename);
187
192 bool SelectParticle(const ParticleProperty& particleProperty) const;
193
198 bool SelectTrack(const TrackProperty& trackProperty) const;
199
202 void SetCuts(const CutValues& cuts);
203
205 std::string ToString() const;
206
208 static constexpr int GetV0Pdg()
209 {
210 if constexpr (EV0Type::Lambda == V0Type) {
211 return 3122; // Lambda
212 }
213 else {
214 return -2; // undef
215 }
216 }
217
218 private:
219 CutValues fCuts;
220 std::string fsName{""};
221 };
222} // namespace cbm::algo::kfp
223
224#endif // KfpV0FinderCutter_h
Different definitions for V0 candidates finding in mCBM.
V0FinderCutter()=default
Default constructor.
V0FinderCutter & operator=(const V0FinderCutter &)=default
Copy assignment operator.
void ReadCutsFromYaml(const std::string &filename)
Reads parameters from the YAML config.
V0FinderCutter(const std::string &filename)
Constructor from path to the parameter file.
V0FinderCutter(const V0FinderCutter &)=default
Copy constructor.
void ApplyCutsToKFParticleFinder(KFParticleFinder *pFinder) const
Applies cuts to the KFParticleFinder instance.
bool SelectParticle(const ParticleProperty &particleProperty) const
Selects a particle within the cuts (after the KFParticleFinder stage)
bool SelectTrack(const TrackProperty &trackProperty) const
Selects a track (to pass it to the KFParticleFinder stage)
V0FinderCutter(V0FinderCutter &&)=default
Move constructor.
static constexpr int GetV0Pdg()
Gets the PDG code for V0.
V0FinderCutter & operator=(V0FinderCutter &&)=default
Move assignment operator.
std::array< T, 2 > Range_t
A range: [0] – min, [1] – max.
std::string ToString() const
String representation of the class.
~V0FinderCutter()=default
Destructor.
void SetCuts(const CutValues &cuts)
Sets the cuts.
ETrackPid
An enumeration for PID of global tracks.
ParticleCuts particleCuts
Cuts on the final lambda-candidates selection.
void Init()
A method, which initializes the instance of the CutValues.
TrackCuts trackCuts
Cuts on tracks at pre-selection stage.
KfpFinderCuts kfpFinderCuts
Internal KFParticleFinder cuts.
CBM_YAML_PROPERTIES(yaml::Property(&CutValues::trackCuts, "trackCuts", "Cuts on tracks at pre-selection stage"), yaml::Property(&CutValues::kfpFinderCuts, "kfpFinderCuts", "Internal KFParticleFinder cuts"), yaml::Property(&CutValues::particleCuts, "particleCuts", "Cuts on the final V0 candidates selection"))
Range_t< double > dcaRelToOrigin
DCA to origin [cm].
CBM_YAML_PROPERTIES(yaml::Property(&DaughterCuts::dcaRelToOrigin, "dcaRelToOrigin", "DCA rel. to origin [cm]", YAML::Flow), yaml::Property(&DaughterCuts::beta, "beta", "Speed [c]", YAML::Flow))
double dcaRelToOrigin
Distance of closest approach relative to origin [cm].
CBM_YAML_PROPERTIES(yaml::Property(&KfpFinderCuts::minDecayLength, "minDecayLength", "Min. decay length of particles [cm]"), yaml::Property(&KfpFinderCuts::minDecayLDL, "minDecayLDL", "Min. length to decay length error ratio"), yaml::Property(&KfpFinderCuts::maxChi2NdfPrim, "maxChi2NdfPrim", "Max. chi2/NDF for primary particles"), yaml::Property(&KfpFinderCuts::maxChi2NdfGeo, "maxChi2NdfGeo", "Max. chi2/NDF for V0 candidates"))
float minDecayLDL
Minimal value of decay length to decay length error ratio.
float maxChi2NdfPrim
Maximal chi2/NDF for primary particles (coming from the PV)
float minDecayLength
Minimal decay length of particles (initial) [cm].
float maxChi2NdfGeo
Maximal chi2/NDF for V0 candidates.
Range_t< float > decayLength
Decay length of particle (afterburner?) [cm].
DaughterCuts daughterA
Individual cuts for daughter "a".
float maxDcaBetweenDaughters
Maximal DCA between two daughters [cm].
Range_t< float > chi2NdfGeo
chi2/NDF (with respect to origin)
CBM_YAML_PROPERTIES(yaml::Property(&ParticleCuts::daughterA, "daughterA", "Individual cuts for daughter \"a\""), yaml::Property(&ParticleCuts::daughterB, "daughterB", "Individual cuts for daughter \"b\""), yaml::Property(&ParticleCuts::maxDcaRelToPrimVertex, "maxDcaRelToPrimVertex", "Max. DCA relative to primary vertex [cm]"), yaml::Property(&ParticleCuts::maxDcaBetweenDaughters, "maxDcaBetweenDaughters", "Max. DCA between two daughters [cm]"), yaml::Property(&ParticleCuts::decayLength, "decayLength", "Decay length of particle (afterburner?) [cm]", YAML::Flow), yaml::Property(&ParticleCuts::daughterVtxZ, "daughterVtxZ", "z-coordinate of daughter vertex [cm]", YAML::Flow), yaml::Property(&ParticleCuts::minOpeningAngle, "minOpeningAngle", "Min. opening angle between daughters [radians]"), yaml::Property(&ParticleCuts::chi2NdfTopo, "chi2NdfTopo", "Topology chi2/NDF (with reconstructed PV)", YAML::Flow), yaml::Property(&ParticleCuts::chi2NdfGeo, "chi2NdfGeo", "chi2/NDF (with respect to origin)", YAML::Flow))
Range_t< float > daughterVtxZ
z-coordinate of daughter vertex [cm]
float maxDcaRelToPrimVertex
Maximal DCA relative to primary vertex [cm].
float minOpeningAngle
Minimal opening angle between daughters [radians].
DaughterCuts daughterB
Individual cuts for daughter "b".
Range_t< float > chi2NdfTopo
Topology chi2/NDF (with reconstructed PV)
double chi2NdfGeo
chi2/NDF relative to origin (??? Is it correct?)
double chi2NdfTopo
chi2/NDF relative to primary vertex
DaughterProperty daughterA
Properties of daughter "a".
double daughterVtxZ
z-coordinate of daughter vertex [cm]
DaughterProperty daughterB
Properties of daughter "b".
double dcaBetweenDaughters
Distance of closest approach between daughters [cm].
double dcaRelToPrimVertex
Distance of closest approach relative to PV [cm].
Cuts for tracks on pre-selection stage.
CBM_YAML_PROPERTIES(yaml::Property(&TrackCuts::pidCuts, "pidCuts", "Track properties vs. PID", YAML::Flow))
Specific track cuts vs. particle ID.
ETrackPid pid
Track PID (NOTE: is needed for reading)
Range_t< double > beta
Particle speed [c].
CBM_YAML_PROPERTIES(yaml::Property(&TrackPidCuts::pid, "pid", "Particle identifier"), yaml::Property(&TrackPidCuts::beta, "beta", "Speed [c]", YAML::Flow))
Properties of a track to perform track pre-selection.
ETrackPid pid
Identity of the particle.
double dcaRelToOrigin
Distanse of closest approach relative to origin [cm].