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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/parameterisations/Par02/src/Par02PhysicsList.cc (Version 11.3.0) and /examples/extended/parameterisations/Par02/src/Par02PhysicsList.cc (Version 10.7.p1)


  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 //                                                 26 //
 27 /// \file Par02PhysicsList.cc                      27 /// \file Par02PhysicsList.cc
 28 /// \brief Implementation of the Par02PhysicsL     28 /// \brief Implementation of the Par02PhysicsList class
 29                                                    29 
 30 #include "Par02PhysicsList.hh"                     30 #include "Par02PhysicsList.hh"
                                                   >>  31 #include "globals.hh"
                                                   >>  32 #include "G4ParticleDefinition.hh"
                                                   >>  33 #include "G4ProcessManager.hh"
                                                   >>  34 #include "G4ProcessVector.hh"
                                                   >>  35 #include "G4ParticleTypes.hh"
                                                   >>  36 #include "G4ParticleTable.hh"
                                                   >>  37 #include "G4Material.hh"
                                                   >>  38 #include "G4MaterialTable.hh"
                                                   >>  39 #include "G4ios.hh"
                                                   >>  40 #include "G4SystemOfUnits.hh"
                                                   >>  41 #include <iomanip>
                                                   >>  42 #include "G4FastSimulationManagerProcess.hh"
 31                                                    43 
 32 #include "G4BaryonConstructor.hh"              << 
 33 #include "G4ComptonScattering.hh"              << 
 34 #include "G4Decay.hh"                              44 #include "G4Decay.hh"
 35 #include "G4FastSimulationManagerProcess.hh"   << 
 36 #include "G4GammaConversion.hh"                << 
 37 #include "G4IonConstructor.hh"                 << 
 38 #include "G4LeptonConstructor.hh"                  45 #include "G4LeptonConstructor.hh"
 39 #include "G4Material.hh"                       << 
 40 #include "G4MaterialTable.hh"                  << 
 41 #include "G4MesonConstructor.hh"                   46 #include "G4MesonConstructor.hh"
 42 #include "G4MuBremsstrahlung.hh"               <<  47 #include "G4BaryonConstructor.hh"
 43 #include "G4MuIonisation.hh"                   <<  48 #include "G4IonConstructor.hh"
 44 #include "G4MuMultipleScattering.hh"           <<  49 
 45 #include "G4MuPairProduction.hh"               <<  50 #include "G4ComptonScattering.hh"
 46 #include "G4ParticleDefinition.hh"             <<  51 #include "G4GammaConversion.hh"
 47 #include "G4ParticleTable.hh"                  << 
 48 #include "G4ParticleTypes.hh"                  << 
 49 #include "G4PhotoElectricEffect.hh"                52 #include "G4PhotoElectricEffect.hh"
 50 #include "G4ProcessManager.hh"                 <<  53 
 51 #include "G4ProcessVector.hh"                  << 
 52 #include "G4SystemOfUnits.hh"                  << 
 53 #include "G4eBremsstrahlung.hh"                << 
 54 #include "G4eIonisation.hh"                    << 
 55 #include "G4eMultipleScattering.hh"                54 #include "G4eMultipleScattering.hh"
 56 #include "G4eplusAnnihilation.hh"              <<  55 #include "G4MuMultipleScattering.hh"
 57 #include "G4hIonisation.hh"                    << 
 58 #include "G4hMultipleScattering.hh"                56 #include "G4hMultipleScattering.hh"
 59 #include "G4ios.hh"                            << 
 60 #include "globals.hh"                          << 
 61                                                    57 
 62 #include <iomanip>                             <<  58 #include "G4eIonisation.hh"
                                                   >>  59 #include "G4eBremsstrahlung.hh"
                                                   >>  60 #include "G4eplusAnnihilation.hh"
                                                   >>  61 
                                                   >>  62 #include "G4MuIonisation.hh"
                                                   >>  63 #include "G4MuBremsstrahlung.hh"
                                                   >>  64 #include "G4MuPairProduction.hh"
                                                   >>  65 
                                                   >>  66 #include "G4hIonisation.hh"
 63                                                    67 
 64 //....oooOO0OOooo........oooOO0OOooo........oo     68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 65                                                    69 
 66 Par02PhysicsList::Par02PhysicsList() : G4VUser <<  70 Par02PhysicsList::Par02PhysicsList() :  G4VUserPhysicsList() {
 67 {                                              <<  71   SetVerboseLevel( 1 );
 68   SetVerboseLevel(1);                          <<  72   defaultCutValue = 0.1*m;
 69   defaultCutValue = 0.1 * m;                   << 
 70 }                                                  73 }
 71                                                    74 
 72 //....oooOO0OOooo........oooOO0OOooo........oo     75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 73                                                    76 
 74 Par02PhysicsList::~Par02PhysicsList() = defaul <<  77 Par02PhysicsList::~Par02PhysicsList() {}
 75                                                    78 
 76 //....oooOO0OOooo........oooOO0OOooo........oo     79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 77                                                    80 
 78 void Par02PhysicsList::ConstructParticle()     <<  81 void Par02PhysicsList::ConstructParticle() {
 79 {                                              << 
 80   // In this method, static member functions s     82   // In this method, static member functions should be called for all particles
 81   // which you want to use.                        83   // which you want to use.
 82   // This ensures that objects of these partic     84   // This ensures that objects of these particle types will be created in the program.
 83   ConstructBosons();                               85   ConstructBosons();
 84   ConstructLeptons();                              86   ConstructLeptons();
 85   ConstructMesons();                               87   ConstructMesons();
 86   ConstructBaryons();                              88   ConstructBaryons();
 87   ConstructIons();                                 89   ConstructIons();
 88 }                                                  90 }
 89                                                    91 
 90 //....oooOO0OOooo........oooOO0OOooo........oo     92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 91                                                    93 
 92 void Par02PhysicsList::ConstructBosons()       <<  94 void Par02PhysicsList::ConstructBosons() {
 93 {                                              << 
 94   G4Geantino::GeantinoDefinition();                95   G4Geantino::GeantinoDefinition();
 95   G4ChargedGeantino::ChargedGeantinoDefinition     96   G4ChargedGeantino::ChargedGeantinoDefinition();
 96   G4Gamma::GammaDefinition();                      97   G4Gamma::GammaDefinition();
 97   G4OpticalPhoton::OpticalPhotonDefinition();      98   G4OpticalPhoton::OpticalPhotonDefinition();
 98 }                                                  99 }
 99                                                   100 
100 //....oooOO0OOooo........oooOO0OOooo........oo    101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101                                                   102 
102 void Par02PhysicsList::ConstructLeptons()      << 103 void Par02PhysicsList::ConstructLeptons() {
103 {                                              << 
104   G4LeptonConstructor pConstructor;               104   G4LeptonConstructor pConstructor;
105   pConstructor.ConstructParticle();               105   pConstructor.ConstructParticle();
106 }                                                 106 }
107                                                   107 
108 //....oooOO0OOooo........oooOO0OOooo........oo    108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
109                                                   109 
110 void Par02PhysicsList::ConstructMesons()       << 110 void Par02PhysicsList::ConstructMesons() {
111 {                                              << 
112   G4MesonConstructor pConstructor;                111   G4MesonConstructor pConstructor;
113   pConstructor.ConstructParticle();               112   pConstructor.ConstructParticle();
114 }                                                 113 }
115                                                   114 
116 //....oooOO0OOooo........oooOO0OOooo........oo    115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
117                                                   116 
118 void Par02PhysicsList::ConstructBaryons()      << 117 void Par02PhysicsList::ConstructBaryons() {
119 {                                              << 118   G4BaryonConstructor  pConstructor;
120   G4BaryonConstructor pConstructor;            << 
121   pConstructor.ConstructParticle();               119   pConstructor.ConstructParticle();
122 }                                                 120 }
123                                                   121 
124 //....oooOO0OOooo........oooOO0OOooo........oo    122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
125                                                   123 
126 void Par02PhysicsList::ConstructIons()         << 124 void Par02PhysicsList::ConstructIons() {
127 {                                              << 
128   G4IonConstructor pConstructor;                  125   G4IonConstructor pConstructor;
129   pConstructor.ConstructParticle();               126   pConstructor.ConstructParticle();
130 }                                                 127 }
131                                                   128 
132 //....oooOO0OOooo........oooOO0OOooo........oo    129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
133                                                   130 
134 void Par02PhysicsList::ConstructProcess()      << 131 void Par02PhysicsList::ConstructProcess() {
135 {                                              << 
136   AddTransportation();                            132   AddTransportation();
137   AddParameterisation();                          133   AddParameterisation();
138   ConstructGeneral();                             134   ConstructGeneral();
139 }                                                 135 }
140                                                   136 
141 //....oooOO0OOooo........oooOO0OOooo........oo    137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
142                                                   138 
143 void Par02PhysicsList::AddTransportation()     << 139 void Par02PhysicsList::AddTransportation() {
144 {                                              << 140   //UseCoupledTransportation();
145   // UseCoupledTransportation();               << 
146   G4VUserPhysicsList::AddTransportation();        141   G4VUserPhysicsList::AddTransportation();
147 }                                                 142 }
148                                                   143 
149 //....oooOO0OOooo........oooOO0OOooo........oo    144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
150                                                   145 
151 void Par02PhysicsList::ConstructGeneral()      << 146 void Par02PhysicsList::ConstructGeneral() {
152 {                                              << 147   G4Decay* theDecayProcess = new G4Decay();
153   auto theDecayProcess = new G4Decay();        << 148   auto particleIterator=GetParticleIterator();
154   auto particleIterator = GetParticleIterator( << 
155   particleIterator->reset();                      149   particleIterator->reset();
156   while ((*particleIterator)()) {              << 150   while ( (*particleIterator)() ) {
157     G4ParticleDefinition* particle = particleI    151     G4ParticleDefinition* particle = particleIterator->value();
158     G4ProcessManager* pmanager = particle->Get    152     G4ProcessManager* pmanager = particle->GetProcessManager();
159     if (theDecayProcess->IsApplicable(*particl << 153     if ( theDecayProcess->IsApplicable( *particle ) ) {
160       pmanager->AddProcess(theDecayProcess);   << 154       pmanager->AddProcess( theDecayProcess );
161       // set ordering for PostStepDoIt and AtR    155       // set ordering for PostStepDoIt and AtRestDoIt
162       pmanager->SetProcessOrdering(theDecayPro << 156       pmanager->SetProcessOrdering( theDecayProcess, idxPostStep );
163       pmanager->SetProcessOrdering(theDecayPro << 157       pmanager->SetProcessOrdering( theDecayProcess, idxAtRest );
164     }                                             158     }
165   }                                               159   }
166 }                                                 160 }
167                                                   161 
168 //....oooOO0OOooo........oooOO0OOooo........oo    162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
169                                                   163 
170 void Par02PhysicsList::AddParameterisation()   << 164 void Par02PhysicsList::AddParameterisation() {
171 {                                              << 165   G4FastSimulationManagerProcess* fastSimProcess = 
172   G4FastSimulationManagerProcess* fastSimProce << 166     new G4FastSimulationManagerProcess( "G4FSMP" );
173                                                   167 
174   // Registers the fastSimProcess with all the    168   // Registers the fastSimProcess with all the particles as a discrete and
175   // continuous process (this works in all cas    169   // continuous process (this works in all cases; in the case that parallel
176   // geometries are not used, as in this examp    170   // geometries are not used, as in this example, it would be enough to
177   // add it as a discrete process).               171   // add it as a discrete process).
178   auto particleIterator = GetParticleIterator( << 172   auto particleIterator=GetParticleIterator();
179   particleIterator->reset();                      173   particleIterator->reset();
180   while ((*particleIterator)()) {              << 174   while ( (*particleIterator)() ) {
181     G4ParticleDefinition* particle = particleI    175     G4ParticleDefinition* particle = particleIterator->value();
182     G4ProcessManager* pmanager = particle->Get    176     G4ProcessManager* pmanager = particle->GetProcessManager();
183     // pmanager->AddDiscreteProcess( fastSimPr << 177     //pmanager->AddDiscreteProcess( fastSimProcess );    // No parallel geometry
184     pmanager->AddProcess(fastSimProcess, -1, 0 << 178     pmanager->AddProcess( fastSimProcess, -1, 0, 0 );  // General
185   }                                               179   }
186 }                                                 180 }
187                                                   181 
188 //....oooOO0OOooo........oooOO0OOooo........oo    182 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
189                                                   183 
190 void Par02PhysicsList::SetCuts()               << 184 void Par02PhysicsList::SetCuts() {
191 {                                              << 185   if ( verboseLevel > 1 ) {
192   if (verboseLevel > 1) {                      << 
193     G4cout << "Par02PhysicsList::SetCuts:";       186     G4cout << "Par02PhysicsList::SetCuts:";
194   }                                               187   }
195   SetCutsWithDefault();                           188   SetCutsWithDefault();
196 }                                                 189 }
197                                                   190 
198 //....oooOO0OOooo........oooOO0OOooo........oo    191 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 192 
199                                                   193