Thomas Gawne , Sebastian Schwalbe , Thomas Chuna , Uwe Hernandez Acosta , Thomas R. Preston , Tobias Dornheim
{"title":"一种新的镶嵌晶体光谱仪x射线跟踪代码","authors":"Thomas Gawne , Sebastian Schwalbe , Thomas Chuna , Uwe Hernandez Acosta , Thomas R. Preston , Tobias Dornheim","doi":"10.1016/j.cpc.2025.109878","DOIUrl":null,"url":null,"abstract":"<div><div>We introduce a new open-source Python x-ray tracing code for modelling Bragg diffracting mosaic crystal spectrometers: <em>High Energy Applications Ray Tracer (HEART)</em>. <em>HEART</em>'s high modularity enables customizable workflows as well as efficient development of novel features. Utilizing Numba's just-in-time (JIT) compiler and the message-passing interface (MPI) allows running <em>HEART</em> in parallel leading to excellent performance. <em>HEART</em> is intended to be used for modelling x-ray spectra as they would be seen in experiments that measure x-ray spectroscopy with a mosaic crystal spectrometer. This enables the user to make predictions about what will be seen on a detector in experiment, perform optimizations on the design of the spectrometer setup, or to study the effect of the spectrometer on measured spectra. However, the code certainly has further uses beyond these example use cases. Here, we discuss the physical model used in the code, and explore a number of different mosaic distribution functions, intrinsic rocking curves, and sampling approaches which are available to the user. Finally, we demonstrate its strong predictive capability in comparison to spectroscopic data collected at the European XFEL in Germany.</div></div><div><h3>Program summary</h3><div><em>Program Title:</em> High Energy Applications Ray Tracer (HEART)</div><div><em>CPC Library link to program files:</em> <span><span>https://doi.org/10.17632/d3wc5jxdgj.1</span><svg><path></path></svg></span></div><div><em>Developer's repository link:</em> <span><span>https://gitlab.com/heart-ray-tracing/HEART</span><svg><path></path></svg></span></div><div><em>Licensing provisions:</em> GPLv3</div><div><em>Programming language:</em> Python ≥3.10</div><div><em>Nature of problem:</em> Mosaic crystal spectrometers are widely-used at high energy density (HED) facilities owing to their very high integrated reflectivities. However, the mosaic nature of the crystal introduces a lot of complexity into the instrument functions of these spectrometers. Understanding how the mosaic crystal will impact the measured spectrum is vital for reliably inferring conditions measured via x-ray spectroscopy and for planning experiments.</div><div><em>Solution method:</em> We have developed a ray tracing code with specific support for mosaic crystals. With the implemented precise dynamical theory models, our ray tracing code simulates accurate detector images enabling realistic comparisons with experiments. It takes advantage of the inherent randomness of mosaic crystals to run Monte Carlo simulations of rays passing through the crystal. This also means the detector images produced contain similar photon counting noise that would appear in experiments. A number of options for crystal materials, geometries, mosaic distribution functions, and rocking curves are supported. Effects such as absorption and multiple ray reflections are also treated explicitly.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"318 ","pages":"Article 109878"},"PeriodicalIF":3.4000,"publicationDate":"2025-09-29","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"HEART: A new X-ray tracing code for mosaic crystal spectrometers\",\"authors\":\"Thomas Gawne , Sebastian Schwalbe , Thomas Chuna , Uwe Hernandez Acosta , Thomas R. Preston , Tobias Dornheim\",\"doi\":\"10.1016/j.cpc.2025.109878\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><div>We introduce a new open-source Python x-ray tracing code for modelling Bragg diffracting mosaic crystal spectrometers: <em>High Energy Applications Ray Tracer (HEART)</em>. <em>HEART</em>'s high modularity enables customizable workflows as well as efficient development of novel features. Utilizing Numba's just-in-time (JIT) compiler and the message-passing interface (MPI) allows running <em>HEART</em> in parallel leading to excellent performance. <em>HEART</em> is intended to be used for modelling x-ray spectra as they would be seen in experiments that measure x-ray spectroscopy with a mosaic crystal spectrometer. This enables the user to make predictions about what will be seen on a detector in experiment, perform optimizations on the design of the spectrometer setup, or to study the effect of the spectrometer on measured spectra. However, the code certainly has further uses beyond these example use cases. Here, we discuss the physical model used in the code, and explore a number of different mosaic distribution functions, intrinsic rocking curves, and sampling approaches which are available to the user. Finally, we demonstrate its strong predictive capability in comparison to spectroscopic data collected at the European XFEL in Germany.</div></div><div><h3>Program summary</h3><div><em>Program Title:</em> High Energy Applications Ray Tracer (HEART)</div><div><em>CPC Library link to program files:</em> <span><span>https://doi.org/10.17632/d3wc5jxdgj.1</span><svg><path></path></svg></span></div><div><em>Developer's repository link:</em> <span><span>https://gitlab.com/heart-ray-tracing/HEART</span><svg><path></path></svg></span></div><div><em>Licensing provisions:</em> GPLv3</div><div><em>Programming language:</em> Python ≥3.10</div><div><em>Nature of problem:</em> Mosaic crystal spectrometers are widely-used at high energy density (HED) facilities owing to their very high integrated reflectivities. However, the mosaic nature of the crystal introduces a lot of complexity into the instrument functions of these spectrometers. Understanding how the mosaic crystal will impact the measured spectrum is vital for reliably inferring conditions measured via x-ray spectroscopy and for planning experiments.</div><div><em>Solution method:</em> We have developed a ray tracing code with specific support for mosaic crystals. With the implemented precise dynamical theory models, our ray tracing code simulates accurate detector images enabling realistic comparisons with experiments. It takes advantage of the inherent randomness of mosaic crystals to run Monte Carlo simulations of rays passing through the crystal. This also means the detector images produced contain similar photon counting noise that would appear in experiments. A number of options for crystal materials, geometries, mosaic distribution functions, and rocking curves are supported. Effects such as absorption and multiple ray reflections are also treated explicitly.</div></div>\",\"PeriodicalId\":285,\"journal\":{\"name\":\"Computer Physics Communications\",\"volume\":\"318 \",\"pages\":\"Article 109878\"},\"PeriodicalIF\":3.4000,\"publicationDate\":\"2025-09-29\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Computer Physics Communications\",\"FirstCategoryId\":\"101\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S0010465525003807\",\"RegionNum\":2,\"RegionCategory\":\"物理与天体物理\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q1\",\"JCRName\":\"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computer Physics Communications","FirstCategoryId":"101","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0010465525003807","RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS","Score":null,"Total":0}
HEART: A new X-ray tracing code for mosaic crystal spectrometers
We introduce a new open-source Python x-ray tracing code for modelling Bragg diffracting mosaic crystal spectrometers: High Energy Applications Ray Tracer (HEART). HEART's high modularity enables customizable workflows as well as efficient development of novel features. Utilizing Numba's just-in-time (JIT) compiler and the message-passing interface (MPI) allows running HEART in parallel leading to excellent performance. HEART is intended to be used for modelling x-ray spectra as they would be seen in experiments that measure x-ray spectroscopy with a mosaic crystal spectrometer. This enables the user to make predictions about what will be seen on a detector in experiment, perform optimizations on the design of the spectrometer setup, or to study the effect of the spectrometer on measured spectra. However, the code certainly has further uses beyond these example use cases. Here, we discuss the physical model used in the code, and explore a number of different mosaic distribution functions, intrinsic rocking curves, and sampling approaches which are available to the user. Finally, we demonstrate its strong predictive capability in comparison to spectroscopic data collected at the European XFEL in Germany.
Program summary
Program Title: High Energy Applications Ray Tracer (HEART)
CPC Library link to program files:https://doi.org/10.17632/d3wc5jxdgj.1
Nature of problem: Mosaic crystal spectrometers are widely-used at high energy density (HED) facilities owing to their very high integrated reflectivities. However, the mosaic nature of the crystal introduces a lot of complexity into the instrument functions of these spectrometers. Understanding how the mosaic crystal will impact the measured spectrum is vital for reliably inferring conditions measured via x-ray spectroscopy and for planning experiments.
Solution method: We have developed a ray tracing code with specific support for mosaic crystals. With the implemented precise dynamical theory models, our ray tracing code simulates accurate detector images enabling realistic comparisons with experiments. It takes advantage of the inherent randomness of mosaic crystals to run Monte Carlo simulations of rays passing through the crystal. This also means the detector images produced contain similar photon counting noise that would appear in experiments. A number of options for crystal materials, geometries, mosaic distribution functions, and rocking curves are supported. Effects such as absorption and multiple ray reflections are also treated explicitly.
期刊介绍:
The focus of CPC is on contemporary computational methods and techniques and their implementation, the effectiveness of which will normally be evidenced by the author(s) within the context of a substantive problem in physics. Within this setting CPC publishes two types of paper.
Computer Programs in Physics (CPiP)
These papers describe significant computer programs to be archived in the CPC Program Library which is held in the Mendeley Data repository. The submitted software must be covered by an approved open source licence. Papers and associated computer programs that address a problem of contemporary interest in physics that cannot be solved by current software are particularly encouraged.
Computational Physics Papers (CP)
These are research papers in, but are not limited to, the following themes across computational physics and related disciplines.
mathematical and numerical methods and algorithms;
computational models including those associated with the design, control and analysis of experiments; and
algebraic computation.
Each will normally include software implementation and performance details. The software implementation should, ideally, be available via GitHub, Zenodo or an institutional repository.In addition, research papers on the impact of advanced computer architecture and special purpose computers on computing in the physical sciences and software topics related to, and of importance in, the physical sciences may be considered.