Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:16:37

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 #include "G4RunManager.hh"
0028 #include "globals.hh"
0029 #include "G4ProcessManager.hh"
0030 #include "G4Region.hh"
0031 #include "G4RegionStore.hh"
0032 
0033 #include "G4ParticleDefinition.hh"
0034 #include "G4ParticleTypes.hh"
0035 #include "G4ParticleTable.hh"
0036 
0037 #include "G4PhysListFactory.hh"
0038 #include "GammaKnifePhysicsList.hh"
0039 #include "GammaKnifePhysicsListMessenger.hh"
0040 #include "GammaKnifeParticles.hh"
0041 #include "G4SystemOfUnits.hh"
0042 
0043 
0044 // Physic lists (contained inside the Geant4 source code, in the 'physicslists folder')
0045 #include "G4EmStandardPhysics_option3.hh"
0046 #include "G4EmLivermorePhysics.hh"
0047 #include "G4EmPenelopePhysics.hh"
0048 #include "G4EmExtraPhysics.hh"
0049 
0050 #include "G4DecayPhysics.hh"
0051 #include "G4RadioactiveDecayPhysics.hh"
0052 
0053 #include "G4LossTableManager.hh"
0054 #include "G4UnitsTable.hh"
0055 
0056 GammaKnifePhysicsList::GammaKnifePhysicsList(): G4VModularPhysicsList()
0057 {
0058   G4LossTableManager::Instance();
0059   defaultCutValue = 1.*mm;
0060   cutForGamma     = defaultCutValue;
0061   cutForElectron  = defaultCutValue;
0062   cutForPositron  = defaultCutValue;
0063 
0064   radioactiveDecayIsRegistered = false;
0065 
0066 
0067   messenger = new GammaKnifePhysicsListMessenger(this);
0068   SetVerboseLevel(1);
0069 
0070   // EM physics
0071   emPhysicsList = new G4EmStandardPhysics_option3(1);
0072   emName = G4String("emstandard_opt3");
0073 
0074   // Decay physics and all particles
0075   decPhysicsList = new G4DecayPhysics();
0076 }
0077 
0078 GammaKnifePhysicsList::~GammaKnifePhysicsList()
0079 { 
0080   delete messenger;
0081   delete emPhysicsList;
0082   delete decPhysicsList;
0083   for(size_t i=0; i<hadronPhys.size(); i++) 
0084     delete hadronPhys[i];
0085 }
0086 
0087 void GammaKnifePhysicsList::ConstructParticle()
0088 {
0089   decPhysicsList->ConstructParticle();
0090   emPhysicsList->ConstructParticle();
0091 }
0092 
0093 void GammaKnifePhysicsList::ConstructProcess()
0094 {
0095   // transportation
0096   AddTransportation();
0097 
0098   // electromagnetic physics list
0099   emPhysicsList->ConstructProcess();
0100   
0101   // decay physics list
0102   decPhysicsList->ConstructProcess();
0103 
0104   // hadronic physics lists
0105   for(size_t i=0; i<hadronPhys.size(); i++) {
0106     hadronPhys[i] -> ConstructProcess();
0107   }
0108 
0109 }
0110 
0111 
0112 void GammaKnifePhysicsList::AddPhysicsList(const G4String& name)
0113 {
0114 
0115     if (verboseLevel>1) {
0116     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0117     }
0118     if (name == emName) return;
0119 
0120     /////////////////////////////////////////////////////////////////////////////
0121     //   ELECTROMAGNETIC MODELS
0122     /////////////////////////////////////////////////////////////////////////////
0123     if (name == "standard_opt3") {
0124     emName = name;
0125     delete emPhysicsList;
0126     emPhysicsList = new G4EmStandardPhysics_option3();
0127     G4RunManager::GetRunManager() -> PhysicsHasBeenModified();
0128     G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
0129 
0130     } else if (name == "LowE_Livermore") {
0131     emName = name;
0132     delete emPhysicsList;
0133     emPhysicsList = new G4EmLivermorePhysics();
0134     G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
0135     G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
0136 
0137     } else if (name == "LowE_Penelope") {
0138     emName = name;
0139     delete emPhysicsList;
0140     emPhysicsList = new G4EmPenelopePhysics();
0141     G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
0142     G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
0143 
0144     /////////////////////////////////////////////////////////////////////////////
0145     //   HADRONIC MODELS
0146     /////////////////////////////////////////////////////////////////////////////
0147 
0148 
0149     }  else if (name == "decay")
0150     {
0151     hadronPhys.push_back(new G4DecayPhysics());
0152     //radioactiveDecayIsRegistered = true;
0153     }
0154     else if (name == "radioactive_decay" && !radioactiveDecayIsRegistered )
0155     {
0156     hadronPhys.push_back(new G4RadioactiveDecayPhysics());
0157     radioactiveDecayIsRegistered = true;
0158     }
0159     else {
0160 
0161     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0162         << " is not defined"
0163         << G4endl;
0164     }
0165 
0166  }
0167 
0168 
0169 /////////////////////////////////////////////////////////////////////////////
0170 void GammaKnifePhysicsList::SetCuts()
0171 {  
0172 
0173   if (verboseLevel >0){
0174     G4cout << "PhysicsList::SetCuts:";
0175     G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
0176   }
0177 
0178   // set cut values for gamma at first and for e- second and next for e+,
0179   // because some processes for e+/e- need cut values for gamma
0180   SetCutValue(cutForGamma, "gamma");
0181   SetCutValue(cutForElectron, "e-");
0182   SetCutValue(cutForPositron, "e+");
0183 
0184  
0185   if (verboseLevel>0) DumpCutValuesTable();
0186 }
0187 
0188 /////////////////////////////////////////////////////////////////////////////
0189 void GammaKnifePhysicsList::SetCutForGamma(G4double cut)
0190 {
0191   cutForGamma = cut;
0192   SetParticleCuts(cutForGamma, G4Gamma::Gamma());
0193 }
0194 
0195 /////////////////////////////////////////////////////////////////////////////
0196 void GammaKnifePhysicsList::SetCutForElectron(G4double cut)
0197 {
0198   cutForElectron = cut;
0199   SetParticleCuts(cutForElectron, G4Electron::Electron());
0200 }
0201 
0202 /////////////////////////////////////////////////////////////////////////////
0203 void GammaKnifePhysicsList::SetCutForPositron(G4double cut)
0204 {
0205   cutForPositron = cut;
0206   SetParticleCuts(cutForPositron, G4Positron::Positron());
0207 }
0208