File indexing completed on 2026-04-10 07:50:29
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
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066 #ifndef InstrumentedG4OpBoundaryProcess_h
0067 #define InstrumentedG4OpBoundaryProcess_h 1
0068
0069
0070
0071
0072
0073 #include "globals.hh"
0074 #include "templates.hh"
0075 #include "geomdefs.hh"
0076 #include "Randomize.hh"
0077
0078 #include "G4RandomTools.hh"
0079 #include "G4RandomDirection.hh"
0080
0081
0082 #include "U4RandomTools.hh"
0083 #include "U4RandomDirection.hh"
0084 #include "plog/Severity.h"
0085
0086 #ifdef WITH_PMTFASTSIM
0087 #include "SOpBoundaryProcess.hh"
0088
0089 struct IPMTAccessor ;
0090 struct CustomART ;
0091 #endif
0092
0093 #include "G4Step.hh"
0094 #include "G4VDiscreteProcess.hh"
0095 #include "G4DynamicParticle.hh"
0096 #include "G4Material.hh"
0097 #include "G4LogicalBorderSurface.hh"
0098 #include "G4LogicalSkinSurface.hh"
0099 #include "G4OpticalSurface.hh"
0100 #include "G4OpticalPhoton.hh"
0101 #include "G4TransportationManager.hh"
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113 #include "G4OpBoundaryProcess.hh"
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153 #ifdef DEBUG_TAG
0154 #include "U4Stack.h"
0155 #include "SEvt.hh"
0156 #endif
0157
0158
0159
0160 #include "U4_API_EXPORT.hh"
0161 class U4_API InstrumentedG4OpBoundaryProcess
0162 :
0163 public G4VDiscreteProcess
0164 #ifdef WITH_PMTFASTSIM
0165 ,public SOpBoundaryProcess
0166 #endif
0167 {
0168
0169 #if !defined(PRODUCTION) && defined(DEBUG_PIDX)
0170 static const int PIDX ;
0171 int pidx ;
0172 bool pidx_dump ;
0173 #endif
0174
0175 public:
0176 static const plog::Severity LEVEL ;
0177 char theCustomStatus ;
0178
0179 #ifdef WITH_PMTFASTSIM
0180 CustomART* m_custom_art ;
0181
0182 double getU0() const ;
0183 int getU0_idx() const ;
0184 const double* getRecoveredNormal() const ;
0185 char getCustomStatus() const ;
0186
0187 static void Save(const char* dir);
0188 #endif
0189
0190 #ifdef DEBUG_TAG
0191 static const bool FLOAT ;
0192 void ResetNumberOfInteractionLengthLeft();
0193 #endif
0194
0195
0196
0197
0198
0199 InstrumentedG4OpBoundaryProcess(
0200 #ifdef WITH_PMTFASTSIM
0201 const IPMTAccessor* accessor,
0202 #endif
0203 const G4String& processName = "OpBoundary",
0204 G4ProcessType type = fOptical) ;
0205
0206 ~InstrumentedG4OpBoundaryProcess();
0207
0208 private:
0209
0210 InstrumentedG4OpBoundaryProcess(const InstrumentedG4OpBoundaryProcess &right);
0211
0212
0213
0214
0215
0216 InstrumentedG4OpBoundaryProcess& operator=(const InstrumentedG4OpBoundaryProcess &right);
0217
0218 public:
0219
0220
0221
0222
0223
0224 G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
0225
0226
0227 G4double GetMeanFreePath(const G4Track& ,
0228 G4double ,
0229 G4ForceCondition* condition);
0230
0231
0232
0233
0234
0235 G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
0236 const G4Step& aStep);
0237
0238 G4VParticleChange* PostStepDoIt_(const G4Track& aTrack,
0239 const G4Step& aStep);
0240
0241
0242
0243 G4OpBoundaryProcessStatus GetStatus() const;
0244
0245
0246 void SetInvokeSD(G4bool );
0247
0248
0249 private:
0250
0251 G4bool G4BooleanRand(const G4double prob) const;
0252 G4bool G4BooleanRand_TransCoeff(const G4double prob) const;
0253 G4bool G4BooleanRand_theEfficiency(const G4double prob) const;
0254 G4bool G4BooleanRand_theReflectivity(const G4double prob) const;
0255
0256 G4ThreeVector GetFacetNormal(const G4ThreeVector& Momentum,
0257 const G4ThreeVector& Normal) const;
0258
0259 void DielectricMetal();
0260 void DielectricDielectric();
0261
0262 void DielectricLUT();
0263 void DielectricLUTDAVIS();
0264
0265 void DielectricDichroic();
0266
0267 void ChooseReflection();
0268 void DoAbsorption();
0269 void DoReflection();
0270
0271 G4double GetIncidentAngle();
0272
0273
0274 G4double GetReflectivity(G4double E1_perp,
0275 G4double E1_parl,
0276 G4double incidentangle,
0277 G4double RealRindex,
0278 G4double ImaginaryRindex);
0279
0280
0281 void CalculateReflectivity(void);
0282
0283 void BoundaryProcessVerbose(void) const;
0284
0285
0286 G4bool InvokeSD(const G4Step* step);
0287
0288 public:
0289
0290 #ifdef DEBUG_TAG
0291 double m_u0 ;
0292 int m_u0_idx ;
0293 int m_u0_idx_delta ;
0294 #endif
0295 int PostStepDoIt_count ;
0296
0297 private:
0298 G4double thePhotonMomentum;
0299
0300 G4ThreeVector OldMomentum;
0301 G4ThreeVector OldPolarization;
0302
0303 G4ThreeVector NewMomentum;
0304 G4ThreeVector NewPolarization;
0305
0306 G4ThreeVector theGlobalPoint ;
0307 G4ThreeVector theGlobalExitNormal;
0308 G4ThreeVector theGlobalNormal;
0309 G4ThreeVector theRecoveredNormal ;
0310
0311 G4ThreeVector theFacetNormal;
0312
0313 G4Material* Material1;
0314 G4Material* Material2;
0315
0316 G4OpticalSurface* OpticalSurface;
0317
0318 G4MaterialPropertyVector* PropertyPointer;
0319 G4MaterialPropertyVector* PropertyPointer1;
0320 G4MaterialPropertyVector* PropertyPointer2;
0321
0322 G4double Rindex1;
0323 G4double Rindex2;
0324
0325 G4double cost1, cost2, sint1, sint2;
0326
0327 G4OpBoundaryProcessStatus theStatus;
0328
0329 G4OpticalSurfaceModel theModel;
0330
0331 G4OpticalSurfaceFinish theFinish;
0332
0333 G4double theReflectivity;
0334 G4double theEfficiency;
0335 G4double theTransmittance;
0336
0337 G4double theSurfaceRoughness;
0338
0339 G4double prob_sl, prob_ss, prob_bs;
0340
0341 G4int iTE, iTM;
0342
0343 G4double kCarTolerance;
0344
0345 size_t idx, idy;
0346 G4Physics2DVector* DichroicVector;
0347
0348 G4bool fInvokeSD;
0349 };
0350
0351
0352
0353 #endif