Import Geant4 11.1.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2022-07-01 10:44:02 +02:00
parent b3bf75a2a1
commit c07cea1fe0
2172 changed files with 183300 additions and 123938 deletions
@@ -54,9 +54,13 @@ class G4ToolsAnalysisMessenger : public G4UImessenger
// Methods
template <typename HT>
G4String GetHnAddress(G4int id, G4THnManager<HT>* htManager) const;
template <typename HT>
G4String GetHnVectorAddress(G4THnManager<HT>* htManager) const;
// Data members
G4ToolsAnalysisManager* fManager; ///< Associated class
// analysis/hn|pn/get command
std::unique_ptr<G4UIcommand> fGetH1Cmd;
std::unique_ptr<G4UIcommand> fGetH2Cmd;
std::unique_ptr<G4UIcommand> fGetH3Cmd;
@@ -67,6 +71,18 @@ class G4ToolsAnalysisMessenger : public G4UImessenger
G4String fH3Value;
G4String fP1Value;
G4String fP2Value;
// analysis/hn|pn/getVector command
std::unique_ptr<G4UIcommand> fGetH1VectorCmd;
std::unique_ptr<G4UIcommand> fGetH2VectorCmd;
std::unique_ptr<G4UIcommand> fGetH3VectorCmd;
std::unique_ptr<G4UIcommand> fGetP1VectorCmd;
std::unique_ptr<G4UIcommand> fGetP2VectorCmd;
G4String fH1VectorValue;
G4String fH2VectorValue;
G4String fH3VectorValue;
G4String fP1VectorValue;
G4String fP2VectorValue;
};
// inline functions
@@ -85,4 +101,18 @@ G4String G4ToolsAnalysisMessenger::GetHnAddress(
return G4String();
}
template <typename HT>
inline
G4String G4ToolsAnalysisMessenger::GetHnVectorAddress(
G4THnManager<HT>* htManager) const
{
auto htVector = htManager->GetTVector();
if ( htVector != nullptr ) {
std::ostringstream os;
os << static_cast<void*>(htVector);
return os.str();
}
return G4String();
}
#endif
@@ -44,18 +44,23 @@ G4ToolsAnalysisMessenger::G4ToolsAnalysisMessenger(G4ToolsAnalysisManager* manag
// Create get commands
G4AnalysisMessengerHelper helper("h1");
fGetH1Cmd = helper.CreateGetCommand(this);
fGetH1VectorCmd = helper.CreateGetVectorCommand(this);
helper.SetHnType("h2");
fGetH2Cmd = helper.CreateGetCommand(this);
fGetH2VectorCmd = helper.CreateGetVectorCommand(this);
helper.SetHnType("h3");
fGetH3Cmd = helper.CreateGetCommand(this);
fGetH3VectorCmd = helper.CreateGetVectorCommand(this);
helper.SetHnType("p1");
fGetP1Cmd = helper.CreateGetCommand(this);
fGetP1VectorCmd = helper.CreateGetVectorCommand(this);
helper.SetHnType("p2");
fGetP2Cmd = helper.CreateGetCommand(this);
fGetP2VectorCmd = helper.CreateGetVectorCommand(this);
}
//_____________________________________________________________________________
@@ -73,6 +78,13 @@ G4String G4ToolsAnalysisMessenger::GetCurrentValue (G4UIcommand* command)
if ( command == fGetH3Cmd.get() ) return fH3Value;
if ( command == fGetP1Cmd.get() ) return fP1Value;
if ( command == fGetP2Cmd.get() ) return fP2Value;
if ( command == fGetH1VectorCmd.get() ) return fH1VectorValue;
if ( command == fGetH2VectorCmd.get() ) return fH2VectorValue;
if ( command == fGetH3VectorCmd.get() ) return fH3VectorValue;
if ( command == fGetP1VectorCmd.get() ) return fP1VectorValue;
if ( command == fGetP2VectorCmd.get() ) return fP2VectorValue;
return "";
}
@@ -95,4 +107,19 @@ void G4ToolsAnalysisMessenger::SetNewValue(G4UIcommand* command, G4String value)
else if ( command == fGetP2Cmd.get() ) {
fP2Value = GetHnAddress(id, fManager->fP2Manager);
}
if ( command == fGetH1VectorCmd.get() ) {
fH1VectorValue = GetHnVectorAddress(fManager->fH1Manager);
}
else if ( command == fGetH2VectorCmd.get() ) {
fH2VectorValue = GetHnVectorAddress(fManager->fH2Manager);
}
else if ( command == fGetH3VectorCmd.get() ) {
fH3VectorValue = GetHnVectorAddress(fManager->fH3Manager);
}
else if ( command == fGetP1VectorCmd.get() ) {
fP1VectorValue = GetHnVectorAddress(fManager->fP1Manager);
}
else if ( command == fGetP2VectorCmd.get() ) {
fP2VectorValue = GetHnVectorAddress(fManager->fP2Manager);
}
}