Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:51

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 // G4ParticleChangeForMSC
0027 //
0028 // Class description:
0029 //
0030 // Concrete "Particle Change" class for Multiple Scattering process.
0031 
0032 // Author: Hisaya Kurashige, 23 March 1998  
0033 // Revision: Vladimir Ivantchenko, 16 January 2004
0034 //                                 23 August 2022
0035 // --------------------------------------------------------------------
0036 #ifndef G4ParticleChangeForMSC_hh
0037 #define G4ParticleChangeForMSC_hh 1
0038 
0039 #include "globals.hh"
0040 #include "G4ios.hh"
0041 #include "G4ThreeVector.hh"
0042 #include "G4VParticleChange.hh"
0043 
0044 class G4ParticleChangeForMSC final : public G4VParticleChange
0045 {
0046 public:
0047 
0048   G4ParticleChangeForMSC();
0049 
0050   ~G4ParticleChangeForMSC() override = default;
0051 
0052   G4ParticleChangeForMSC(const G4ParticleChangeForMSC& right) = delete;
0053   G4ParticleChangeForMSC& operator=
0054   (const G4ParticleChangeForMSC& right) = delete;
0055 
0056   // A multiple scattering process gives the final state of the particle
0057   G4Step* UpdateStepForAlongStep(G4Step* step) final;
0058 
0059   // Initialise only properties changed by multiple scattering
0060   inline void InitialiseMSC(const G4Track&, const G4Step& step);
0061 
0062   inline void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
0063   inline const G4ThreeVector* GetProposedMomentumDirection() const;
0064 
0065   inline void ProposePosition(const G4ThreeVector& finalPosition);
0066   inline const G4ThreeVector& GetProposedPosition() const;
0067 
0068 private:
0069 
0070   G4ThreeVector theMomentumDirection;
0071   // It is the vector containing the final momentum direction
0072   // after multiple scattering is applied along step
0073 
0074   G4ThreeVector thePosition;
0075   // The changed of post step position after multiple scattering
0076 };
0077 
0078 inline void G4ParticleChangeForMSC::ProposeMomentumDirection(
0079   const G4ThreeVector& P)
0080 {
0081   theMomentumDirection = P;
0082 }
0083 
0084 inline const G4ThreeVector*
0085 G4ParticleChangeForMSC::GetProposedMomentumDirection() const
0086 {
0087   return &theMomentumDirection;
0088 }
0089 
0090 inline void G4ParticleChangeForMSC::ProposePosition(const G4ThreeVector& P)
0091 {
0092   thePosition = P;
0093 }
0094 
0095 inline const G4ThreeVector& G4ParticleChangeForMSC::GetProposedPosition() const
0096 {
0097   return thePosition;
0098 }
0099 
0100 inline void
0101 G4ParticleChangeForMSC::InitialiseMSC(const G4Track& track, const G4Step& step)
0102 {
0103   theStatusChange = track.GetTrackStatus();
0104   auto poststep = step.GetPostStepPoint();
0105   thePosition = poststep->GetPosition();
0106   theMomentumDirection = poststep->GetMomentumDirection();  
0107   theCurrentTrack = &track;
0108 }
0109 
0110 #endif