Back to home page

EIC code displayed by LXR

 
 

    


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

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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0028 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0029 
0030 #include "PhysicsList.hh"
0031 #include "PhysicsListMessenger.hh"
0032 
0033 #include "PhysListEmStandard.hh"
0034 
0035 #include "G4EmStandardPhysics.hh"
0036 #include "G4EmStandardPhysics_option1.hh"
0037 #include "G4EmStandardPhysics_option2.hh"
0038 #include "G4EmStandardPhysics_option3.hh"
0039 
0040 #include "G4LossTableManager.hh"
0041 #include "G4SystemOfUnits.hh"
0042 #include "G4UnitsTable.hh"
0043 
0044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0045 
0046 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0047 {
0048   pMessenger = new PhysicsListMessenger(this);
0049   SetVerboseLevel(1);
0050 
0051   // EM physics
0052   emName = G4String("local");
0053   emPhysicsList = new PhysListEmStandard(emName);
0054   
0055   SetDefaultCutValue(1*mm);
0056   G4LossTableManager::Instance();
0057 }
0058 
0059 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0060 
0061 PhysicsList::~PhysicsList()
0062 {
0063   delete pMessenger;
0064 }
0065 
0066 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0067 
0068 #include "G4BosonConstructor.hh"
0069 #include "G4LeptonConstructor.hh"
0070 #include "G4MesonConstructor.hh"
0071 #include "G4BosonConstructor.hh"
0072 #include "G4BaryonConstructor.hh"
0073 #include "G4IonConstructor.hh"
0074 #include "G4ShortLivedConstructor.hh"
0075 
0076 void PhysicsList::ConstructParticle()
0077 {
0078     G4BosonConstructor  pBosonConstructor;
0079     pBosonConstructor.ConstructParticle();
0080 
0081     G4LeptonConstructor pLeptonConstructor;
0082     pLeptonConstructor.ConstructParticle();
0083 
0084     G4MesonConstructor pMesonConstructor;
0085     pMesonConstructor.ConstructParticle();
0086 
0087     G4BaryonConstructor pBaryonConstructor;
0088     pBaryonConstructor.ConstructParticle();
0089 
0090     G4IonConstructor pIonConstructor;
0091     pIonConstructor.ConstructParticle();
0092 
0093     G4ShortLivedConstructor pShortLivedConstructor;
0094     pShortLivedConstructor.ConstructParticle();  
0095 }
0096 
0097 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0098 
0099 #include "G4PhysicsListHelper.hh"
0100 #include "G4Decay.hh"
0101 
0102 void PhysicsList::ConstructProcess()
0103 {
0104   AddTransportation();
0105 
0106   // electromagnetic Physics List
0107   //
0108   emPhysicsList->ConstructProcess();
0109 
0110   // Add Decay Process
0111   //
0112   G4Decay* fDecayProcess = new G4Decay();
0113   G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0114   
0115   auto particleIterator=GetParticleIterator();
0116   particleIterator->reset();
0117   while( (*particleIterator)() ){
0118     G4ParticleDefinition* particle = particleIterator->value();
0119     if (fDecayProcess->IsApplicable(*particle)) 
0120       ph ->RegisterProcess(fDecayProcess, particle);
0121   }
0122 }
0123 
0124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0125 
0126 void PhysicsList::AddPhysicsList(const G4String& name)
0127 {
0128   if (verboseLevel>1) {
0129     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0130   }
0131 
0132   if (name == emName) return;
0133 
0134   if (name == "local") {
0135 
0136     emName = name;
0137     delete emPhysicsList;
0138     emPhysicsList = new PhysListEmStandard(name);
0139 
0140   } else if (name == "emstandard_opt0") {
0141 
0142     emName = name;
0143     delete emPhysicsList;
0144     emPhysicsList = new G4EmStandardPhysics();
0145 
0146   } else if (name == "emstandard_opt1") {
0147 
0148     emName = name;
0149     delete emPhysicsList;
0150     emPhysicsList = new G4EmStandardPhysics_option1();
0151 
0152   } else if (name == "emstandard_opt2") {
0153 
0154     emName = name;
0155     delete emPhysicsList;
0156     emPhysicsList = new G4EmStandardPhysics_option2();
0157     
0158   } else if (name == "emstandard_opt3") {
0159 
0160     emName = name;
0161     delete emPhysicsList;
0162     emPhysicsList = new G4EmStandardPhysics_option3();
0163 
0164   } else {
0165 
0166     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0167            << " is not defined"
0168            << G4endl;
0169   }
0170 }
0171 
0172 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......