Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:56

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file orange/orangeinp/InputBuilder.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include <string>
0011 
0012 #include "orange/OrangeTypes.hh"
0013 
0014 namespace celeritas
0015 {
0016 struct OrangeInput;
0017 
0018 namespace orangeinp
0019 {
0020 class ProtoInterface;
0021 
0022 //---------------------------------------------------------------------------//
0023 /*!
0024  * Construct an ORANGE input from a top-level proto.
0025  */
0026 class InputBuilder
0027 {
0028   public:
0029     //!@{
0030     //! \name Type aliases
0031     using arg_type = ProtoInterface const&;
0032     using result_type = OrangeInput;
0033     //!@}
0034 
0035     //! Input options for construction
0036     struct Options
0037     {
0038         //! Manually specify a tracking/construction tolerance
0039         Tolerance<> tol;
0040         //! Write unfolded universe structure to a JSON file
0041         std::string proto_output_file;
0042         //! Write intermediate build output to a JSON file
0043         std::string debug_output_file;
0044     };
0045 
0046   public:
0047     // Construct with options
0048     explicit InputBuilder(Options&& opts);
0049 
0050     //! Construct with defaults
0051     InputBuilder() : InputBuilder{Options{}} {}
0052 
0053     // Convert a proto
0054     result_type operator()(ProtoInterface const& global) const;
0055 
0056   private:
0057     Options opts_;
0058 };
0059 
0060 //---------------------------------------------------------------------------//
0061 }  // namespace orangeinp
0062 }  // namespace celeritas