Skip to content

Add conditional load of newest classes/nodes.

Riccardo Maria Bianchi requested to merge IO_ConditionalLoadDBTables into main

The GeoModel toolkit has been developed at the beginning of the design phase of the ATLAS experiment.

The original toolkit featured a set of classes and graph nodes: GeoPhysVol, GeoLogVol, GeoMaterial, and so forth.

Recently, however, more classes and nodes have been added to the toolkit; and more are being added.

To ensure that adding new classes and nodes to the toolkit does not interfere with the reading of databases created with an earlier GeoModel version that did not have those, we now can set an "optional" flag to the load function, such as getTableFrom...().

Please note, a set of GeoModel nodes are compulsory: we cannot have a functional GeoModel tree without GeoPhysVols, LogVols, GeoElements, GeoMaterials, and GeoBox (we can't even instantiate the top/root 'World' volume without those!). For those 'compulsory' classes/nodes, the flag should be set to 'false', which is the default value.

However, for other classes/nodes that flag can be set to 'true'; e.g., for shapes like the recently introduced 'GeoTorus' and 'GeoGenericTrap', as well as for all the new shapes and classes that will be added to the toolkit in the future.

To be able to have new GeoModel nodes/classes while not breaking the load of DBs generated with an earlier version of GeoModel, I added an 'optional' flag to the calls loading the new nodes from the DB. In that way, when loading a DB where we don't expect to see those new nodes, we have no errors as expected.

I also added the optional flag to the 'checkDBTable' and 'getPublishedNodes' methods.


Cc: @boudreau @tsulaia

Edited by Riccardo Maria Bianchi

Merge request reports