Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4TrackingActionMessenger.cxx
Go to the documentation of this file.
1//------------------------------------------------
2// The Geant4 Virtual Monte Carlo package
3// Copyright (C) 2007 - 2015 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
14
16#include "TG4Globals.h"
17#include "TG4TrackManager.h"
18#include "TG4TrackingAction.h"
19
20#include <G4UIcmdWithABool.hh>
21#include <G4UIcmdWithAString.hh>
22#include <G4UIcmdWithAnInteger.hh>
23#include <G4UIdirectory.hh>
24
25//_____________________________________________________________________________
27 TG4TrackingAction* trackingAction)
28 : G4UImessenger(),
29 fTrackingAction(trackingAction),
30 fTrackingDirectory(0),
31 fNewVerboseCmd(0),
32 fNewVerboseTrackCmd(0),
33 fSaveSecondariesCmd(0),
34 fSaveDynamicChargeCmd(0)
35{
37
38 fTrackingDirectory = new G4UIdirectory("/mcTracking/");
39 fTrackingDirectory->SetGuidance("TG4TrackingAction control commands.");
40
41 fNewVerboseCmd = new G4UIcmdWithAnInteger("/mcTracking/newVerbose", this);
42 fNewVerboseCmd->SetGuidance("Set new verbose level (/tracking/verbose)");
43 fNewVerboseCmd->SetGuidance("when a track with specified track ID ");
44 fNewVerboseCmd->SetGuidance(
45 "(/mcTracking/newVerboseTrack)\n starts tracking");
46 fNewVerboseCmd->SetParameterName("NewVerboseLevel", false);
47 fNewVerboseCmd->SetRange("NewVerboseLevel >= 0 && NewVerboseLevel <= 5");
48 fNewVerboseCmd->AvailableForStates(
49 G4State_PreInit, G4State_Init, G4State_Idle);
50
52 new G4UIcmdWithAnInteger("/mcTracking/newVerboseTrack", this);
53 fNewVerboseTrackCmd->SetGuidance(
54 "Set the track ID for which the new verbose level");
55 fNewVerboseTrackCmd->SetGuidance("(/mcTracking/newVerbose) will be applied.");
56 fNewVerboseTrackCmd->SetParameterName("NewVerboseLevelTrackID", false);
57 fNewVerboseTrackCmd->SetRange("NewVerboseLevelTrackID >= 0");
58 fNewVerboseTrackCmd->AvailableForStates(
59 G4State_PreInit, G4State_Init, G4State_Idle);
60
62 new G4UIcmdWithAString("/mcTracking/saveSecondaries", this);
63 fSaveSecondariesCmd->SetGuidance(
64 "Option for saving secondaries in the stack in tracking:");
65 fSaveSecondariesCmd->SetGuidance("(Default is saving in pre-track.)");
66 fSaveSecondariesCmd->SetParameterName("SaveSecondaries", false);
67 fSaveSecondariesCmd->SetCandidates("DoNotSave SaveInPreTrack SaveInStep");
68 fSaveSecondariesCmd->AvailableForStates(
69 G4State_PreInit, G4State_Init, G4State_Idle);
70
72 new G4UIcmdWithABool("/mcTracking/saveDynamicCharge", this);
73 fSaveDynamicChargeCmd->SetGuidance(
74 "Option for saving dynamic charge of secondary particles (as TParticle "
75 "status).");
76 fSaveDynamicChargeCmd->SetGuidance(
77 "(The dynamic charge is not saved by default.)");
78 fSaveDynamicChargeCmd->SetParameterName("SaveDynamicCharge", false);
79 fSaveDynamicChargeCmd->AvailableForStates(
80 G4State_PreInit, G4State_Init, G4State_Idle);
81}
82
83//_____________________________________________________________________________
94
95//
96// public methods
97//
98
99//_____________________________________________________________________________
101 G4UIcommand* command, G4String newValue)
102{
104
105 if (command == fNewVerboseCmd) {
107 fNewVerboseCmd->GetNewIntValue(newValue));
108 }
109 else if (command == fNewVerboseTrackCmd) {
111 fNewVerboseTrackCmd->GetNewIntValue(newValue));
112 }
113 else if (command == fSaveSecondariesCmd) {
114 if (newValue == "DoNotSave")
116 else if (newValue == "SaveInPreTrack")
118 else if (newValue == "SaveInStep")
120 }
121 else if (command == fSaveDynamicChargeCmd) {
123 fSaveDynamicChargeCmd->GetNewBoolValue(newValue));
124 }
125}
Definition of the TG4Globals class and basic container types.
Definition of the TG4TrackManager class.
Definition of the TG4TrackingActionMessenger class.
Definition of the TG4TrackingAction class.
void SetTrackSaveControl(TG4TrackSaveControl control)
static TG4TrackManager * Instance()
void SetSaveDynamicCharge(G4bool saveDynamicCharge)
TG4TrackingAction * fTrackingAction
associated class
G4UIcmdWithAString * fSaveSecondariesCmd
command: saveSecondaries
virtual void SetNewValue(G4UIcommand *command, G4String string)
G4UIcmdWithABool * fSaveDynamicChargeCmd
command: saveDynamicCharge
G4UIdirectory * fTrackingDirectory
command directory
TG4TrackingActionMessenger()
Not implemented.
G4UIcmdWithAnInteger * fNewVerboseCmd
command: newVerbose
G4UIcmdWithAnInteger * fNewVerboseTrackCmd
command: newVerboseTrack
Actions at the beginnig and at the end of track.
void SetNewVerboseLevel(G4int level)
void SetNewVerboseTrackID(G4int trackID)
@ kSaveInPreTrack
save in pre-track
@ kDoNotSave
do not save
@ kSaveInStep
save in step