Skip to content
Snippets Groups Projects
Select Git revision
  • must_firstversion
  • master default protected
  • fix_2138
  • must_simulation
  • ot_firstversion
  • nightly_master
  • jul24_patches
  • nov23_patches
  • DC_2404
  • nighly_master
  • DC_Jan24
  • DC_Nov23
  • DC_Oct23
  • feb23_patches
  • L1Algo-dev9
  • dec21_patches
  • apr21_patches
  • dev_2024_47
  • JUL24
  • dev_2024_46
  • dev_2024_45
  • dev_2024_44
  • dev_2024_43
  • dev_2024_42
  • dev_2024_41
  • dev_2024_40
  • dev_2024_39
  • dev_2024_38
  • dev_2024_37
  • dev_2024_36
  • dev_2024_35
  • dev_2024_34
  • dev_2024_33
  • dev_2024_32
  • dev_2024_31
  • dev_2024_29
  • RC5_nov23
37 results

CiDescription.md

Blame
  • Forked from Computing / cbmroot
    Source project has a limited visibility.
    TrackingChain.h 3.89 KiB
    /* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
       SPDX-License-Identifier: GPL-3.0-only
       Authors: Sergei Zharko [committer] */
    
    /// \file   TrackingChain.h
    /// \date   13.09.2023
    /// \brief  A chain class to execute CA tracking algorithm in online reconstruction (header)
    /// \author S.Zharko <s.zharko@gsi.de>
    
    #pragma once
    
    #include "CaDataManager.h"
    #include "CaFramework.h"
    #include "CaInputQa.h"
    #include "CaOutputQa.h"
    #include "CaTrack.h"
    #include "CaTrackingMonitor.h"
    #include "CaVector.h"
    #include "HistogramSender.h"
    #include "PartitionedSpan.h"
    #include "RecoResults.h"
    #include "SubChain.h"
    #include "TrackingDefs.h"
    #include "sts/Hit.h"
    #include "tof/Hit.h"
    
    #include <memory>
    #include <vector>
    
    namespace cbm::algo
    {
      /// \class cbm::algo::TrackingChain
      /// \brief A chain for tracking algorithm
      ///
      /// The class executes a tracking algorithm in the online data reconstruction chain.
      class TrackingChain : public SubChain {
       public:
        /// \brief Constructor from parameters
        /// \param histoSender  A shared pointer to a histogram sender
        TrackingChain(std::shared_ptr<HistogramSender> histoSender = nullptr);
    
        /// \struct Input_t
        /// \brief  Input to the TrackingChain
        struct Input_t {
          PartitionedSpan<sts::Hit> stsHits;
          PartitionedSpan<tof::Hit> tofHits;
        };
    
        /// \struct Output_t
        /// \brief  Output from the TrackingChain
        struct Output_t {
          /// \brief Reconstructed tracks
          ca::Vector<ca::Track> tracks;
    
          /// \brief STS hit indices
          /// \note  Indexing: [trackID][localHit], value: (partitionID, hitIDinPartition)
          ca::Vector<std::vector<std::pair<uint32_t, uint32_t>>> stsHitIndices;
    
          /// \brief TOF hit indices
          /// \note  Indexing: [trackID][localHit], value: (partitionID, hitIDinPartition)
          ca::Vector<std::vector<std::pair<uint32_t, uint32_t>>> tofHitIndices;
    
          /// \brief Monitor data
          ca::TrackingMonitorData monitorData;
        };
    
        /// \brief  Gets internal monitor
        const ca::TrackingMonitor& GetCaMonitor() const { return fCaMonitor; }
    
        /// \brief  Provides action in the initialization of the run
        void Init();
    
        /// \brief  Provides action for a given time-slice
        /// \param  recoResults  Structure of reconstruction results
        /// \return A pair (vector of tracks, tracking monitor)
        Output_t Run(Input_t recoResults);
    
        /// \brief  Provides action in the end of the run
        void Finalize();
    
       private:
        // *********************
        // **  Utility functions
    
        /// \brief  Prepares input data
        /// \param  recoResults  Structure of reconstruction results
        void PrepareInput(Input_t recoResults);
    
        /// \brief  Prepares output data
        Output_t PrepareOutput();
    
        /// \brief  Reads from different detector subsystems
        /// \tparam DetID Detector ID
        /// \param  hits  Hits vector
        template<ca::EDetectorID DetID>
        void ReadHits(PartitionedSpan<const ca::HitTypes_t::at<DetID>> hits);
    
        // *************************
        // **  Framework variables
    
        ca::TrackingMonitor fCaMonitor{};              ///< CA internal monitor (debug purposes)
        ca::TrackingMonitorData fCaMonitorData{};      ///< CA monitor data object
        ca::Framework fCaFramework{};                  ///< CA framework instance
        ca::DataManager fCaDataManager{};              ///< CA data manager
    
        ca::InputQa fInputQa;    ///< CA input QA builder
        ca::OutputQa fOutputQa;  ///< CA output QA builder
    
        // ************************
        // **  Auxilary variables
    
        ca::HitKeyIndex_t fNofHitKeys = 0;  ///< Current number of hit keys (aux)
    
        /// \brief External indices of used hits
        /// \note  Indexing: [globalHitID], value: (DetID, partitionID, hitID)
        ca::Vector<std::tuple<ca::EDetectorID, uint32_t, uint32_t>> faHitExternalIndices{"faHitExternalIndices"};
    
        static constexpr bool kDEBUG = false;  ///< Debug mode
      };
    
    
    }  // namespace cbm::algo