// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // /// \file PhysicsList.cc /// \brief Implementation of the PhysicsList class // //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... #include "PhysicsList.hh" #include "G4SystemOfUnits.hh" #include "G4UnitsTable.hh" //#include "GammaNuclearPhysics.hh" //#include "G4DecayPhysics.hh" #include "G4RadioactiveDecayPhysics.hh" /*#include "G4HadronElasticPhysicsHP.hh" #include "G4HadronElasticPhysicsXS.hh" #include "G4IonElasticPhysics.hh"*/ #include "FTFP_BERT.hh" // particles #include "G4BosonConstructor.hh" #include "G4LeptonConstructor.hh" #include "G4MesonConstructor.hh" #include "G4BosonConstructor.hh" #include "G4BaryonConstructor.hh" #include "G4IonConstructor.hh" #include "G4ShortLivedConstructor.hh" #include "G4EmStandardPhysics_option4.hh" #include "G4EmStandardPhysics.hh" #include "G4OpticalPhysics.hh" #include "G4Scintillation.hh" #include "G4OpAbsorption.hh" #include "G4OpBoundaryProcess.hh" #include "G4DecayPhysics.hh" #include "G4ProcessManager.hh" #include "G4Electron.hh" #include "G4Positron.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... PhysicsList::PhysicsList() :G4VModularPhysicsList() { G4int verb = 0; OpVerbLevel = 1; SetVerboseLevel(verb); RegisterPhysics(new G4EmStandardPhysics()); G4VModularPhysicsList* phys = new FTFP_BERT; for (G4int i = 0; ; ++i) { G4VPhysicsConstructor* elem = const_cast (phys->GetPhysics(i)); if (elem == NULL) break; G4cout << "RegisterPhysics: " << elem->GetPhysicsName() << G4endl; RegisterPhysics(elem); hadronPhys.push_back(elem); } emPhysicsList = new G4EmStandardPhysics_option4(); // Decay //RegisterPhysics(new G4RadioactiveDecayPhysics()); //RegisterPhysics(new G4IonPhysics()); // Gamma physics // //RegisterPhysics( new GammaNuclearPhysics("gamma")); RegisterPhysics(new G4DecayPhysics()); ReplacePhysics(new G4EmStandardPhysics_option4()); emName = G4String("standard_opt4"); G4OpticalPhysics* opticalPhysics = new G4OpticalPhysics(); auto opticalParams = G4OpticalParameters::Instance(); opticalParams->SetBoundaryInvokeSD(true); RegisterPhysics(opticalPhysics); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... PhysicsList::~PhysicsList() { //delete pMessenger; delete emPhysicsList; delete decPhysicsList; //for(size_t i=0; iConstructProcess(); em_config.AddModels(); } //////////////////////////////////////////// void PhysicsList::ConstructHad() { AddTransportation(); emPhysicsList->ConstructProcess(); em_config.AddModels(); // decay physics list //decPhysicsList->ConstructProcess(); // hadronic physics lists for(size_t i=0; iConstructProcess(); } } // Optical Processes //////////////////////////////////////////////////////// void PhysicsList::ConstructOp() { // default scintillation process G4Scintillation* theScintProcessDef = new G4Scintillation("Scintillation"); theScintProcessDef->SetTrackSecondariesFirst(true); theScintProcessDef->SetVerboseLevel(OpVerbLevel); // optical processes G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption(); G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess(); theAbsorptionProcess->SetVerboseLevel(OpVerbLevel); theBoundaryProcess->SetVerboseLevel(OpVerbLevel); auto particleIterator=GetParticleIterator(); particleIterator->reset(); while( (*particleIterator)() ) { G4ParticleDefinition* particle = particleIterator->value(); G4ProcessManager* pmanager = particle->GetProcessManager(); G4String particleName = particle->GetParticleName(); if (theScintProcessDef->IsApplicable(*particle)) { pmanager->AddProcess(theScintProcessDef); pmanager->SetProcessOrderingToLast(theScintProcessDef,idxAtRest); pmanager->SetProcessOrderingToLast(theScintProcessDef,idxPostStep); } if (particleName == "opticalphoton") { pmanager->AddDiscreteProcess(theAbsorptionProcess); pmanager->AddDiscreteProcess(theBoundaryProcess); } } } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void PhysicsList::SetCuts() { //SetCutValue(0.*mm, "proton"); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... ///////////////////////////////////////////////////////////////////////////// void PhysicsList::AddPhysicsList(const G4String& name) { if (verboseLevel>1) { G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; } //if (name == emName) { // return; //} //else if (name == "standard_opt4") { emName = name; delete emPhysicsList; emPhysicsList = new G4EmStandardPhysics_option4(); G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option4" << G4endl; } /* else if (name == "binary" && !bicIsRegisted) { hadronPhys.push_back(new G4HadronPhysicsQGSP_BIC_HP()); bicIsRegisted = true; G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: HadronPhysicsQGSP_BIC_HP()" << G4endl; } */ /*else if (name == "radioactive_decay" && !radioactiveDecayIsRegisted ) { hadronPhys.push_back(new G4RadioactiveDecayPhysics()); radioactiveDecayIsRegisted = true; G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4RadioactiveDecayPhysics()" << G4endl; } else { G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << " is not defined" << G4endl; }*/ }