Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:13

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4TransportationWithMsc
0027 //
0028 // Class Description:
0029 //
0030 // It is a generic process of transportation with multiple scattering included
0031 // in the step limitation and propagation.
0032 //
0033 // Original author: Jonas Hahnfeld, 2022
0034 
0035 #ifndef G4TrasportationWithMsc_h
0036 #define G4TrasportationWithMsc_h 1
0037 
0038 #include "G4Transportation.hh"
0039 
0040 #include <vector>
0041 
0042 class G4DataVector;
0043 class G4EmDataHandler;
0044 class G4EmModelManager;
0045 class G4LossTableManager;
0046 class G4ParticleChangeForGamma;
0047 class G4ParticleChangeForMSC;
0048 class G4ParticleDefinition;
0049 class G4PhysicsTable;
0050 class G4Region;
0051 class G4VEmModel;
0052 class G4VEnergyLossProcess;
0053 class G4VMscModel;
0054 
0055 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0056 
0057 class G4TransportationWithMsc : public G4Transportation
0058 {
0059   public:
0060     enum class ScatteringType
0061     {
0062       MultipleScattering,
0063       SingleScattering,
0064     };
0065 
0066     explicit G4TransportationWithMsc(ScatteringType type, G4int verbosity = 0);
0067 
0068     ~G4TransportationWithMsc() override;
0069 
0070     inline void SetMultipleSteps(G4bool val);
0071     inline G4bool MultipleSteps() const;
0072 
0073     void AddMscModel(G4VMscModel* mscModel, G4int order = 0, const G4Region* region = nullptr);
0074 
0075     void AddSSModel(G4VEmModel* model, G4int order = 0, const G4Region* region = nullptr);
0076 
0077   public:
0078     void PreparePhysicsTable(const G4ParticleDefinition& part) override;
0079     void BuildPhysicsTable(const G4ParticleDefinition& part) override;
0080 
0081     void StartTracking(G4Track* track) override;
0082 
0083     G4double AlongStepGetPhysicalInteractionLength(const G4Track& track, G4double previousStepSize,
0084                                                    G4double currentMinimumStep,
0085                                                    G4double& proposedSafety,
0086                                                    G4GPILSelection* selection) override;
0087 
0088   private:
0089     const ScatteringType fType;
0090     G4bool fMultipleSteps = false;
0091 
0092     G4LossTableManager* fEmManager;
0093     G4EmModelManager* fModelManager;
0094 
0095     // Not initialized in the constructor, but later in PreparePhysicsTable or StartTracking.
0096     const G4DataVector* fCuts = nullptr;
0097     const G4ParticleDefinition* fFirstParticle = nullptr;
0098     G4VEnergyLossProcess* fIonisation = nullptr;
0099 
0100     // For ScatteringType::MultipleScattering
0101     G4ParticleChangeForMSC* fParticleChangeForMSC = nullptr;
0102 
0103     // For ScatteringType::SingleScattering
0104     G4EmDataHandler* fEmData = nullptr;
0105     G4PhysicsTable* fLambdaTable = nullptr;
0106     G4ParticleChangeForGamma* fParticleChangeForSS = nullptr;
0107     std::vector<G4DynamicParticle*>* fSecondariesSS = nullptr;
0108 
0109     G4DynamicParticle* fSubStepDynamicParticle;
0110     G4Track* fSubStepTrack;
0111     G4Step* fSubStep;
0112 };
0113 
0114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0115 
0116 inline void G4TransportationWithMsc::SetMultipleSteps(G4bool val)
0117 {
0118   fMultipleSteps = val;
0119 }
0120 
0121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0122 
0123 inline G4bool G4TransportationWithMsc::MultipleSteps() const
0124 {
0125   return fMultipleSteps;
0126 }
0127 
0128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0129 
0130 #endif