Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4TrackingMessenger Class Reference

#include <G4TrackingMessenger.hh>

Inheritance diagram for G4TrackingMessenger:
Collaboration 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 ()
 
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)
 
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 56 of file G4TrackingMessenger.hh.

Constructor & Destructor Documentation

G4TrackingMessenger::G4TrackingMessenger ( G4TrackingManager trMan)

Definition at line 60 of file G4TrackingMessenger.cc.

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

Here is the call graph for this function:

G4TrackingMessenger::~G4TrackingMessenger ( )

Definition at line 111 of file G4TrackingMessenger.cc.

113 {
114  delete TrackingDirectory;
115  delete AbortCmd;
116  delete ResumeCmd;
117  delete StoreTrajectoryCmd;
118  delete VerboseCmd;
119 }

Member Function Documentation

G4String G4TrackingMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 158 of file G4TrackingMessenger.cc.

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

Here is the call graph for this function:

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

Reimplemented from G4UImessenger.

Definition at line 122 of file G4TrackingMessenger.cc.

124 {
125  if( command == VerboseCmd ){
126  trackingManager->SetVerboseLevel(VerboseCmd->ConvertToInt(newValues));
127  }
128 
129  if( command == AbortCmd ){
130  steppingManager->GetTrack()->SetTrackStatus(fStopAndKill);
131  G4UImanager::GetUIpointer()->ApplyCommand("/control/exit");
132  }
133 
134  if( command == ResumeCmd ){
135  G4UImanager::GetUIpointer()->ApplyCommand("/control/exit");
136  }
137 
138  static G4ThreadLocal G4IdentityTrajectoryFilter* auxiliaryPointsFilter = 0;
139  if(!auxiliaryPointsFilter) auxiliaryPointsFilter = new G4IdentityTrajectoryFilter;
140  if( command == StoreTrajectoryCmd ){
141  G4int trajType = StoreTrajectoryCmd->ConvertToInt(newValues);
142  if(trajType==2||trajType==4)
143  {
145  ->GetPropagatorInField()->SetTrajectoryFilter(auxiliaryPointsFilter);
146  }
147  else
148  {
151  }
152  trackingManager->SetStoreTrajectory(trajType);
153  }
154 }
void SetTrackStatus(const G4TrackStatus aTrackStatus)
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
void SetStoreTrajectory(G4int value)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
static G4int ConvertToInt(const char *st)
Definition: G4UIcommand.cc:447
static G4TransportationManager * GetTransportationManager()
void SetVerboseLevel(G4int vLevel)
void SetTrajectoryFilter(G4VCurvedTrajectoryFilter *filter)
G4PropagatorInField * GetPropagatorInField() const
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447
G4Track * GetTrack() const

Here is the call graph for this function:


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