File indexing completed on 2026-04-10 07:49:40
0001 #pragma once
0002 #include "squad.h"
0003
0004 #if defined(__CUDACC__) || defined(__CUDABE__)
0005 #define QGS_METHOD __device__
0006 #else
0007 #define QGS_METHOD
0008 #endif
0009
0010
0011 struct ST
0012 {
0013 int Id ;
0014 int ParentId ;
0015 int MaterialIndex ;
0016 int NumPhotons ;
0017
0018 float3 x0 ;
0019 float t0 ;
0020
0021 float3 DeltaPosition ;
0022 float step_length ;
0023
0024 };
0025
0026 struct CK0
0027 {
0028 int code;
0029 float charge ;
0030 float weight ;
0031 float preVelocity ;
0032
0033 float BetaInverse ;
0034 float Pmin ;
0035 float Pmax ;
0036 float maxCos ;
0037
0038 float maxSin2 ;
0039 float MeanNumberOfPhotons1 ;
0040 float MeanNumberOfPhotons2 ;
0041 float postVelocity ;
0042 };
0043
0044 struct CK1
0045 {
0046 int code;
0047 float charge ;
0048 float weight ;
0049 float preVelocity ;
0050
0051 float BetaInverse ;
0052 float Wmin ;
0053 float Wmax ;
0054 float maxCos ;
0055
0056 float maxSin2 ;
0057 float MeanNumberOfPhotons1 ;
0058 float MeanNumberOfPhotons2 ;
0059 float postVelocity ;
0060 };
0061
0062
0063 struct SC0
0064 {
0065 int code;
0066 float charge ;
0067 float weight ;
0068 float preVelocity ;
0069
0070 int scnt ;
0071 float slowerRatio ;
0072 float slowTimeConstant ;
0073 float slowerTimeConstant ;
0074
0075 float ScintillationTime ;
0076 float ScintillationIntegralMax ;
0077 float Other1 ;
0078 float Other2 ;
0079 };
0080
0081 struct SC1
0082 {
0083 int code;
0084 float charge ;
0085 float weight ;
0086 float midVelocity ;
0087
0088 int scnt ;
0089 float f41 ;
0090 float f42 ;
0091 float f43 ;
0092
0093 float ScintillationTime ;
0094 float f51 ;
0095 float f52 ;
0096 float f53 ;
0097 };
0098
0099 struct GS
0100 {
0101 ST st ;
0102 union
0103 {
0104 CK0 ck0 ;
0105 CK1 ck1 ;
0106 SC0 sc0 ;
0107 SC1 sc1 ;
0108 };
0109 };
0110
0111
0112 struct QG
0113 {
0114 union
0115 {
0116 quad6 q ;
0117 GS g ;
0118 };
0119
0120 QGS_METHOD void load(const quad6* src, unsigned id);
0121 };
0122
0123
0124 inline QGS_METHOD void QG::load(const quad6* src, unsigned id)
0125 {
0126
0127
0128 const quad6& sgs = *(src+id) ;
0129 q.q0.f = sgs.q0.f ;
0130 q.q1.f = sgs.q1.f ;
0131 q.q2.f = sgs.q2.f ;
0132 q.q3.f = sgs.q3.f ;
0133 q.q4.f = sgs.q4.f ;
0134 q.q5.f = sgs.q5.f ;
0135 }
0136