Geant4 11.2.2
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 () override
 
void SetNewValue (G4UIcommand *command, G4String newValues) override
 
G4String GetCurrentValue (G4UIcommand *command) override
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String LtoS (G4long l)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (const G4String &s)
 
G4long StoL (const G4String &s)
 
G4double StoD (const 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 52 of file G4TrackingMessenger.hh.

Constructor & Destructor Documentation

◆ G4TrackingMessenger()

G4TrackingMessenger::G4TrackingMessenger ( G4TrackingManager * trMan)

Definition at line 51 of file G4TrackingMessenger.cc.

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

◆ ~G4TrackingMessenger()

G4TrackingMessenger::~G4TrackingMessenger ( )
override

Definition at line 100 of file G4TrackingMessenger.cc.

102{
103 delete TrackingDirectory;
104 delete AbortCmd;
105 delete ResumeCmd;
106 delete StoreTrajectoryCmd;
107 delete VerboseCmd;
108 delete auxiliaryPointsFilter;
109}

Member Function Documentation

◆ GetCurrentValue()

G4String G4TrackingMessenger::GetCurrentValue ( G4UIcommand * command)
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 149 of file G4TrackingMessenger.cc.

151{
152 if (command == VerboseCmd) {
153 return VerboseCmd->ConvertToString(trackingManager->GetVerboseLevel());
154 }
155 if (command == StoreTrajectoryCmd) {
156 return StoreTrajectoryCmd->ConvertToString(trackingManager->GetStoreTrajectory());
157 }
158 return G4String(1, '\0');
159}
G4int GetVerboseLevel() const
G4int GetStoreTrajectory() const
static G4String ConvertToString(G4bool boolVal)

◆ SetNewValue()

void G4TrackingMessenger::SetNewValue ( G4UIcommand * command,
G4String newValues )
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 112 of file G4TrackingMessenger.cc.

114{
115 if (command == VerboseCmd) {
116 trackingManager->SetVerboseLevel(VerboseCmd->ConvertToInt(newValues));
117 }
118
119 if (command == AbortCmd) {
120 steppingManager->GetTrack()->SetTrackStatus(fStopAndKill);
121 G4UImanager::GetUIpointer()->ApplyCommand("/control/exit");
122 }
123
124 if (command == ResumeCmd) {
125 G4UImanager::GetUIpointer()->ApplyCommand("/control/exit");
126 }
127
128 if (command == StoreTrajectoryCmd) {
129 G4int trajType = StoreTrajectoryCmd->ConvertToInt(newValues);
130 if (trajType == 2 || trajType == 4) {
131
132 if (nullptr == auxiliaryPointsFilter) {
133 auxiliaryPointsFilter = new G4IdentityTrajectoryFilter;
134 }
137 ->SetTrajectoryFilter(auxiliaryPointsFilter);
138 }
139 else {
142 ->SetTrajectoryFilter(nullptr);
143 }
144 trackingManager->SetStoreTrajectory(trajType);
145 }
146}
@ fStopAndKill
int G4int
Definition G4Types.hh:85
void SetTrajectoryFilter(G4VCurvedTrajectoryFilter *filter)
G4Track * GetTrack() const
void SetTrackStatus(const G4TrackStatus aTrackStatus)
void SetVerboseLevel(G4int vLevel)
void SetStoreTrajectory(G4int value)
static G4TransportationManager * GetTransportationManager()
G4PropagatorInField * GetPropagatorInField() const
static G4int ConvertToInt(const char *st)
G4int ApplyCommand(const char *aCommand)
static G4UImanager * GetUIpointer()

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