File indexing completed on 2026-04-10 07:50:30
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 #ifndef Local_G4Cerenkov_modified_h
0049 #define Local_G4Cerenkov_modified_h 1
0050
0051
0052
0053
0054
0055 #include <CLHEP/Units/SystemOfUnits.h>
0056
0057 #include "globals.hh"
0058 #include "templates.hh"
0059 #include "Randomize.hh"
0060 #include "G4ThreeVector.hh"
0061 #include "G4ParticleMomentum.hh"
0062 #include "G4Step.hh"
0063 #include "G4VProcess.hh"
0064 #include "G4OpticalPhoton.hh"
0065 #include "G4DynamicParticle.hh"
0066 #include "G4Material.hh"
0067 #include "G4PhysicsTable.hh"
0068 #include "G4MaterialPropertyVector.hh"
0069 #include "G4MaterialPropertiesTable.hh"
0070 #include "G4PhysicsOrderedFreeVector.hh"
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081 #ifdef INSTRUMENTED
0082 template <typename T> struct OpticksDebug ;
0083 struct OpticksRandom ;
0084 #endif
0085
0086
0087 class Local_G4Cerenkov_modified : public G4VProcess
0088 {
0089 public:
0090
0091 #ifdef INSTRUMENTED
0092 template <typename T> friend struct Local_G4Cerenkov_modifiedTest ;
0093 bool looping_condition(unsigned& count);
0094 OpticksDebug<double>* gen ;
0095 OpticksDebug<double>* par ;
0096 OpticksRandom* rnd ;
0097 #endif
0098
0099
0100
0101
0102
0103
0104 explicit Local_G4Cerenkov_modified(const G4String& processName = "Cerenkov",
0105 G4ProcessType type = fElectromagnetic);
0106 ~Local_G4Cerenkov_modified();
0107
0108 explicit Local_G4Cerenkov_modified(const Local_G4Cerenkov_modified &right);
0109
0110 private:
0111
0112
0113
0114
0115
0116 Local_G4Cerenkov_modified& operator=(const Local_G4Cerenkov_modified &right) = delete;
0117
0118 public:
0119
0120
0121
0122
0123
0124 G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override;
0125
0126
0127
0128 void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override;
0129
0130
0131 G4double GetMeanFreePath(const G4Track& aTrack,
0132 G4double, G4ForceCondition* );
0133
0134
0135
0136 G4double PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
0137 G4double ,
0138 G4ForceCondition* ) override;
0139
0140
0141
0142 G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
0143 const G4Step& aStep) override;
0144
0145
0146
0147 virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track&,
0148 G4double ,
0149 G4double ,
0150 G4double& ,
0151 G4GPILSelection*
0152 ) override { return -1.0; };
0153
0154 virtual G4double AtRestGetPhysicalInteractionLength(const G4Track& ,
0155 G4ForceCondition*
0156 ) override { return -1.0; };
0157
0158
0159 virtual G4VParticleChange* AtRestDoIt(const G4Track& , const G4Step& )
0160 override {return nullptr;};
0161
0162 virtual G4VParticleChange* AlongStepDoIt(const G4Track& , const G4Step&)
0163 override {return nullptr;};
0164
0165 void SetTrackSecondariesFirst(const G4bool state);
0166
0167
0168
0169
0170 G4bool GetTrackSecondariesFirst() const;
0171
0172
0173 void SetMaxBetaChangePerStep(const G4double d);
0174
0175
0176
0177 G4double GetMaxBetaChangePerStep() const;
0178
0179
0180 void SetMaxNumPhotonsPerStep(const G4int NumPhotons);
0181
0182
0183
0184
0185
0186
0187
0188 G4int GetMaxNumPhotonsPerStep() const;
0189
0190
0191
0192 void SetStackPhotons(const G4bool );
0193
0194
0195 G4bool GetStackPhotons() const;
0196
0197
0198 G4int GetNumPhotons() const;
0199
0200 G4int GetNumPhotons1() const;
0201 G4int GetNumPhotons2() const;
0202
0203
0204 void ResetNumPhotons() {
0205 fNumPhotons = 0;
0206 fNumPhotons1 = 0;
0207 fNumPhotons2 = 0;
0208 }
0209
0210 G4PhysicsTable* GetPhysicsTable() const;
0211
0212
0213 void DumpPhysicsTable() const;
0214
0215
0216 private:
0217 void BuildThePhysicsTable();
0218
0219
0220
0221
0222
0223 G4double GetAverageNumberOfPhotons(const G4double charge,
0224 const G4double beta,
0225 const G4Material *aMaterial,
0226 G4MaterialPropertyVector* Rindex);
0227
0228
0229 G4double GetAverageNumberOfPhotons_s2(const G4double charge,
0230 const G4double beta,
0231 const G4Material *aMaterial,
0232 G4MaterialPropertyVector* Rindex) const;
0233
0234
0235
0236
0237
0238
0239
0240 protected:
0241
0242 G4PhysicsTable* thePhysicsTable;
0243
0244
0245
0246
0247 private:
0248
0249 G4bool fTrackSecondariesFirst;
0250 G4double fMaxBetaChange;
0251 G4int fMaxPhotons;
0252
0253 G4bool fStackingFlag;
0254
0255 #ifdef INSTRUMENTED
0256 public:
0257 G4int override_fNumPhotons ;
0258 private:
0259 #endif
0260
0261 G4int fNumPhotons;
0262 G4int fNumPhotons1;
0263 G4int fNumPhotons2;
0264
0265 private:
0266
0267 };
0268
0269
0270
0271
0272
0273 inline
0274 G4bool Local_G4Cerenkov_modified::GetTrackSecondariesFirst() const
0275 {
0276 return fTrackSecondariesFirst;
0277 }
0278
0279 inline
0280 G4double Local_G4Cerenkov_modified::GetMaxBetaChangePerStep() const
0281 {
0282 return fMaxBetaChange;
0283 }
0284
0285 inline
0286 G4int Local_G4Cerenkov_modified::GetMaxNumPhotonsPerStep() const
0287 {
0288 return fMaxPhotons;
0289 }
0290
0291 inline
0292 void Local_G4Cerenkov_modified::SetStackPhotons(const G4bool stackingFlag)
0293 {
0294 fStackingFlag = stackingFlag;
0295 }
0296
0297 inline
0298 G4bool Local_G4Cerenkov_modified::GetStackPhotons() const
0299 {
0300 return fStackingFlag;
0301 }
0302
0303 inline
0304 G4int Local_G4Cerenkov_modified::GetNumPhotons() const
0305 {
0306 return fNumPhotons;
0307 }
0308
0309 inline
0310 G4int Local_G4Cerenkov_modified::GetNumPhotons1() const
0311 {
0312 return fNumPhotons1;
0313 }
0314
0315 inline
0316 G4int Local_G4Cerenkov_modified::GetNumPhotons2() const
0317 {
0318 return fNumPhotons2;
0319 }
0320
0321 inline
0322 G4PhysicsTable* Local_G4Cerenkov_modified::GetPhysicsTable() const
0323 {
0324 return thePhysicsTable;
0325 }
0326
0327 #endif
0328
0329