Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:27

0001 #ifndef TRIGGER_MINBIASCLASSIFIER_H
0002 #define TRIGGER_MINBIASCLASSIFIER_H
0003 
0004 #include <fun4all/SubsysReco.h>
0005 #include <array>
0006 #include <limits>
0007 #include <string>  // for allocator, string
0008 #include <utility>
0009 #include <vector>
0010 
0011 // Forward declarations
0012 
0013 class MinimumBiasInfo;
0014 class PHCompositeNode;
0015 class Zdcinfo;
0016 class MbdPmtContainer;
0017 class MbdPmtHit;
0018 class GlobalVertexMap;
0019 
0020 class MinimumBiasClassifier : public SubsysReco
0021 {
0022  public:
0023   //! constructor
0024   explicit MinimumBiasClassifier(const std::string &name = "MinimumBiasClassifier");
0025 
0026   //! destructor
0027 
0028   ~MinimumBiasClassifier() override = default;
0029 
0030   int InitRun(PHCompositeNode *) override;
0031   static void CreateNodes(PHCompositeNode *);
0032   int GetNodes(PHCompositeNode *);
0033 
0034   //! event processing method
0035   int process_event(PHCompositeNode *) override;
0036   //! end of run method
0037 
0038   int ResetEvent(PHCompositeNode *) override;
0039 
0040   int FillMinimumBiasInfo();
0041 
0042   bool passesHitCut(MbdPmtHit *hit) const;
0043 
0044   int Download_centralityScale(const std::string &dbfile);
0045   int Download_centralityVertexScales(const std::string &dbfile);
0046 
0047   void setOverwriteScale(const std::string &url)
0048   {
0049     m_overwrite_url_scale = url;
0050     m_overwrite_scale = true;
0051   }
0052   void setOverwriteVtx(const std::string &url)
0053   {
0054     m_overwrite_url_vtx = url;
0055     m_overwrite_vtx = true;
0056   }
0057   void setIsSim(const bool sim) { m_issim = sim; }
0058 
0059  private:
0060   bool m_issim{false};
0061   float getVertexScale();
0062   std::string m_dbfilename;
0063 
0064   bool m_overwrite_scale{false};
0065   bool m_overwrite_vtx{false};
0066   std::string m_overwrite_url_scale{""};
0067   std::string m_overwrite_url_vtx{""};
0068 
0069   const float m_z_vtx_cut{60.};
0070   const float m_mbd_north_cut{10.};
0071   const float m_mbd_south_cut{150};
0072   const float m_mbd_charge_cut{0.5};
0073   const float m_mbd_time_cut{25.};
0074   //  const int m_mbd_tube_cut{2};
0075   const float m_zdc_cut{60.};
0076 
0077   MinimumBiasInfo *m_mb_info{nullptr};
0078   MbdPmtContainer *m_mbd_container{nullptr};
0079   MbdPmtHit *m_mbd_pmt{nullptr};
0080   GlobalVertexMap *m_global_vertex_map{nullptr};
0081   Zdcinfo *m_zdcinfo{nullptr};
0082 
0083   std::array<float, 2> m_zdc_energy_sum{};
0084   std::array<float, 2> m_mbd_charge_sum{};
0085   std::array<int, 2> m_mbd_hit{};
0086 
0087   double m_centrality_scale{std::numeric_limits<double>::quiet_NaN()};
0088   double m_vertex_scale{std::numeric_limits<double>::quiet_NaN()};
0089   float m_vertex{std::numeric_limits<float>::quiet_NaN()};
0090   std::vector<std::pair<std::pair<float, float>, float>> m_vertex_scales{};
0091 };
0092 
0093 #endif