Back to home page

EIC code displayed by LXR

 
 

    


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

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 //
0027 // Geant4 Header : G4HadronElastic
0028 //
0029 // Author : V.Ivanchenko 29 June 2009 (redesign old elastic model)
0030 //  
0031 // Modified:
0032 //
0033 // Class Description
0034 // Default model for elastic scattering; GHEISHA algorithm is used 
0035 // Class Description - End
0036 
0037 #ifndef G4HadronElastic_h
0038 #define G4HadronElastic_h 1
0039  
0040 #include "globals.hh"
0041 #include "G4HadronicInteraction.hh"
0042 #include "G4HadProjectile.hh"
0043 #include "G4Nucleus.hh"
0044 #include "G4NucleiProperties.hh"
0045 
0046 class G4ParticleDefinition;
0047 
0048 class G4HadronElastic : public G4HadronicInteraction
0049 {
0050 public:
0051 
0052   explicit G4HadronElastic(const G4String& name = "hElasticLHEP");
0053 
0054   ~G4HadronElastic() override;
0055  
0056   // implementation of the G4HadronicInteraction interface
0057   G4HadFinalState* ApplyYourself(const G4HadProjectile & aTrack, 
0058                  G4Nucleus & targetNucleus) override;
0059 
0060   // sample momentum transfer using Lab. momentum
0061   G4double SampleInvariantT(const G4ParticleDefinition* p, G4double plab,
0062                 G4int Z, G4int A) override;
0063   
0064   G4double GetSlopeCof( const G4int pdg );
0065 
0066   inline void SetLowestEnergyLimit(G4double value);
0067 
0068   inline G4double LowestEnergyLimit() const;
0069 
0070   inline G4double ComputeMomentumCMS(const G4ParticleDefinition* p, 
0071                      G4double plab, G4int Z, G4int A);
0072   
0073   void ModelDescription(std::ostream&) const override;
0074 
0075 protected:
0076 
0077   G4double pLocalTmax;
0078   G4int secID;  // Creator model ID for the recoil
0079 
0080 private:
0081 
0082   G4ParticleDefinition* theProton;
0083   G4ParticleDefinition* theNeutron;
0084   G4ParticleDefinition* theDeuteron;
0085   G4ParticleDefinition* theAlpha;
0086 
0087   G4double lowestEnergyLimit;
0088   G4int nwarn;
0089 };
0090 
0091 inline void G4HadronElastic::SetLowestEnergyLimit(G4double value)
0092 {
0093   lowestEnergyLimit = value;
0094 }
0095 
0096 inline G4double G4HadronElastic::LowestEnergyLimit() const
0097 {
0098   return lowestEnergyLimit;
0099 }
0100 
0101 inline G4double
0102 G4HadronElastic::ComputeMomentumCMS(const G4ParticleDefinition* p, 
0103                     G4double plab, G4int Z, G4int A)
0104 {
0105   G4double m1 = p->GetPDGMass();
0106   G4double m12= m1*m1;
0107   G4double mass2 = G4NucleiProperties::GetNuclearMass(A, Z);
0108   return plab*mass2/std::sqrt(m12 + mass2*mass2 + 2.*mass2*std::sqrt(m12 + plab*plab));
0109 }
0110 
0111 #endif