File indexing completed on 2025-08-05 08:16:53
0001 #ifndef TPC_TPCLOADDISTORTIONCORRECTION_H
0002 #define TPC_TPCLOADDISTORTIONCORRECTION_H
0003
0004
0005
0006
0007
0008
0009
0010 #include <fun4all/SubsysReco.h>
0011 #include <phool/PHObject.h>
0012 #include <phool/PHTimer.h>
0013 #include <trackbase/TrkrDefs.h>
0014
0015 #include <array>
0016
0017 class TH3;
0018
0019 class TpcLoadDistortionCorrection : public SubsysReco
0020 {
0021 public:
0022
0023 TpcLoadDistortionCorrection(const std::string& = "TpcLoadDistortionCorrection");
0024
0025
0026 int InitRun(PHCompositeNode*) override;
0027
0028
0029 int process_event(PHCompositeNode*) override;
0030
0031
0032 enum DistortionType:int
0033 {
0034 DistortionType_Static = 0,
0035 DistortionType_Average = 1,
0036 DistortionType_Fluctuation = 2,
0037 DistortionType_ModuleEdge = 3
0038 };
0039
0040 static constexpr int nDistortionTypes = 4;
0041
0042
0043 void set_correction_filename(DistortionType i, const std::string& value)
0044 {
0045 if (i < 0 || i >= nDistortionTypes) return;
0046 m_correction_filename[i] = value;
0047 m_correction_in_use[i] = true;
0048 }
0049
0050
0051 void set_scale_factor(DistortionType i, float value)
0052 {
0053 m_use_scalefactor[i] = true;
0054 m_scalefactor[i] = value;
0055 }
0056
0057
0058 void set_read_phi_as_radians(bool flag)
0059 {
0060 m_phi_hist_in_radians[0] = flag;
0061 }
0062 void set_read_phi_as_radians(int i, bool flag)
0063 {
0064 m_phi_hist_in_radians[i] = flag;
0065 }
0066
0067
0068
0069 void set_interpolate_2D_to_zero(bool flag)
0070 {
0071 m_interpolate_z[0] = flag;
0072 }
0073 void set_interpolate_2D_to_zero(int i, bool flag)
0074 {
0075 m_interpolate_z[i] = flag;
0076 }
0077
0078
0079 void set_node_name(const std::string& value)
0080 {
0081 m_node_name[0] = value;
0082 }
0083 void set_node_name(int i, const std::string& value)
0084 {
0085 m_node_name[i] = value;
0086 }
0087
0088 private:
0089
0090
0091 std::array<std::string,nDistortionTypes> m_correction_filename = {};
0092
0093
0094 std::array<bool,nDistortionTypes> m_correction_in_use = {};
0095
0096
0097 std::array<bool,nDistortionTypes> m_use_scalefactor = {};
0098
0099
0100 std::array<float,nDistortionTypes> m_scalefactor = {1.0,1.0,1.0,1.0};
0101
0102
0103 std::array<bool,nDistortionTypes> m_phi_hist_in_radians = {true,true,true,true};
0104
0105
0106 std::array<bool,nDistortionTypes> m_interpolate_z = {true,true,true,true};
0107
0108
0109 std::array<std::string,nDistortionTypes> m_node_name = {"TpcDistortionCorrectionContainerStatic", "TpcDistortionCorrectionContainerAverage", "TpcDistortionCorrectionContainerFluctuation","TpcDistortionCorrectionContainerModuleEdge"};
0110 };
0111
0112 #endif