Back to home page

EIC code displayed by LXR

 
 

    


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