Warning, file /geant4/examples/extended/polarisation/Pol01/src/PhysicsList.cc was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #include "PhysicsList.hh"
0035
0036 #include "PhysListEmPolarized.hh"
0037 #include "PhysicsListMessenger.hh"
0038 #include "StepMax.hh"
0039
0040 #include "G4EmBuilder.hh"
0041 #include "G4EmParameters.hh"
0042 #include "G4EmStandardPhysics.hh"
0043 #include "G4ProcessManager.hh"
0044
0045
0046
0047 PhysicsList::PhysicsList()
0048 : G4VModularPhysicsList(), fEmPhysicsList(0), fEmName("polarized"), fMessenger(0)
0049 {
0050 fMessenger = new PhysicsListMessenger(this);
0051
0052 G4EmParameters::Instance();
0053
0054 SetVerboseLevel(1);
0055
0056 fEmPhysicsList = new PhysListEmPolarized();
0057 }
0058
0059
0060
0061 PhysicsList::~PhysicsList()
0062 {
0063 delete fMessenger;
0064 }
0065
0066
0067
0068 void PhysicsList::ConstructParticle()
0069 {
0070
0071 G4EmBuilder::ConstructMinimalEmSet();
0072 }
0073
0074
0075
0076 void PhysicsList::ConstructProcess()
0077 {
0078
0079
0080 AddTransportation();
0081
0082
0083
0084 fEmPhysicsList->ConstructProcess();
0085
0086
0087
0088 AddStepMax();
0089 }
0090
0091
0092
0093 void PhysicsList::AddPhysicsList(const G4String& name)
0094 {
0095 if (verboseLevel > 0) {
0096 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0097 }
0098
0099 if (name == fEmName) return;
0100
0101 if (name == "standard") {
0102 fEmName = name;
0103 delete fEmPhysicsList;
0104 fEmPhysicsList = new G4EmStandardPhysics();
0105 }
0106 else if (name == "polarized") {
0107 fEmName = name;
0108 delete fEmPhysicsList;
0109 fEmPhysicsList = new PhysListEmPolarized();
0110 }
0111 else {
0112 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0113 << " is not defined" << G4endl;
0114 }
0115 }
0116
0117
0118
0119 void PhysicsList::AddStepMax()
0120 {
0121
0122 StepMax* stepMaxProcess = new StepMax();
0123
0124 auto particleIterator = GetParticleIterator();
0125 particleIterator->reset();
0126 while ((*particleIterator)()) {
0127 G4ParticleDefinition* particle = particleIterator->value();
0128 G4ProcessManager* pmanager = particle->GetProcessManager();
0129
0130 if (stepMaxProcess->IsApplicable(*particle) && pmanager)
0131 pmanager->AddDiscreteProcess(stepMaxProcess);
0132 }
0133 }
0134
0135