Back to home page

EIC code displayed by LXR

 
 

    


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

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 medical/fanoCavity2/src/PhysicsList.cc
0027 /// \brief Implementation of the PhysicsList class
0028 //
0029 //
0030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 
0033 #include "PhysicsList.hh"
0034 
0035 #include "PhysListEmStandard_GS.hh"
0036 #include "PhysListEmStandard_SS.hh"
0037 #include "PhysListEmStandard_WVI.hh"
0038 #include "PhysListEmStandard_option0.hh"
0039 #include "PhysListEmStandard_option3.hh"
0040 #include "PhysListEmStandard_option4.hh"
0041 #include "PhysicsListMessenger.hh"
0042 #include "StepMax.hh"
0043 
0044 #include "G4LossTableManager.hh"
0045 #include "G4ParticleDefinition.hh"
0046 #include "G4ProcessManager.hh"
0047 
0048 // Bosons
0049 #include "G4ChargedGeantino.hh"
0050 #include "G4Gamma.hh"
0051 #include "G4Geantino.hh"
0052 
0053 // leptons
0054 #include "G4Electron.hh"
0055 #include "G4Positron.hh"
0056 
0057 // Hadrons
0058 #include "G4Proton.hh"
0059 #include "G4SystemOfUnits.hh"
0060 
0061 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0062 
0063 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0064 {
0065   G4LossTableManager::Instance();
0066   fMessenger = new PhysicsListMessenger(this);
0067 
0068   // EM physics
0069   fEmName = G4String("standard_opt3");
0070   fEmPhysicsList = new PhysListEmStandard_option3(fEmName);
0071 
0072   defaultCutValue = 10 * km;
0073 
0074   SetVerboseLevel(1);
0075 }
0076 
0077 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0078 
0079 PhysicsList::~PhysicsList()
0080 {
0081   delete fEmPhysicsList;
0082   delete fMessenger;
0083 }
0084 
0085 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0086 
0087 void PhysicsList::ConstructParticle()
0088 {
0089   // pseudo-particles
0090   G4Geantino::GeantinoDefinition();
0091   G4ChargedGeantino::ChargedGeantinoDefinition();
0092 
0093   // gamma
0094   G4Gamma::GammaDefinition();
0095 
0096   // leptons
0097   G4Electron::ElectronDefinition();
0098   G4Positron::PositronDefinition();
0099 
0100   // baryons
0101   G4Proton::ProtonDefinition();
0102 }
0103 
0104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0105 
0106 void PhysicsList::ConstructProcess()
0107 {
0108   AddTransportation();
0109   fEmPhysicsList->ConstructProcess();
0110 
0111   AddStepMax();
0112 }
0113 
0114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0115 
0116 void PhysicsList::AddStepMax()
0117 {
0118   // Step limitation seen as a process
0119   StepMax* stepMaxProcess = new StepMax();
0120 
0121   auto particleIterator = GetParticleIterator();
0122   particleIterator->reset();
0123   while ((*particleIterator)()) {
0124     G4ParticleDefinition* particle = particleIterator->value();
0125     G4ProcessManager* pmanager = particle->GetProcessManager();
0126 
0127     if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
0128       pmanager->AddDiscreteProcess(stepMaxProcess);
0129     }
0130   }
0131 }
0132 
0133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0134 
0135 void PhysicsList::AddPhysicsList(const G4String& name)
0136 {
0137   if (verboseLevel > 0) {
0138     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0139   }
0140 
0141   if (name == fEmName) return;
0142 
0143   if (name == "standard_opt0") {
0144     fEmName = name;
0145     delete fEmPhysicsList;
0146     fEmPhysicsList = new PhysListEmStandard_option0(name);
0147   }
0148   else if (name == "standard_opt3") {
0149     fEmName = name;
0150     delete fEmPhysicsList;
0151     fEmPhysicsList = new PhysListEmStandard_option3(name);
0152   }
0153   else if (name == "standard_opt4") {
0154     fEmName = name;
0155     delete fEmPhysicsList;
0156     fEmPhysicsList = new PhysListEmStandard_option4(name);
0157   }
0158   else if (name == "standard_GS") {
0159     fEmName = name;
0160     delete fEmPhysicsList;
0161     fEmPhysicsList = new PhysListEmStandard_GS(name);
0162   }
0163   else if (name == "standard_WVI") {
0164     fEmName = name;
0165     delete fEmPhysicsList;
0166     fEmPhysicsList = new PhysListEmStandard_WVI(name);
0167   }
0168   else if (name == "standard_SS") {
0169     fEmName = name;
0170     delete fEmPhysicsList;
0171     fEmPhysicsList = new PhysListEmStandard_SS(name);
0172   }
0173   else {
0174     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0175            << " is not defined" << G4endl;
0176   }
0177 }
0178 
0179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......