Back to home page

EIC code displayed by LXR

 
 

    


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

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 /// \file radiobiology/src/PhysicsList.cc
0028 /// \brief Implementation of the RadioBio::PhysicsList class
0029 //
0030 //
0031 // 'HADRONTHERAPY_1' and 'HADRONTHERAPY_2' are both suggested;
0032 // It can be activated inside any macro file using the command:
0033 // /Physics/addPhysics HADRONTHERAPY_1 (HADRONTHERAPY_2)
0034 
0035 #include "PhysicsList.hh"
0036 
0037 #include "G4DecayPhysics.hh"
0038 #include "G4EmExtraPhysics.hh"
0039 #include "G4EmStandardPhysics.hh"
0040 #include "G4EmStandardPhysics_option4.hh"
0041 #include "G4HadronElasticPhysics.hh"
0042 #include "G4HadronElasticPhysicsHP.hh"
0043 #include "G4HadronPhysicsQGSP_BIC.hh"
0044 #include "G4HadronPhysicsQGSP_BIC_AllHP.hh"
0045 #include "G4HadronPhysicsQGSP_BIC_HP.hh"
0046 #include "G4IonBinaryCascadePhysics.hh"
0047 #include "G4LossTableManager.hh"
0048 #include "G4NeutronTrackingCut.hh"
0049 #include "G4RadioactiveDecayPhysics.hh"
0050 #include "G4RunManager.hh"
0051 #include "G4StoppingPhysics.hh"
0052 #include "G4SystemOfUnits.hh"
0053 #include "G4VPhysicsConstructor.hh"
0054 
0055 #include "PhysicsListMessenger.hh"
0056 
0057 namespace RadioBio
0058 {
0059 
0060 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0061 
0062 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0063 {
0064   // Set default cut values
0065   G4LossTableManager::Instance();
0066   defaultCutValue = 1. * mm;
0067   fCutForGamma = defaultCutValue;
0068   fCutForElectron = defaultCutValue;
0069   fCutForPositron = defaultCutValue;
0070 
0071   fPhysMessenger = new PhysicsListMessenger(this);
0072   SetVerboseLevel(1);
0073 
0074   // Create default decay physics
0075   fDecayPhysicsList = new G4DecayPhysics();
0076 
0077   // Create default electromagnetic physics
0078   fEmPhysicsList = new G4EmStandardPhysics_option4();
0079 }
0080 
0081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0082 
0083 PhysicsList::~PhysicsList()
0084 {
0085   delete fPhysMessenger;
0086   delete fEmPhysicsList;
0087   delete fDecayPhysicsList;
0088 
0089   // Destroy hadronic physics
0090   for (size_t i = 0; i < fHadronPhys.size(); i++) {
0091     delete fHadronPhys[i];
0092   }
0093 
0094   // Clear pointers
0095   fHadronPhys.clear();
0096 }
0097 
0098 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0099 
0100 void PhysicsList::ConstructParticle()
0101 {
0102   fDecayPhysicsList->ConstructParticle();
0103 }
0104 
0105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0106 
0107 void PhysicsList::ConstructProcess()
0108 {
0109   // Transportation
0110   AddTransportation();
0111 
0112   // Construct default decay and EM processes
0113   fDecayPhysicsList->ConstructProcess();
0114   fEmPhysicsList->ConstructProcess();
0115 
0116   // Construct hadronic processes
0117   for (size_t i = 0; i < fHadronPhys.size(); i++) {
0118     fHadronPhys[i]->ConstructProcess();
0119   }
0120 }
0121 
0122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0123 
0124 void PhysicsList::AddPhysicsList(const G4String& name)
0125 {
0126   if (verboseLevel > 1) {
0127     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0128   }
0129   if (name == fEmName) return;
0130 
0131   ///////////////////////////////////
0132   //   ELECTROMAGNETIC MODELS
0133   ///////////////////////////////////
0134   if (name == "standard_opt4") {
0135     fEmName = name;
0136     delete fEmPhysicsList;
0137     fHadronPhys.clear();
0138     fEmPhysicsList = new G4EmStandardPhysics_option4();
0139     G4RunManager::GetRunManager()->PhysicsHasBeenModified();
0140     if (verboseLevel > 1) {
0141       G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: "
0142              << "G4EmStandardPhysics_option4" << G4endl;
0143     }
0144 
0145     ////////////////////////////////////////
0146     //   ELECTROMAGNETIC + HADRONIC MODELS
0147     ////////////////////////////////////////
0148   }
0149   else if (name == "HADRONTHERAPY_1") {
0150     AddPhysicsList("standard_opt4");
0151     fHadronPhys.push_back(new G4RadioactiveDecayPhysics());
0152     fHadronPhys.push_back(new G4IonBinaryCascadePhysics());
0153     fHadronPhys.push_back(new G4EmExtraPhysics());
0154     fHadronPhys.push_back(new G4HadronElasticPhysicsHP());
0155     fHadronPhys.push_back(new G4StoppingPhysics());
0156     fHadronPhys.push_back(new G4HadronPhysicsQGSP_BIC_HP());
0157     fHadronPhys.push_back(new G4NeutronTrackingCut());
0158 
0159     G4cout << "HADRONTHERAPY_1 PHYSICS LIST has been activated" << G4endl;
0160   }
0161 
0162   else if (name == "HADRONTHERAPY_2") {
0163     // HP models are switched off
0164     AddPhysicsList("standard_opt4");
0165     fHadronPhys.push_back(new G4RadioactiveDecayPhysics());
0166     fHadronPhys.push_back(new G4IonBinaryCascadePhysics());
0167     fHadronPhys.push_back(new G4EmExtraPhysics());
0168     fHadronPhys.push_back(new G4HadronElasticPhysics());
0169     fHadronPhys.push_back(new G4StoppingPhysics());
0170     fHadronPhys.push_back(new G4HadronPhysicsQGSP_BIC());
0171     fHadronPhys.push_back(new G4NeutronTrackingCut());
0172 
0173     G4cout << "HADRONTHERAPY_2 PHYSICS LIST has been activated" << G4endl;
0174   }
0175   else {
0176     G4Exception("PhysicsList::AddPhysicsList", "NoPhysicsList", JustWarning,
0177                 (name + " is not a defined physics list").c_str());
0178   }
0179 }
0180 
0181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0182 
0183 }  // namespace RadioBio