Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-18 07:42:19

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 PhysicsList.cc
0027 /// \brief Implementation of the PhysicsList class
0028 
0029 #include "PhysicsList.hh"
0030 
0031 #include "G4SystemOfUnits.hh"
0032 #include "G4UnitsTable.hh"
0033 
0034 #include "PhysicsListMessenger.hh"
0035 
0036 // Particles
0037 #include "G4Gamma.hh"
0038 #include "G4Electron.hh"
0039 #include "G4Positron.hh"
0040 #include "G4Proton.hh"
0041 #include "G4BaryonConstructor.hh"
0042 #include "G4BosonConstructor.hh"
0043 #include "G4DNAGenericIonsManager.hh"
0044 #include "G4IonConstructor.hh"
0045 #include "G4LeptonConstructor.hh"
0046 #include "G4MesonConstructor.hh"
0047 #include "G4ShortLivedConstructor.hh"
0048 
0049 // Physics packages (builders contained in the Geant4 source code)
0050 // Electromagnetic
0051 #include "G4EmDNAPhysics.hh"
0052 #include "G4EmDNAPhysics_option1.hh"
0053 #include "G4EmDNAPhysics_option2.hh"
0054 #include "G4EmDNAPhysics_option3.hh"
0055 #include "G4EmDNAPhysics_option4.hh"
0056 #include "G4EmDNAPhysics_option5.hh"
0057 #include "G4EmDNAPhysics_option6.hh"
0058 #include "G4EmDNAPhysics_option7.hh"
0059 #include "G4EmDNAPhysics_option8.hh"
0060 #include "G4EmLivermorePhysics.hh"
0061 #include "G4EmPenelopePhysics.hh"
0062 #include "G4EmStandardPhysics_option4.hh"
0063 
0064 
0065 
0066 #include <memory>
0067 
0068 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0069 
0070 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0071 {
0072   fMessenger = std::make_unique<PhysicsListMessenger>(this);
0073   SetVerboseLevel(1);
0074   fPhysicsList = std::make_unique<G4EmDNAPhysics_option2>();
0075 }
0076 
0077 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0078 
0079 PhysicsList::~PhysicsList() = default;
0080 
0081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0082 
0083 void PhysicsList::ConstructParticle()
0084 {
0085   // This method is invoked when the Geant4 application starts
0086   // (do not mix with run initialization).
0087 
0088   // (Taken from G4DecayPhysics)
0089   G4BosonConstructor pBosonConstructor;
0090   pBosonConstructor.ConstructParticle();
0091 
0092   G4LeptonConstructor pLeptonConstructor;
0093   pLeptonConstructor.ConstructParticle();
0094 
0095   G4MesonConstructor pMesonConstructor;
0096   pMesonConstructor.ConstructParticle();
0097 
0098   G4BaryonConstructor pBaryonConstructor;
0099   pBaryonConstructor.ConstructParticle();
0100 
0101   G4IonConstructor pIonConstructor;
0102   pIonConstructor.ConstructParticle();
0103 
0104   G4ShortLivedConstructor pShortLivedConstructor;
0105   pShortLivedConstructor.ConstructParticle();
0106 
0107   G4DNAGenericIonsManager* genericIonsManager;
0108   genericIonsManager = G4DNAGenericIonsManager::Instance();
0109   genericIonsManager->GetIon("hydrogen");
0110   genericIonsManager->GetIon("deuteron");
0111   genericIonsManager->GetIon("triton");
0112   genericIonsManager->GetIon("helium");
0113   genericIonsManager->GetIon("alpha");
0114   genericIonsManager->GetIon("alpha+");
0115   genericIonsManager->GetIon("alpha++");
0116   genericIonsManager->GetIon("carbon");
0117 }
0118 
0119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0120 
0121 void PhysicsList::ConstructProcess()
0122 {
0123   // Transportation
0124   AddTransportation();
0125 
0126   // Physics list
0127   fPhysicsList->ConstructProcess();
0128 
0129   // Set cuts for particles
0130   SetCuts();
0131 }
0132 
0133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0134 
0135 void PhysicsList::AddPhysicsList(const G4String& name)
0136 {
0137   if (verboseLevel > -1) {
0138     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0139   }
0140 
0141   if (name == fName) return;
0142 
0143   if (name == "dna") {
0144     fName = name;
0145     fPhysicsList = std::make_unique<G4EmDNAPhysics>();
0146     G4cout << fPhysicsList->GetPhysicsName()
0147            << " physics package has been activated." << G4endl;
0148   }
0149   else if (name == "dna_opt1") {
0150     fName = name;
0151     fPhysicsList = std::make_unique<G4EmDNAPhysics_option1>();
0152     G4cout << fPhysicsList->GetPhysicsName()
0153            << " physics package has been activated." << G4endl;
0154   }
0155 
0156   else if (name == "dna_opt2") {
0157     fName = name;
0158     fPhysicsList = std::make_unique<G4EmDNAPhysics_option2>();
0159     G4cout << fPhysicsList->GetPhysicsName()
0160            << " physics package has been activated." << G4endl;
0161   }
0162 
0163   else if (name == "dna_opt3") {
0164     fName = name;
0165     fPhysicsList = std::make_unique<G4EmDNAPhysics_option3>();
0166     G4cout << fPhysicsList->GetPhysicsName()
0167            << " physics package has been activated." << G4endl;
0168   }
0169 
0170   else if (name == "dna_opt4") {
0171     fName = name;
0172     fPhysicsList = std::make_unique<G4EmDNAPhysics_option4>();
0173     G4cout << fPhysicsList->GetPhysicsName()
0174            << " physics package has been activated." << G4endl;
0175   }
0176 
0177   else if (name == "dna_opt5") {
0178     fName = name;
0179     fPhysicsList = std::make_unique<G4EmDNAPhysics_option5>();
0180     G4cout << fPhysicsList->GetPhysicsName()
0181            << " physics package has been activated." << G4endl;
0182   }
0183 
0184   else if (name == "dna_opt6") {
0185     fName = name;
0186     fPhysicsList = std::make_unique<G4EmDNAPhysics_option6>();
0187     G4cout << fPhysicsList->GetPhysicsName()
0188            << " physics package has been activated." << G4endl;
0189   }
0190 
0191   else if (name == "dna_opt7") {
0192     fName = name;
0193     fPhysicsList = std::make_unique<G4EmDNAPhysics_option7>();
0194     G4cout << fPhysicsList->GetPhysicsName()
0195            << " physics package has been activated." << G4endl;
0196   }
0197 
0198   else if (name == "dna_opt8") {
0199     fName = name;
0200     fPhysicsList = std::make_unique<G4EmDNAPhysics_option8>();
0201     G4cout << fPhysicsList->GetPhysicsName()
0202            << " physics package has been activated." << G4endl;
0203   }
0204 
0205   else if (name == "liv") {
0206     fName = name;
0207     fPhysicsList = std::make_unique<G4EmLivermorePhysics>();
0208     G4cout << fPhysicsList->GetPhysicsName()
0209            << " physics package has been activated." << G4endl;
0210   }
0211 
0212   else if (name == "penelope") {
0213     fName = name;
0214     fPhysicsList = std::make_unique<G4EmPenelopePhysics>();
0215     G4cout << fPhysicsList->GetPhysicsName()
0216            << " physics package has been activated." << G4endl;
0217   }
0218 
0219   else if (name == "em_standard_opt4") {
0220     fName = name;
0221     fPhysicsList = std::make_unique<G4EmStandardPhysics_option4>();
0222     G4cout << fPhysicsList->GetPhysicsName()
0223            << " physics package has been activated." << G4endl;
0224   }
0225 
0226   else {
0227     G4cout << "PhysicsList::AddPhysicsList: \"" << name << "\" is not defined!"
0228            << G4endl;
0229   }
0230 }
0231 
0232 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......