![]() |
|
|||
File indexing completed on 2025-02-23 09:22:39
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 /// \file polarisation/Pol01/src/PhysicsList.cc 0027 /// \brief Implementation of the PhysicsList class 0028 // 0029 // 0030 // 0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0060 0061 PhysicsList::~PhysicsList() 0062 { 0063 delete fMessenger; 0064 } 0065 0066 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0067 0068 void PhysicsList::ConstructParticle() 0069 { 0070 // minimal set of particles for EM physics 0071 G4EmBuilder::ConstructMinimalEmSet(); 0072 } 0073 0074 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0075 0076 void PhysicsList::ConstructProcess() 0077 { 0078 // Transportation 0079 // 0080 AddTransportation(); 0081 0082 // Electromagnetic physics list 0083 // 0084 fEmPhysicsList->ConstructProcess(); 0085 0086 // step limitation (as a full process) 0087 // 0088 AddStepMax(); 0089 } 0090 0091 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0118 0119 void PhysicsList::AddStepMax() 0120 { 0121 // Step limitation seen as a process 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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |