Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4FileMessenger Class Reference

#include <G4FileMessenger.hh>

Inheritance diagram for G4FileMessenger:
Collaboration 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)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Public Attributes

G4VAnalysisManagerfManager
 Associated class. More...
 
std::unique_ptr
< G4UIcmdWithAString
fSetFileNameCmd
 
std::unique_ptr
< G4UIcmdWithAString
fSetHistoDirNameCmd
 
std::unique_ptr
< G4UIcmdWithAString
fSetNtupleDirNameCmd
 

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)
 
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
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 48 of file G4FileMessenger.hh.

Constructor & Destructor Documentation

G4FileMessenger::G4FileMessenger ( G4VAnalysisManager manager)
explicit

Definition at line 40 of file G4FileMessenger.cc.

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

Definition at line 64 of file G4FileMessenger.cc.

65 {}

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 71 of file G4FileMessenger.cc.

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

Here is the call graph for this function:

Member Data Documentation

G4VAnalysisManager* G4FileMessenger::fManager

Associated class.

Definition at line 57 of file G4FileMessenger.hh.

std::unique_ptr<G4UIcmdWithAString> G4FileMessenger::fSetFileNameCmd

Definition at line 59 of file G4FileMessenger.hh.

std::unique_ptr<G4UIcmdWithAString> G4FileMessenger::fSetHistoDirNameCmd

Definition at line 60 of file G4FileMessenger.hh.

std::unique_ptr<G4UIcmdWithAString> G4FileMessenger::fSetNtupleDirNameCmd

Definition at line 61 of file G4FileMessenger.hh.


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