File indexing completed on 2026-04-10 07:50:34
0001 #pragma once
0002
0003 #include "U4Stack.h"
0004
0005 struct U4StackAuto
0006 {
0007 static unsigned Classify(const char* summary);
0008 static bool IsClassified(unsigned stack);
0009
0010 static constexpr const char* RestDiscreteReset = R"(
0011 U4Random::flat
0012 G4VProcess::ResetNumberOfInteractionLengthLeft
0013 G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength
0014 G4VProcess::PostStepGPIL
0015 G4SteppingManager::DefinePhysicalStepLength
0016 G4SteppingManager::Stepping
0017 )" ;
0018
0019 static constexpr const char* RestDiscreteReset_note = R"(
0020 must be Scintillation, as only RestDiscrete process around
0021 )" ;
0022
0023
0024 static constexpr const char* DiscreteReset = R"(
0025 U4Random::flat
0026 G4VProcess::ResetNumberOfInteractionLengthLeft
0027 G4VDiscreteProcess::PostStepGetPhysicalInteractionLength
0028 G4VProcess::PostStepGPIL
0029 G4SteppingManager::DefinePhysicalStepLength
0030 G4SteppingManager::Stepping
0031 )" ;
0032
0033 static constexpr const char* ScintDiscreteReset = R"(
0034 U4Random::flat
0035 G4VProcess::ResetNumberOfInteractionLengthLeft
0036 DsG4Scintillation::ResetNumberOfInteractionLengthLeft
0037 G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength
0038 G4VProcess::PostStepGPIL
0039 G4SteppingManager::DefinePhysicalStepLength
0040 G4SteppingManager::Stepping
0041 )" ;
0042
0043 static constexpr const char* BoundaryDiscreteReset = R"(
0044 U4Random::flat
0045 G4VProcess::ResetNumberOfInteractionLengthLeft
0046 InstrumentedG4OpBoundaryProcess::ResetNumberOfInteractionLengthLeft
0047 G4VDiscreteProcess::PostStepGetPhysicalInteractionLength
0048 G4VProcess::PostStepGPIL
0049 G4SteppingManager::DefinePhysicalStepLength
0050 G4SteppingManager::Stepping
0051 )" ;
0052
0053 static constexpr const char* BoundaryDiscreteReset2_ = "BoundaryDiscreteReset2" ;
0054 static constexpr const char* BoundaryDiscreteReset2 = R"(
0055 U4Random::flat
0056 InstrumentedG4OpBoundaryProcess::ResetNumberOfInteractionLengthLeft
0057 G4VDiscreteProcess::PostStepGetPhysicalInteractionLength
0058 G4SteppingManager::DefinePhysicalStepLength
0059 G4SteppingManager::Stepping
0060 )" ;
0061
0062
0063 static constexpr const char* RayleighDiscreteReset = R"(
0064 U4Random::flat
0065 G4VProcess::ResetNumberOfInteractionLengthLeft
0066 ShimG4OpRayleigh::ResetNumberOfInteractionLengthLeft
0067 G4VDiscreteProcess::PostStepGetPhysicalInteractionLength
0068 G4VProcess::PostStepGPIL
0069 G4SteppingManager::DefinePhysicalStepLength
0070 G4SteppingManager::Stepping
0071 )" ;
0072
0073 static constexpr const char* ShimRayleighDiscreteReset_ = "ShimRayleighDiscreteReset" ;
0074 static constexpr const char* ShimRayleighDiscreteReset = R"(
0075 U4Random::flat
0076 ShimG4OpRayleigh::ResetNumberOfInteractionLengthLeft
0077 G4VDiscreteProcess::PostStepGetPhysicalInteractionLength
0078 G4VProcess::PostStepGPIL
0079 G4SteppingManager::DefinePhysicalStepLength
0080 G4SteppingManager::Stepping
0081 )" ;
0082
0083 static constexpr const char* Shim2RayleighDiscreteReset_ = "Shim2RayleighDiscreteReset" ;
0084 static constexpr const char* Shim2RayleighDiscreteReset = R"(
0085 U4Random::flat
0086 ShimG4OpRayleigh::ResetNumberOfInteractionLengthLeft
0087 ShimG4OpRayleigh::PostStepGetPhysicalInteractionLength
0088 G4VProcess::PostStepGPIL
0089 G4SteppingManager::DefinePhysicalStepLength
0090 G4SteppingManager::Stepping
0091 )" ;
0092
0093
0094
0095 static constexpr const char* AbsorptionDiscreteReset = R"(
0096 U4Random::flat
0097 G4VProcess::ResetNumberOfInteractionLengthLeft
0098 ShimG4OpAbsorption::ResetNumberOfInteractionLengthLeft
0099 G4VDiscreteProcess::PostStepGetPhysicalInteractionLength
0100 G4VProcess::PostStepGPIL
0101 G4SteppingManager::DefinePhysicalStepLength
0102 G4SteppingManager::Stepping
0103 )" ;
0104 static constexpr const char* ShimAbsorptionDiscreteReset_ = "ShimAbsorptionDiscreteReset" ;
0105 static constexpr const char* ShimAbsorptionDiscreteReset = R"(
0106 U4Random::flat
0107 ShimG4OpAbsorption::ResetNumberOfInteractionLengthLeft
0108 G4VDiscreteProcess::PostStepGetPhysicalInteractionLength
0109 G4VProcess::PostStepGPIL
0110 G4SteppingManager::DefinePhysicalStepLength
0111 G4SteppingManager::Stepping
0112 )" ;
0113
0114 static constexpr const char* Shim2AbsorptionDiscreteReset_ = "Shim2AbsorptionDiscreteReset" ;
0115 static constexpr const char* Shim2AbsorptionDiscreteReset = R"(
0116 U4Random::flat
0117 ShimG4OpAbsorption::ResetNumberOfInteractionLengthLeft
0118 ShimG4OpAbsorption::PostStepGetPhysicalInteractionLength
0119 G4VProcess::PostStepGPIL
0120 G4SteppingManager::DefinePhysicalStepLength
0121 G4SteppingManager::Stepping
0122 )" ;
0123
0124
0125 static constexpr const char* BoundaryBurn_SurfaceReflectTransmitAbsorb = R"(
0126 U4Random::flat
0127 InstrumentedG4OpBoundaryProcess::PostStepDoIt
0128 G4SteppingManager::InvokePSDIP
0129 G4SteppingManager::InvokePostStepDoItProcs
0130 G4SteppingManager::Stepping
0131 )" ;
0132
0133
0134 static constexpr const char* BoundaryDiDiTransCoeff = R"(
0135 U4Random::flat
0136 InstrumentedG4OpBoundaryProcess::G4BooleanRand
0137 InstrumentedG4OpBoundaryProcess::DielectricDielectric
0138 InstrumentedG4OpBoundaryProcess::PostStepDoIt
0139 G4SteppingManager::InvokePSDIP
0140 G4SteppingManager::InvokePostStepDoItProcs
0141 G4SteppingManager::Stepping
0142 )" ;
0143
0144 static constexpr const char* AbsorptionEffDetect = R"(
0145 U4Random::flat
0146 InstrumentedG4OpBoundaryProcess::G4BooleanRand
0147 InstrumentedG4OpBoundaryProcess::DoAbsorption
0148 InstrumentedG4OpBoundaryProcess::PostStepDoIt
0149 G4SteppingManager::InvokePSDIP
0150 G4SteppingManager::InvokePostStepDoItProcs
0151 G4SteppingManager::Stepping
0152 )" ;
0153
0154 static constexpr const char* RayleighScatter = R"(
0155 U4Random::flat
0156 G4OpRayleigh::PostStepDoIt
0157 G4SteppingManager::InvokePSDIP
0158 G4SteppingManager::InvokePostStepDoItProcs
0159 G4SteppingManager::Stepping
0160 )" ;
0161
0162
0163
0164
0165 };
0166
0167
0168
0169 inline unsigned U4StackAuto::Classify(const char* summary)
0170 {
0171 unsigned stack = U4Stack_Unclassified ;
0172 if(strstr(summary, RestDiscreteReset)) stack = U4Stack_RestDiscreteReset ;
0173 if(strstr(summary, DiscreteReset)) stack = U4Stack_DiscreteReset ;
0174 if(strstr(summary, ScintDiscreteReset)) stack = U4Stack_ScintDiscreteReset ;
0175 if(strstr(summary, BoundaryDiscreteReset)) stack = U4Stack_BoundaryDiscreteReset ;
0176 if(strstr(summary, BoundaryDiscreteReset2)) stack = U4Stack_BoundaryDiscreteReset ;
0177
0178 if(strstr(summary, RayleighDiscreteReset)) stack = U4Stack_RayleighDiscreteReset ;
0179 if(strstr(summary, ShimRayleighDiscreteReset)) stack = U4Stack_RayleighDiscreteReset ;
0180 if(strstr(summary, Shim2RayleighDiscreteReset)) stack = U4Stack_RayleighDiscreteReset ;
0181
0182 if(strstr(summary, AbsorptionDiscreteReset)) stack = U4Stack_AbsorptionDiscreteReset ;
0183 if(strstr(summary, ShimAbsorptionDiscreteReset)) stack = U4Stack_AbsorptionDiscreteReset ;
0184 if(strstr(summary, Shim2AbsorptionDiscreteReset)) stack = U4Stack_AbsorptionDiscreteReset ;
0185
0186 if(strstr(summary, BoundaryBurn_SurfaceReflectTransmitAbsorb)) stack = U4Stack_BoundaryBurn_SurfaceReflectTransmitAbsorb ;
0187 if(strstr(summary, BoundaryDiDiTransCoeff)) stack = U4Stack_BoundaryDiDiTransCoeff ;
0188 if(strstr(summary, AbsorptionEffDetect)) stack = U4Stack_AbsorptionEffDetect ;
0189 if(strstr(summary, RayleighScatter)) stack = U4Stack_RayleighScatter ;
0190 return stack ;
0191 }
0192
0193 inline bool U4StackAuto::IsClassified(unsigned stack)
0194 {
0195 return stack != U4Stack_Unclassified ;
0196 }
0197
0198
0199