diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt index a2a052fa4026f62246d4be605c6a50c2217bf65a..0524146a40df5e21ae4af1edf685216eb7e1847c 100644 --- a/algo/CMakeLists.txt +++ b/algo/CMakeLists.txt @@ -56,6 +56,7 @@ add_subdirectory(log) add_subdirectory(data) add_subdirectory(kf) add_subdirectory(ca) +#add_subdirectory(kfp) # For KFParticleOnline # exclude unittests from being build inside the container if (NOT CBM_ONLINE_STANDALONE) @@ -160,6 +161,8 @@ set(SRCS ca/TrackingSetup.cxx ca/TrackingChain.cxx ca/qa/CaQa.cxx + kfp/KfpV0Finder.cxx + kfp/KfpV0FinderChain.cxx kfp/KfpV0FinderConfig.cxx ) diff --git a/algo/global/Reco.cxx b/algo/global/Reco.cxx index cfde9b3b479f022e9c08c8a77c36db6e10e10e82..7f7de2d060028950de00968556602c9838aa245b 100644 --- a/algo/global/Reco.cxx +++ b/algo/global/Reco.cxx @@ -22,6 +22,7 @@ #include "ca/core/data/CaTrack.h" #include "compat/OpenMP.h" #include "evbuild/Config.h" +#include "kfp/KfpV0FinderChain.h" #include "much/Unpack.h" #include "qa/QaManager.h" #include "qa/hitfind/BmonHitfindQa.h" @@ -275,7 +276,12 @@ void Reco::Init(const Options& opts) fTrackingEvent->RegisterSetup(pTrackingSetup); fTrackingEvent->SetContext(&fContext); fTrackingEvent->Init(); - + + fV0Finder = std::make_unique<V0FinderChain>(); + fV0Finder->SetContext(&fContext); + fV0Finder->Init(); + } + // Initialize the QA manager if (fQaManager != nullptr) { fQaManager->Init(); @@ -575,6 +581,11 @@ bool Reco::ReconstructEvent(const DigiEvent& digiEvent) } } + //* V0-selector + { + auto triggers = fV0Finder->ProcessEvent(recoEvent); + } + fEvSelectingMonitor.IncrementCounter(evselect::ECounter::EventsSelected); return true; } diff --git a/algo/global/Reco.h b/algo/global/Reco.h index 1ab27d58d38cdfbc3da97d6fbcb3d0b9b74a4021..eb8ba804acabac619f33f00f9c84bf5b6074fcee 100644 --- a/algo/global/Reco.h +++ b/algo/global/Reco.h @@ -21,6 +21,7 @@ namespace cbm::algo class HistogramSender; class Options; class TrackingChain; + class V0FinderChain; template<class M> struct UnpackMonitor; @@ -185,6 +186,9 @@ namespace cbm::algo std::unique_ptr<TrackingChain> fTracking; ///< Tracking in timeslice std::unique_ptr<TrackingChain> fTrackingEvent; ///< Tracking in event + // V0-finding + std::unique_ptr<V0FinderChain> fV0Finder; ///< V0-finding chain (in event or a bunch of events) + // Event selection evselect::Monitor fEvSelectingMonitor; ///< Monitor for event selecting diff --git a/algo/kfp/KfpV0Finder.cxx b/algo/kfp/KfpV0Finder.cxx new file mode 100644 index 0000000000000000000000000000000000000000..58ca4293937fe17d28acce2f076541b40eb79c68 --- /dev/null +++ b/algo/kfp/KfpV0Finder.cxx @@ -0,0 +1,25 @@ +/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergei Zharko [committer] */ + +/// \file KfpV0Finder.cxx +/// \date 01.02.2025 +/// \brief A V0 finding algorithm (implementation) +/// \author Sergei Zharko <s.zharko@gsi.de> + +#include "kfp/KfpV0Finder.h" + +using cbm::algo::kfp::V0Finder; + + +// --------------------------------------------------------------------------------------------------------------------- +// +void V0Finder::Init() {} + +// --------------------------------------------------------------------------------------------------------------------- +// +CbmEventTriggers V0Finder::Process(const RecoResults&) +{ + CbmEventTriggers res; + return res; +} diff --git a/algo/kfp/KfpV0Finder.h b/algo/kfp/KfpV0Finder.h new file mode 100644 index 0000000000000000000000000000000000000000..d0a8a451ae92c3031f57cb1508d58c7f754d14b5 --- /dev/null +++ b/algo/kfp/KfpV0Finder.h @@ -0,0 +1,47 @@ +/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergei Zharko [committer] */ + +/// \file KfpV0Finder.h +/// \date 01.02.2025 +/// \brief A V0 finding algorithm +/// \author Sergei Zharko <s.zharko@gsi.de> + +#pragma once + +#include "CbmEventTriggers.h" +#include "global/RecoResults.h" + +namespace cbm::algo::kfp +{ + /// \class V0Finder + /// \brief A V0-finding algorithm + class V0Finder { + public: + /// \brief Default constructor + V0Finder() = default; + + /// \brief Copy constructor + V0Finder(const V0Finder&) = delete; + + /// \brief Move constructor + V0Finder(V0Finder&&) = delete; + + /// \brief Destructor + ~V0Finder() = default; + + /// \brief Copy assignment operator + V0Finder& operator=(const V0Finder&) = delete; + + /// \brief Move assignment operator + V0Finder& operator=(V0Finder&&) = delete; + + /// \brief Initializes the instance (called in the beginning of the run) + void Init(); + + /// \brief Processes a reconstructed data sample, returns a collection of fired triggers + CbmEventTriggers Process(const RecoResults& recoEvent); + + private: + }; +} // namespace cbm::algo::kfp diff --git a/algo/kfp/KfpV0FinderChain.cxx b/algo/kfp/KfpV0FinderChain.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a2a78be1c4679254c29c7a3084902537ce9c8210 --- /dev/null +++ b/algo/kfp/KfpV0FinderChain.cxx @@ -0,0 +1,30 @@ +/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergei Zharko [committer] */ + +/// \file KfpV0FinderChain.cxx +/// \date 01.02.2025 +/// \brief A chain for V0 finding (implementation) +/// \author Sergei Zharko <s.zharko@gsi.de> + +#include "kfp/KfpV0FinderChain.h" + +#include "log/AlgoFairloggerCompat.h" + +using cbm::algo::V0FinderChain; + +// --------------------------------------------------------------------------------------------------------------------- +// +void V0FinderChain::Finalize() {} + +// --------------------------------------------------------------------------------------------------------------------- +// +void V0FinderChain::Init() +{ + L_(info) << "Initializing the V0-finder chain ..."; + L_(info) << "Initializing the V0-finder chain ... done"; +} + +// --------------------------------------------------------------------------------------------------------------------- +// +CbmEventTriggers V0FinderChain::ProcessEvent(const RecoResults& recoEvent) { return fV0Finder.Process(recoEvent); } diff --git a/algo/kfp/KfpV0FinderChain.h b/algo/kfp/KfpV0FinderChain.h new file mode 100644 index 0000000000000000000000000000000000000000..e3582f93167d8c369a738dd9409a3d55c73013a3 --- /dev/null +++ b/algo/kfp/KfpV0FinderChain.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergei Zharko [committer] */ + +/// \file KfpV0FinderChain.h +/// \date 01.02.2025 +/// \brief A chain for V0 finding +/// \author Sergei Zharko <s.zharko@gsi.de> + +#pragma once + +#include "CbmEventTriggers.h" +#include "base/SubChain.h" +#include "global/RecoResults.h" +#include "kfp/KfpV0Finder.h" + +namespace cbm::algo +{ + /// \class V0FinderChain + /// \brief A chain for the V0 finder + class V0FinderChain : public SubChain { + public: + /// \brief Default constructor + V0FinderChain() = default; + + /// \brief Copy constructor + V0FinderChain(const V0FinderChain&) = delete; + + /// \brief Move constructor + V0FinderChain(V0FinderChain&&) = delete; + + /// \brief Destructor + ~V0FinderChain() = default; + + /// \brief Copy assignment operator + V0FinderChain& operator=(const V0FinderChain&) = delete; + + /// \brief Move assignment operator + V0FinderChain& operator=(V0FinderChain&&) = delete; + + /// \brief Finalizes the instance (called in the end of the run) + void Finalize(); + + /// \brief Initializes the instance (called in the beginning of the run) + void Init(); + + /// \brief Processes an event, returns a collection of fired triggers + CbmEventTriggers ProcessEvent(const RecoResults& recoEvent); + + private: + kfp::V0Finder fV0Finder; ///< Instance of the V0-finding algorithm + }; +} // namespace cbm::algo diff --git a/core/data/CbmEventTriggers.h b/core/data/CbmEventTriggers.h index ce1b8de535825650cfb3e6cbf77661bbf44c36c5..365d286e505137cabe5551fe180a53d4a2572318 100644 --- a/core/data/CbmEventTriggers.h +++ b/core/data/CbmEventTriggers.h @@ -9,6 +9,9 @@ #pragma once +#include <cstdint> +#include <string> + #if !defined(NO_ROOT) && !XPU_IS_HIP_CUDA #include <Rtypes.h> // for ClassDef #endif