Public Member Functions | Private Attributes | List of all members
EDepSim::PersistencyMessenger Class Reference

#include <EDepSimPersistencyMessenger.hh>

Inheritance diagram for EDepSim::PersistencyMessenger:

Public Member Functions

 PersistencyMessenger (EDepSim::PersistencyManager *persistencyMgr)
 
virtual ~PersistencyMessenger ()
 
void SetNewValue (G4UIcommand *command, G4String newValues)
 
G4String GetCurrentValue (G4UIcommand *command)
 

Private Attributes

EDepSim::PersistencyManagerfPersistencyManager
 
G4UIdirectory * fPersistencyDIR
 
G4UIdirectory * fPersistencySetDIR
 
G4UIcmdWithAString * fOpenCMD
 
G4UIcmdWithoutParameter * fCloseCMD
 
G4UIcmdWithADoubleAndUnit * fGammaThresholdCMD
 
G4UIcmdWithADoubleAndUnit * fNeutronThresholdCMD
 
G4UIcmdWithADoubleAndUnit * fLengthThresholdCMD
 
G4UIcmdWithABool * fSaveAllPrimaryTrajectoriesCMD
 
G4UIcmdWithADoubleAndUnit * fTrajectoryPointAccuracyCMD
 
G4UIcmdWithADoubleAndUnit * fTrajectoryPointDepositCMD
 
G4UIcmdWithAString * fTrajectoryBoundaryCMD
 
G4UIcmdWithoutParameter * fClearBoundariesCMD
 

Detailed Description

Definition at line 19 of file EDepSimPersistencyMessenger.hh.

Constructor & Destructor Documentation

EDepSim::PersistencyMessenger::PersistencyMessenger ( EDepSim::PersistencyManager persistencyMgr)

Definition at line 16 of file EDepSimPersistencyMessenger.cc.

18  : fPersistencyManager(persistencyMgr) {
19  fPersistencyDIR = new G4UIdirectory("/edep/db/");
20  fPersistencyDIR->SetGuidance("Output file control commands.");
21 
22  fOpenCMD = new G4UIcmdWithAString("/edep/db/open",this);
23  fOpenCMD->SetGuidance("Set the name of the output file and open it.");
24  fOpenCMD->SetParameterName("filename",true);
25  fOpenCMD->SetDefaultValue("edepsim-output.root");
26  fOpenCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
27 
28  fCloseCMD = new G4UIcmdWithoutParameter("/edep/db/close",this);
29  fCloseCMD->SetGuidance("Close the output file.");
30 
31  fPersistencySetDIR = new G4UIdirectory("/edep/db/set/");
32  fPersistencySetDIR->SetGuidance("Set various parameters");
33 
35  = new G4UIcmdWithADoubleAndUnit("/edep/db/set/gammaThreshold", this);
36  fGammaThresholdCMD->SetGuidance(
37  "Set momentum threshold for writing out gamma-ray trajectories");
38  fGammaThresholdCMD->SetParameterName("momentum", false, false);
39  fGammaThresholdCMD->SetUnitCategory("Energy");
40 
42  = new G4UIcmdWithADoubleAndUnit("/edep/db/set/neutronThreshold", this);
43  fNeutronThresholdCMD->SetGuidance(
44  "Set momentum threshold for writing out neutron trajectories");
45  fNeutronThresholdCMD->SetParameterName("momentum", false, false);
46  fNeutronThresholdCMD->SetUnitCategory("Energy");
47 
49  = new G4UIcmdWithADoubleAndUnit("/edep/db/set/lengthThreshold", this);
50  fLengthThresholdCMD->SetGuidance(
51  "Set length of track in an SD for writing out particle trajectories");
52  fLengthThresholdCMD->SetParameterName("length", false, false);
53  fLengthThresholdCMD->SetUnitCategory("Length");
54 
56  = new G4UIcmdWithABool("/edep/db/set/saveAllPrimTraj", this);
57  fSaveAllPrimaryTrajectoriesCMD->SetGuidance(
58  "Control which primaries have saved trajectories.\n"
59  " True: Save all prim. part. trajectories.\n"
60  " False: Save prim. that ultimately deposit energy in SD.");
61 
63  = new G4UIcmdWithADoubleAndUnit("/edep/db/set/trajectoryAccuracy", this);
64  fTrajectoryPointAccuracyCMD->SetGuidance(
65  "Set the minimum accuracy of the trajectory.");
66  fTrajectoryPointAccuracyCMD->SetParameterName("length", false, false);
67  fTrajectoryPointAccuracyCMD->SetUnitCategory("Length");
68 
70  = new G4UIcmdWithADoubleAndUnit("/edep/db/set/trajectoryDeposit", this);
71  fTrajectoryPointDepositCMD->SetGuidance(
72  "Set the minimum energy deposit for a trajectory point.");
73  fTrajectoryPointDepositCMD->SetParameterName("energy", false, false);
74  fTrajectoryPointDepositCMD->SetUnitCategory("Energy");
75 
77  = new G4UIcmdWithAString("/edep/db/set/trajectoryBoundary",this);
78  fTrajectoryBoundaryCMD->SetGuidance(
79  "Add a Perl RegExp for a phys. vol. boundary where a\n"
80  " trajectory point is saved. The expression is compared to a\n"
81  " string constructed \":particle:charge:volume:\" where particle\n"
82  " is the particle name, charge is \"charged\" or \"neutral\" and\n"
83  " volume is the physical volume name.");
84  fTrajectoryBoundaryCMD->SetParameterName("boundary",true);
85  fTrajectoryBoundaryCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
86 
88  = new G4UIcmdWithoutParameter("/edep/db/set/clearBoundaries",this);
89  fClearBoundariesCMD->SetGuidance("Remove all of the boundaries for "
90  "trajectory points.");
91 
92 }
G4UIcmdWithoutParameter * fClearBoundariesCMD
G4UIcmdWithADoubleAndUnit * fTrajectoryPointDepositCMD
G4UIcmdWithADoubleAndUnit * fNeutronThresholdCMD
EDepSim::PersistencyManager * fPersistencyManager
G4UIcmdWithADoubleAndUnit * fTrajectoryPointAccuracyCMD
G4UIcmdWithADoubleAndUnit * fLengthThresholdCMD
G4UIcmdWithADoubleAndUnit * fGammaThresholdCMD
EDepSim::PersistencyMessenger::~PersistencyMessenger ( )
virtual

Definition at line 94 of file EDepSimPersistencyMessenger.cc.

94  {
95  delete fOpenCMD;
96  delete fCloseCMD;
97  delete fGammaThresholdCMD;
98  delete fNeutronThresholdCMD;
99  delete fLengthThresholdCMD;
103  delete fTrajectoryBoundaryCMD;
104  delete fClearBoundariesCMD;
105  delete fPersistencyDIR;
106  delete fPersistencySetDIR;
107 }
G4UIcmdWithoutParameter * fClearBoundariesCMD
G4UIcmdWithADoubleAndUnit * fTrajectoryPointDepositCMD
G4UIcmdWithADoubleAndUnit * fNeutronThresholdCMD
G4UIcmdWithADoubleAndUnit * fTrajectoryPointAccuracyCMD
G4UIcmdWithADoubleAndUnit * fLengthThresholdCMD
G4UIcmdWithADoubleAndUnit * fGammaThresholdCMD

Member Function Documentation

G4String EDepSim::PersistencyMessenger::GetCurrentValue ( G4UIcommand *  command)

Definition at line 151 of file EDepSimPersistencyMessenger.cc.

151  {
152  G4String currentValue;
153 
154  if (command==fOpenCMD) {
155  currentValue = fPersistencyManager->GetFilename();
156  }
157  else if (command==fGammaThresholdCMD) {
158  currentValue = fGammaThresholdCMD->ConvertToString(
160  }
161  else if (command==fNeutronThresholdCMD) {
162  currentValue = fNeutronThresholdCMD->ConvertToString(
164  }
165  else if (command==fLengthThresholdCMD) {
166  currentValue = fLengthThresholdCMD->ConvertToString(
168  }
170  currentValue = fSaveAllPrimaryTrajectoriesCMD->ConvertToString(
172  }
174  currentValue = fTrajectoryPointAccuracyCMD->ConvertToString(
176  }
178  currentValue = fTrajectoryPointDepositCMD->ConvertToString(
180  }
181 
182  return currentValue;
183 }
virtual G4String GetFilename(void) const
Return the output file name.
int command
virtual bool GetSaveAllPrimaryTrajectories(void) const
virtual G4double GetNeutronThreshold() const
virtual double GetTrajectoryPointAccuracy(void) const
G4UIcmdWithADoubleAndUnit * fTrajectoryPointDepositCMD
G4UIcmdWithADoubleAndUnit * fNeutronThresholdCMD
virtual double GetTrajectoryPointDeposit(void) const
EDepSim::PersistencyManager * fPersistencyManager
G4UIcmdWithADoubleAndUnit * fTrajectoryPointAccuracyCMD
virtual G4double GetGammaThreshold() const
G4UIcmdWithADoubleAndUnit * fLengthThresholdCMD
virtual G4double GetLengthThreshold() const
Get the threshold for length in a sensitive detector.
G4UIcmdWithADoubleAndUnit * fGammaThresholdCMD
void EDepSim::PersistencyMessenger::SetNewValue ( G4UIcommand *  command,
G4String  newValues 
)

Definition at line 110 of file EDepSimPersistencyMessenger.cc.

111  {
112  if (command==fOpenCMD) {
113  fPersistencyManager->Open(newValue);
114  }
115  else if (command == fCloseCMD) {
117  }
118  else if (command == fGammaThresholdCMD) {
120  fGammaThresholdCMD->GetNewDoubleValue(newValue));
121  }
122  else if (command == fNeutronThresholdCMD) {
124  fNeutronThresholdCMD->GetNewDoubleValue(newValue));
125  }
126  else if (command == fLengthThresholdCMD) {
128  fLengthThresholdCMD->GetNewDoubleValue(newValue));
129  }
132  fSaveAllPrimaryTrajectoriesCMD->GetNewBoolValue(newValue));
133  }
134  else if (command == fTrajectoryPointAccuracyCMD) {
136  fTrajectoryPointAccuracyCMD->GetNewDoubleValue(newValue));
137  }
138  else if (command == fTrajectoryPointDepositCMD) {
140  fTrajectoryPointDepositCMD->GetNewDoubleValue(newValue));
141  }
142  else if (command == fTrajectoryBoundaryCMD) {
144  }
145  else if (command == fClearBoundariesCMD) {
147  }
148 }
G4UIcmdWithoutParameter * fClearBoundariesCMD
int command
virtual void AddTrajectoryBoundary(const G4String &boundary)
virtual void SetTrajectoryPointAccuracy(double acc)
G4UIcmdWithADoubleAndUnit * fTrajectoryPointDepositCMD
virtual void SetNeutronThreshold(G4double thresh)
G4UIcmdWithADoubleAndUnit * fNeutronThresholdCMD
EDepSim::PersistencyManager * fPersistencyManager
G4UIcmdWithADoubleAndUnit * fTrajectoryPointAccuracyCMD
virtual G4bool Open(G4String filename)
G4UIcmdWithADoubleAndUnit * fLengthThresholdCMD
virtual void SetLengthThreshold(G4double thresh)
virtual void SetGammaThreshold(G4double thresh)
virtual void SetSaveAllPrimaryTrajectories(bool val)
virtual void SetTrajectoryPointDeposit(double dep)
virtual G4bool Close(void)
Make sure the output file is closed.
G4UIcmdWithADoubleAndUnit * fGammaThresholdCMD

Member Data Documentation

G4UIcmdWithoutParameter* EDepSim::PersistencyMessenger::fClearBoundariesCMD
private

Definition at line 41 of file EDepSimPersistencyMessenger.hh.

G4UIcmdWithoutParameter* EDepSim::PersistencyMessenger::fCloseCMD
private

Definition at line 33 of file EDepSimPersistencyMessenger.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::PersistencyMessenger::fGammaThresholdCMD
private

Definition at line 34 of file EDepSimPersistencyMessenger.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::PersistencyMessenger::fLengthThresholdCMD
private

Definition at line 36 of file EDepSimPersistencyMessenger.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::PersistencyMessenger::fNeutronThresholdCMD
private

Definition at line 35 of file EDepSimPersistencyMessenger.hh.

G4UIcmdWithAString* EDepSim::PersistencyMessenger::fOpenCMD
private

Definition at line 32 of file EDepSimPersistencyMessenger.hh.

G4UIdirectory* EDepSim::PersistencyMessenger::fPersistencyDIR
private

Definition at line 30 of file EDepSimPersistencyMessenger.hh.

EDepSim::PersistencyManager* EDepSim::PersistencyMessenger::fPersistencyManager
private

Definition at line 28 of file EDepSimPersistencyMessenger.hh.

G4UIdirectory* EDepSim::PersistencyMessenger::fPersistencySetDIR
private

Definition at line 31 of file EDepSimPersistencyMessenger.hh.

G4UIcmdWithABool* EDepSim::PersistencyMessenger::fSaveAllPrimaryTrajectoriesCMD
private

Definition at line 37 of file EDepSimPersistencyMessenger.hh.

G4UIcmdWithAString* EDepSim::PersistencyMessenger::fTrajectoryBoundaryCMD
private

Definition at line 40 of file EDepSimPersistencyMessenger.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::PersistencyMessenger::fTrajectoryPointAccuracyCMD
private

Definition at line 38 of file EDepSimPersistencyMessenger.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::PersistencyMessenger::fTrajectoryPointDepositCMD
private

Definition at line 39 of file EDepSimPersistencyMessenger.hh.


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