Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4EmPhysicsList.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
15#include "TG4EmPhysicsList.h"
16
17#include <G4DecayPhysics.hh>
18#include <G4EmStandardPhysics.hh>
19#include <G4SystemOfUnits.hh>
20
21#include <G4ParticleDefinition.hh>
22#include <G4ProcessManager.hh>
23#include <G4ProcessTable.hh>
24
25// According to G4VModularPhysicsList.cc
26#include <G4StateManager.hh>
27// This macros change the references to fields that are now encapsulated
28// in the class G4VMPLData.
29#define G4MT_physicsVector \
30 ((G4VMPLsubInstanceManager.offset[g4vmplInstanceID]).physicsVector)
31
32const G4double TG4EmPhysicsList::fgkDefaultCutValue = 1.0 * mm;
33
34//
35// static methods
36//
37
38//_____________________________________________________________________________
40{
42
43 G4String selections;
44 selections += "emStandard ";
45
46 return selections;
47}
48
49//_____________________________________________________________________________
50G4bool TG4EmPhysicsList::IsAvailableSelection(const G4String& selection)
51{
53
54 G4String available = AvailableSelections();
55 G4String checkSelection = selection;
56 checkSelection += " ";
57
58 return G4StrUtil::contains(available, checkSelection);
59}
60
61//
62// ctors, dtor
63//
64
65//_____________________________________________________________________________
66TG4EmPhysicsList::TG4EmPhysicsList(const G4String& selection)
67 : G4VModularPhysicsList(), TG4Verbose("emPhysicsList")
68{
70
71 Configure(selection);
72
73 defaultCutValue = fgkDefaultCutValue;
74
75 SetVerboseLevel(TG4Verbose::VerboseLevel());
76}
77
78//_____________________________________________________________________________
80{
82
83 // delete fExtDecayer;
84 // fExtDecayer is deleted in G4Decay destructor
85}
86
87//
88// private methods
89//
90
91//_____________________________________________________________________________
92void TG4EmPhysicsList::Configure(const G4String& /*selection*/)
93{
96
97 // Standard electromagnetic physics
98 RegisterPhysics(new G4EmStandardPhysics(1));
99
100 // decay physics
101 RegisterPhysics(new G4DecayPhysics());
102}
103
104//
105// public methods
106//
107
108//_____________________________________________________________________________
110{
112
113 // create processes for registered physics
114 G4VModularPhysicsList::ConstructProcess();
115
116 if (VerboseLevel() > 0) G4cout << "### EM physics constructed. " << G4endl;
117}
118
119//_____________________________________________________________________________
121{
123
125}
126
127//_____________________________________________________________________________
129{
133
135 SetVerboseLevel(level);
136
137 G4PhysConstVector::iterator it;
138 for (it = G4MT_physicsVector->begin(); it != G4MT_physicsVector->end();
139 ++it) {
140 TG4Verbose* verbose = dynamic_cast<TG4Verbose*>(*it);
141 if (verbose)
142 verbose->VerboseLevel(level);
143 else
144 (*it)->SetVerboseLevel(level);
145 }
146}
147
148//_____________________________________________________________________________
150{
155
156 defaultCutValue = value;
157}
#define G4MT_physicsVector
Definition of the TG4EmPhysicsList class.
virtual void ConstructProcess()
void Configure(const G4String &)
static G4bool IsAvailableSelection(const G4String &selection)
TG4EmPhysicsList(const G4String &selection="emStandard")
static G4String AvailableSelections()
virtual G4int VerboseLevel() const
static const G4double fgkDefaultCutValue
default cut value
void SetRangeCut(G4double value)
Base class for defining the verbose level and a common messenger.
Definition TG4Verbose.h:36
virtual G4int VerboseLevel() const
Definition TG4Verbose.h:78
virtual void VerboseLevel(G4int level)
Definition TG4Verbose.h:72