From b35e1187133d0903c05b5976c18898d5669213c4 Mon Sep 17 00:00:00 2001
From: adrien matta <matta@lpccaen.in2p3.fr>
Date: Thu, 12 Jan 2017 11:14:59 +0100
Subject: [PATCH] * Fixed proper initialisation of Drift Electron Physics      
   - This caused a crash whan the simulation was not provided a          
 physics list option file

---
 NPSimulation/Process/PhysicsList.cc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/NPSimulation/Process/PhysicsList.cc b/NPSimulation/Process/PhysicsList.cc
index 6cc59d9a5..cf08ee488 100644
--- a/NPSimulation/Process/PhysicsList.cc
+++ b/NPSimulation/Process/PhysicsList.cc
@@ -42,7 +42,7 @@ PhysicsList::PhysicsList() : G4VUserPhysicsList(){
     m_EmList = "Option4";
     defaultCutValue = 1*mm;//0.2*mm;
     opticalPhysicsList = NULL;
-    
+    driftElectronPhysicsList = NULL; 
     ReadConfiguration("PhysicsListOption.txt");
     G4LossTableManager::Instance();
     SetVerboseLevel(0);
@@ -116,8 +116,8 @@ PhysicsList::PhysicsList() : G4VUserPhysicsList(){
         opticalPhysicsList->SetTrackSecondariesFirst(kCerenkov,true);
     }
  
+    // Drift electron for gazeous detector simulation
     if(m_DriftElectronPhysics){
-      
         driftElectronPhysicsList = new G4DriftElectronPhysics(0);
         driftElectronPhysicsList->SetMaxNumDriftElectronPerStep(1e6);
     }
@@ -213,7 +213,7 @@ void PhysicsList::ConstructParticle(){
         
     }
    
-     if(driftElectronPhysicsList){
+     if(m_DriftElectronPhysics){
         ((G4VPhysicsConstructor*) driftElectronPhysicsList)->ConstructParticle();
     }
  
@@ -291,7 +291,7 @@ void PhysicsList::AddStepMax(){
 }
 /////////////////////////////////////////////////////////////////////////////
 void PhysicsList::AddParametrisation(){
-
+/*
 	G4FastSimulationManagerProcess* drift =
 			new G4FastSimulationManagerProcess("DriftElectron");
 
@@ -307,7 +307,7 @@ void PhysicsList::AddParametrisation(){
 
       if(particle->GetParticleName()=="e-")
         pmanager->AddDiscreteProcess(drift);
-  }
+  }*/
 }
 
 
-- 
GitLab