Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:50

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 // This example is provided by the Geant4-DNA collaboration
0027 // chem6 example is derived from chem4 and chem5 examples
0028 //
0029 // Any report or published results obtained using the Geant4-DNA software
0030 // shall cite the following Geant4-DNA collaboration publication:
0031 // J. Appl. Phys. 125 (2019) 104301
0032 // Med. Phys. 45 (2018) e722-e739
0033 // J. Comput. Phys. 274 (2014) 841-882
0034 // Med. Phys. 37 (2010) 4692-4708
0035 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157-178
0036 // The Geant4-DNA web site is available at http://geant4-dna.org
0037 //
0038 // Authors: W. G. Shin and S. Incerti (CENBG, France)
0039 //
0040 /// \file PhysicsList.cc
0041 /// \brief Implementation of the PhysicsList class
0042 
0043 #include "PhysicsList.hh"
0044 
0045 #include "G4EmDNAChemistry.hh"
0046 #include "G4EmDNAChemistry_option1.hh"
0047 #include "G4EmDNAChemistry_option2.hh"
0048 #include "G4EmDNAChemistry_option3.hh"
0049 #include "G4EmDNAPhysics.hh"
0050 #include "G4EmDNAPhysics_option1.hh"
0051 #include "G4EmDNAPhysics_option2.hh"
0052 #include "G4EmDNAPhysics_option3.hh"
0053 #include "G4EmDNAPhysics_option4.hh"
0054 #include "G4EmDNAPhysics_option5.hh"
0055 #include "G4EmDNAPhysics_option6.hh"
0056 #include "G4EmDNAPhysics_option7.hh"
0057 #include "G4EmDNAPhysics_option8.hh"
0058 #include "G4EmParameters.hh"
0059 #include "G4SystemOfUnits.hh"
0060 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0061 
0062 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0063 {
0064   G4double currentDefaultCut = 0.001 * mm;
0065   G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV);
0066   SetDefaultCutValue(currentDefaultCut);
0067   SetVerboseLevel(1);
0068 
0069   RegisterConstructor("G4EmDNAPhysics_option2");
0070   RegisterConstructor("G4EmDNAChemistry_option3");
0071 }
0072 
0073 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0074 
0075 PhysicsList::~PhysicsList() = default;
0076 
0077 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0078 
0079 void PhysicsList::ConstructParticle()
0080 {
0081   if (fEmDNAPhysicsList != nullptr) {
0082     fEmDNAPhysicsList->ConstructParticle();
0083   }
0084   if (fEmDNAChemistryList != nullptr) {
0085     fEmDNAChemistryList->ConstructParticle();
0086   }
0087 }
0088 
0089 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0090 
0091 void PhysicsList::ConstructProcess()
0092 {
0093   AddTransportation();
0094   if (fEmDNAPhysicsList != nullptr) {
0095     fEmDNAPhysicsList->ConstructProcess();
0096   }
0097   if (fEmDNAChemistryList != nullptr) {
0098     fEmDNAChemistryList->ConstructProcess();
0099   }
0100 }
0101 
0102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0103 
0104 void PhysicsList::RegisterConstructor(const G4String& name)
0105 {
0106   if (name == fPhysDNAName) {
0107     return;
0108   }
0109   if (verboseLevel > 0) {
0110     G4cout << "===== Register constructor ==== " << name << G4endl;
0111   }
0112   if (name == "G4EmDNAPhysics") {
0113     fEmDNAPhysicsList = std::make_unique<G4EmDNAPhysics>(verboseLevel);
0114     fPhysDNAName = name;
0115   }
0116   else if (name == "G4EmDNAPhysics_option1") {
0117     fEmDNAPhysicsList = std::make_unique<G4EmDNAPhysics_option1>(verboseLevel);
0118     fPhysDNAName = name;
0119   }
0120   else if (name == "G4EmDNAPhysics_option2") {
0121     fEmDNAPhysicsList = std::make_unique<G4EmDNAPhysics_option2>(verboseLevel);
0122     fPhysDNAName = name;
0123   }
0124   else if (name == "G4EmDNAPhysics_option3") {
0125     fEmDNAPhysicsList = std::make_unique<G4EmDNAPhysics_option3>(verboseLevel);
0126     fPhysDNAName = name;
0127   }
0128   else if (name == "G4EmDNAPhysics_option4") {
0129     fEmDNAPhysicsList = std::make_unique<G4EmDNAPhysics_option4>(verboseLevel);
0130     fPhysDNAName = name;
0131   }
0132   else if (name == "G4EmDNAPhysics_option5") {
0133     fEmDNAPhysicsList = std::make_unique<G4EmDNAPhysics_option5>(verboseLevel);
0134     fPhysDNAName = name;
0135   }
0136   else if (name == "G4EmDNAPhysics_option6") {
0137     fEmDNAPhysicsList = std::make_unique<G4EmDNAPhysics_option6>(verboseLevel);
0138     fPhysDNAName = name;
0139   }
0140   else if (name == "G4EmDNAPhysics_option7") {
0141     fEmDNAPhysicsList = std::make_unique<G4EmDNAPhysics_option7>(verboseLevel);
0142     fPhysDNAName = name;
0143   }
0144   else if (name == "G4EmDNAPhysics_option8") {
0145     fEmDNAPhysicsList = std::make_unique<G4EmDNAPhysics_option8>(verboseLevel);
0146     fPhysDNAName = name;
0147   }
0148   else if (name == "G4EmDNAChemistry") {
0149     fEmDNAChemistryList = std::make_unique<G4EmDNAChemistry>();
0150     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0151   }
0152   else if (name == "G4EmDNAChemistry_option1") {
0153     fEmDNAChemistryList = std::make_unique<G4EmDNAChemistry_option1>();
0154     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0155   }
0156   else if (name == "G4EmDNAChemistry_option2") {
0157     fEmDNAChemistryList = std::make_unique<G4EmDNAChemistry_option2>();
0158     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0159   }
0160   else if (name == "G4EmDNAChemistry_option3") {
0161     fEmDNAChemistryList = std::make_unique<G4EmDNAChemistry_option3>();
0162     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0163   }
0164   else {
0165     G4cout << "PhysicsList::RegisterConstructor: <" << name << ">"
0166            << " fails - name is not defined" << G4endl;
0167   }
0168 }
0169 
0170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......