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 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/extended/medical/GammaTherapy/src/PhysicsList.cc (Version 11.3.0) and /examples/extended/medical/GammaTherapy/src/PhysicsList.cc (Version 9.3)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 /// \file medical/GammaTherapy/src/PhysicsList <<  26 // $Id: PhysicsList.cc,v 1.17 2009/11/21 16:47:07 vnivanch Exp $
 27 /// \brief Implementation of the PhysicsList c <<  27 // GEANT4 tag $Name: geant4-09-03 $
 28 //                                             << 
 29 //                                                 28 //
 30 //--------------------------------------------     29 //---------------------------------------------------------------------------
 31 //                                                 30 //
 32 // ClassName:   PhysicsList                        31 // ClassName:   PhysicsList
 33 //                                                 32 //
 34 // Author:      V.Ivanchenko 03.05.2004            33 // Author:      V.Ivanchenko 03.05.2004
 35 //                                                 34 //
 36 // Modified:                                       35 // Modified:
 37 // 16.11.06 Use components from physics_lists      36 // 16.11.06 Use components from physics_lists subdirectory (V.Ivanchenko)
 38 // 16.05.07 Use renamed EM components from phy     37 // 16.05.07 Use renamed EM components from physics_lists (V.Ivanchenko)
 39 //                                                 38 //
 40 //--------------------------------------------     39 //----------------------------------------------------------------------------
 41 //                                                 40 //
 42                                                    41 
 43 //....oooOO0OOooo........oooOO0OOooo........oo     42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 44 //....oooOO0OOooo........oooOO0OOooo........oo     43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 45                                                    44 
 46 #include "PhysicsList.hh"                          45 #include "PhysicsList.hh"
 47                                                << 
 48 #include "PhysicsListMessenger.hh"                 46 #include "PhysicsListMessenger.hh"
 49 #include "StepLimiterBuilder.hh"               << 
 50                                                    47 
 51 #include "G4DecayPhysics.hh"                   << 
 52 #include "G4EmExtraPhysics.hh"                 << 
 53 #include "G4EmLivermorePhysics.hh"             << 
 54 #include "G4EmLowEPPhysics.hh"                 << 
 55 #include "G4EmParameters.hh"                   << 
 56 #include "G4EmPenelopePhysics.hh"              << 
 57 #include "G4EmStandardPhysics.hh"                  48 #include "G4EmStandardPhysics.hh"
 58 #include "G4EmStandardPhysics_option1.hh"          49 #include "G4EmStandardPhysics_option1.hh"
 59 #include "G4EmStandardPhysics_option2.hh"          50 #include "G4EmStandardPhysics_option2.hh"
 60 #include "G4EmStandardPhysics_option3.hh"          51 #include "G4EmStandardPhysics_option3.hh"
 61 #include "G4EmStandardPhysics_option4.hh"      <<  52 #include "G4EmLivermorePhysics.hh"
                                                   >>  53 #include "G4EmPenelopePhysics.hh"
                                                   >>  54 #include "G4StepLimiterBuilder.hh"
                                                   >>  55 #include "G4DecayPhysics.hh"
 62 #include "G4HadronElasticPhysics.hh"               56 #include "G4HadronElasticPhysics.hh"
 63 #include "G4HadronInelasticQBBC.hh"                57 #include "G4HadronInelasticQBBC.hh"
 64 #include "G4IonBinaryCascadePhysics.hh"            58 #include "G4IonBinaryCascadePhysics.hh"
 65 #include "G4LossTableManager.hh"               <<  59 #include "G4EmExtraPhysics.hh"
 66 #include "G4PhysicalConstants.hh"              <<  60 #include "G4QStoppingPhysics.hh"
 67 #include "G4StoppingPhysics.hh"                <<  61 
 68 #include "G4SystemOfUnits.hh"                  << 
 69 #include "G4UnitsTable.hh"                         62 #include "G4UnitsTable.hh"
                                                   >>  63 #include "G4LossTableManager.hh"
                                                   >>  64 #include "G4EmProcessOptions.hh"
 70                                                    65 
 71 //....oooOO0OOooo........oooOO0OOooo........oo     66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 72                                                    67 
 73 PhysicsList::PhysicsList() : G4VModularPhysics <<  68 PhysicsList::PhysicsList() 
                                                   >>  69 : G4VModularPhysicsList()
 74 {                                                  70 {
 75   fHelIsRegisted = false;                      <<  71   emBuilderIsRegisted = false;
 76   fBicIsRegisted = false;                      <<  72   decayIsRegisted = false;
 77   fIonIsRegisted = false;                      <<  73   stepLimiterIsRegisted = false;
 78   fGnucIsRegisted = false;                     <<  74   helIsRegisted = false;
 79   fStopIsRegisted = false;                     <<  75   bicIsRegisted = false;
 80   fVerbose = 1;                                <<  76   ionIsRegisted = false;
 81                                                <<  77   gnucIsRegisted = false;
 82   SetDefaultCutValue(1 * mm);                  <<  78   stopIsRegisted = false;
                                                   >>  79   verbose = 1;
                                                   >>  80   G4LossTableManager::Instance()->SetVerbose(1);
                                                   >>  81   defaultCutValue = 1.*mm;
                                                   >>  82   cutForGamma     = defaultCutValue;
                                                   >>  83   cutForElectron  = defaultCutValue;
                                                   >>  84   cutForPositron  = defaultCutValue;
 83                                                    85 
 84   fMessenger = new PhysicsListMessenger(this); <<  86   pMessenger = new PhysicsListMessenger(this);
 85                                                    87 
 86   // Add Physics builders                          88   // Add Physics builders
 87   RegisterPhysics(new G4EmStandardPhysics());  << 
 88   RegisterPhysics(new G4DecayPhysics());           89   RegisterPhysics(new G4DecayPhysics());
 89   RegisterPhysics(new StepLimiterBuilder());   << 
 90 }                                                  90 }
 91                                                    91 
 92 //....oooOO0OOooo........oooOO0OOooo........oo     92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 93                                                    93 
 94 PhysicsList::~PhysicsList()                        94 PhysicsList::~PhysicsList()
 95 {                                              <<  95 {}
 96   delete fMessenger;                           << 
 97 }                                              << 
 98                                                    96 
 99 //....oooOO0OOooo........oooOO0OOooo........oo     97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
100                                                    98 
101 void PhysicsList::ConstructParticle()              99 void PhysicsList::ConstructParticle()
102 {                                                 100 {
103   if (fVerbose > 0) {                          << 101   if(verbose > 0) 
104     G4cout << "### PhysicsList Construte Parti    102     G4cout << "### PhysicsList Construte Particles" << G4endl;
105   }                                            << 
106   G4VModularPhysicsList::ConstructParticle();     103   G4VModularPhysicsList::ConstructParticle();
107 }                                                 104 }
108                                                   105 
109 //....oooOO0OOooo........oooOO0OOooo........oo    106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110                                                   107 
111 void PhysicsList::ConstructProcess()              108 void PhysicsList::ConstructProcess()
112 {                                                 109 {
113   if (fVerbose > 0) {                          << 110   if(verbose > 0) 
114     G4cout << "### PhysicsList Construte Proce    111     G4cout << "### PhysicsList Construte Processes" << G4endl;
115   }                                            << 112   if(!emBuilderIsRegisted) AddPhysicsList("emstandard");
116                                                << 113   RegisterPhysics(new G4StepLimiterBuilder());
117   G4VModularPhysicsList::ConstructProcess();      114   G4VModularPhysicsList::ConstructProcess();
118                                                   115 
119   // Define energy interval for loss processes    116   // Define energy interval for loss processes
120   // from 10 eV to 10 GeV                      << 117   G4EmProcessOptions emOptions;
121   G4EmParameters* param = G4EmParameters::Inst << 118   emOptions.SetMinEnergy(0.1*keV);
122   param->SetMinEnergy(0.01 * keV);             << 119   emOptions.SetMaxEnergy(100.*GeV);
123   param->SetMaxEnergy(10. * GeV);              << 120   emOptions.SetDEDXBinning(90);
124   param->SetNumberOfBinsPerDecade(10);         << 121   emOptions.SetLambdaBinning(90);
125   param->SetVerbose(1);                        << 122   //  emOptions.SetBuildCSDARange(false);
                                                   >> 123   emOptions.SetApplyCuts(true);
                                                   >> 124   //emOptions.SetVerbose(0);
126 }                                                 125 }
127                                                   126 
128 //....oooOO0OOooo........oooOO0OOooo........oo    127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
129                                                   128 
130 void PhysicsList::AddPhysicsList(const G4Strin    129 void PhysicsList::AddPhysicsList(const G4String& name)
131 {                                                 130 {
132   if (fVerbose > 0) {                          << 131   if(verbose > 0) {
133     G4cout << "### PhysicsList Add Physics <"  << 132     G4cout << "### PhysicsList Add Physics <" << name 
134   }                                            << 133            << "> emBuilderIsRegisted= " << emBuilderIsRegisted
135   if (name == "emstandard") {                  << 134            << G4endl;
136     ReplacePhysics(new G4EmStandardPhysics()); << 135   }
137   }                                            << 136   if ((name == "emstandard") && !emBuilderIsRegisted) {
138   else if (name == "emstandard_opt1") {        << 137     RegisterPhysics(new G4EmStandardPhysics());
139     ReplacePhysics(new G4EmStandardPhysics_opt << 138     emBuilderIsRegisted = true;
140   }                                            << 139     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;    
141   else if (name == "emstandard_opt2") {        << 140 
142     ReplacePhysics(new G4EmStandardPhysics_opt << 141   } else if (name == "emstandard_opt1" && !emBuilderIsRegisted) {
143   }                                            << 142     RegisterPhysics(new G4EmStandardPhysics_option1());
144   else if (name == "emstandard_opt3") {        << 143     emBuilderIsRegisted = true;
145     ReplacePhysics(new G4EmStandardPhysics_opt << 144     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
146   }                                            << 145 
147   else if (name == "emstandard_opt4") {        << 146   } else if (name == "emstandard_opt2" && !emBuilderIsRegisted) {
148     ReplacePhysics(new G4EmStandardPhysics_opt << 147     RegisterPhysics(new G4EmStandardPhysics_option2());
149   }                                            << 148     emBuilderIsRegisted = true;
150   else if (name == "emlivermore") {            << 149     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
151     ReplacePhysics(new G4EmLivermorePhysics()) << 150 
152   }                                            << 151   } else if (name == "emstandard_opt3" && !emBuilderIsRegisted) {
153   else if (name == "empenelope") {             << 152     RegisterPhysics(new G4EmStandardPhysics_option3());
154     ReplacePhysics(new G4EmPenelopePhysics()); << 153     emBuilderIsRegisted = true;
155   }                                            << 154     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
156   else if (name == "emlowenergy") {            << 155 
157     ReplacePhysics(new G4EmLowEPPhysics());    << 156   } else if (name == "emlivermore" && !emBuilderIsRegisted) {
158   }                                            << 157     RegisterPhysics(new G4EmLivermorePhysics());
159   else if (name == "elastic" && !fHelIsRegiste << 158     emBuilderIsRegisted = true;
                                                   >> 159     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
                                                   >> 160 
                                                   >> 161   } else if (name == "empenelope" && !emBuilderIsRegisted) {
                                                   >> 162     RegisterPhysics(new G4EmPenelopePhysics());
                                                   >> 163     emBuilderIsRegisted = true;
                                                   >> 164     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
                                                   >> 165 
                                                   >> 166   } else if (name == "elastic" && !helIsRegisted && emBuilderIsRegisted) {
160     RegisterPhysics(new G4HadronElasticPhysics    167     RegisterPhysics(new G4HadronElasticPhysics());
161     fHelIsRegisted = true;                     << 168     helIsRegisted = true;
162   }                                            << 169     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
163   else if (name == "binary" && !fBicIsRegisted << 170     
                                                   >> 171   } else if (name == "binary" && !bicIsRegisted && emBuilderIsRegisted) {
164     RegisterPhysics(new G4HadronInelasticQBBC(    172     RegisterPhysics(new G4HadronInelasticQBBC());
165     fBicIsRegisted = true;                     << 173     bicIsRegisted = true;
166   }                                            << 174     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
167   else if (name == "binary_ion" && !fIonIsRegi << 175     
                                                   >> 176   } else if (name == "binary_ion" && !ionIsRegisted && emBuilderIsRegisted) {
168     RegisterPhysics(new G4IonBinaryCascadePhys    177     RegisterPhysics(new G4IonBinaryCascadePhysics());
169     fIonIsRegisted = true;                     << 178     ionIsRegisted = true;
170   }                                            << 179     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
171   else if (name == "gamma_nuc" && !fGnucIsRegi << 180 
                                                   >> 181   } else if (name == "gamma_nuc" && !gnucIsRegisted && emBuilderIsRegisted) {
172     RegisterPhysics(new G4EmExtraPhysics());      182     RegisterPhysics(new G4EmExtraPhysics());
173     fGnucIsRegisted = true;                    << 183     gnucIsRegisted = true;
174   }                                            << 184     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
175   else if (name == "stopping" && !fStopIsRegis << 185 
176     RegisterPhysics(new G4StoppingPhysics());  << 186   } else if (name == "stopping" && !stopIsRegisted && emBuilderIsRegisted) {
177     fStopIsRegisted = true;                    << 187     RegisterPhysics(new G4QStoppingPhysics());
178   }                                            << 188     gnucIsRegisted = true;
179   else {                                       << 189     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
180     G4cout << "PhysicsList::AddPhysicsList <"  << 190     
                                                   >> 191   } else if(!emBuilderIsRegisted) {
                                                   >> 192     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" 
                                                   >> 193            << " fail - EM physics should be registered first " << G4endl;
                                                   >> 194   } else {
                                                   >> 195     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" 
181            << " fail - module is already regit    196            << " fail - module is already regitered or is unknown " << G4endl;
182   }                                               197   }
                                                   >> 198 }
                                                   >> 199 
                                                   >> 200 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 201 
                                                   >> 202 void PhysicsList::SetCuts()
                                                   >> 203 {
                                                   >> 204 
                                                   >> 205   SetCutValue(cutForGamma, "gamma");
                                                   >> 206   SetCutValue(cutForElectron, "e-");
                                                   >> 207   SetCutValue(cutForPositron, "e+");
                                                   >> 208 
                                                   >> 209   if (verbose>0) DumpCutValuesTable();
                                                   >> 210 }
                                                   >> 211 
                                                   >> 212 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 213 
                                                   >> 214 void PhysicsList::SetVerbose(G4int val)
                                                   >> 215 {
                                                   >> 216   verbose = val;
                                                   >> 217 }
                                                   >> 218 
                                                   >> 219 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 220 
                                                   >> 221 void PhysicsList::SetCutForGamma(G4double cut)
                                                   >> 222 {
                                                   >> 223   cutForGamma = cut;
                                                   >> 224   SetParticleCuts(cutForGamma, G4Gamma::Gamma());
                                                   >> 225 }
                                                   >> 226 
                                                   >> 227 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 228 
                                                   >> 229 void PhysicsList::SetCutForElectron(G4double cut)
                                                   >> 230 {
                                                   >> 231   cutForElectron = cut;
                                                   >> 232   SetParticleCuts(cutForElectron, G4Electron::Electron());
                                                   >> 233 }
                                                   >> 234 
                                                   >> 235 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 236 
                                                   >> 237 void PhysicsList::SetCutForPositron(G4double cut)
                                                   >> 238 {
                                                   >> 239   cutForPositron = cut;
                                                   >> 240   SetParticleCuts(cutForPositron, G4Positron::Positron());
183 }                                                 241 }
184                                                   242 
185 //....oooOO0OOooo........oooOO0OOooo........oo    243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
186                                                   244