From a0a9edff0d9f52c324ebfffa8b0d71e4f335c621 Mon Sep 17 00:00:00 2001
From: Tim Williams <timothy.williams@cern.ch>
Date: Tue, 20 Feb 2018 16:25:38 +0000
Subject: [PATCH] Updated
 LHCbG4PhysLists/G4EmStandardPhysics_option1NoApplyCuts to be inline with
 emstandard_option1 from G4 v10.3.3

---
 .../G4EmStandardPhysics_option1NoApplyCuts.h  | 13 ++--
 .../G4EmStandardPhysics_option1NoApplyCuts.cc | 75 ++++++++++---------
 2 files changed, 45 insertions(+), 43 deletions(-)

diff --git a/LHCbG4PhysLists/LHCbG4PhysLists/G4EmStandardPhysics_option1NoApplyCuts.h b/LHCbG4PhysLists/LHCbG4PhysLists/G4EmStandardPhysics_option1NoApplyCuts.h
index d46b7585c6..88651cc346 100644
--- a/LHCbG4PhysLists/LHCbG4PhysLists/G4EmStandardPhysics_option1NoApplyCuts.h
+++ b/LHCbG4PhysLists/LHCbG4PhysLists/G4EmStandardPhysics_option1NoApplyCuts.h
@@ -23,11 +23,11 @@
 // * acceptance of all terms of the Geant4 Software license.          *
 // ********************************************************************
 //
-// $Id$
+// $Id: G4EmStandardPhysics_option1.hh 98736 2016-08-09 10:55:12Z gcosmo $
 //
 //---------------------------------------------------------------------------
 //
-// ClassName:   G4EmStandardPhysics_option1NoApplyCuts
+// ClassName:   G4EmStandardPhysics_option1
 //
 // Author:      V.Ivanchenko 09.11.2005
 //
@@ -55,15 +55,12 @@ class G4EmStandardPhysics_option1NoApplyCuts : public G4VPhysicsConstructor
 {
 public:
 
-  G4EmStandardPhysics_option1NoApplyCuts(G4int ver = 1);
-
-  // obsolete
-  G4EmStandardPhysics_option1NoApplyCuts(G4int ver, const G4String& name);
+  explicit G4EmStandardPhysics_option1NoApplyCuts(G4int ver=1, const G4String& name="");
 
   virtual ~G4EmStandardPhysics_option1NoApplyCuts();
 
-  void ConstructParticle() override;
-  void ConstructProcess() override;
+  virtual void ConstructParticle();
+  virtual void ConstructProcess();
 
 private:
   G4int  verbose;
diff --git a/LHCbG4PhysLists/src/G4EmStandardPhysics_option1NoApplyCuts.cc b/LHCbG4PhysLists/src/G4EmStandardPhysics_option1NoApplyCuts.cc
index ed5bda86d6..82a8541d6f 100644
--- a/LHCbG4PhysLists/src/G4EmStandardPhysics_option1NoApplyCuts.cc
+++ b/LHCbG4PhysLists/src/G4EmStandardPhysics_option1NoApplyCuts.cc
@@ -23,11 +23,11 @@
 // * acceptance of all terms of the Geant4 Software license.          *
 // ********************************************************************
 //
-// $Id$
+// $Id: G4EmStandardPhysics_option1.cc 99938 2016-10-12 08:06:52Z gcosmo $
 //
 //---------------------------------------------------------------------------
 //
-// ClassName:   G4EmStandardPhysics_option1NoApplyCuts
+// ClassName:   G4EmStandardPhysics_option1
 //
 // Author:      V.Ivanchenko 09.11.2005
 //
@@ -51,7 +51,7 @@
 #include "Geant4/G4SystemOfUnits.hh"
 #include "Geant4/G4ParticleDefinition.hh"
 #include "Geant4/G4LossTableManager.hh"
-#include "Geant4/G4EmProcessOptions.hh"
+#include "Geant4/G4EmParameters.hh"
 
 #include "Geant4/G4ComptonScattering.hh"
 #include "Geant4/G4GammaConversion.hh"
@@ -102,9 +102,9 @@
 #include "Geant4/G4Alpha.hh"
 #include "Geant4/G4GenericIon.hh"
 
-#include "Geant4/G4VUserPhysicsList.hh"
 #include "Geant4/G4PhysicsListHelper.hh"
 #include "Geant4/G4BuilderType.hh"
+#include "Geant4/G4EmModelActivator.hh"
 
 // factory
 #include "Geant4/G4PhysicsConstructorFactory.hh"
@@ -113,20 +113,16 @@ G4_DECLARE_PHYSCONSTR_FACTORY(G4EmStandardPhysics_option1NoApplyCuts);
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-G4EmStandardPhysics_option1NoApplyCuts::G4EmStandardPhysics_option1NoApplyCuts(G4int ver)
+G4EmStandardPhysics_option1NoApplyCuts::G4EmStandardPhysics_option1NoApplyCuts(G4int ver, 
+							 const G4String&)
   : G4VPhysicsConstructor("G4EmStandard_opt1"), verbose(ver)
 {
-  G4LossTableManager::Instance();
-  SetPhysicsType(bElectromagnetic);
-  //  std::cout<<"This is the v9.6 option 1 physics list with ApplyCuts option commented out"<<std::endl;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-G4EmStandardPhysics_option1NoApplyCuts::G4EmStandardPhysics_option1NoApplyCuts(G4int ver, const G4String&)
-  : G4VPhysicsConstructor("G4EmStandard_opt1"), verbose(ver)
-{
-  G4LossTableManager::Instance();
+  G4EmParameters* param = G4EmParameters::Instance();
+  param->SetDefaults();
+  param->SetVerbose(verbose);
+  param->SetApplyCuts(false); //LHCb Specific modification, don't apply prodcution cuts for specific processes
+  param->SetMscRangeFactor(0.2);
+  param->SetMscStepLimitType(fMinimal);
   SetPhysicsType(bElectromagnetic);
 }
 
@@ -139,26 +135,26 @@ G4EmStandardPhysics_option1NoApplyCuts::~G4EmStandardPhysics_option1NoApplyCuts(
 
 void G4EmStandardPhysics_option1NoApplyCuts::ConstructParticle()
 {
-// gamma
+  // gamma
   G4Gamma::Gamma();
 
-// leptons
+  // leptons
   G4Electron::Electron();
   G4Positron::Positron();
   G4MuonPlus::MuonPlus();
   G4MuonMinus::MuonMinus();
 
-// mesons
+  // mesons
   G4PionPlus::PionPlusDefinition();
   G4PionMinus::PionMinusDefinition();
   G4KaonPlus::KaonPlusDefinition();
   G4KaonMinus::KaonMinusDefinition();
 
-// barions
+  // barions
   G4Proton::Proton();
   G4AntiProton::AntiProton();
 
-// ions
+  // ions
   G4Deuteron::Deuteron();
   G4Triton::Triton();
   G4He3::He3();
@@ -170,6 +166,9 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructParticle()
 
 void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
 {
+  if(verbose > 1) {
+    G4cout << "### " << GetPhysicsName() << " Construct Processes " << G4endl;
+  }
   G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
 
   // muon & hadron bremsstrahlung and pair production
@@ -185,26 +184,31 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
   // muon & hadron multiple scattering
   G4MuMultipleScattering* mumsc = new G4MuMultipleScattering();
   mumsc->AddEmModel(0, new G4WentzelVIModel());
+  G4CoulombScattering* muss = new G4CoulombScattering();
+
   G4MuMultipleScattering* pimsc = new G4MuMultipleScattering();
   pimsc->AddEmModel(0, new G4WentzelVIModel());
+  G4CoulombScattering* piss = new G4CoulombScattering();
+
   G4MuMultipleScattering* kmsc = new G4MuMultipleScattering();
   kmsc->AddEmModel(0, new G4WentzelVIModel());
+  G4CoulombScattering* kss = new G4CoulombScattering();
+
   G4MuMultipleScattering* pmsc = new G4MuMultipleScattering();
   pmsc->AddEmModel(0, new G4WentzelVIModel());
+  G4CoulombScattering* pss = new G4CoulombScattering();
+
   G4hMultipleScattering* hmsc = new G4hMultipleScattering("ionmsc");
 
   // high energy limit for e+- scattering models and bremsstrahlung
   G4double highEnergyLimit = 100*MeV;
 
   // Add standard EM Processes
-  auto particleIterator = GetParticleIterator();
-  particleIterator->reset();
-  while( (*particleIterator)() ){
-    G4ParticleDefinition* particle = particleIterator->value();
+  auto myParticleIterator=GetParticleIterator();
+  myParticleIterator->reset();
+  while( (*myParticleIterator)() ){
+    G4ParticleDefinition* particle = myParticleIterator->value();
     G4String particleName = particle->GetParticleName();
-    if(verbose > 1)
-      G4cout << "### " << GetPhysicsName() << " instantiates for " 
-	     << particleName << G4endl;
 
     if (particleName == "gamma") {
 
@@ -218,9 +222,9 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
       eioni->SetStepFunction(0.8, 1.0*mm);
 
       G4eMultipleScattering* msc = new G4eMultipleScattering;
-      msc->SetStepLimitType(fMinimal);
       G4UrbanMscModel* msc1 = new G4UrbanMscModel();
       G4WentzelVIModel* msc2 = new G4WentzelVIModel();
+      msc1->SetNewDisplacementFlag(false);
       msc1->SetHighEnergyLimit(highEnergyLimit);
       msc2->SetLowEnergyLimit(highEnergyLimit);
       msc->AddEmModel(0, msc1);
@@ -244,9 +248,9 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
       eioni->SetStepFunction(0.8, 1.0*mm);
 
       G4eMultipleScattering* msc = new G4eMultipleScattering;
-      msc->SetStepLimitType(fMinimal);
       G4UrbanMscModel* msc1 = new G4UrbanMscModel();
       G4WentzelVIModel* msc2 = new G4WentzelVIModel();
+      msc1->SetNewDisplacementFlag(false);
       msc1->SetHighEnergyLimit(highEnergyLimit);
       msc2->SetLowEnergyLimit(highEnergyLimit);
       msc->AddEmModel(0, msc1);
@@ -272,7 +276,7 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
       ph->RegisterProcess(new G4MuIonisation(), particle);
       ph->RegisterProcess(mub, particle);
       ph->RegisterProcess(mup, particle);
-      ph->RegisterProcess(new G4CoulombScattering(), particle);
+      ph->RegisterProcess(muss, particle);
 
     } else if (particleName == "alpha" || 
 	       particleName == "He3" ) {
@@ -294,6 +298,7 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
       ph->RegisterProcess(new G4hIonisation(), particle);
       ph->RegisterProcess(pib, particle);
       ph->RegisterProcess(pip, particle);
+      ph->RegisterProcess(piss, particle);
 
     } else if (particleName == "kaon+" ||
                particleName == "kaon-" ) {
@@ -303,6 +308,7 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
       ph->RegisterProcess(new G4hIonisation(), particle);
       ph->RegisterProcess(kb, particle);
       ph->RegisterProcess(kp, particle);
+      ph->RegisterProcess(kss, particle);
 
       //    } else if (particleName == "proton" ) {
     } else if (particleName == "proton" ||
@@ -313,6 +319,7 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
       ph->RegisterProcess(new G4hIonisation(), particle);
       ph->RegisterProcess(pb, particle);
       ph->RegisterProcess(pp, particle);
+      ph->RegisterProcess(pss, particle);
 
     } else if (particleName == "B+" ||
 	       particleName == "B-" ||
@@ -349,15 +356,13 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
       ph->RegisterProcess(new G4hIonisation(), particle);
     }
   }
-  G4EmProcessOptions opt;
-  opt.SetVerbose(verbose);
-  opt.SetPolarAngleLimit(CLHEP::pi);
-  //opt.SetApplyCuts(true);
 
   // Deexcitation
   //
   G4VAtomDeexcitation* de = new G4UAtomicDeexcitation();
   G4LossTableManager::Instance()->SetAtomDeexcitation(de);
+
+  G4EmModelActivator mact(GetPhysicsName());
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-- 
GitLab