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 ] [ 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 /error_propagation/src/G4ErrorPhysicsList.cc (Version 11.3.0) and /error_propagation/src/G4ErrorPhysicsList.cc (Version 10.3.p2)


  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 // $Id: G4ErrorPhysicsList.cc 99974 2016-10-13 07:22:33Z gcosmo $
 26 //                                                 27 //
 27 // -------------------------------------------     28 // ------------------------------------------------------------
 28 //      GEANT 4 class implementation file      <<  29 //      GEANT 4 class implementation file 
 29 // -------------------------------------------     30 // ------------------------------------------------------------
 30                                                    31 
 31 #include "globals.hh"                              32 #include "globals.hh"
 32                                                    33 
 33 #include "G4PhysicalConstants.hh"                  34 #include "G4PhysicalConstants.hh"
 34 #include "G4SystemOfUnits.hh"                      35 #include "G4SystemOfUnits.hh"
 35                                                    36 
 36 #include "G4ErrorPhysicsList.hh"                   37 #include "G4ErrorPhysicsList.hh"
 37 #include "G4ComptonScattering.hh"                  38 #include "G4ComptonScattering.hh"
 38 #include "G4GammaConversion.hh"                    39 #include "G4GammaConversion.hh"
 39 #include "G4PhotoElectricEffect.hh"                40 #include "G4PhotoElectricEffect.hh"
 40                                                <<  41  
 41 #include "G4eIonisation.hh"                        42 #include "G4eIonisation.hh"
 42 #include "G4eBremsstrahlung.hh"                    43 #include "G4eBremsstrahlung.hh"
 43 #include "G4eplusAnnihilation.hh"                  44 #include "G4eplusAnnihilation.hh"
 44                                                    45 
 45 #include "G4MuIonisation.hh"                       46 #include "G4MuIonisation.hh"
 46 #include "G4MuBremsstrahlung.hh"                   47 #include "G4MuBremsstrahlung.hh"
 47 #include "G4MuPairProduction.hh"                   48 #include "G4MuPairProduction.hh"
 48                                                    49 
 49 #include "G4hIonisation.hh"                        50 #include "G4hIonisation.hh"
 50                                                    51 
 51 #include "G4MuIonisation.hh"                       52 #include "G4MuIonisation.hh"
 52 #include "G4MuBremsstrahlung.hh"                   53 #include "G4MuBremsstrahlung.hh"
 53 #include "G4MuPairProduction.hh"                   54 #include "G4MuPairProduction.hh"
 54                                                    55 
 55 #include "G4hIonisation.hh"                        56 #include "G4hIonisation.hh"
 56                                                    57 
 57 #include "G4ParticleDefinition.hh"                 58 #include "G4ParticleDefinition.hh"
 58 #include "G4ProcessManager.hh"                     59 #include "G4ProcessManager.hh"
 59 #include "G4ProcessVector.hh"                      60 #include "G4ProcessVector.hh"
 60 #include "G4ParticleTypes.hh"                      61 #include "G4ParticleTypes.hh"
 61 #include "G4ParticleTable.hh"                      62 #include "G4ParticleTable.hh"
 62 #include "G4Material.hh"                           63 #include "G4Material.hh"
 63 #include "G4MaterialTable.hh"                      64 #include "G4MaterialTable.hh"
 64 #include "G4ios.hh"                                65 #include "G4ios.hh"
 65 #include "G4PhysicsTable.hh"                       66 #include "G4PhysicsTable.hh"
 66 #include "G4Transportation.hh"                     67 #include "G4Transportation.hh"
 67                                                    68 
 68 #include "G4ErrorEnergyLoss.hh"                    69 #include "G4ErrorEnergyLoss.hh"
 69                                                    70 
 70 //--------------------------------------------     71 //------------------------------------------------------------------------
 71 G4ErrorPhysicsList::G4ErrorPhysicsList()       <<  72 G4ErrorPhysicsList::G4ErrorPhysicsList():  G4VUserPhysicsList()
 72   : G4VUserPhysicsList()                       << 
 73 {                                                  73 {
 74   defaultCutValue =                            <<  74   defaultCutValue = 1.0E+9*cm; // set big step so that AlongStep computes all the energy
 75     1.0E+9 * cm;  // set big step so that Alon << 
 76 }                                                  75 }
 77                                                    76 
                                                   >>  77 
 78 //--------------------------------------------     78 //------------------------------------------------------------------------
 79 G4ErrorPhysicsList::~G4ErrorPhysicsList() {}   <<  79 G4ErrorPhysicsList::~G4ErrorPhysicsList()
                                                   >>  80 {
                                                   >>  81 }
                                                   >>  82 
 80                                                    83 
 81 //--------------------------------------------     84 //------------------------------------------------------------------------
 82 void G4ErrorPhysicsList::ConstructParticle()       85 void G4ErrorPhysicsList::ConstructParticle()
 83 {                                                  86 {
 84   // In this method, static member functions s <<  87 // In this method, static member functions should be called
 85   // for all particles which you want to use.      88   // for all particles which you want to use.
 86   // This ensures that objects of these partic     89   // This ensures that objects of these particle types will be
 87   // created in the program.                   <<  90   // created in the program. 
 88   //  gamma                                        91   //  gamma
 89   G4Gamma::GammaDefinition();                  <<  92   G4Gamma::GammaDefinition(); 
 90   //  e+/-                                         93   //  e+/-
 91   G4Electron::ElectronDefinition();                94   G4Electron::ElectronDefinition();
 92   G4Positron::PositronDefinition();                95   G4Positron::PositronDefinition();
 93   // mu+/-                                         96   // mu+/-
 94   G4MuonPlus::MuonPlusDefinition();                97   G4MuonPlus::MuonPlusDefinition();
 95   G4MuonMinus::MuonMinusDefinition();              98   G4MuonMinus::MuonMinusDefinition();
 96                                                    99 
 97   // pi+/-                                        100   // pi+/-
 98   G4PionPlus::PionPlusDefinition();               101   G4PionPlus::PionPlusDefinition();
 99   G4PionMinus::PionMinusDefinition();             102   G4PionMinus::PionMinusDefinition();
100                                                   103 
101   // proton                                       104   // proton
102   G4Proton::ProtonDefinition();                   105   G4Proton::ProtonDefinition();
                                                   >> 106 
103 }                                                 107 }
104                                                   108 
                                                   >> 109 
105 //--------------------------------------------    110 //------------------------------------------------------------------------
106 void G4ErrorPhysicsList::ConstructProcess()       111 void G4ErrorPhysicsList::ConstructProcess()
107 {                                                 112 {
108   G4Transportation* theTransportationProcess = << 113   G4Transportation* theTransportationProcess= new G4Transportation();
109                                                   114 
110 #ifdef G4VERBOSE                                  115 #ifdef G4VERBOSE
111   if(verboseLevel >= 4)                        << 116     if (verboseLevel >= 4){
112   {                                            << 117       G4cout << "G4VUserPhysicsList::ConstructProcess()  "<< G4endl;
113     G4cout << "G4VUserPhysicsList::ConstructPr << 118     }
114   }                                            << 
115 #endif                                            119 #endif
116                                                   120 
117   // loop over all particles in G4ParticleTabl    121   // loop over all particles in G4ParticleTable
118   auto myParticleIterator = GetParticleIterato << 122   auto myParticleIterator=GetParticleIterator();
119   myParticleIterator->reset();                    123   myParticleIterator->reset();
120   while((*myParticleIterator)())               << 124   while( (*myParticleIterator)() ) {  // Loop checking, 06.08.2015, G.Cosmo
121   {  // Loop checking, 06.08.2015, G.Cosmo     << 
122     G4ParticleDefinition* particle = myParticl    125     G4ParticleDefinition* particle = myParticleIterator->value();
123     G4ProcessManager* pmanager     = particle- << 126     G4ProcessManager* pmanager = particle->GetProcessManager();
124     if(!particle->IsShortLived())              << 127     if (!particle->IsShortLived()) {
125     {                                          << 128       G4cout << particle << "G4ErrorPhysicsList:: particle process manager " << particle->GetParticleName() << " = " << particle->GetProcessManager() << G4endl;
126       G4cout << particle << "G4ErrorPhysicsLis << 
127              << particle->GetParticleName() << << 
128              << particle->GetProcessManager()  << 
129       // Add transportation process for all pa    129       // Add transportation process for all particles other than  "shortlived"
130       if(pmanager == 0)                        << 130       if ( pmanager == 0) {
131       {                                        << 
132         // Error !! no process manager            131         // Error !! no process manager
133         G4String particleName = particle->GetP    132         G4String particleName = particle->GetParticleName();
134         G4Exception("G4ErrorPhysicsList::Const << 133         G4Exception("G4ErrorPhysicsList::ConstructProcess","No process manager",
135                     "No process manager", RunM << 134                     RunMustBeAborted, particleName );
136       }                                        << 135       } else {
137       else                                     << 
138       {                                        << 
139         // add transportation with ordering =     136         // add transportation with ordering = ( -1, "first", "first" )
140         pmanager->AddProcess(theTransportation << 137         pmanager ->AddProcess(theTransportationProcess);
141         pmanager->SetProcessOrderingToFirst(th << 138         pmanager ->SetProcessOrderingToFirst(theTransportationProcess, idxAlongStep);
142                                             id << 139         pmanager ->SetProcessOrderingToFirst(theTransportationProcess, idxPostStep);
143         pmanager->SetProcessOrderingToFirst(th << 
144                                             id << 
145       }                                           140       }
146     }                                          << 141     } else {
147     else                                       << 
148     {                                          << 
149       // shortlived particle case                 142       // shortlived particle case
150     }                                             143     }
151   }                                               144   }
152                                                   145 
153   ConstructEM();                                  146   ConstructEM();
154 }                                                 147 }
155                                                   148 
                                                   >> 149 
156 //--------------------------------------------    150 //------------------------------------------------------------------------
157 #include "G4eBremsstrahlung.hh"                   151 #include "G4eBremsstrahlung.hh"
158 #include "G4eIonisation.hh"                       152 #include "G4eIonisation.hh"
159                                                   153 
160 #include "G4eIonisation.hh"                       154 #include "G4eIonisation.hh"
161                                                   155 
162 #include "G4MuBremsstrahlung.hh"                  156 #include "G4MuBremsstrahlung.hh"
163 #include "G4MuIonisation.hh"                      157 #include "G4MuIonisation.hh"
164 #include "G4MuPairProduction.hh"                  158 #include "G4MuPairProduction.hh"
165                                                   159 
166 #include "G4PhysicsTable.hh"                      160 #include "G4PhysicsTable.hh"
167                                                   161 
168 #include "G4MuIonisation.hh"                      162 #include "G4MuIonisation.hh"
169                                                   163 
170 #include "G4ErrorStepLengthLimitProcess.hh"       164 #include "G4ErrorStepLengthLimitProcess.hh"
171 #include "G4ErrorMagFieldLimitProcess.hh"         165 #include "G4ErrorMagFieldLimitProcess.hh"
172 #include "G4ErrorMessenger.hh"                    166 #include "G4ErrorMessenger.hh"
173                                                   167 
174 void G4ErrorPhysicsList::ConstructEM()            168 void G4ErrorPhysicsList::ConstructEM()
175 {                                                 169 {
                                                   >> 170 
176   G4ErrorEnergyLoss* eLossProcess = new G4Erro    171   G4ErrorEnergyLoss* eLossProcess = new G4ErrorEnergyLoss;
177   G4ErrorStepLengthLimitProcess* stepLengthLim << 172   G4ErrorStepLengthLimitProcess* stepLengthLimitProcess = new G4ErrorStepLengthLimitProcess;
178     new G4ErrorStepLengthLimitProcess;         << 173   G4ErrorMagFieldLimitProcess* magFieldLimitProcess = new G4ErrorMagFieldLimitProcess;
179   G4ErrorMagFieldLimitProcess* magFieldLimitPr << 174   new G4ErrorMessenger( stepLengthLimitProcess, magFieldLimitProcess, eLossProcess );
180     new G4ErrorMagFieldLimitProcess;           << 
181   new G4ErrorMessenger(stepLengthLimitProcess, << 
182                        eLossProcess);          << 
183                                                   175 
184   auto myParticleIterator = GetParticleIterato << 176   auto myParticleIterator=GetParticleIterator();
185   myParticleIterator->reset();                    177   myParticleIterator->reset();
186   while((*myParticleIterator)())               << 178   while( (*myParticleIterator)() ) {  // Loop checking, 06.08.2015, G.Cosmo
187   {  // Loop checking, 06.08.2015, G.Cosmo     << 
188     G4ParticleDefinition* particle = myParticl    179     G4ParticleDefinition* particle = myParticleIterator->value();
189     G4ProcessManager* pmanager     = particle- << 180     G4ProcessManager* pmanager = particle->GetProcessManager();
190     G4String particleName          = particle- << 181     G4String particleName = particle->GetParticleName();
191                                                << 182      
192     if(particleName == "gamma")                << 183     if (particleName == "gamma") {
193     {                                          << 184     // gamma
194       // gamma                                 << 
195       pmanager->AddDiscreteProcess(new G4Gamma    185       pmanager->AddDiscreteProcess(new G4GammaConversion());
196       pmanager->AddDiscreteProcess(new G4Compt << 186       pmanager->AddDiscreteProcess(new G4ComptonScattering());      
197       pmanager->AddDiscreteProcess(new G4Photo    187       pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
198                                                   188 
199       //    } else if (particleName == "e-" ||    189       //    } else if (particleName == "e-" || particleName == "e+"
200       //               || particleName == "mu+    190       //               || particleName == "mu+" || particleName == "mu-" ) {
201     }                                          << 191     }else if (!particle->IsShortLived() && particle->GetPDGCharge() != 0 ) {
202     else if(!particle->IsShortLived() && parti << 192   
203     {                                          << 193       pmanager->AddContinuousProcess(eLossProcess,1);
204       pmanager->AddContinuousProcess(eLossProc << 194       pmanager->AddDiscreteProcess( stepLengthLimitProcess, 2 ); 
205       pmanager->AddDiscreteProcess(stepLengthL << 195       pmanager->AddDiscreteProcess( magFieldLimitProcess, 3 );     
206       pmanager->AddDiscreteProcess(magFieldLim << 196       
207                                                << 
208       /*     } else if ((!particle->IsShortLiv    197       /*     } else if ((!particle->IsShortLived()) &&
209                (particle->GetPDGCharge() != 0. << 198                (particle->GetPDGCharge() != 0.0) && 
210                (particle->GetParticleName() !=    199                (particle->GetParticleName() != "chargedgeantino")) {
211      // all others charged particles except ge    200      // all others charged particles except geantino
212       //   G4VProcess* aMultipleScattering = n    201       //   G4VProcess* aMultipleScattering = new G4MultipleScattering();
213      G4VProcess* anIonisation        = new G4h << 202      G4VProcess* anIonisation        = new G4hIonisation();     
214      ////G4VProcess*  theUserCuts = new G4User    203      ////G4VProcess*  theUserCuts = new G4UserSpecialCuts();
215                                                << 204      
216      //                                           205      //
217      // add processes                             206      // add processes
218      pmanager->AddProcess(anIonisation);          207      pmanager->AddProcess(anIonisation);
219      //   pmanager->AddProcess(aMultipleScatte << 208      //   pmanager->AddProcess(aMultipleScattering);    
220      ////pmanager->AddProcess(theUserCuts);       209      ////pmanager->AddProcess(theUserCuts);
221                                                << 210      
222      //                                           211      //
223      // set ordering for AlongStepDoIt            212      // set ordering for AlongStepDoIt
224      //   pmanager->SetProcessOrdering(aMultip    213      //   pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
225      pmanager->SetProcessOrdering(anIonisation    214      pmanager->SetProcessOrdering(anIonisation, idxAlongStep,1);
226                                                << 215      
227      //                                           216      //
228      // set ordering for PostStepDoIt             217      // set ordering for PostStepDoIt
229      //   pmanager->SetProcessOrdering(aMultip    218      //   pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
230      pmanager->SetProcessOrdering(anIonisation    219      pmanager->SetProcessOrdering(anIonisation, idxPostStep,1);
231      ////pmanager->SetProcessOrdering(theUserC    220      ////pmanager->SetProcessOrdering(theUserCuts,     idxPostStep,2);
232      */                                           221      */
233     }                                             222     }
234   }                                               223   }
235 }                                                 224 }
236                                                   225 
                                                   >> 226 
237 //--------------------------------------------    227 //------------------------------------------------------------------------
238 void G4ErrorPhysicsList::SetCuts()                228 void G4ErrorPhysicsList::SetCuts()
239 {                                                 229 {
240   //  " G4VUserPhysicsList::SetCutsWithDefault << 230   //  " G4VUserPhysicsList::SetCutsWithDefault" method sets 
241   //   the default cut value or all particle t << 231   //   the default cut value or all particle types 
242   SetCutsWithDefault();                        << 232   SetCutsWithDefault(); 
243   // if (verboseLevel>0)                       << 233   // if (verboseLevel>0) 
244   //  DumpCutValuesTable();                       234   //  DumpCutValuesTable();
245 }                                                 235 }
                                                   >> 236 
246                                                   237