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

#include <G4TrackingMessenger.hh>

+ Inheritance diagram for G4TrackingMessenger:

Public Member Functions

 G4TrackingMessenger (G4TrackingManager *trMan)
 
 ~G4TrackingMessenger ()
 
void SetNewValue (G4UIcommand *command, G4String newValues)
 
G4String GetCurrentValue (G4UIcommand *command)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 

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)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 

Detailed Description

Definition at line 56 of file G4TrackingMessenger.hh.

Constructor & Destructor Documentation

◆ G4TrackingMessenger()

G4TrackingMessenger::G4TrackingMessenger ( G4TrackingManager trMan)

Definition at line 57 of file G4TrackingMessenger.cc.

59: trackingManager(trMan)
60{
61 steppingManager = trackingManager->GetSteppingManager();
62
63 TrackingDirectory = new G4UIdirectory("/tracking/");
64 TrackingDirectory->SetGuidance("TrackingManager and SteppingManager control commands.");
65
66 AbortCmd = new G4UIcmdWithoutParameter("/tracking/abort",this);
67 AbortCmd->SetGuidance("Abort current G4Track processing.");
68
69
70 ResumeCmd = new G4UIcmdWithoutParameter("/tracking/resume",this);
71 ResumeCmd->SetGuidance("Resume current G4Track processing.");
72
73 StoreTrajectoryCmd = new G4UIcmdWithAnInteger("/tracking/storeTrajectory",this);
74 StoreTrajectoryCmd->SetGuidance("Store trajectories or not.");
75 StoreTrajectoryCmd->SetGuidance(" 0 : Don't Store trajectories.");
76 StoreTrajectoryCmd->SetGuidance(" !=0 : Store trajectories.");
77 StoreTrajectoryCmd->SetGuidance(" 1 : Choose G4Trajectory as default.");
78 StoreTrajectoryCmd->SetGuidance(" 2 : Choose G4SmoothTrajectory as default.");
79 StoreTrajectoryCmd->SetGuidance(" 3 : Choose G4RichTrajectory as default.");
80 StoreTrajectoryCmd->SetParameterName("Store",true);
81 StoreTrajectoryCmd->SetDefaultValue(0);
82 StoreTrajectoryCmd->SetRange("Store >=0 && Store <= 3");
83
84
85 VerboseCmd = new G4UIcmdWithAnInteger("/tracking/verbose",this);
86#ifdef G4VERBOSE
87 VerboseCmd->SetGuidance("Set Verbose level of tracking category.");
88 VerboseCmd->SetGuidance(" -1 : Silent.");
89 VerboseCmd->SetGuidance(" 0 : Silent.");
90 VerboseCmd->SetGuidance(" 1 : Minium information of each Step.");
91 VerboseCmd->SetGuidance(" 2 : Addition to Level=1, info of secondary particles.");
92 VerboseCmd->SetGuidance(" 3 : Addition to Level=1, pre/postStepoint information");
93 VerboseCmd->SetGuidance(" after all AlongStep/PostStep process executions.");
94 VerboseCmd->SetGuidance(" 4 : Addition to Level=3, pre/postStepoint information");
95 VerboseCmd->SetGuidance(" at each AlongStepPostStep process execuation.");
96 VerboseCmd->SetGuidance(" 5 : Addition to Level=4, proposed Step length information");
97 VerboseCmd->SetGuidance(" from each AlongStepPostStep process.");
98 VerboseCmd->SetParameterName("verbose_level",true);
99 VerboseCmd->SetDefaultValue(0);
100 VerboseCmd->SetRange("verbose_level >=-1 ");
101#else
102 VerboseCmd->SetGuidance("You need to recompile the tracking category defining G4VERBOSE ");
103#endif
104}
G4SteppingManager * GetSteppingManager() const
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4int defVal)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
void SetRange(const char *rs)
Definition: G4UIcommand.hh:120

◆ ~G4TrackingMessenger()

G4TrackingMessenger::~G4TrackingMessenger ( )

Definition at line 107 of file G4TrackingMessenger.cc.

109{
110 delete TrackingDirectory;
111 delete AbortCmd;
112 delete ResumeCmd;
113 delete StoreTrajectoryCmd;
114 delete VerboseCmd;
115}

Member Function Documentation

◆ GetCurrentValue()

G4String G4TrackingMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 141 of file G4TrackingMessenger.cc.

143{
144 if( command == VerboseCmd ){
145 return VerboseCmd->ConvertToString(trackingManager->GetVerboseLevel());
146 }
147 else if( command == StoreTrajectoryCmd ){
148 return StoreTrajectoryCmd->ConvertToString(trackingManager->GetStoreTrajectory());
149 }
150 return G4String('\0');
151}
G4int GetVerboseLevel() const
G4int GetStoreTrajectory() const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:349

◆ SetNewValue()

void G4TrackingMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 118 of file G4TrackingMessenger.cc.

120{
121 if( command == VerboseCmd ){
122 trackingManager->SetVerboseLevel(VerboseCmd->ConvertToInt(newValues));
123 }
124
125 if( command == AbortCmd ){
126 steppingManager->GetTrack()->SetTrackStatus(fStopAndKill);
127 G4UImanager::GetUIpointer()->ApplyCommand("/control/exit");
128 }
129
130 if( command == ResumeCmd ){
131 G4UImanager::GetUIpointer()->ApplyCommand("/control/exit");
132 }
133
134 if( command == StoreTrajectoryCmd ){
135 trackingManager->SetStoreTrajectory(StoreTrajectoryCmd->ConvertToInt(newValues));
136 }
137}
@ fStopAndKill
G4Track * GetTrack() const
void SetTrackStatus(const G4TrackStatus aTrackStatus)
void SetVerboseLevel(G4int vLevel)
void SetStoreTrajectory(G4int value)
static G4int ConvertToInt(const char *st)
Definition: G4UIcommand.cc:413
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:369
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:51

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