Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef G4HepEmMSCTrackData_HH
0002 #define G4HepEmMSCTrackData_HH
0003 
0004 #include "G4HepEmMacros.hh"
0005 
0006 // A simple structure that encapsulates MSC related data for a single e-/e+ track.
0007 //
0008 // This object stores all the MSC related information that an e-/e+ a track needs
0009 // to keep and propagate between the different parts of the simulation step related
0010 // to MSC. G4HepEmElectronTrack contains an instance of this.
0011 
0012 #include <cmath>
0013 
0014 class G4HepEmMSCTrackData {
0015 
0016 public:
0017   G4HepEmHostDevice
0018   G4HepEmMSCTrackData() { ReSet(); }
0019 
0020   G4HepEmHostDevice
0021   G4HepEmMSCTrackData(const G4HepEmMSCTrackData& o) {
0022     CopyFrom(o);
0023   }
0024 
0025   G4HepEmHostDevice
0026   G4HepEmMSCTrackData& operator=(const G4HepEmMSCTrackData& o) {
0027     if (this != &o) {
0028       CopyFrom(o);
0029     }
0030     return *this;
0031   }
0032 
0033   G4HepEmHostDevice
0034   void SetDisplacement(double x, double y, double z) {
0035     fDisplacement[0] = x;
0036     fDisplacement[1] = y;
0037     fDisplacement[2] = z;
0038   }
0039   G4HepEmHostDevice
0040   double* GetDisplacement() { return fDisplacement; }
0041 
0042   G4HepEmHostDevice
0043   void SetNewDirection(double x, double y, double z) {
0044     fDirection[0] = x;
0045     fDirection[1] = y;
0046     fDirection[2] = z;
0047   }
0048   G4HepEmHostDevice
0049   double* GetDirection() { return fDirection; }
0050 
0051 
0052   // reset all member values
0053   G4HepEmHostDevice
0054   void ReSet() {
0055     fLambtr1              = 0.;
0056 
0057     fTrueStepLength       = 0.;
0058     fZPathLength          = 0.;
0059     fDisplacement[0]      = 0.;
0060     fDisplacement[1]      = 0.;
0061     fDisplacement[2]      = 0.;
0062     fDirection[0]         = 0.;
0063     fDirection[1]         = 0.;
0064     fDirection[2]         = 1.;
0065 
0066     fInitialRange         = 1.0e+21;
0067     fDynamicRangeFactor   = 0.04;   // fr will be set in the MSC step limit
0068     fTlimitMin            = 1.0E-7; // tlimitmin 10*0.01 [nm] 1.0E-7[mm]
0069 
0070     fPar1                 = -1.;
0071     fPar2                 =  0.;
0072     fPar3                 =  0.;
0073 
0074     fIsNoScatteringInMSC  = false;
0075     fIsDisplace           = false;
0076     fIsFirstStep          = true;
0077     fIsActive             = false;
0078   }
0079 
0080   // Helper to be used in the copy constructor and assigment
0081   G4HepEmHostDevice
0082   void CopyFrom(const G4HepEmMSCTrackData& o) {
0083     fLambtr1              = o.fLambtr1;
0084 
0085     fTrueStepLength       = o.fTrueStepLength;
0086     fZPathLength          = o.fZPathLength;
0087     fDisplacement[0]      = o.fDisplacement[0];
0088     fDisplacement[1]      = o.fDisplacement[1];
0089     fDisplacement[2]      = o.fDisplacement[2];
0090     fDirection[0]         = o.fDirection[0];
0091     fDirection[1]         = o.fDirection[1];
0092     fDirection[2]         = o.fDirection[2];
0093 
0094     fInitialRange         = o.fInitialRange;
0095     fDynamicRangeFactor   = o.fDynamicRangeFactor;
0096     fTlimitMin            = o.fTlimitMin;
0097 
0098     fPar1                 = o.fPar1;
0099     fPar2                 = o.fPar2;
0100     fPar3                 = o.fPar3;
0101 
0102     fIsNoScatteringInMSC  = o.fIsNoScatteringInMSC;
0103     fIsDisplace           = o.fIsDisplace;
0104     fIsFirstStep          = o.fIsFirstStep;
0105     fIsActive             = o.fIsActive;
0106   }
0107 
0108 
0109 
0110 
0111 public:
0112   double fLambtr1;            // first transport mfp
0113 
0114   double fTrueStepLength;     // the true, i.e. physical step Length
0115   double fZPathLength;        // projection of the transport distance along the org. dir.
0116   double fDisplacement[3];    // the displacement vector
0117   double fDirection[3];       // direction proposed by MSC
0118 
0119   double fInitialRange;       // initial range value (entering in the volume)
0120   double fDynamicRangeFactor; // dynamic range factor i.e. `fr`
0121   double fTlimitMin;          // minimum true step length i.e. `tlimitmin`
0122 
0123   double fPar1;               // parameters used in the true - > geom conversion
0124   double fPar2;
0125   double fPar3;
0126 
0127   bool   fIsNoScatteringInMSC; // indicates that no scattering happend
0128   bool   fIsDisplace;          // indicates that displacement needs to be done
0129   bool   fIsFirstStep;         // first step with this particle
0130 
0131   bool   fIsActive;
0132 
0133 };
0134 
0135 #endif // G4HepEmMSCTrackData