From 745b61828fad09ba78d936cd4a8f98e25ba824f6 Mon Sep 17 00:00:00 2001
From: "s.zharko@gsi.de" <s.zharko@gsi.de>
Date: Thu, 30 Jan 2025 01:18:07 +0100
Subject: [PATCH] - ca: misalignment tolerances of x and y are set to 0 -
 V0Finder:   - YAML config   - cuts on velocity of pion and proton candidates 
  - enhanced cut for decay length (0.1 -> 5 cm)

---
 algo/evselector/KfpfV0FinderConfig.h | 74 ++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 algo/evselector/KfpfV0FinderConfig.h

diff --git a/algo/evselector/KfpfV0FinderConfig.h b/algo/evselector/KfpfV0FinderConfig.h
new file mode 100644
index 0000000000..cbeaec0a76
--- /dev/null
+++ b/algo/evselector/KfpfV0FinderConfig.h
@@ -0,0 +1,74 @@
+/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
+   SPDX-License-Identifier: GPL-3.0-only
+   Authors: Sergei Zharko [committer] */
+
+/// \file   KfpfV0FinderConfig.h
+/// \date   29.01.2025
+/// \brief  Configuration structure for V0 selector in mCBM
+/// \author Sergei Zharko <s.zharko@gsi.de>
+
+#pragma once
+
+#include "yaml/Yaml.h"
+
+#include <vector>
+
+namespace cbm::algo::kfpf
+{
+  /// \struct CutsKfpf
+  /// \brief  Cuts for the KFParticleFinder
+  struct CutsKfpf {
+    float minDecayLength;  ///< Minimal decay length of particles [cm]
+    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 maxChi2NdfGeo;   ///< Maximal chi2/NDF for V0 candidates
+
+    CBM_YAML_PROPERTIES(
+      yaml::Property(&CutsKfpf::minDecayLength, "min_decay_length", "Minimal decay length of particles [cm]"),
+      yaml::Property(&CutsKfpf::minDecayLDL, "min_decay_ldl", "Minimal value of decay length to decay length error ratio"),
+      yaml::Property(&CutsKfpf::maxChi2NdfPrim, "max_chi2_ndf_prim", "Maximal chi2/NDF for primary particles"),
+      yaml::Property(&CutsKfpf::maxChi2NdfGeo, "max_chi2_ndf_geo", "Maximal chi2/NDF for V0 candidates"));
+  };
+
+  /// \struct ParticlePid
+  /// \brief  PID and pre-selection cuts for a given particle
+  struct ParticlePid {
+    int pdg;             ///< PDG code for particle
+    double minDca;       ///< Minimal DCA to PV [cm]
+    double minVelocity;  ///< Minimal velocity [cm/ns]
+    double maxVelocity;  ///< Maximal velocity [cm/ns]
+
+    CBM_YAML_PROPERTIES(
+      yaml::Property(&ParticlePid::pdg, "pdg", "PDG code of the particle"),
+      yaml::Property(&ParticlePid::minDca, "min_dca", "Minimal DCA to PV [cm]"),
+      yaml::Property(&ParticlePid::minVelocity, "min_velocity", "Minimal velocity [cm/ns]"),
+      yaml::Property(&ParticlePid::maxVelocity, "max_velocity", "Maximal velocity [cm/ns]"));
+  };
+
+  /// \struct Cuts;
+  struct Cuts {
+    CutsKfpf kfpf;                       ///< KFParticleFinder specific cuts
+    std::vector<ParticlePid> particles;  ///< Daughter PID cuts and other properties
+
+    CBM_YAML_PROPERTIES(
+      yaml::Property(&Cuts::kfpf, "kfpf", "Specific cuts for the KFParticleFinder"),
+      yaml::Property(&Cuts::particles,  "particles", "Particle identification cuts and properties"));
+  };
+
+  /// \struct LambdaFinderConfig
+  /// \brief  Configuration for the V0 finder
+  struct V0FinderConfig {
+    Cuts cuts;                     ///< Different selection cuts
+    double tZeroOffset;            ///< Offset for T0 [ns]
+    double qpAssignedUncertainty;  ///< Assigned relative uncertainty for q/p estimation
+    int primaryAssignedPdg;        ///< Assigned PDG hypothesis for primary particles
+    int reconstructPdg;            ///< PDG of the particle, the decay of which is to be reconstructed
+
+    CBM_YAML_PROPERTIES(
+      yaml::Property(&V0FinderConfig::cuts, "cuts", "Different selection cuts"),
+      yaml::Property(&V0FinderConfig::tZeroOffset, "t0_offset", "The t0 offset [ns]"),
+      yaml::Property(&V0FinderConfig::qpAssignedUncertainty, "qa_uncertainty", "Assigned relative uncertainty for q/p"),
+      yaml::Property(&V0FinderConfig::primaryAssignedPdg, "primary_pdg", "Assigned PDG code for primary tracks"),
+      yaml::Property(&V0FinderConfig::reconstructPdg, "reconstruct_pdg", "PDG code of the particle to be reconstructed"));
+  };
+}  // namespace cbm::algo::kfpf
-- 
GitLab