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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 8.1)


  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.10 2006/06/29 17:28:01 gunter Exp $
 27 /// \brief Implementation of the PhysicsList c <<  27 // GEANT4 tag $Name: geant4-08-01 $
 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 // 03-10-05 Add g4v71 (V.Ivanchenko)
 38 // 16.05.07 Use renamed EM components from phy << 
 39 //                                                 37 //
 40 //--------------------------------------------     38 //----------------------------------------------------------------------------
 41 //                                                 39 //
 42                                                    40 
 43 //....oooOO0OOooo........oooOO0OOooo........oo     41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 44 //....oooOO0OOooo........oooOO0OOooo........oo     42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 45                                                    43 
 46 #include "PhysicsList.hh"                          44 #include "PhysicsList.hh"
 47                                                << 
 48 #include "PhysicsListMessenger.hh"                 45 #include "PhysicsListMessenger.hh"
 49 #include "StepLimiterBuilder.hh"               << 
 50                                                    46 
 51 #include "G4DecayPhysics.hh"                   <<  47 #include "ParticlesBuilder.hh"
 52 #include "G4EmExtraPhysics.hh"                 <<  48 #include "G4EmQEDBuilder.hh"
 53 #include "G4EmLivermorePhysics.hh"             <<  49 #include "G4EmMuonBuilder.hh"
 54 #include "G4EmLowEPPhysics.hh"                 <<  50 #include "G4EmHadronBuilder.hh"
 55 #include "G4EmParameters.hh"                   <<  51 #include "G4LowEnergyQEDBuilder.hh"
 56 #include "G4EmPenelopePhysics.hh"              <<  52 #include "G4PenelopeQEDBuilder.hh"
 57 #include "G4EmStandardPhysics.hh"              <<  53 #include "G4EmQEDBuilder52.hh"
 58 #include "G4EmStandardPhysics_option1.hh"      <<  54 #include "G4EmMuonBuilder52.hh"
 59 #include "G4EmStandardPhysics_option2.hh"      <<  55 #include "G4EmHadronBuilder52.hh"
 60 #include "G4EmStandardPhysics_option3.hh"      <<  56 #include "G4EmQEDBuilder71.hh"
 61 #include "G4EmStandardPhysics_option4.hh"      <<  57 #include "G4EmMuonBuilder71.hh"
 62 #include "G4HadronElasticPhysics.hh"           <<  58 #include "G4EmHadronBuilder71.hh"
 63 #include "G4HadronInelasticQBBC.hh"            <<  59 #include "G4StepLimiterBuilder.hh"
 64 #include "G4IonBinaryCascadePhysics.hh"        <<  60 #include "DecaysBuilder.hh"
 65 #include "G4LossTableManager.hh"               <<  61 #include "EmHadronElasticBuilder.hh"
 66 #include "G4PhysicalConstants.hh"              <<  62 #include "EmBinaryCascadeBuilder.hh"
 67 #include "G4StoppingPhysics.hh"                <<  63 #include "EmIonBinaryCascadeBuilder.hh"
 68 #include "G4SystemOfUnits.hh"                  <<  64 #include "EmGammaNucleusBuilder.hh"
                                                   >>  65 
 69 #include "G4UnitsTable.hh"                         66 #include "G4UnitsTable.hh"
                                                   >>  67 #include "G4LossTableManager.hh"
                                                   >>  68 #include "G4EmProcessOptions.hh"
                                                   >>  69 
                                                   >>  70 #include "G4Gamma.hh"
                                                   >>  71 #include "G4Electron.hh"
                                                   >>  72 #include "G4Positron.hh"
 70                                                    73 
 71 //....oooOO0OOooo........oooOO0OOooo........oo     74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 72                                                    75 
 73 PhysicsList::PhysicsList() : G4VModularPhysics <<  76 PhysicsList::PhysicsList() 
                                                   >>  77 : G4VModularPhysicsList()
 74 {                                                  78 {
 75   fHelIsRegisted = false;                      <<  79   emBuilderIsRegisted = false;
 76   fBicIsRegisted = false;                      <<  80   decayIsRegisted = false;
 77   fIonIsRegisted = false;                      <<  81   stepLimiterIsRegisted = false;
 78   fGnucIsRegisted = false;                     <<  82   helIsRegisted = false;
 79   fStopIsRegisted = false;                     <<  83   bicIsRegisted = false;
 80   fVerbose = 1;                                <<  84   ionIsRegisted = false;
 81                                                <<  85   gnucIsRegisted = false;
 82   SetDefaultCutValue(1 * mm);                  <<  86   verbose = 0;
                                                   >>  87   G4LossTableManager::Instance()->SetVerbose(0);
                                                   >>  88   defaultCutValue = 1.*mm;
                                                   >>  89   cutForGamma     = defaultCutValue;
                                                   >>  90   cutForElectron  = defaultCutValue;
                                                   >>  91   cutForPositron  = defaultCutValue;
 83                                                    92 
 84   fMessenger = new PhysicsListMessenger(this); <<  93   pMessenger = new PhysicsListMessenger(this);
 85                                                    94 
 86   // Add Physics builders                          95   // Add Physics builders
 87   RegisterPhysics(new G4EmStandardPhysics());  <<  96   RegisterPhysics(new ParticlesBuilder());
 88   RegisterPhysics(new G4DecayPhysics());       <<  97   steplimiter = new G4StepLimiterBuilder();
 89   RegisterPhysics(new StepLimiterBuilder());   << 
 90 }                                                  98 }
 91                                                    99 
 92 //....oooOO0OOooo........oooOO0OOooo........oo    100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 93                                                   101 
 94 PhysicsList::~PhysicsList()                       102 PhysicsList::~PhysicsList()
 95 {                                              << 103 {}
 96   delete fMessenger;                           << 
 97 }                                              << 
 98                                                   104 
 99 //....oooOO0OOooo........oooOO0OOooo........oo    105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
100                                                   106 
101 void PhysicsList::ConstructParticle()             107 void PhysicsList::ConstructParticle()
102 {                                                 108 {
103   if (fVerbose > 0) {                          << 109   if(verbose > 0) 
104     G4cout << "### PhysicsList Construte Parti << 110     G4cout << "Construte Particles" << G4endl;
105   }                                            << 
106   G4VModularPhysicsList::ConstructParticle();     111   G4VModularPhysicsList::ConstructParticle();
107 }                                                 112 }
108                                                   113 
109 //....oooOO0OOooo........oooOO0OOooo........oo    114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110                                                   115 
111 void PhysicsList::ConstructProcess()              116 void PhysicsList::ConstructProcess()
112 {                                                 117 {
113   if (fVerbose > 0) {                          << 118   if(verbose > 0) 
114     G4cout << "### PhysicsList Construte Proce << 119     G4cout << "Construte Processes" << G4endl;
115   }                                            << 120   if(!emBuilderIsRegisted) AddPhysicsList("standard");
116                                                << 
117   G4VModularPhysicsList::ConstructProcess();      121   G4VModularPhysicsList::ConstructProcess();
118                                                   122 
119   // Define energy interval for loss processes    123   // Define energy interval for loss processes
120   // from 10 eV to 10 GeV                      << 124   G4EmProcessOptions emOptions;
121   G4EmParameters* param = G4EmParameters::Inst << 125   emOptions.SetMinEnergy(0.1*keV);
122   param->SetMinEnergy(0.01 * keV);             << 126   emOptions.SetMaxEnergy(100.*GeV);
123   param->SetMaxEnergy(10. * GeV);              << 127   emOptions.SetDEDXBinning(90);
124   param->SetNumberOfBinsPerDecade(10);         << 128   emOptions.SetLambdaBinning(90);
125   param->SetVerbose(1);                        << 129   //  emOptions.SetBuildCSDARange(false);
                                                   >> 130   emOptions.SetApplyCuts(true);
                                                   >> 131   //emOptions.SetVerbose(0);
126 }                                                 132 }
127                                                   133 
128 //....oooOO0OOooo........oooOO0OOooo........oo    134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
129                                                   135 
130 void PhysicsList::AddPhysicsList(const G4Strin    136 void PhysicsList::AddPhysicsList(const G4String& name)
131 {                                                 137 {
132   if (fVerbose > 0) {                          << 138   if(verbose > 0) {
133     G4cout << "### PhysicsList Add Physics <"  << 139     G4cout << "Add Physics <" << name 
134   }                                            << 140            << "> emBuilderIsRegisted= " << emBuilderIsRegisted
135   if (name == "emstandard") {                  << 141            << G4endl;
136     ReplacePhysics(new G4EmStandardPhysics()); << 142   }
137   }                                            << 143   if ((name == "standard") && !emBuilderIsRegisted) {
138   else if (name == "emstandard_opt1") {        << 144     RegisterPhysics(new G4EmQEDBuilder());
139     ReplacePhysics(new G4EmStandardPhysics_opt << 145     RegisterPhysics(steplimiter);
140   }                                            << 146     RegisterPhysics(new G4EmMuonBuilder());
141   else if (name == "emstandard_opt2") {        << 147     RegisterPhysics(new G4EmHadronBuilder());
142     ReplacePhysics(new G4EmStandardPhysics_opt << 148     emBuilderIsRegisted = true;
143   }                                            << 149     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;    
144   else if (name == "emstandard_opt3") {        << 150 
145     ReplacePhysics(new G4EmStandardPhysics_opt << 151   } else if (name == "g4v52" && !emBuilderIsRegisted) {
146   }                                            << 152     RegisterPhysics(new G4EmQEDBuilder52());
147   else if (name == "emstandard_opt4") {        << 153     RegisterPhysics(steplimiter);
148     ReplacePhysics(new G4EmStandardPhysics_opt << 154     RegisterPhysics(new G4EmMuonBuilder52());
149   }                                            << 155     RegisterPhysics(new G4EmHadronBuilder52());
150   else if (name == "emlivermore") {            << 156     emBuilderIsRegisted = true;
151     ReplacePhysics(new G4EmLivermorePhysics()) << 157     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
152   }                                            << 158 
153   else if (name == "empenelope") {             << 159   } else if (name == "g4v71" && !emBuilderIsRegisted) {
154     ReplacePhysics(new G4EmPenelopePhysics()); << 160     RegisterPhysics(new G4EmQEDBuilder71());
155   }                                            << 161     RegisterPhysics(steplimiter);
156   else if (name == "emlowenergy") {            << 162     RegisterPhysics(new G4EmMuonBuilder71());
157     ReplacePhysics(new G4EmLowEPPhysics());    << 163     RegisterPhysics(new G4EmHadronBuilder71());
158   }                                            << 164     emBuilderIsRegisted = true;
159   else if (name == "elastic" && !fHelIsRegiste << 165     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
160     RegisterPhysics(new G4HadronElasticPhysics << 166 
161     fHelIsRegisted = true;                     << 167   } else if (name == "lowenergy" && !emBuilderIsRegisted) {
162   }                                            << 168     RegisterPhysics(new G4LowEnergyQEDBuilder());
163   else if (name == "binary" && !fBicIsRegisted << 169     RegisterPhysics(steplimiter);
164     RegisterPhysics(new G4HadronInelasticQBBC( << 170     RegisterPhysics(new G4EmMuonBuilder());
165     fBicIsRegisted = true;                     << 171     RegisterPhysics(new G4EmHadronBuilder());
166   }                                            << 172     emBuilderIsRegisted = true;
167   else if (name == "binary_ion" && !fIonIsRegi << 173     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
168     RegisterPhysics(new G4IonBinaryCascadePhys << 174 
169     fIonIsRegisted = true;                     << 175   } else if (name == "penelope" && !emBuilderIsRegisted) {
170   }                                            << 176     RegisterPhysics(new G4PenelopeQEDBuilder());
171   else if (name == "gamma_nuc" && !fGnucIsRegi << 177     RegisterPhysics(steplimiter);
172     RegisterPhysics(new G4EmExtraPhysics());   << 178     RegisterPhysics(new G4EmMuonBuilder());
173     fGnucIsRegisted = true;                    << 179     RegisterPhysics(new G4EmHadronBuilder());
174   }                                            << 180     emBuilderIsRegisted = true;
175   else if (name == "stopping" && !fStopIsRegis << 181     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
176     RegisterPhysics(new G4StoppingPhysics());  << 182 
177     fStopIsRegisted = true;                    << 183   } else if (name == "decay" && !decayIsRegisted) {
178   }                                            << 184     RegisterPhysics(new DecaysBuilder());
179   else {                                       << 185     decayIsRegisted = true;
180     G4cout << "PhysicsList::AddPhysicsList <"  << 186     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
                                                   >> 187 
                                                   >> 188   } else if (name == "elastic" && !helIsRegisted) {
                                                   >> 189     RegisterPhysics(new EmHadronElasticBuilder());
                                                   >> 190     helIsRegisted = true;
                                                   >> 191     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
                                                   >> 192     
                                                   >> 193   } else if (name == "binary" && !bicIsRegisted) {
                                                   >> 194     RegisterPhysics(new EmBinaryCascadeBuilder());
                                                   >> 195     bicIsRegisted = true;
                                                   >> 196     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
                                                   >> 197     
                                                   >> 198   } else if (name == "binary_ion" && !ionIsRegisted) {
                                                   >> 199     RegisterPhysics(new EmIonBinaryCascadeBuilder());
                                                   >> 200     ionIsRegisted = true;
                                                   >> 201     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
                                                   >> 202 
                                                   >> 203   } else if (name == "gamma_nuc" && !gnucIsRegisted) {
                                                   >> 204     RegisterPhysics(new EmGammaNucleusBuilder());
                                                   >> 205     gnucIsRegisted = true;
                                                   >> 206     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
                                                   >> 207     
                                                   >> 208   } else {
                                                   >> 209     G4cout << "PhysicsList::AddPhysicsList <" << name << ">" 
181            << " fail - module is already regit    210            << " fail - module is already regitered or is unknown " << G4endl;
182   }                                               211   }
                                                   >> 212 }
                                                   >> 213 
                                                   >> 214 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 215 
                                                   >> 216 void PhysicsList::SetCuts()
                                                   >> 217 {
                                                   >> 218 
                                                   >> 219   SetCutValue(cutForGamma, "gamma");
                                                   >> 220   SetCutValue(cutForElectron, "e-");
                                                   >> 221   SetCutValue(cutForPositron, "e+");
                                                   >> 222 
                                                   >> 223   if (verbose>0) DumpCutValuesTable();
                                                   >> 224 }
                                                   >> 225 
                                                   >> 226 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 227 
                                                   >> 228 void PhysicsList::SetVerbose(G4int val)
                                                   >> 229 {
                                                   >> 230   verbose = val;
                                                   >> 231 }
                                                   >> 232 
                                                   >> 233 void PhysicsList::SetCutForGamma(G4double cut)
                                                   >> 234 {
                                                   >> 235   cutForGamma = cut;
                                                   >> 236   SetParticleCuts(cutForGamma, G4Gamma::Gamma());
                                                   >> 237 }
                                                   >> 238 
                                                   >> 239 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 240 
                                                   >> 241 void PhysicsList::SetCutForElectron(G4double cut)
                                                   >> 242 {
                                                   >> 243   cutForElectron = cut;
                                                   >> 244   SetParticleCuts(cutForElectron, G4Electron::Electron());
                                                   >> 245 }
                                                   >> 246 
                                                   >> 247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 248 
                                                   >> 249 void PhysicsList::SetCutForPositron(G4double cut)
                                                   >> 250 {
                                                   >> 251   cutForPositron = cut;
                                                   >> 252   SetParticleCuts(cutForPositron, G4Positron::Positron());
183 }                                                 253 }
184                                                   254 
185 //....oooOO0OOooo........oooOO0OOooo........oo    255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
186                                                   256