File indexing completed on 2025-01-18 09:59:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 #ifndef G4THnMessenger_h
0033 #define G4THnMessenger_h 1
0034
0035 #include "G4UImessenger.hh"
0036 #include "globals.hh"
0037
0038 #include <memory>
0039 #include <array>
0040 #include <vector>
0041 #include <string_view>
0042
0043 class G4VAnalysisManager;
0044 class G4UIdirectory;
0045 class G4UIcommand;
0046 struct G4HnDimension;
0047 struct G4HnDimensionInformation;
0048
0049 template <unsigned int DIM, typename HT>
0050 class G4THnToolsManager;
0051
0052 template <unsigned int DIM, typename HT>
0053 class G4THnMessenger : public G4UImessenger
0054 {
0055 public:
0056 G4THnMessenger(G4THnToolsManager<DIM,HT>* manager);
0057 G4THnMessenger() = delete;
0058 ~G4THnMessenger() override = default;
0059
0060
0061 G4String GetCurrentValue(G4UIcommand* command) final;
0062 void SetNewValue(G4UIcommand* command, G4String value) final;
0063
0064 private:
0065
0066 G4String GetObjectType() const;
0067 G4bool IsProfileLastDimension(unsigned int idim) const;
0068 std::unique_ptr<G4UIcommand> CreateCommand(G4String name, G4String guideline);
0069 void CreateDimensionParameters(unsigned int idim,
0070 std::vector<G4UIparameter*>& parameters) const;
0071 void AddIdParameter(G4UIcommand& command);
0072 G4String GetTAddress(G4int id) const;
0073 G4String GetTVectorAddress() const;
0074
0075
0076 void CreateDirectory() const;
0077 void CreateCmd();
0078 void SetCmd();
0079 void DeleteCmd();
0080 std::unique_ptr<G4UIcommand> CreateSetBinsCommand(unsigned int ibin);
0081 void CreateSetTitleCommand();
0082 std::unique_ptr<G4UIcommand> CreateSetAxisCommand(unsigned int ibin);
0083 void CreateListCommand();
0084 void CreateGetCommand();
0085 void CreateGetVectorCommand();
0086
0087
0088 void GetBinData(unsigned int idim, G4int& counter,
0089 const std::vector<G4String>& parameters, G4HnDimension& bins) const;
0090 void GetBinInfoData(unsigned int idim, G4int& counter,
0091 const std::vector<G4String>& parameters, G4HnDimension& bins,
0092 G4HnDimensionInformation& info) const;
0093 void GetData(G4int& counter, const std::vector<G4String>& parameters,
0094 std::array<G4HnDimension, DIM>& bins,
0095 std::array<G4HnDimensionInformation, DIM>& info) const;
0096
0097
0098 static constexpr std::string_view fkClass { "G4THnMessenger" };
0099
0100
0101 G4THnToolsManager<DIM,HT>* fManager { nullptr };
0102
0103 std::unique_ptr<G4UIcommand> fCreateCmd;
0104 std::unique_ptr<G4UIcommand> fSetCmd;
0105 std::unique_ptr<G4UIcommand> fDeleteCmd;
0106 std::array<std::unique_ptr<G4UIcommand>, DIM> fSetDimensionCmd;
0107 std::unique_ptr<G4UIcommand> fSetTitleCmd;
0108 std::array<std::unique_ptr<G4UIcommand>, DIM+1> fSetAxisCmd;
0109 std::unique_ptr<G4UIcommand> fListCmd;
0110 std::unique_ptr<G4UIcommand> fGetTCmd;
0111 std::unique_ptr<G4UIcommand> fGetTVectorCmd;
0112
0113 std::array<unsigned int, DIM> fTmpId;
0114 std::array<G4HnDimension, DIM> fTmpBins;
0115 std::array<G4HnDimensionInformation, DIM> fTmpInfo;
0116
0117 G4String fTValue;
0118 G4String fTVectorValue;
0119 };
0120
0121
0122
0123
0124 #endif