Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4HadronPhysicsList.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
17#include <G4SystemOfUnits.hh>
18
19#include "G4PhysListFactory.hh"
20
21const G4double TG4HadronPhysicsList::fgkDefaultCutValue = 1.0 * mm;
22
23//
24// static methods
25//
26
27//_____________________________________________________________________________
29{
31
32 G4PhysListFactory phyListFactory;
33 const std::vector<G4String>& availablePhysLists =
34 phyListFactory.AvailablePhysLists();
35
36 G4String selections;
37 for (G4int i = 0; i < G4int(availablePhysLists.size()); ++i) {
38 selections += availablePhysLists[i];
39 selections += " ";
40 }
41 // selections += "ShieldingLEND ";
42
43 return selections;
44}
45
46//_____________________________________________________________________________
48{
50
51 G4PhysListFactory phyListFactory;
52 const std::vector<G4String>& availablePhysListsEM =
53 phyListFactory.AvailablePhysListsEM();
54
55 G4String selections;
56 for (G4int i = 0; i < G4int(availablePhysListsEM.size()); ++i) {
57 selections += availablePhysListsEM[i];
58 selections += " ";
59 }
60
61 return selections;
62}
63
64//_____________________________________________________________________________
65G4bool TG4HadronPhysicsList::IsAvailableSelection(const G4String& selection)
66{
68
69 G4PhysListFactory physListFactory;
70 return physListFactory.IsReferencePhysList(selection);
71}
72
73//
74// ctors, dtor
75//
76
77//_____________________________________________________________________________
79 : G4VUserPhysicsList(), TG4Verbose("hadronPhysicsList")
80{
82
83 Configure(selection);
84
85 defaultCutValue = fgkDefaultCutValue;
86
87 SetVerboseLevel(TG4Verbose::VerboseLevel());
88}
89
90//_____________________________________________________________________________
92{
94
95 // delete fExtDecayer;
96 // fExtDecayer is deleted in G4Decay destructor
97}
98
99//
100// private methods
101//
102
103//_____________________________________________________________________________
104void TG4HadronPhysicsList::Configure(const G4String& sel)
105{
108
109 G4PhysListFactory phyListFactory;
110
111 fPhysicsList = phyListFactory.GetReferencePhysList(sel);
112}
113
114//
115// public methods
116//
117
118//_____________________________________________________________________________
120{
122
123 // create processes for registered physics
124 fPhysicsList->ConstructParticle();
125}
126
127//_____________________________________________________________________________
129{
131
132 // create processes for registered physics
133 fPhysicsList->ConstructProcess();
134
135 if (VerboseLevel() > 0)
136 G4cout << "### Hadron physics constructed. " << G4endl;
137}
138
139//_____________________________________________________________________________
141{
143
145}
146
147//_____________________________________________________________________________
149{
153
155 fPhysicsList->SetVerboseLevel(level);
156}
157
158//_____________________________________________________________________________
160{
165
166 defaultCutValue = value;
167}
Definition of the TG4HadronPhysicsList class.
void Configure(const G4String &selection)
G4VUserPhysicsList * fPhysicsList
the physics list according to user selection
void SetRangeCut(G4double value)
static G4String AvailableHadronSelections()
static G4String AvailableEMSelections()
virtual G4int VerboseLevel() const
TG4HadronPhysicsList(const G4String &selection)
static const G4double fgkDefaultCutValue
default cut value
static G4bool IsAvailableSelection(const G4String &selection)
Base class for defining the verbose level and a common messenger.
Definition TG4Verbose.h:36
virtual G4int VerboseLevel() const
Definition TG4Verbose.h:78