Message: Disabling a persistency manager Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Disabling a persistency manager 

Forum: Persistency
Date: 09 Nov, 2016
From: Jeremy McCormick <Jeremy McCormick>


I am attempting to write a macro command that disables an installed persistency manager. By default, I have enabled a persistency manager but I want the user to be able to turn it on and off interactively if they desire.

The following code does not seem to work:

G4PersistencyCenter::GetPersistencyCenter()->SetPersistencyManager(nullptr, "RootPersistencyManager");
if (G4PersistencyCenter::GetPersistencyCenter()->GetPersistencyManager("RootPersistencyManager")) {
    throw std::runtime_error("RootPersistencyManager is still set!!!");

I would expect this to set the named persistency manager pointer to null but it does not as the error always throws.

I also tried the following to delete the existing persistency manager:


But the manager is still registered as "RootPersistencyManager" even after this deletion.

Is there a way to disable a registered persistency manager in a clean way from the idle state, e.g. using methods of G4PersistencyCenter?



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

1 None: Re: Disabling a persistency manager   (Jeremy McCormick - 09 Nov, 2016)
 Add Message Add Message
to: "Disabling a persistency manager"

 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 ]