Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 09:06:13

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