Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:59:52

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 geocel/GeoParamsOutput.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <memory>
0010 
0011 #include "corecel/io/OutputInterface.hh"
0012 
0013 namespace celeritas
0014 {
0015 //---------------------------------------------------------------------------//
0016 class GeoParamsInterface;
0017 
0018 //---------------------------------------------------------------------------//
0019 /*!
0020  * Save geometry diagnostic data.
0021  */
0022 class GeoParamsOutput final : public OutputInterface
0023 {
0024   public:
0025     //!@{
0026     //! \name Type aliases
0027     using SPConstGeoParams = std::shared_ptr<GeoParamsInterface const>;
0028     //!@}
0029 
0030   public:
0031     // Construct from shared geometry data
0032     explicit GeoParamsOutput(SPConstGeoParams geo);
0033 
0034     //! Category of data to write
0035     Category category() const final { return Category::internal; }
0036 
0037     //! Name of the entry inside the category.
0038     std::string_view label() const final { return "geometry"; }
0039 
0040     // Write output to the given JSON object
0041     void output(JsonPimpl*) const final;
0042 
0043   private:
0044     SPConstGeoParams geo_;
0045 };
0046 
0047 //---------------------------------------------------------------------------//
0048 }  // namespace celeritas