File indexing completed on 2026-04-09 07:49:39
0001 #pragma once
0002
0003
0004
0005
0006
0007
0008 #if defined(__CUDACC__) || defined(__CUDABE__)
0009 # define SGS_METHOD __host__ __device__ __forceinline__
0010 #else
0011 # define SGS_METHOD inline
0012 #endif
0013
0014 #if defined(__CUDACC__) || defined(__CUDABE__)
0015 #else
0016 #include <string>
0017 #include "spho.h"
0018 #endif
0019
0020
0021 struct sgs
0022 {
0023 int64_t index ;
0024 int64_t photons ;
0025 int64_t offset ;
0026 int64_t gentype ;
0027
0028
0029 #if defined(__CUDACC__) || defined(__CUDABE__)
0030 #else
0031 spho MakePho(unsigned idx, const spho& ancestor);
0032 std::string desc() const ;
0033 #endif
0034 };
0035
0036 #if defined(__CUDACC__) || defined(__CUDABE__)
0037 #else
0038 #include <sstream>
0039 #include <iomanip>
0040 #include "OpticksGenstep.h"
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 inline spho sgs::MakePho(unsigned idx, const spho& ancestor)
0058 {
0059 return ancestor.isDefined() ? ancestor.make_nextgen() : spho::MakePho(index, idx, offset + idx ) ;
0060 }
0061
0062 inline std::string sgs::desc() const
0063 {
0064 std::stringstream ss ;
0065 ss << "sgs:"
0066 << " idx" << std::setw(4) << index
0067 << " pho" << std::setw(6) << photons
0068 << " off " << std::setw(6) << offset
0069 << " typ " << OpticksGenstep_::Name(gentype)
0070 ;
0071 std::string s = ss.str();
0072 return s ;
0073 }
0074 #endif
0075