Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:59:57

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/g4/Repr.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <G4ThreeVector.hh>
0010 
0011 #include "corecel/io/Repr.hh"
0012 
0013 namespace celeritas
0014 {
0015 //---------------------------------------------------------------------------//
0016 template<>
0017 struct ReprTraits<G4ThreeVector>
0018 {
0019     using value_type = std::decay_t<G4ThreeVector>;
0020 
0021     static void print_type(std::ostream& os, char const* name = nullptr)
0022     {
0023         os << "G4ThreeVector";
0024         if (name)
0025         {
0026             os << ' ' << name;
0027         }
0028     }
0029     static void init(std::ostream& os) { ReprTraits<double>::init(os); }
0030 
0031     static void print_value(std::ostream& os, G4ThreeVector const& vec)
0032     {
0033         os << '{' << vec[0] << ", " << vec[1] << ", " << vec[2] << '}';
0034     }
0035 };
0036 
0037 //---------------------------------------------------------------------------//
0038 }  // namespace celeritas