--- PamVMC/PamG4RunConfiguration/src/PamG4RunConfiguration.cxx 2007/06/28 07:16:56 1.1 +++ PamVMC/PamG4RunConfiguration/src/PamG4RunConfiguration.cxx 2009/02/18 17:05:15 1.2 @@ -1,24 +1,61 @@ -// $Id: PamG4RunConfiguration.cxx,v 1.0 2007/06/04 -// -// Class PamG4RunConfiguration - +#include #include "PamG4RunConfiguration.h" +#include +#include +#include +#include +#include + + +#include "PamG4RangeCutsPhysicsList.h" +ClassImp(PamG4RunConfiguration) -#include -PamG4RunConfiguration::PamG4RunConfiguration(const TString& userGeometry) - : TG4RunConfiguration(userGeometry) { +PamG4RunConfiguration::PamG4RunConfiguration(const TString& userGeometry, + const TString& physicsList, + const TString& specialProcess) + : TG4RunConfiguration(userGeometry, physicsList, specialProcess) +{ + } -PamG4RunConfiguration::~PamG4RunConfiguration(){ +PamG4RunConfiguration::~PamG4RunConfiguration() +{ +/// Destructor } -G4VUserPhysicsList* PamG4RunConfiguration::CreatePhysicsList() +G4VUserPhysicsList* PamG4RunConfiguration::CreatePhysicsList() { -// Create LHEP_BIC_HP physics list +// Create default Geant4 VMC physics list - return new LHEP_BIC_HP(); + TG4ComposedPhysicsList* builder = new TG4ComposedPhysicsList(); + + TString token1 = TG4Globals::GetToken(0, fPhysicsListSelection); + TString token2 = TG4Globals::GetToken(1, fPhysicsListSelection); + + if ( token1 == "emStandard" ) { + G4cout << "Adding EMPhysicsList" << G4endl; + builder->AddPhysicsList(new TG4EmPhysicsList()); } +else { + G4cout << "Adding HadronPhysicsList " << token1.Data() << G4endl; + builder->AddPhysicsList(new TG4HadronPhysicsList(token1.Data())); +} + +if ( token2 == "optical" ) { + G4cout << "Adding OpticalPhysicsList " << G4endl; + builder->AddPhysicsList(new TG4OpticalPhysicsList()); +} + + // add option here + G4cout << "Adding SpecialPhysicsList " << G4endl; + builder->AddPhysicsList(new TG4SpecialPhysicsList( + fSpecialProcessSelection.Data())); + G4cout << "Adding Range Cuts PhysicsList " << G4endl; + builder->AddPhysicsList(new PamG4RangeCutsPhysicsList()); + +return builder; +}