Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-13 08:21:04

0001 #ifndef G4HepEmElectronInteractionUMSC_HH
0002 #define G4HepEmElectronInteractionUMSC_HH
0003 
0004 #include "G4HepEmMacros.hh"
0005 
0006 struct G4HepEmData;
0007 struct G4HepEmParameters;
0008 
0009 class  G4HepEmMSCTrackData;
0010 class  G4HepEmRandomEngine;
0011 
0012 /**
0013  * @file    G4HepEmElectronInteractionUMSC.hh
0014  * @class   G4HepEmElectronInteractionUMSC
0015  * @author  M. Novak
0016  * @date    2022
0017  *
0018  * @brief Urban model for multiple scattering of e-/e+ for HEP applications.
0019  */
0020 
0021 
0022 class G4HepEmElectronInteractionUMSC {
0023 private:
0024   G4HepEmElectronInteractionUMSC() = delete;
0025 
0026 public:
0027 
0028   G4HepEmHostDevice
0029   static void StepLimit(G4HepEmData* hepEmData, G4HepEmParameters* hepEmPars, G4HepEmMSCTrackData* mscData,
0030                         double ekin, int imat, int iregion, double range, double presafety,
0031                         bool onBoundary, bool iselectron, G4HepEmRandomEngine* rnge);
0032 
0033   G4HepEmHostDevice
0034   static void SampleScattering(G4HepEmData* hepEmData, G4HepEmMSCTrackData* mscData, double pStepLength,
0035                                double preStepEkin, double preStepTr1mfp, double postStepEkin, double postStepTr1mfp,
0036                                int imat, bool isElectron, bool isPosCor, bool isDisplace, G4HepEmRandomEngine* rnge);
0037 
0038 
0039 
0040 
0041   // auxilary method for sampling Urban MSC cos(theta) in the given step (used in the above `SampleScattering`)
0042   G4HepEmHostDevice
0043   static double SampleCosineTheta(double pStepLengt, double preStepEkin, double preStepTr1mfp,
0044                                   double postStepEkin, double postStepTr1mfp, double umscTlimitMin,
0045                                   double radLength, double zeff, const double* umscTailCoeff, const double* umscThetaCoeff,
0046                                   bool isElectron, bool isPosCor, G4HepEmRandomEngine* rnge);
0047 
0048   // auxilary method for sampling cos(theta) in a simplified way: using an arbitrary pdf with correct mean and stdev
0049   // (used in the above `SampleCosineTheta`)
0050   G4HepEmHostDevice
0051   static double SimpleScattering(double xmeanth, double x2meanth, G4HepEmRandomEngine* rnge);
0052 
0053   // auxilary method for computing theta0 (used in the above `SampleCosineTheta`)
0054   G4HepEmHostDevice
0055   static double ComputeTheta0(double stepInRadLength, double postStepEkin, double preStepEkin,
0056                               double zeff, const double* umscThetaCoeff, bool isElectron, bool isPosCor);
0057 
0058   // auxilary method for computing the e+ correction to theta0 (used in the above `ComputeTheta0` but only in case of e+)
0059   G4HepEmHostDevice
0060   static double Theta0PositronCorrection(double eekin, double zeff);
0061 
0062   // auxilary method for sampling the lateral displacement vector (x,y,0) on a rather approximate way
0063   G4HepEmHostDevice
0064   static void   SampleDisplacement(double pStepLengt, double thePhi, G4HepEmMSCTrackData* mscData, G4HepEmRandomEngine* rnge);
0065 
0066 };
0067 
0068 #endif // G4HepEmElectronInteractionUMSC_HH