Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef SEPDEVENTPLANECALIB_QVECDEFS_H
0002 #define SEPDEVENTPLANECALIB_QVECDEFS_H
0003 
0004 #include <array>
0005 #include <string>
0006 #include <format>
0007 #include <vector>
0008 
0009 namespace QVecShared
0010 {
0011   static constexpr size_t CENT_BINS = 80;
0012   static constexpr std::array<int, 3> HARMONICS = {2, 3, 4};
0013   static constexpr int SEPD_CHANNELS = 744;
0014 
0015   enum class ChannelStatus : int
0016   {
0017     Good = 0,
0018     Dead = 1,
0019     Hot = 2,
0020     Cold = 3
0021   };
0022 
0023   enum class Subdetector : size_t
0024   {
0025     S = 0,
0026     N = 1,
0027     NS = 2,
0028     Count = 3
0029   };
0030 
0031   enum class QComponent
0032   {
0033     X,
0034     Y
0035   };
0036 
0037   struct QVec
0038   {
0039     double x{0.0};
0040     double y{0.0};
0041   };
0042 
0043  /**
0044    * @brief Centralized helper to generate standard histogram names for the sEPD calibration.
0045    * * Standardizes the naming convention: h_sEPD_Q_{det}_{var}_{n}{suffix}_avg
0046    * * @param det The detector arm ("S" for South, "N" for North).
0047    * @param var The physics variable or moment (e.g., "x", "y", "xx", "xy").
0048    * @param n The harmonic order (e.g., 2, 3, 4).
0049    * @param suffix Optional pass-specific suffix (e.g., "_corr", "_corr2").
0050    * @return A formatted std::string representing the ROOT histogram name.
0051    */
0052   inline std::string get_hist_name(const std::string& det, const std::string& var, int n, const std::string& suffix = "")
0053   {
0054     return std::format("h_sEPD_Q_{}_{}_{}{}_avg", det, var, n, suffix);
0055   }
0056 }  // namespace QVecShared
0057 
0058 #endif // SEPDEVENTPLANECALIB_QVECDEFS_H