Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:33

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