Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:37

0001 #ifndef TRIGGER_CALOTRIGGERSIM_H
0002 #define TRIGGER_CALOTRIGGERSIM_H
0003 
0004 //===========================================================
0005 /// \file CaloTriggerSim.h
0006 /// \brief simple trigger emulation
0007 /// \author Dennis V. Perepelitsa
0008 //===========================================================
0009 
0010 // sPHENIX includes
0011 #include <fun4all/SubsysReco.h>
0012 
0013 // standard includes
0014 #include <cmath>
0015 #include <limits>
0016 #include <string>
0017 #include <vector>
0018 
0019 // forward declarations
0020 class PHCompositeNode;
0021 
0022 /// \class CaloTriggerSim
0023 ///
0024 /// \brief simple trigger emulation
0025 ///
0026 /// This module constructs calo-based trigger signatures
0027 ///
0028 class CaloTriggerSim : public SubsysReco
0029 {
0030  public:
0031   CaloTriggerSim(const std::string &name = "CaloTriggerSim");
0032   ~CaloTriggerSim() override {}
0033 
0034   int InitRun(PHCompositeNode *topNode) override;
0035   int process_event(PHCompositeNode *topNode) override;
0036 
0037   void set_truncation(const int emulate_truncation) { m_EmulateTruncationFlag = emulate_truncation; }
0038   static double truncate_8bit(const double raw_E);
0039 
0040  private:
0041   int CreateNode(PHCompositeNode *topNode) const;
0042   void FillNode(PHCompositeNode *topNode) const;
0043 
0044   int m_EmulateTruncationFlag{0};
0045 
0046   int m_EMCAL_1x1_NETA{-1};
0047   int m_EMCAL_1x1_NPHI{-1};
0048 
0049   std::vector<double>::size_type m_EMCAL_2x2_NETA{std::numeric_limits<std::vector<double>::size_type>::max()};
0050   std::vector<double>::size_type m_EMCAL_2x2_NPHI{std::numeric_limits<std::vector<double>::size_type>::max()};
0051 
0052   int m_EMCAL_4x4_NETA{-1};
0053   int m_EMCAL_4x4_NPHI{-1};
0054 
0055   float m_EMCAL_2x2_BEST_E{0.};
0056   float m_EMCAL_2x2_BEST_PHI{0.};
0057   float m_EMCAL_2x2_BEST_ETA{0.};
0058 
0059   float m_EMCAL_4x4_BEST_E{0.};
0060   float m_EMCAL_4x4_BEST_PHI{0.};
0061   float m_EMCAL_4x4_BEST_ETA{0.};
0062 
0063   float m_EMCAL_4x4_BEST2_E{0.};
0064   float m_EMCAL_4x4_BEST2_PHI{0.};
0065   float m_EMCAL_4x4_BEST2_ETA{0.};
0066 
0067   // needed since phi ranges are potentially different in EMCal vs. HCal
0068   float m_FULLCALO_PHI_START{0.};
0069   float m_FULLCALO_PHI_END{2 * M_PI};
0070 
0071   // full calo (based on 0.1x0.1 HCal towers) limits and maps
0072   int m_FULLCALO_0p1x0p1_NETA{-1};
0073   int m_FULLCALO_0p1x0p1_NPHI{-1};
0074 
0075   std::vector<double>::size_type m_FULLCALO_0p2x0p2_NETA{std::numeric_limits<std::vector<double>::size_type>::max()};
0076   std::vector<double>::size_type m_FULLCALO_0p2x0p2_NPHI{std::numeric_limits<std::vector<double>::size_type>::max()};
0077 
0078   int m_FULLCALO_0p4x0p4_NETA{-1};
0079   int m_FULLCALO_0p4x0p4_NPHI{-1};
0080 
0081   int m_FULLCALO_0p6x0p6_NETA{-1};
0082   int m_FULLCALO_0p6x0p6_NPHI{-1};
0083 
0084   int m_FULLCALO_0p8x0p8_NETA{-1};
0085   int m_FULLCALO_0p8x0p8_NPHI{-1};
0086 
0087   int m_FULLCALO_1p0x1p0_NETA{-1};
0088   int m_FULLCALO_1p0x1p0_NPHI{-1};
0089 
0090   // highest full calo window energies
0091   float m_FULLCALO_0p2x0p2_BEST_E{0.};
0092   float m_FULLCALO_0p2x0p2_BEST_PHI{0.};
0093   float m_FULLCALO_0p2x0p2_BEST_ETA{0.};
0094 
0095   float m_FULLCALO_0p4x0p4_BEST_E{0.};
0096   float m_FULLCALO_0p4x0p4_BEST_PHI{0.};
0097   float m_FULLCALO_0p4x0p4_BEST_ETA{0.};
0098 
0099   float m_FULLCALO_0p6x0p6_BEST_E{0.};
0100   float m_FULLCALO_0p6x0p6_BEST_PHI{0.};
0101   float m_FULLCALO_0p6x0p6_BEST_ETA{0.};
0102 
0103   float m_FULLCALO_0p8x0p8_BEST_E{0.};
0104   float m_FULLCALO_0p8x0p8_BEST_PHI{0.};
0105   float m_FULLCALO_0p8x0p8_BEST_ETA{0.};
0106 
0107   float m_FULLCALO_1p0x1p0_BEST_E{0.};
0108   float m_FULLCALO_1p0x1p0_BEST_PHI{0.};
0109   float m_FULLCALO_1p0x1p0_BEST_ETA{0.};
0110 
0111   std::vector<std::vector<double> > m_EMCAL_1x1_MAP;
0112   std::vector<std::vector<double> > m_EMCAL_2x2_MAP;
0113   std::vector<std::vector<double> > m_EMCAL_4x4_MAP;
0114   std::vector<std::vector<double> > m_FULLCALO_0p1x0p1_MAP;
0115   std::vector<std::vector<double> > m_FULLCALO_0p2x0p2_MAP;
0116   std::vector<std::vector<double> > m_FULLCALO_0p4x0p4_MAP;
0117   std::vector<std::vector<double> > m_FULLCALO_0p6x0p6_MAP;
0118   std::vector<std::vector<double> > m_FULLCALO_0p8x0p8_MAP;
0119   std::vector<std::vector<double> > m_FULLCALO_1p0x1p0_MAP;
0120 };
0121 
0122 #endif  // TRIGGER_CALOTRIGGERSIM_H