Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4SpecialStackingActionMessenger.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"
18
19#include <G4UIcmdWithABool.hh>
20#include <G4UIcmdWithAnInteger.hh>
21
22//_____________________________________________________________________________
24 TG4SpecialStackingAction* stackingAction)
25 : G4UImessenger(),
26 fStackingAction(stackingAction),
27 fSkipNeutrinoCmd(0),
28 fWaitPrimaryCmd(0)
29
30{
32
33 fSkipNeutrinoCmd = new G4UIcmdWithABool("/mcTracking/skipNeutrino", this);
34 fSkipNeutrinoCmd->SetGuidance("Option to skip neutrinos.");
35 fSkipNeutrinoCmd->SetGuidance("By default this option is false.");
36 fSkipNeutrinoCmd->SetParameterName("SkipNeutrino", false);
37 fSkipNeutrinoCmd->AvailableForStates(
38 G4State_PreInit, G4State_Init, G4State_Idle);
39
40 fWaitPrimaryCmd = new G4UIcmdWithABool("/mcTracking/waitPrimary", this);
41 fWaitPrimaryCmd->SetGuidance(
42 "Option to track all secondaries before starting the next primary.");
43 fWaitPrimaryCmd->SetGuidance("By default this option is true.");
44 fWaitPrimaryCmd->SetParameterName("WaitPrimary", true);
45 fWaitPrimaryCmd->AvailableForStates(
46 G4State_PreInit, G4State_Init, G4State_Idle);
47}
48
49//_____________________________________________________________________________
57
58//
59// public methods
60//
61
62//_____________________________________________________________________________
64 G4UIcommand* command, G4String newValue)
65{
67
68 if (command == fSkipNeutrinoCmd) {
70 fSkipNeutrinoCmd->GetNewBoolValue(newValue));
71 }
72 else if (command == fWaitPrimaryCmd) {
73 fStackingAction->SetWaitPrimary(fWaitPrimaryCmd->GetNewBoolValue(newValue));
74 }
75}
Definition of the TG4Globals class and basic container types.
Definition of the TG4SpecialStackingActionMessenger class.
Definition of the TG4SpecialStackingAction class.
G4UIcmdWithABool * fSkipNeutrinoCmd
command: skipNeutrino
TG4SpecialStackingActionMessenger()
Not implemented.
TG4SpecialStackingAction * fStackingAction
associated class
G4UIcmdWithABool * fWaitPrimaryCmd
command: waitPrimary
virtual void SetNewValue(G4UIcommand *command, G4String string)
Defines a special stacking mechanism.
void SetSkipNeutrino(G4bool value)
Set the option for skipping neutrino.