GDCP:用于 Geant4 中灵活探测器设置的自定义软件包
GDCP: A custom package for flexible detector setups in Geant4
AI总结:
本文提出 C++ 软件包 GDCP,通过在 Geant4 探测器构造阶段引入 Builder 设计模式及光学组件辅助类,提升复杂探测器代码的灵活性、可读性与可维护性。
摘要:
Geant4 Detector Construction Pattern(GDCP)是一个 C++ 软件包,包含一组实用类,供开发者在 Geant4 应用程序的探测器构造阶段使用。本研究的主要目标是提供一个接口,帮助用户开发高度灵活、易于理解且可维护的探测器构造代码。该软件包还包含两个辅助类,用于促进闪烁探测器中光学组件的实现。最后,本文提供了一个高级 Geant 应用程序,以展示该软件包的实用性。程序摘要:程序名称:GDCP;CPC 程序文件库链接:;许可条款:GNU General Public License 3;编程语言:C++;外部例程/库:Geant4。问题性质:Geant4 提供抽象类 G4VUserDetectorConstruction,用于整个探测器构造。对于简单的探测器设置,这已经足够;但实现单个类来构建复杂探测器会导致代码复杂。为解决此问题,建议将实现拆分为更多方法或类;然而,目前尚无已发布的标准解决方案,完全取决于用户的能力。解决方法:为解决此问题,我提出在探测器构造阶段应用“Builder 设计模式”。为此,本文引入了 Builder 设计模式的各个组成部分,并将其提供给开发者使用。关键词:G4VUserDetectorConstruction、Builder 设计模式、探测器构造、组件构建器、光学光子、闪烁体。
英文摘要:
Geant4 Detector Construction Pattern (GDCP) is a C++ package containing a set of utility classes for developers to utilize during the detector construction phase of a Geant4 application. The main objective of this study is to provide an interface that helps users develop a highly flexible, understandable, and maintainable detector construction code. The package also contains a couple of helper classes facilitating the implementation of optical components in scintillation detectors. Finally, an advanced Geant application has been provided to demonstrate the package's utility. Program summary Program title: GDCP CPC Library link to program files: Licensing provisions: GNU General Public License 3 Programming language: C++ External routines/libraries: Geant4 Nature of problem: Geant4 provides an abstract class, G4VUserDetectorConstruction, that is used for the whole detector construction. This is sufficient for a simple detector setup but implementing a single class for building a complex detector leads to complexity in the code. To solve this issue it is recommended to split the implementation into more methods or classes; however, there is no standard solution published yet and it is entirely left to the users' ability. Solution method: To address this issue, I propose to apply the "Builder design pattern" in the detector construction phase. For this, the elements of the Builder design pattern have been introduced and made available for developers. Keywords: G4VUserDetectorConstruction, Builder design pattern, Detector construction, Component builder, Optical photon, Scintillator
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。