GDMLSchema directory not located in same area as geometry gdml file
The experimental geometry files all point to a GDMLSchema file that is assumed to live in Geometry/gdml/GDMLSchema. One can copy that directory to the experiment specific location of the gdml files, i.e.
or we could put in a better path that looks to a more central location.
#1 Updated by Erica Snider over 6 years ago
- Category set to Geometry
- Target version set to v0_02_00
The first question is whether this file is still needed, since the later versions of the parser might know the schema. Brian will test this.
If the file is still required, we should define an environment variable that points to a central directory, since copying the schema to multiple places seems like a bad idea, and we have no control over the file search mechanism used by the gdml parser.
In this case, I would propose that we use $GDML_SCHEMA_PATH/xxx.xsd with the requirement that this gets set in the LArSoft setup. We can continue to install in the current location.
#3 Updated by Lynn Garren over 6 years ago
Looks like the schema are here:
I'll see about making a product.
#4 Updated by Lynn Garren over 6 years ago
This tarball contains an exact match to larcore/Geometry/gdml/GDMLSchema:
There is a newer tarball which is an exact match to the schema in geant4 v4_9_6_p01a:
So there are two questions here.
First question, why not use the schema distributed with geant4? This does mean that you will get new schema files when you move to a new version of geant4. Would that be good, bad, or neutral?
Second question, if there is a reason to continue having a larsoft distribution of GDMLSchema, which distribution do you want? I presume you would want to update when you move to a newer geant4??
#7 Updated by Lynn Garren over 6 years ago
- Status changed from New to Feedback
There is only 1 difference between larcore/Geometry/gdml/GDMLSchema and .../geant4/v4_9_6_p01a/source/geant4.9.6.p01a/source/persistency/gdml/schema:
gdml_materials.xsd has a new property in geant4 v4_9_6_p01a
I'm now waiting for a proposed solution from you. If you are going to use the geant4 gdml files, our build of geant4 needs to make sure they are always available and set some environmental variable.
#8 Updated by Brian Rebel over 6 years ago
I think this is a call for Rick. If we were to make our own ups product then we don't have to worry about checking each G4 build. On the other hand, if we rely on the G4 build then we will catch any changes to the schema automatically (i.e. things will just fail if something major changes).
#9 Updated by Erica Snider over 6 years ago
Since the schema is part of the geant4 product, and larcore already depends upon geant4 via root, I would prefer that we just use the schema that is in g4.
In order to maintain consistency with existing environment variable names and to avoid possible confusion (per Lynn's suggestion), we should use GDML_SCHEMA_DIR to point to the correct directory. This will need to be made part of the g4 packaging procedure. Since we can't make a new g4 before the next beta, however, we'll need to put this into the larcore table file for now.
#10 Updated by Lynn Garren over 6 years ago
- Status changed from Feedback to Resolved
- % Done changed from 0 to 100
larcore now explicitly sets up geant4 and defines GDML_SCHEMA_DIR. This is a temporary hack that will stay in place until larsoft uses a version of geant4 which defines GDML_SCHEMA_DIR.
The files in gdml/GDMLSchema are not installed and should be removed from the release, although I have not done that.
#11 Updated by Erica Snider over 6 years ago
- Status changed from Resolved to Remission
The GDML_SCHEMA_DIR hack will not work because the GDML parser assumes that the schema directory is relative to the GDML file directory. Until we have a work-around for this problem, we will need to use the local installed version of the schema files.
Reverted larcore, and added the schema files with a local install for lbnecode and uboonecode, since both have gdml files.
#14 Updated by Lynn Garren about 5 years ago
Discussion with Hans Wenzel.
All geant4 gdml examples contain http links to the schema files. We need to edit our gdml files to point to local schema files so internet access is not required.
For instance, in icarus.gdml:
<gdml xmlns:gdml="http://cern.ch/2001/Schemas/GDML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="GDMLSchema/gdml.xsd">
We are not sure if we can use environmental variables in the gdml files.