Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FileMessenger Class Reference

#include <G4FileMessenger.hh>

+ Inheritance diagram for G4FileMessenger:

Public Member Functions

 G4FileMessenger (G4VAnalysisManager *manager)
 
virtual ~G4FileMessenger ()
 
virtual void SetNewValue (G4UIcommand *command, G4String value) final
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool operator!= (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Public Attributes

G4VAnalysisManagerfManager
 Associated class.
 
std::unique_ptr< G4UIcmdWithAStringfSetFileNameCmd
 
std::unique_ptr< G4UIcmdWithAStringfSetHistoDirNameCmd
 
std::unique_ptr< G4UIcmdWithAStringfSetNtupleDirNameCmd
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4long StoL (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Detailed Description

Definition at line 47 of file G4FileMessenger.hh.

Constructor & Destructor Documentation

◆ G4FileMessenger()

G4FileMessenger::G4FileMessenger ( G4VAnalysisManager manager)
explicit

Definition at line 39 of file G4FileMessenger.cc.

40 : G4UImessenger(),
41 fManager(manager),
42 fSetFileNameCmd(nullptr),
43 fSetHistoDirNameCmd(nullptr),
45{
46 fSetFileNameCmd = G4Analysis::make_unique<G4UIcmdWithAString>("/analysis/setFileName",this);
47 fSetFileNameCmd->SetGuidance("Set name for the histograms & ntuple file");
48 fSetFileNameCmd->SetParameterName("Filename", false);
49 fSetFileNameCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
50
51 fSetHistoDirNameCmd = G4Analysis::make_unique<G4UIcmdWithAString>("/analysis/setHistoDirName",this);
52 fSetHistoDirNameCmd->SetGuidance("Set name for the histograms directory");
53 fSetHistoDirNameCmd->SetParameterName("HistoDirName", false);
55
56 fSetNtupleDirNameCmd = G4Analysis::make_unique<G4UIcmdWithAString>("/analysis/setNtupleDirName",this);
57 fSetNtupleDirNameCmd->SetGuidance("Set name for the ntuple directory");
58 fSetNtupleDirNameCmd->SetParameterName("NtupleDirName", false);
60}
@ G4State_Idle
@ G4State_PreInit
std::unique_ptr< G4UIcmdWithAString > fSetNtupleDirNameCmd
std::unique_ptr< G4UIcmdWithAString > fSetHistoDirNameCmd
std::unique_ptr< G4UIcmdWithAString > fSetFileNameCmd
G4VAnalysisManager * fManager
Associated class.

◆ ~G4FileMessenger()

G4FileMessenger::~G4FileMessenger ( )
virtual

Definition at line 63 of file G4FileMessenger.cc.

64{}

Member Function Documentation

◆ SetNewValue()

void G4FileMessenger::SetNewValue ( G4UIcommand command,
G4String  value 
)
finalvirtual

Reimplemented from G4UImessenger.

Definition at line 70 of file G4FileMessenger.cc.

71{
72 if ( command == fSetFileNameCmd.get() ) {
73 G4cout << "Set file name: " << newValues << G4endl;
74 fManager->SetFileName(newValues);
75 }
76 else if ( command == fSetHistoDirNameCmd.get() ) {
78 }
79 else if ( command == fSetNtupleDirNameCmd.get() ) {
81 }
82}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4bool SetHistoDirectoryName(const G4String &dirName)
G4bool SetFileName(const G4String &fileName)
G4bool SetNtupleDirectoryName(const G4String &dirName)

Member Data Documentation

◆ fManager

G4VAnalysisManager* G4FileMessenger::fManager

Associated class.

Definition at line 56 of file G4FileMessenger.hh.

Referenced by SetNewValue().

◆ fSetFileNameCmd

std::unique_ptr<G4UIcmdWithAString> G4FileMessenger::fSetFileNameCmd

Definition at line 58 of file G4FileMessenger.hh.

Referenced by G4FileMessenger(), and SetNewValue().

◆ fSetHistoDirNameCmd

std::unique_ptr<G4UIcmdWithAString> G4FileMessenger::fSetHistoDirNameCmd

Definition at line 59 of file G4FileMessenger.hh.

Referenced by G4FileMessenger(), and SetNewValue().

◆ fSetNtupleDirNameCmd

std::unique_ptr<G4UIcmdWithAString> G4FileMessenger::fSetNtupleDirNameCmd

Definition at line 60 of file G4FileMessenger.hh.

Referenced by G4FileMessenger(), and SetNewValue().


The documentation for this class was generated from the following files: