00001 // $Id: GiGaExtPhysics.h,v 1.4 2007/03/26 09:01:39 gcorti Exp $ 00002 #ifndef GIGA_GIGAEXTERNALPHYSICSCONSTRUCTOR_H 00003 #define GIGA_GIGAEXTERNALPHYSICSCONSTRUCTOR_H 1 00004 00005 // Include files 00006 #include "GiGa/GiGaPhysicsConstructorBase.h" 00007 00015 template <class PHYSCONSTR> 00016 class GiGaExtPhysics : public GiGaPhysicsConstructorBase 00017 { 00019 typedef PHYSCONSTR PhysConstr ; 00020 00021 public: 00022 00029 G4VPhysicsConstructor* physicsConstructor () const 00030 { 00031 if( 0 == m_phys ) 00032 { 00033 m_phys = new PhysConstr() ; 00034 m_phys -> SetPhysicsName( name() ); 00035 } 00036 return m_phys ; 00037 }; 00038 00047 GiGaExtPhysics 00048 ( const std::string& type , 00049 const std::string& name , 00050 const IInterface* parent ) 00051 : GiGaPhysicsConstructorBase( type , name , parent ) 00052 , m_phys ( 0 ) 00053 {} 00054 00056 virtual ~GiGaExtPhysics(){} ; 00057 00058 private: 00059 00060 // physics constructor itself 00061 mutable G4VPhysicsConstructor* m_phys ; 00062 00063 }; 00064 00065 #endif // GIGA_GIGAEXTERNALPHYSICSCONSTRUCTOR_H