Message: Can I use a reference list inside my inherited PhysicsList class Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Can I use a reference list inside my inherited PhysicsList class 

Forum: Physics List
Date: 10 Aug, 2017
From: <php1ic>

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?

Thanks

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Idea: Re: Can I use a reference list inside my inherited PhysicsList class   (Vladimir Ivanchenko - 28 Aug, 2017)
 Add Message Add Message
to: "Can I use a reference list inside my inherited PhysicsList class"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]