Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-04-06 08:13:10

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef CALOSTATUSSKIMMER_H
0004 #define CALOSTATUSSKIMMER_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <cstdint>
0009 #include <limits>
0010 #include <string>
0011 #include <utility>
0012 
0013 class PHCompositeNode;
0014 
0015 class CaloStatusSkimmer : public SubsysReco {
0016 public:
0017   CaloStatusSkimmer(const std::string &name = "CaloStatusSkimmer");
0018 
0019   ~CaloStatusSkimmer() override = default;
0020 
0021   /** Called for each event.
0022       This is where you do the real work.
0023    */
0024   int process_event(PHCompositeNode *topNode) override;
0025 
0026   /// Called at the end of all processing.
0027   int End(PHCompositeNode *topNode) override;
0028 
0029   void do_skim_EMCal( uint16_t threshold) {
0030     m_EMC_skim_threshold = threshold;
0031   }
0032 
0033   void do_skim_HCal( uint16_t threshold) {
0034     m_HCal_skim_threshold = threshold;
0035   }
0036 
0037   void do_skim_sEPD( uint16_t threshold) {
0038     m_sEPD_skim_threshold = threshold;
0039   }
0040 
0041   void do_skim_ZDC( uint16_t threshold) {
0042     m_ZDC_skim_threshold = threshold;
0043   }
0044 
0045 private:
0046   uint32_t n_eventcounter{0};
0047   uint32_t n_skimcounter{0};
0048   uint32_t n_notowernodecounter{0};
0049 
0050   // If the threshold is set to 0, then the skimming for that subsystem is disabled. If threshold is > 0, then the event is skimmed if nchannels >= threshold not-instrumented (empty/missing packet) channels in that subsystem.
0051   uint16_t m_EMC_skim_threshold{192}; 
0052   // skim if nchannels >= this many not-instrumented (empty/missing packet) channels in EMCal
0053 
0054   uint16_t m_HCal_skim_threshold{192}; 
0055   // skim if nchannels >= this many not-instrumented (empty/missing packet) channels in HCal
0056 
0057   uint16_t m_sEPD_skim_threshold{1}; 
0058   // skim if nchannels >= this many not-instrumented (empty/missing packet) channels in sEPD
0059 
0060   uint16_t m_ZDC_skim_threshold{1}; 
0061   // skim if nchannels >= this many not-instrumented (empty/missing packet) channels in ZDC
0062 };
0063 
0064 #endif // CALOSTATUSSKIMMER_H