Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-27 07:24:18

0001 # This file is part of the ACTS project.
0002 #
0003 # Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 #
0005 # This Source Code Form is subject to the terms of the Mozilla Public
0006 # License, v. 2.0. If a copy of the MPL was not distributed with this
0007 # file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 """Schema of a material grid file"""
0010 
0011 material_map_schema = {
0012     "type": "object",
0013     "properties": {
0014         "header": {
0015             "type": "object",
0016             "description": "File header section with important IO metadata",
0017             "properties": {
0018                 "common": {
0019                     "type": "object",
0020                     "description": "General metadata",
0021                     "properties": {
0022                         "version": {
0023                             "type": "string",
0024                             "description": "detray version this file was created with",
0025                         },
0026                         "detector": {
0027                             "type": "string",
0028                             "description": "Name of the detector",
0029                         },
0030                         "date": {
0031                             "type": "string",
0032                             "description": "Time stamp (file creation)",
0033                         },
0034                         "tag": {
0035                             "type": "string",
0036                             "description": "Type of data",
0037                             "enum": ["material_maps"],
0038                         },
0039                     },
0040                     "required": ["version", "detector", "tag"],
0041                 },
0042                 "grid_count": {
0043                     "type": "integer",
0044                     "description": "Number of material maps in the detector",
0045                     "minimum": 0,
0046                 },
0047             },
0048             "required": ["common"],
0049         },
0050         "data": {
0051             "type": "object",
0052             "description": "Grid data section (volume-by-volume)",
0053             "properties": {
0054                 "grids": {
0055                     "type": "array",
0056                     "minitems": 1,
0057                     "items": {
0058                         "type": "object",
0059                         "description": "Data of all material maps in a volume",
0060                         "properties": {
0061                             "volume_link": {
0062                                 "type": "integer",
0063                                 "description": "Volume link",
0064                                 "minimum": 0,
0065                             },
0066                             "grid_data": {
0067                                 "type": "array",
0068                                 "minitems": 1,
0069                                 "items": {
0070                                     "type": "object",
0071                                     "description": "Data of a single map",
0072                                     "properties": {
0073                                         "owner_link": {
0074                                             "type": "integer",
0075                                             "description": "Link to the owner of the grid",
0076                                             "minimum": 0,
0077                                         },
0078                                         "grid_link": {
0079                                             "type": "object",
0080                                             "description": "Typed index for the grid",
0081                                             "properties": {
0082                                                 "type": {
0083                                                     "type": "integer",
0084                                                     "description": "Type ID of the acceleration structure",
0085                                                     "minimum": 0,
0086                                                     "maximum": 4,
0087                                                 },
0088                                                 "index": {
0089                                                     "type": "integer",
0090                                                     "description": "Global index of the acceleration structure",
0091                                                     "minimum": 0,
0092                                                 },
0093                                             },
0094                                             "required": ["type", "index"],
0095                                         },
0096                                         "axes": {
0097                                             "type": "array",
0098                                             "descriptrion": "The axes of the grid",
0099                                             "minitems": 1,
0100                                             "uniqueItems": True,
0101                                             "items": {
0102                                                 "type": "object",
0103                                                 "properties": {
0104                                                     "label": {
0105                                                         "type": "integer",
0106                                                         "description": "Label ID of the axis",
0107                                                         "minimum": 0,
0108                                                         "maximum": 2,
0109                                                     },
0110                                                     "bounds": {
0111                                                         "type": "integer",
0112                                                         "description": "Type ID of the bounds",
0113                                                         "minimum": 0,
0114                                                         "maximum": 2,
0115                                                     },
0116                                                     "binning": {
0117                                                         "type": "integer",
0118                                                         "description": "Type ID of the binning",
0119                                                         "minimum": 0,
0120                                                         "maximum": 1,
0121                                                     },
0122                                                     "bins": {
0123                                                         "type": "integer",
0124                                                         "description": "Number of bins",
0125                                                         "minimum": 1,
0126                                                     },
0127                                                     "edges": {
0128                                                         "type": "array",
0129                                                         "description": "Bin edges (min, max for regular binning)",
0130                                                         "minitems": 2,
0131                                                         "uniqueItems": True,
0132                                                         "items": {"type": "number"},
0133                                                     },
0134                                                 },
0135                                                 "required": [
0136                                                     "label",
0137                                                     "bounds",
0138                                                     "binning",
0139                                                     "bins",
0140                                                     "edges",
0141                                                 ],
0142                                             },
0143                                         },
0144                                         "bins": {
0145                                             "type": "array",
0146                                             "description": "The bin content",
0147                                             "minitems": 1,
0148                                             "uniqueItems": True,
0149                                             "items": {
0150                                                 "type": "object",
0151                                                 "description": "A single bin",
0152                                                 "properties": {
0153                                                     "loc_index": {
0154                                                         "type": "array",
0155                                                         "description": "Local bin indices",
0156                                                         "minitems": 1,
0157                                                         "maxitems": 3,
0158                                                         "items": {
0159                                                             "type": "integer",
0160                                                             "minimum": 0,
0161                                                         },
0162                                                     },
0163                                                     "content": {
0164                                                         "type": "array",
0165                                                         "description": "Global surface indices",
0166                                                         "items": {
0167                                                             "type": "object",
0168                                                             "minimum": 0,
0169                                                             "properties": {
0170                                                                 "type": {
0171                                                                     "type": "integer",
0172                                                                     "description": "Material type ID",
0173                                                                     "enum": [5],
0174                                                                 },
0175                                                                 "surface_idx": {
0176                                                                     "type": "integer",
0177                                                                     "description": "Volume-local index of the surface the slab belongs to",
0178                                                                     "minimum": 0,
0179                                                                 },
0180                                                                 "thickness": {
0181                                                                     "type": "number",
0182                                                                     "description": "Thickness of the slab",
0183                                                                     "minimum": 0,
0184                                                                 },
0185                                                                 "index_in_coll": {
0186                                                                     "type": "integer",
0187                                                                     "description": "Volume-local sorting index",
0188                                                                     "minimum": 0,
0189                                                                 },
0190                                                                 "material": {
0191                                                                     "type": "object",
0192                                                                     "properties": {
0193                                                                         "params": {
0194                                                                             "type": "array",
0195                                                                             "description": "Material parameters",
0196                                                                             "minitems": 7,
0197                                                                             "maxItems": 7,
0198                                                                             "items": {
0199                                                                                 "type": "number"
0200                                                                             },
0201                                                                         }
0202                                                                     },
0203                                                                     "required": [
0204                                                                         "params"
0205                                                                     ],
0206                                                                 },
0207                                                             },
0208                                                             "required": [
0209                                                                 "type",
0210                                                                 "thickness",
0211                                                                 "material",
0212                                                             ],
0213                                                         },
0214                                                     },
0215                                                 },
0216                                                 "required": ["loc_index", "content"],
0217                                             },
0218                                         },
0219                                     },
0220                                     "required": ["owner_link", "axes", "bins"],
0221                                 },
0222                             },
0223                         },
0224                         "required": ["volume_link", "grid_data"],
0225                     },
0226                 }
0227             },
0228             "required": ["grids"],
0229         },
0230     },
0231     "required": ["header", "data"],
0232 }