Geant4 VMC
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
source
run
src
TG4PrimaryGeneratorMessenger.cxx
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Geant4 Virtual Monte Carlo package
3
// Copyright (C) 2007 - 2019 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
15
#include "
TG4PrimaryGeneratorMessenger.h
"
16
#include "
TG4PrimaryGeneratorAction.h
"
17
18
#include <G4UIcmdWithABool.hh>
19
#include <G4UIcmdWithAString.hh>
20
#include <G4UIcmdWithAnInteger.hh>
21
#include <G4UIdirectory.hh>
22
23
//_____________________________________________________________________________
24
TG4PrimaryGeneratorMessenger::TG4PrimaryGeneratorMessenger
(
25
TG4PrimaryGeneratorAction
* action)
26
:
G4UImessenger
(),
27
fPrimaryGeneratorAction
(action),
28
fDirectory
(0),
29
fSkipUnknownParticlesCmd
(0)
30
{
32
33
fDirectory
=
new
G4UIdirectory(
"/mcPrimaryGenerator/"
);
34
fDirectory
->SetGuidance(
"TGeant4 primary generator action commands."
);
35
36
fSkipUnknownParticlesCmd
=
37
new
G4UIcmdWithABool(
"/mcPrimaryGenerator/skipUnknownParticles"
,
this
);
38
fSkipUnknownParticlesCmd
->SetGuidance(
39
"Switch on|off applying range cuts for gamma"
);
40
fSkipUnknownParticlesCmd
->SetParameterName(
"ApplyForGamma"
,
false
);
41
fSkipUnknownParticlesCmd
->AvailableForStates(G4State_PreInit, G4State_Init);
42
}
43
44
//_____________________________________________________________________________
45
TG4PrimaryGeneratorMessenger::~TG4PrimaryGeneratorMessenger
()
46
{
48
49
delete
fDirectory
;
50
delete
fSkipUnknownParticlesCmd
;
51
}
52
53
//
54
// public methods
55
//
56
57
//_____________________________________________________________________________
58
void
TG4PrimaryGeneratorMessenger::SetNewValue
(
59
G4UIcommand
* command, G4String newValue)
60
{
62
63
if
(command ==
fSkipUnknownParticlesCmd
) {
64
fPrimaryGeneratorAction
->SetSkipUnknownParticles(
65
fSkipUnknownParticlesCmd
->GetNewBoolValue(newValue));
66
}
67
}
TG4PrimaryGeneratorAction.h
Definition of the TG4PrimaryGeneratorAction class.
TG4PrimaryGeneratorMessenger.h
Definition of the TG4PrimaryGeneratorMessenger class.
G4UIcommand
G4UImessenger
TG4PrimaryGeneratorAction
Primary generator action defined via TVirtualMCStack and TVirtualMCApplication.
Definition
TG4PrimaryGeneratorAction.h:43
TG4PrimaryGeneratorMessenger::fSkipUnknownParticlesCmd
G4UIcmdWithABool * fSkipUnknownParticlesCmd
command: /mcPrimaryGenerator/skipUnknownParticles
Definition
TG4PrimaryGeneratorMessenger.h:59
TG4PrimaryGeneratorMessenger::~TG4PrimaryGeneratorMessenger
virtual ~TG4PrimaryGeneratorMessenger()
Definition
TG4PrimaryGeneratorMessenger.cxx:45
TG4PrimaryGeneratorMessenger::fPrimaryGeneratorAction
TG4PrimaryGeneratorAction * fPrimaryGeneratorAction
associated class
Definition
TG4PrimaryGeneratorMessenger.h:55
TG4PrimaryGeneratorMessenger::SetNewValue
virtual void SetNewValue(G4UIcommand *command, G4String string)
Definition
TG4PrimaryGeneratorMessenger.cxx:58
TG4PrimaryGeneratorMessenger::fDirectory
G4UIdirectory * fDirectory
command directory
Definition
TG4PrimaryGeneratorMessenger.h:56
TG4PrimaryGeneratorMessenger::TG4PrimaryGeneratorMessenger
TG4PrimaryGeneratorMessenger()
Not implemented.
Generated on
for Geant4 VMC by
1.17.0