Geant4 10.7.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, 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
 

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 51 of file G4TrackingMessenger.hh.

Constructor & Destructor Documentation

◆ G4TrackingMessenger()

G4TrackingMessenger::G4TrackingMessenger ( G4TrackingManager trMan)

Definition at line 50 of file G4TrackingMessenger.cc.

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

101{
102 delete TrackingDirectory;
103 delete AbortCmd;
104 delete ResumeCmd;
105 delete StoreTrajectoryCmd;
106 delete VerboseCmd;
107}

Member Function Documentation

◆ GetCurrentValue()

G4String G4TrackingMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 153 of file G4TrackingMessenger.cc.

155{
156 if( command == VerboseCmd )
157 {
158 return VerboseCmd->ConvertToString(trackingManager->GetVerboseLevel());
159 }
160 else if( command == StoreTrajectoryCmd )
161 {
162 return StoreTrajectoryCmd
163 ->ConvertToString(trackingManager->GetStoreTrajectory());
164 }
165 return G4String('\0');
166}
G4int GetVerboseLevel() const
G4int GetStoreTrajectory() const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:430

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 110 of file G4TrackingMessenger.cc.

112{
113 if( command == VerboseCmd )
114 {
115 trackingManager->SetVerboseLevel(VerboseCmd->ConvertToInt(newValues));
116 }
117
118 if( command == AbortCmd )
119 {
120 steppingManager->GetTrack()->SetTrackStatus(fStopAndKill);
121 G4UImanager::GetUIpointer()->ApplyCommand("/control/exit");
122 }
123
124 if( command == ResumeCmd )
125 {
126 G4UImanager::GetUIpointer()->ApplyCommand("/control/exit");
127 }
128
129 static G4ThreadLocal
130 G4IdentityTrajectoryFilter* auxiliaryPointsFilter = nullptr;
131 if(auxiliaryPointsFilter == nullptr)
132 {
133 auxiliaryPointsFilter = new G4IdentityTrajectoryFilter;
134 }
135 if( command == StoreTrajectoryCmd )
136 {
137 G4int trajType = StoreTrajectoryCmd->ConvertToInt(newValues);
138 if(trajType==2||trajType==4)
139 {
141 ->GetPropagatorInField()->SetTrajectoryFilter(auxiliaryPointsFilter);
142 }
143 else
144 {
147 }
148 trackingManager->SetStoreTrajectory(trajType);
149 }
150}
@ 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)
Definition: G4UIcommand.cc:543
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:485
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
#define G4ThreadLocal
Definition: tls.hh:77

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