Warning, file /geant4/examples/advanced/dna/moleculardna/src/ParallelWorldPhysics.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 #include "ParallelWorldPhysics.hh"
0031
0032 #include "G4ParallelWorldProcess.hh"
0033 #include "G4ParticleDefinition.hh"
0034 #include "G4PhysicsConstructorFactory.hh"
0035 #include "G4ProcessManager.hh"
0036 #include "G4TransportationManager.hh"
0037
0038 G4_DECLARE_PHYSCONSTR_FACTORY(ParallelWorldPhysics);
0039
0040
0041
0042 ParallelWorldPhysics::ParallelWorldPhysics(const G4String& name, G4bool layeredMass)
0043 : G4VPhysicsConstructor(name), fLayeredMass(layeredMass)
0044 {
0045
0046 }
0047
0048
0049
0050 void ParallelWorldPhysics::ConstructParticle()
0051 {
0052
0053 }
0054
0055
0056
0057 void ParallelWorldPhysics::ConstructProcess()
0058 {
0059
0060 G4TransportationManager::GetTransportationManager()->GetParallelWorld(namePhysics);
0061
0062
0063 auto theParallelWorldProcess = new G4ParallelWorldProcess(namePhysics);
0064 theParallelWorldProcess->SetParallelWorld(namePhysics);
0065 theParallelWorldProcess->SetLayeredMaterialFlag(fLayeredMass);
0066
0067 auto particleIterator = GetParticleIterator();
0068 particleIterator->reset();
0069
0070 while ((*particleIterator)()) {
0071 G4ParticleDefinition* particle = particleIterator->value();
0072 if (!particle->IsShortLived() && particle->GetParticleType() != "Molecule"
0073 && theParallelWorldProcess->IsApplicable(*particle))
0074 {
0075 G4ProcessManager* pmanager = particle->GetProcessManager();
0076 pmanager->AddProcess(theParallelWorldProcess);
0077 if (theParallelWorldProcess->IsAtRestRequired(particle)) {
0078 pmanager->SetProcessOrdering(theParallelWorldProcess, idxAtRest, 9900);
0079 }
0080 pmanager->SetProcessOrderingToSecond(theParallelWorldProcess, idxAlongStep);
0081 pmanager->SetProcessOrdering(theParallelWorldProcess, idxPostStep, 9900);
0082 }
0083 }
0084 }
0085