Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4SteppingActionMessenger.cxx
Go to the documentation of this file.
1//------------------------------------------------
2// The Geant4 Virtual Monte Carlo package
3// Copyright (C) 2007 - 2014 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 "TG4SteppingAction.h"
18
19#include <G4UIcmdWithAnInteger.hh>
20
21//_____________________________________________________________________________
23 TG4SteppingAction* steppingAction)
24 : G4UImessenger(),
25 fSteppingAction(steppingAction),
26 fLoopVerboseCmd(0),
27 fMaxNofStepsCmd(0)
28{
30
31 fLoopVerboseCmd = new G4UIcmdWithAnInteger("/mcTracking/loopVerbose", this);
32 fLoopVerboseCmd->SetGuidance(
33 "Set tracking verbose level for detected looping tracks.");
34 fLoopVerboseCmd->SetParameterName("LoopVerboseLevel", true);
35 fLoopVerboseCmd->SetDefaultValue(1);
36 fLoopVerboseCmd->SetRange("LoopVerboseLevel >= 0 && LoopVerboseLevel <= 5");
37 fLoopVerboseCmd->AvailableForStates(
38 G4State_PreInit, G4State_Init, G4State_Idle);
39
40 fMaxNofStepsCmd = new G4UIcmdWithAnInteger("/mcTracking/maxNofSteps", this);
41 fMaxNofStepsCmd->SetGuidance("Set maximum number of steps allowed.");
42 fMaxNofStepsCmd->SetParameterName("MaxNofSteps", false);
43 fMaxNofStepsCmd->SetRange("MaxNofSteps >= 0");
44 fMaxNofStepsCmd->AvailableForStates(
45 G4State_PreInit, G4State_Init, G4State_Idle);
46}
47
48//_____________________________________________________________________________
56
57//
58// public methods
59//
60
61//_____________________________________________________________________________
63 G4UIcommand* command, G4String newValue)
64{
66
67 if (command == fLoopVerboseCmd) {
69 fLoopVerboseCmd->GetNewIntValue(newValue));
70 }
71 else if (command == fMaxNofStepsCmd) {
72 fSteppingAction->SetMaxNofSteps(fMaxNofStepsCmd->GetNewIntValue(newValue));
73 }
74}
Definition of the TG4Globals class and basic container types.
Definition of the TG4SteppingActionMessenger class.
Definition of the TG4SteppingAction class.
virtual void SetNewValue(G4UIcommand *command, G4String string)
TG4SteppingActionMessenger()
Not implemented.
G4UIcmdWithAnInteger * fMaxNofStepsCmd
command: maxNofSteps
TG4SteppingAction * fSteppingAction
associated class
G4UIcmdWithAnInteger * fLoopVerboseCmd
command: loopVerbose
Actions at each step.
void SetMaxNofSteps(G4int number)
void SetLoopVerboseLevel(G4int level)