Skip to content
Snippets Groups Projects
Select Git revision
  • f14138c2466839ba178caab380a84738c4a1c8a9
  • master default protected
  • nightly_master
  • online_much_readconf_cleanup protected
  • online_mvd_readconf_cleanup protected
  • jul25_patches
  • cleanup_rich_v25a
  • jul24_patches
  • nov23_patches
  • DC_2404
  • nighly_master
  • DC_Jan24
  • DC_Nov23
  • DC_Oct23
  • feb23_patches
  • L1Algo-dev9
  • dec21_patches protected
  • apr21_patches protected
  • dev_2025_45
  • dev_2025_44
  • dev_2025_43
  • dev_2025_42
  • dev_2025_41
  • dev_2025_40
  • dev_2025_39
  • dev_2025_38
  • dev_2025_37
  • dev_2025_36
  • dev_2025_35
  • dev_2025_34
  • dev_2025_33
  • dev_2025_32
  • dev_2025_31
  • dev_2025_30
  • RC_jul25
  • dev_2025_29
  • dev_2025_28
  • dev_2025_27
38 results

TimeClusterTrigger.h

Blame
  • TimeClusterTrigger.h 1.37 KiB
    /* Copyright (C) 2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
       SPDX-License-Identifier: GPL-3.0-only
       Authors: Volker Friese [committer], Dominik Smith */
    
    #ifndef CBM_ALGO_TIMECLUSTERTRIGGER_H
    #define CBM_ALGO_TIMECLUSTERTRIGGER_H 1
    
    
    #include <cstdint>
    #include <vector>
    
    namespace cbm::algo
    {
    
      /** @class TimeClusterTrigger
       ** @author Volker Friese <v.friese@gsi.de>
       ** @author Dominik Smith <d.smith@gsi.de>
       ** @since 2021
       ** @brief Finds clusters in time-series data
       **
       ** A trigger is generated when the number density of data exceeds a given threshold. Each datum
       ** can contribute to only one trigger. Consecutive triggers are separated by at least the dead time.
       **
       ** The input vector must be sorted, otherwise the behaviour is undefined.
       **/
      class TimeClusterTrigger {
    
      public:
        /** @brief Execution
         ** @param  dataVec     Source data vector
         ** @param  winSize     Size of trigger window
         ** @param  minNumData  Threshold on number of data within the trigger window
         ** @param  deadTime    Minimum time between two triggers
         ** @return Vector of trigger times
         **/
        std::vector<double> operator()(const std::vector<double>& dataVec, double winSize, int32_t minNumData,
                                       double deadTime) const;
      };
    
    
    }  // namespace cbm::algo
    
    #endif /* CBM_ALGO_TIMECLUSTERTRIGGER_H */