Back to home page

EIC code displayed by LXR

 
 

    


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

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 medical/fanoCavity/src/PhysicsList.cc
0027 /// \brief Implementation of the PhysicsList class
0028 //
0029 //
0030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 
0033 #include "PhysicsList.hh"
0034 
0035 #include "PhysListEmStandard_GS.hh"
0036 #include "PhysListEmStandard_SS.hh"
0037 #include "PhysListEmStandard_WVI.hh"
0038 #include "PhysListEmStandard_option0.hh"
0039 #include "PhysListEmStandard_option3.hh"
0040 #include "PhysListEmStandard_option4.hh"
0041 #include "PhysicsListMessenger.hh"
0042 #include "StepMax.hh"
0043 
0044 #include "G4EmBuilder.hh"
0045 #include "G4LossTableManager.hh"
0046 #include "G4ParticleDefinition.hh"
0047 #include "G4ProcessManager.hh"
0048 #include "G4SystemOfUnits.hh"
0049 #include "G4UnitsTable.hh"
0050 
0051 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0052 
0053 PhysicsList::PhysicsList(DetectorConstruction* det) : G4VModularPhysicsList(), fDetector(det)
0054 {
0055   G4LossTableManager::Instance();
0056   fMessenger = new PhysicsListMessenger(this);
0057 
0058   // EM physics
0059   fEmName = G4String("standard_opt3");
0060   fEmPhysicsList = new PhysListEmStandard_option3(fEmName, fDetector);
0061 
0062   defaultCutValue = 10 * km;
0063 
0064   SetVerboseLevel(1);
0065 }
0066 
0067 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0068 
0069 PhysicsList::~PhysicsList()
0070 {
0071   delete fEmPhysicsList;
0072   delete fMessenger;
0073 }
0074 
0075 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0076 
0077 void PhysicsList::ConstructParticle()
0078 {
0079   G4EmBuilder::ConstructMinimalEmSet();
0080 }
0081 
0082 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0083 
0084 void PhysicsList::ConstructProcess()
0085 {
0086   AddTransportation();
0087   fEmPhysicsList->ConstructProcess();
0088 
0089   AddStepMax();
0090 }
0091 
0092 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0093 
0094 void PhysicsList::AddStepMax()
0095 {
0096   // Step limitation seen as a process
0097   StepMax* stepMaxProcess = new StepMax();
0098 
0099   auto particleIterator = GetParticleIterator();
0100   particleIterator->reset();
0101   while ((*particleIterator)()) {
0102     G4ParticleDefinition* particle = particleIterator->value();
0103     G4ProcessManager* pmanager = particle->GetProcessManager();
0104 
0105     if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
0106       pmanager->AddDiscreteProcess(stepMaxProcess);
0107     }
0108   }
0109 }
0110 
0111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0112 
0113 void PhysicsList::AddPhysicsList(const G4String& name)
0114 {
0115   if (verboseLevel > 0) {
0116     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0117   }
0118 
0119   if (name == fEmName) return;
0120 
0121   if (name == "standard_opt0") {
0122     fEmName = name;
0123     delete fEmPhysicsList;
0124     fEmPhysicsList = new PhysListEmStandard_option0(name, fDetector);
0125   }
0126   else if (name == "standard_opt3") {
0127     fEmName = name;
0128     delete fEmPhysicsList;
0129     fEmPhysicsList = new PhysListEmStandard_option3(name, fDetector);
0130   }
0131   else if (name == "standard_opt4") {
0132     fEmName = name;
0133     delete fEmPhysicsList;
0134     fEmPhysicsList = new PhysListEmStandard_option4(name, fDetector);
0135   }
0136   else if (name == "standard_GS") {
0137     fEmName = name;
0138     delete fEmPhysicsList;
0139     fEmPhysicsList = new PhysListEmStandard_GS(name, fDetector);
0140   }
0141   else if (name == "standard_WVI") {
0142     fEmName = name;
0143     delete fEmPhysicsList;
0144     fEmPhysicsList = new PhysListEmStandard_WVI(name, fDetector);
0145   }
0146   else if (name == "standard_SS") {
0147     fEmName = name;
0148     delete fEmPhysicsList;
0149     fEmPhysicsList = new PhysListEmStandard_SS(name, fDetector);
0150   }
0151   else {
0152     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0153            << " is not defined" << G4endl;
0154   }
0155 }
0156 
0157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0158 
0159 void PhysicsList::SetCuts()
0160 {
0161   if (verboseLevel > 0) {
0162     G4cout << "PhysicsList::SetCuts:";
0163     G4cout << "CutLength : " << G4BestUnit(defaultCutValue, "Length") << G4endl;
0164   }
0165 
0166   // set cut values for gamma at first and for e- second and next for e+,
0167   // because some processes for e+/e- need cut values for gamma
0168   SetCutValue(defaultCutValue, "gamma");
0169   SetCutValue(defaultCutValue, "e-");
0170   SetCutValue(defaultCutValue, "e+");
0171   SetCutValue(defaultCutValue, "proton");
0172 }
0173 
0174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......