Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/extended/medical/radiobiology/src/PhysicsList.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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