File indexing completed on 2025-01-18 09:59:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 #ifndef G4UCNBOUNDARYPROCESS_HH
0045 #define G4UCNBOUNDARYPROCESS_HH 1
0046
0047
0048
0049
0050
0051 #include "G4VDiscreteProcess.hh"
0052
0053 #include "G4Neutron.hh"
0054
0055 #include "G4UCNMaterialPropertiesTable.hh"
0056
0057 class G4UCNBoundaryProcessMessenger;
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070 enum G4UCNBoundaryProcessStatus { Undefined,
0071 NotAtBoundary,
0072 SameMaterial,
0073 StepTooSmall,
0074 NoMPT, NoMRT,
0075 NoMRCondition,
0076 Absorption, Ezero, Flip,
0077 SpecularReflection,
0078 LambertianReflection, MRDiffuseReflection,
0079 SnellTransmit, MRDiffuseTransmit
0080 };
0081
0082 class G4UCNBoundaryProcess : public G4VDiscreteProcess
0083 {
0084
0085 public:
0086
0087
0088
0089
0090
0091 G4UCNBoundaryProcess(const G4String& processName = "UCNBoundaryProcess",
0092 G4ProcessType type = fUCN);
0093 virtual ~G4UCNBoundaryProcess();
0094
0095 private:
0096
0097 G4UCNBoundaryProcess(const G4UCNBoundaryProcess &right);
0098
0099
0100
0101
0102
0103 G4UCNBoundaryProcess& operator=(const G4UCNBoundaryProcess &right);
0104
0105 public:
0106
0107
0108
0109
0110
0111 G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
0112
0113
0114 G4double GetMeanFreePath(const G4Track& aTrack,
0115 G4double ,
0116 G4ForceCondition* condition);
0117
0118 G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
0119 const G4Step& aStep);
0120
0121 private:
0122
0123 G4UCNBoundaryProcessMessenger* fMessenger;
0124
0125 G4double neV;
0126
0127 G4double kCarTolerance;
0128
0129 G4UCNBoundaryProcessStatus theStatus;
0130
0131 const G4Material* Material1;
0132 const G4Material* Material2;
0133
0134
0135 G4UCNMaterialPropertiesTable* aMaterialPropertiesTable1;
0136
0137 G4UCNMaterialPropertiesTable* aMaterialPropertiesTable2;
0138
0139 G4bool UseMicroRoughnessReflection;
0140 G4bool DoMicroRoughnessReflection;
0141
0142
0143
0144
0145
0146 G4bool High(G4double , G4double );
0147
0148 G4bool Loss(G4double , G4double , G4double );
0149
0150 G4bool SpinFlip(G4double );
0151
0152 G4double Reflectivity(G4double , G4double );
0153
0154 G4ThreeVector Reflect(G4double , G4ThreeVector , G4ThreeVector );
0155
0156 G4double Transmit(G4double, G4double );
0157
0158 G4ThreeVector LDiffRefl(G4ThreeVector );
0159
0160 public:
0161
0162 G4ThreeVector MRreflect(G4double ,
0163 G4ThreeVector , G4ThreeVector ,
0164 G4double , G4double );
0165 G4ThreeVector MRreflectHigh(G4double , G4double , G4double ,
0166 G4ThreeVector , G4ThreeVector ,
0167 G4double , G4double , G4double& );
0168
0169 private:
0170
0171 G4ThreeVector MRDiffRefl(G4ThreeVector , G4double , G4double ,
0172 G4ThreeVector , G4double );
0173 G4ThreeVector MRDiffTrans(G4ThreeVector , G4double , G4double ,
0174 G4ThreeVector , G4double );
0175
0176 G4RotationMatrix GetCoordinateTransformMatrix(G4ThreeVector ,
0177 G4ThreeVector );
0178
0179 void BoundaryProcessVerbose() const;
0180
0181
0182 G4bool InvokeSD(const G4Step* step);
0183
0184 private:
0185
0186 G4int nNoMPT, nNoMRT, nNoMRCondition;
0187 G4int nAbsorption, nEzero, nFlip;
0188 G4int aSpecularReflection, bSpecularReflection;
0189 G4int bLambertianReflection;
0190 G4int aMRDiffuseReflection, bMRDiffuseReflection;
0191 G4int nSnellTransmit, mSnellTransmit;
0192 G4int aMRDiffuseTransmit;
0193
0194 G4double ftheta_o, fphi_o;
0195
0196 public:
0197
0198 void SetMicroRoughness(G4bool );
0199 G4bool GetMicroRoughness();
0200
0201 G4UCNBoundaryProcessStatus GetStatus() const;
0202
0203 void BoundaryProcessSummary() const;
0204
0205 void SetMaterialPropertiesTable1(G4UCNMaterialPropertiesTable* MPT)
0206 {aMaterialPropertiesTable1 = MPT;}
0207
0208 void SetMaterialPropertiesTable2(G4UCNMaterialPropertiesTable* MPT)
0209 {aMaterialPropertiesTable2 = MPT;}
0210
0211 G4double GetTheta_o() {return ftheta_o;};
0212 G4double GetPhi_o() {return fphi_o;};
0213
0214 };
0215
0216
0217
0218
0219
0220 inline G4bool
0221 G4UCNBoundaryProcess::IsApplicable(const G4ParticleDefinition& aParticleType)
0222 {
0223 return ( &aParticleType == G4Neutron::NeutronDefinition() );
0224 }
0225
0226 inline
0227 G4UCNBoundaryProcessStatus G4UCNBoundaryProcess::GetStatus() const
0228 {
0229 return theStatus;
0230 }
0231
0232 inline
0233 G4bool G4UCNBoundaryProcess::High(G4double Energy, G4double FermiPotDiff)
0234 {
0235
0236
0237 return (Energy > FermiPotDiff);
0238 }
0239
0240 inline
0241 void G4UCNBoundaryProcess::SetMicroRoughness(G4bool active)
0242 {
0243 UseMicroRoughnessReflection = active;
0244 }
0245
0246 inline
0247 G4bool G4UCNBoundaryProcess::GetMicroRoughness()
0248 {
0249 return UseMicroRoughnessReflection;
0250 }
0251
0252 #endif