|Message: Can I use a reference list inside my inherited PhysicsList class||Not Logged In (login)|
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
As the title says, is it possible to register/add a reference physics list to a PhysicsList class that I create through inheritance from G4VModularPhysicsList?
I like the neatness/simplicity of calling runManager->SetUserInitialization(new myPhysicsList) in my main() then doing the physics invocations within that class but I can't see a way of doing this with a reference list.
From within the myPhysicsList constructor I have tried:
- Using the G4PhysListFactory to get the G4VModularPhysicsList then assigning it to "this", but that wouldn't compile.
- Registering the list with the return object of G4PhysListFactory::GetReferenePhysList()->GetPhysics("LIST_NAME"), but this returns a const G4VPhysicsConstructor* and RegisterPhysics() takes a G4VPhysicsConstructor*
I can get/build the list from within the constructor using:
G4PhysListFactory *physListFactory = new G4PhysListFactory();
G4VModularPhysicsList *physicsList = physListFactory->GetReferencePhysList("QGSP_BERT_HP");
but this does not get attached to the runManager and my attempts at accessing the run mananger and adding the list just creates seg faults.
Is it possible to do this? or were the reference lists created and designed so a user PhysicsList was not needed?
|Inline Depth:||Outline Depth:||Add message:|