Geometry Documentation Wiki¶
What is the CAD-based geometry¶
The CAD-based geometry uses a commercial software packages, FastRAD, to convert the
CAD drawings of the MICE beam channel into a machine readable format (GDML). In
the current implementation, these GDML files are again translated into the MICE data
model handling format (MICEModules) before being read into GEANT4 for simulation.
Geometry Release Procedure¶
See http://micewww.pp.rl.ac.uk/projects/maus/wiki/Geometry_release_procedure
How to find the correct geometry¶
There are two types of geometry:- ideal geometries - these are mainly future geometries with no survey information
- real geometries - these are geometries used in data-taking runs -
A full list of CAD-based geometries can be found in the Condition Data Base at
http://cdb.mice.rl.ac.uk/cdbviewer/
and selecting the geometry Tab.
Unfortunately the browser does not show the ID number. However,
the list can be ordered in ascending date of creation, so the first one listed corresponds to ID#1, the second to ID#2, and so on.
The following is an example of the Information available, for ID#9 (ideal STEP IV):
Date Valid From: 1974-01-01 18:00:00 Date Created: 2013-10-29 09:24:02.744 Notes: Interim Step IV geometry. Positions of all available detectors. Detector survey points not included. Currently use the legacy geometry for all detectors. Technical Drawing Name:
"Date valid from" for all ideal geometries is year 197n where n is the step number.
The starting validity date for real geometries is the date of the first data-taking run with that particular geometry configuration.
Technical Drawing number to be included
Can information be added later, after having uploaded the geometry (Use case: we would like to write in the notes whether the geometry has been validated and can be used for production)
Another way to get information on the available geometry IDs is by using the python script bin/utilities/get_geometry_ids.py
Example:
python bin/utilities/get_geometry_ids.py --get_ids_start_time "1974-01-01 00:00:00" --get_ids_stop_time "2015-01-01 00:00:00"
By default, the output file is saved to $MAUS_ROOT_DIR/tmp/geometry_ids.txt and looks like the following
[...] Geometry Number = 7 Geometry Note = New step IV geometry includes tracker but not placement of tracker. Does include placement of TOFs, KL, Ckov, and EMR. Now uses the correct materials for beamline elements. ValidFrom = 2013-06-08 18:00:00 Date Created = 2013-06-27 11:38:46.662000 Geometry Number = 8 Geometry Note = Step I geometry developed for EMR run. Positions of all available detectors and their survey points are included. Currently use the legacy geometry for all detectors. ValidFrom = 2013-10-04 18:00:00 Date Created = 2013-10-20 15:48:34.785000 Geometry Number = 9 Geometry Note = Interim Step IV geometry. Positions of all available detectors. Detector survey points not included. Currently use the legacy geometry for all detectors. ValidFrom = 1974-01-01 18:00:00 Date Created = 2013-10-29 09:24:02.744000 Geometry Number = 10 Geometry Note = Step I geometry developed for EMR run. Positions of all available detectors and their survey points are included. Currently use the legacy geometry for all detectors. ValidFrom = 2013-10-04 18:00:00 Date Created = 2013-11-07 11:35:15.951000 Geometry Number = 11 Geometry Note = Step I geometry developed for EMR run. Positions of all available detectors and their survey points are included. Currently use the legacy geometry for all detectors. Removed an errant Beamline.gdml file in the previous upload. ValidFrom = 2013-10-04 18:00:00 Date Created = 2013-11-11 17:18:27.763000 Geometry Number = 12 Geometry Note = Step I geometry developed for EMR run. Positions of all available detectors and their survey points are included. Currently use the legacy geometry for all detectors. Removed an errant Beamline.gdml file in the previous upload. Changes to the FastRadModel and Maus_Information files to run the detector position/rotation fit. ValidFrom = 2013-10-04 18:00:00 Date Created = 2013-12-17 15:58:59.090000 Geometry Number = 13 Geometry Note = Updated step IV geometry. Detectors including the TOFs, Ckov, KL, Trackers, and Absorbers are included in GDML files. EMR still uses legacy geometry. Survey information not available for detectors. ValidFrom = 1974-01-02 00:00:00 Date Created = 2014-02-06 12:07:02.829000 Geometry Number = 14 Geometry Note = Step I geometry with detectors including the TOFs, Ckov, and KL included as GDML files. EMR still uses legacy geometry. Survey information for detectors TOF, KL, and Ckovs included. ValidFrom = 2013-10-05 18:00:00 Date Created = 2014-02-06 16:01:38.766000 Geometry Number = 15 Geometry Note = Step I geometry with detectors including the TOFs, Ckov, and KL included as GDML files. EMR still uses legacy geometry. Survey information for detectors TOF, KL, EMR, and Ckovs included. ValidFrom = 2013-10-05 18:00:00 Date Created = 2014-03-11 16:11:50.850000 Geometry Number = 16 Geometry Note = Step I geometry with detectors including the TOFs, Ckov, EMR, and KL included as GDML files. Ckov files recreate MICE modules to generate incorrect conical mirror object. Survey information for detectors TOF, KL, EMR, and Ckovs included. ValidFrom = 2013-10-05 18:00:00 Date Created = 2014-03-25 12:18:15.653000 Geometry Number = 17 Geometry Note = Step IV geometry with detectors including the TOFs, Ckov, EMR, Tracker, and KL included as GDML files. Ckov files recreate MICE modules to generate incorrect conical mirror object. A 180 degree rotation is applied to Tracker0 with respect to Tracker1. Survey information not included. ValidFrom = 1974-02-02 18:00:00 Date Created = 2014-03-25 15:15:41.201000
How to download the CAD-based geometry in MAUS¶
Use the python scripts in bin/utilities directory of a recent maus release
Four different examples:
python bin/utilities/download_geometry.py --geometry_download_id 23 --geometry_download_directory $MAUS_ROOT_DIR/files/geometry/download python bin/utilities/download_geometry.py --geometry_download_by run_number --geometry_download_run 5519 python bin/utilities/download_geometry.py --geometry_download_by current python bin/utilities/download_fit_geometry.py --geometry_download_id 24 --geometry_download_cleanup False
The first example returns the step IV geometry corresponding to ID 23 and places the results in the geometry download directory as indicated. The second example downloads the (step I) geometry corresponding to run 5519 and places it in the default directory. The second example accesses the currents from the CDB to specify the magnetic fields of the beam line elements. The third example downloads the current geometry according to the time stamps in the configuration database. The fourth example downloads the step I geometry corresponding to ID 16 (see Geometry Note comment from "get_geometry_ids.py" script) and places it in the default directory. Setting the "geometry_download_cleanup" option to false will leave a "gdml" directory in your "geometry_download_directory" containing the GDML files extracted from CDB. This is potentially useful for debugging the geometry or the survey fit, or visualizing the geometry with an external program (geant4 example "/extended/persisitancy/gdml/G01" for example). $MAUS_ROOT_DIR/files/geometry is the default download directory as set in the ConfigurationDefaults.py file.
Suggested geometry files¶
The geometry is currently in a state of flux because of the development of the software and build up of new detector systems. For the time being it is recommended that people use the "current" Step I geometry, ID 27, or the latest Step IV geometry, ID 23. A version of the Step IV geometry that includes only the detectors and the fields, but no beam line elements for software debugging purposes as ID 22.
Many of the other geometries fail due to a change in the file format (as is the case of ID7) or the survey fit halts because the fit chi-square exceeds tolerance; the chi-square must be less than 3 for all detectors to succeed, which is not the case for ID 12 or 14.
How to run MAUS simulation using CAD-based geometry¶
If the script simulate_mice.py is used, it is sufficient to make a copy of the ConfigurationDefault.py file and change the simulation_geometry_filename to $MAUS_ROOT_DIR/files/geometry/download/ParentGeometryFile.dat. This may also be done on the command line with
python bin/simulate_mice.py --simulation_geometry_filename $MAUS_ROOT_DIR/files/geometry/download/ParentGeometryFile.dat
NOT TO DO¶
Do not move the geometry files after download to a different directory. The directory name where the geometry files reside is embedded in ParentGeometryFile.dat at download time.
Do not download a new geometry over a pre-existing one. The geometry download script does not clean the geometry download directory prior to writing the MICE Module files from the GDML. The result can lead to a confused workspace at the least and a corrupted geometry at worst. The geometry download directory should be cleaned before each download or a new directory must be created for each new geometry download.
Details for Coders and Detector Groups¶
The details required to coordinate the fit are located in the "Maus_Information.gdml" file contained in the CDB entry. In the
Detector_Informationfield there is a list of the detectors to be used in the simulation. Each entry contains the reference to the ideal position of the detector according to the CAD geometry and a list of the corresponding survey nests. Each entry in the list of survey nest contains the reference to the position of the nest in the CAD-based geometry ("gdml_posref") and the position of the nest with respect to the centre of the detector as it is defined in the GEANT geometry description. An example corresponding to TOF0 appears below.
<Detector_Information> <TOF> <TOF0 gdml_posref="posRef_1"> <Survey Point_Number="0" err="5." gdml_name="Step_9" gdml_posref="posRef_10" units="mm" x="269.46" y="225.205" z="27.403"/> <Survey Point_Number="1" err="5." gdml_name="Step_10" gdml_posref="posRef_11" units="mm" x="265.76" y="-225.97" z="25.024"/> <Survey Point_Number="2" err="5." gdml_name="Step_11" gdml_posref="posRef_12" units="mm" x="-269.46" y="-225.206" z="24.832"/> <Survey Point_Number="3" err="5." gdml_name="Step_12" gdml_posref="posRef_13" units="mm" x="-268.45" y="226.175" z="22.596"/> </TOF0> </TOF> </Detector_Information>
The geometry groups should fill out this information based on detector specific surveys. The fit is conducted between the positions of the survey nests in the CAD based geometry and the positions provided. This fit minimizes a chi-square between the positions of the survey nests in the CAD and the survey nests in the detector frame with respect to changes in the position and rotation of the detector. The changes in the positions are written to the CAD GDML prior to translation of the GDML to the MICE module file. The file pointer in the GDML will be updated to point at the GDML file for the detector if that file is contained in the CDB download.
Detector Geometry Validation Procedure¶
The owners of the detectors must contribute to the geometry description to ensure that the most accurate description of MICE is available through CDB. The following describes how the detector owners may contribute to this validation.
- Download latest release of MAUS. Releases following (the next MAUS release?) contain the geometry download, extraction, and fit algorithms. This software will need the latest python based MICE module extraction for the detector geometry and detector position fit.
- Use the "download_geometry'' with configuration options as described in geometry instructions. Please download the StepIV geometry corresponding to geometry ID 13 with the clean up GDML option set to false. The geometry_download_directory should contain a set of .dat files and a gdml directory.
- Review the contents of the gdml files. Confirm that
-> the dimensions of the solids are correct
-> all volumes appear in the detector definition as expected
-> all volumes appear at the desired position in the detector coordinate system
-> all the material definitions are correct.
- Review the MM files. Confirm that
-> There are no obvious errors from translation
-> There is a well defined modules; every module is contained within braces "{}'' and has the correct positions.
-> The detector materials in the MICE Modules are correct.
-> All modules appear in the files as expected.
- Run the simulation with "simulate_mice.py'' or similar script with the simulation_geometry_filename flag pointing at ParentGeometryFile.dat under the geometry_download_directory. The purpose of this is to check for gross errors missed during the visual file inspection.
The results of these checks should be reported to the geometry group (as a mice mine issue?). It is then the responsibility of either RB or SR (as deputy) to correct and respond to any noted problems and issue a corrected geometry (to CDB).
Geometry Readiness Matrix¶
Updated by Ricciardi, Stefania over 9 years ago ยท 30 revisions