Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:14:09

0001 /// ===========================================================================
0002 /*! \file    StreakSidebandFilter.h
0003  *  \authors Hanpu Jiang, Derek Anderson
0004  *  \date    11.01.2024
0005  *
0006  *  Part of the BeamBackgroundFilterAndQA module, this
0007  *  filter returns true if event contains a "streaK"
0008  *  as defined by Hanpu Jiang's streak identification
0009  *  algorithm.
0010  */
0011 /// ===========================================================================
0012 
0013 #ifndef STREAKSIDEBANDFILTER_H
0014 #define STREAKSIDEBANDFILTER_H
0015 
0016 // module components
0017 #include "BaseBeamBackgroundFilter.h"
0018 #include "BeamBackgroundFilterAndQADefs.h"
0019 
0020 // c++ utilities
0021 #include <array>
0022 #include <cstddef>
0023 #include <cstdint>
0024 #include <string>
0025 
0026 // forward declarations
0027 class PHCompositeNode;
0028 class TowerInfoContainer;
0029 
0030 // ============================================================================
0031 //! Identify streaks via sidebands
0032 // ============================================================================
0033 /*! A beam background filter which identifies streaks
0034  *  in the OHCal by comparing streak candidates vs.
0035  *  their sidebands, i.e. adjacent phi slices.
0036  */
0037 class StreakSidebandFilter : public BaseBeamBackgroundFilter
0038 {
0039  public:
0040   // ========================================================================
0041   //! User options for filter
0042   // ========================================================================
0043   struct Config
0044   {
0045     int verbosity{0};
0046     bool debug{true};
0047     float minStreakTwrEne{0.6};
0048     float maxAdjacentTwrEne{0.06};
0049     uint32_t minNumTwrsInStreak{5};
0050     std::string inNodeName{"TOWERINFO_CALIB_HCALOUT"};
0051   };
0052 
0053   // ctor/dtor
0054   StreakSidebandFilter(const std::string& name = "StreakSideband");
0055   StreakSidebandFilter(const Config& cfg, const std::string& name = "StreakSideband");
0056   virtual ~StreakSidebandFilter() = default;
0057 
0058   // inherited methods
0059   bool ApplyFilter(PHCompositeNode* topNode) override;
0060   void BuildHistograms(const std::string& module, const std::string& tag = "") override;
0061 
0062  private:
0063   // inherited methods
0064   void GrabNodes(PHCompositeNode* topNode) override;
0065 
0066   // filter-specific methods
0067   bool IsTowerNotStreaky(const BeamBackgroundFilterAndQADefs::Tower& tower);
0068   bool IsNeighborNotStreaky(const BeamBackgroundFilterAndQADefs::Tower& tower);
0069 
0070   ///! input node
0071   TowerInfoContainer* m_ohContainer{nullptr};
0072 
0073   ///! no. of streaks per event in ohcal
0074   std::array<std::size_t, 64> m_ohNumStreak{};
0075 
0076   ///! tower info (eta, phi) map
0077   BeamBackgroundFilterAndQADefs::OHCalMap m_ohMap;
0078 
0079   ///! configuration
0080   Config m_config;
0081 
0082 };  // end StreakSidebandFilter
0083 
0084 #endif
0085 
0086 // end ========================================================================