Typically, when one tries to check if a snapshot exists in a workspace, one can do
snapshot = workspace.getSnapshot("my_snapshot") exist = True if snapshot else False
snapshot = workspace.loadSnapshot("my_snapshot") exist = True if snapshot else False
However, both will show an error message like this:
[#0] ERROR:ObjectHandling -- RooWorkspace::loadSnapshot(combWS) no snapshot with name <snapshot_name> is available
Of course, you may just ignore the error or disable the error message using
But this is undesirable. I know there are indirect ways since ROOT 6.26, e.g.
My question is whether there is a way to simply check if a snapshot exists without triggering the ObjectHandling error message? If not I think it would make more sense if the getSnapshot method does not trigger such a message since we are not loading the snapshot anyway.