Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 08:30:47

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 Par02PhysicsList.cc
0027 /// \brief Implementation of the Par02PhysicsList class
0028 
0029 #include "Par02PhysicsList.hh"
0030 
0031 #include "G4BaryonConstructor.hh"
0032 #include "G4ComptonScattering.hh"
0033 #include "G4Decay.hh"
0034 #include "G4FastSimulationManagerProcess.hh"
0035 #include "G4GammaConversion.hh"
0036 #include "G4IonConstructor.hh"
0037 #include "G4LeptonConstructor.hh"
0038 #include "G4Material.hh"
0039 #include "G4MaterialTable.hh"
0040 #include "G4MesonConstructor.hh"
0041 #include "G4MuBremsstrahlung.hh"
0042 #include "G4MuIonisation.hh"
0043 #include "G4MuMultipleScattering.hh"
0044 #include "G4MuPairProduction.hh"
0045 #include "G4ParticleDefinition.hh"
0046 #include "G4ParticleTable.hh"
0047 #include "G4ParticleTypes.hh"
0048 #include "G4PhotoElectricEffect.hh"
0049 #include "G4ProcessManager.hh"
0050 #include "G4ProcessVector.hh"
0051 #include "G4SystemOfUnits.hh"
0052 #include "G4eBremsstrahlung.hh"
0053 #include "G4eIonisation.hh"
0054 #include "G4eMultipleScattering.hh"
0055 #include "G4eplusAnnihilation.hh"
0056 #include "G4hIonisation.hh"
0057 #include "G4hMultipleScattering.hh"
0058 #include "G4ios.hh"
0059 #include "globals.hh"
0060 
0061 #include <iomanip>
0062 
0063 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0064 
0065 Par02PhysicsList::Par02PhysicsList() : G4VUserPhysicsList()
0066 {
0067   SetVerboseLevel(1);
0068   defaultCutValue = 0.1 * m;
0069 }
0070 
0071 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0072 
0073 Par02PhysicsList::~Par02PhysicsList() = default;
0074 
0075 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0076 
0077 void Par02PhysicsList::ConstructParticle()
0078 {
0079   // In this method, static member functions should be called for all particles
0080   // which you want to use.
0081   // This ensures that objects of these particle types will be created in the program.
0082   ConstructBosons();
0083   ConstructLeptons();
0084   ConstructMesons();
0085   ConstructBaryons();
0086   ConstructIons();
0087 }
0088 
0089 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0090 
0091 void Par02PhysicsList::ConstructBosons()
0092 {
0093   G4Geantino::GeantinoDefinition();
0094   G4ChargedGeantino::ChargedGeantinoDefinition();
0095   G4Gamma::GammaDefinition();
0096   G4OpticalPhoton::OpticalPhotonDefinition();
0097 }
0098 
0099 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0100 
0101 void Par02PhysicsList::ConstructLeptons()
0102 {
0103   G4LeptonConstructor pConstructor;
0104   pConstructor.ConstructParticle();
0105 }
0106 
0107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0108 
0109 void Par02PhysicsList::ConstructMesons()
0110 {
0111   G4MesonConstructor pConstructor;
0112   pConstructor.ConstructParticle();
0113 }
0114 
0115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0116 
0117 void Par02PhysicsList::ConstructBaryons()
0118 {
0119   G4BaryonConstructor pConstructor;
0120   pConstructor.ConstructParticle();
0121 }
0122 
0123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0124 
0125 void Par02PhysicsList::ConstructIons()
0126 {
0127   G4IonConstructor pConstructor;
0128   pConstructor.ConstructParticle();
0129 }
0130 
0131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0132 
0133 void Par02PhysicsList::ConstructProcess()
0134 {
0135   AddTransportation();
0136   AddParameterisation();
0137   ConstructGeneral();
0138 }
0139 
0140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0141 
0142 void Par02PhysicsList::AddTransportation()
0143 {
0144   // UseCoupledTransportation();
0145   G4VUserPhysicsList::AddTransportation();
0146 }
0147 
0148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0149 
0150 void Par02PhysicsList::ConstructGeneral()
0151 {
0152   auto theDecayProcess = new G4Decay();
0153   auto particleIterator = GetParticleIterator();
0154   particleIterator->reset();
0155   while ((*particleIterator)()) {
0156     G4ParticleDefinition* particle = particleIterator->value();
0157     G4ProcessManager* pmanager = particle->GetProcessManager();
0158     if (theDecayProcess->IsApplicable(*particle)) {
0159       pmanager->AddProcess(theDecayProcess);
0160       // set ordering for PostStepDoIt and AtRestDoIt
0161       pmanager->SetProcessOrdering(theDecayProcess, idxPostStep);
0162       pmanager->SetProcessOrdering(theDecayProcess, idxAtRest);
0163     }
0164   }
0165 }
0166 
0167 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0168 
0169 void Par02PhysicsList::AddParameterisation()
0170 {
0171   G4FastSimulationManagerProcess* fastSimProcess = new G4FastSimulationManagerProcess("G4FSMP");
0172 
0173   // Registers the fastSimProcess with all the particles as a discrete and
0174   // continuous process (this works in all cases; in the case that parallel
0175   // geometries are not used, as in this example, it would be enough to
0176   // add it as a discrete process).
0177   auto particleIterator = GetParticleIterator();
0178   particleIterator->reset();
0179   while ((*particleIterator)()) {
0180     G4ParticleDefinition* particle = particleIterator->value();
0181     G4ProcessManager* pmanager = particle->GetProcessManager();
0182     // pmanager->AddDiscreteProcess( fastSimProcess );    // No parallel geometry
0183     pmanager->AddProcess(fastSimProcess, -1, 0, 0);  // General
0184   }
0185 }
0186 
0187 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0188 
0189 void Par02PhysicsList::SetCuts()
0190 {
0191   if (verboseLevel > 1) {
0192     G4cout << "Par02PhysicsList::SetCuts:";
0193   }
0194   SetCutsWithDefault();
0195 }
0196 
0197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......