Back to home page

EIC code displayed by LXR

 
 

    


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

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 // Author: Luciano Pandola
0028 //
0029 // History:
0030 // -----------
0031 // 03 Dec 2009   L. Pandola   1st implementation. 
0032 // 25 May 2011   L. Pandola   Renamed (make v2008 as default Penelope)
0033 // 27 Sep 2013   L. Pandola  Migration to MT paradigm
0034 // 04 Mar 2021   L. Pandola   Replace maps with arrays
0035 //
0036 // -------------------------------------------------------------------
0037 //
0038 // Class description:
0039 // Low Energy Electromagnetic Physics, Rayleigh Scattering
0040 // with the model from Penelope, version 2008
0041 // -------------------------------------------------------------------
0042 
0043 #ifndef G4PENELOPERAYLEIGHMODEL_HH
0044 #define G4PENELOPERAYLEIGHMODEL_HH 1
0045 
0046 #include "globals.hh"
0047 #include "G4VEmModel.hh"
0048 #include "G4DataVector.hh"
0049 #include "G4ParticleChangeForGamma.hh"
0050 
0051 class G4ParticleDefinition;
0052 class G4DynamicParticle;
0053 class G4MaterialCutsCouple;
0054 class G4Material;
0055 class G4PhysicsFreeVector;
0056 class G4PenelopeSamplingData;
0057 
0058 class G4PenelopeRayleighModel : public G4VEmModel 
0059 {
0060 
0061 public:  
0062   explicit G4PenelopeRayleighModel(const G4ParticleDefinition* p=nullptr,
0063                    const G4String& processName ="PenRayleigh");
0064   
0065   virtual ~G4PenelopeRayleighModel();
0066   
0067   void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0068   void InitialiseLocal(const G4ParticleDefinition*,
0069                G4VEmModel *masterModel) override;
0070 
0071   G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
0072                       G4double kinEnergy,
0073                       G4double Z,
0074                       G4double A=0,
0075                       G4double cut=0,
0076                       G4double emax=DBL_MAX) override;
0077 
0078   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0079              const G4MaterialCutsCouple*,
0080              const G4DynamicParticle*,
0081              G4double tmin,
0082              G4double maxEnergy) override;
0083     
0084   void SetVerbosityLevel(G4int lev){fVerboseLevel = lev;};
0085   G4int GetVerbosityLevel(){return fVerboseLevel;};
0086   
0087   //Testing purposes
0088   void DumpFormFactorTable(const G4Material*);
0089 
0090   G4PenelopeRayleighModel& operator=(const G4PenelopeRayleighModel &right) = delete;
0091   G4PenelopeRayleighModel(const G4PenelopeRayleighModel&) = delete;
0092 
0093 protected:
0094   G4ParticleChangeForGamma* fParticleChange;
0095   const G4ParticleDefinition* fParticle;
0096 
0097 private:
0098   void SetParticle(const G4ParticleDefinition*);
0099   //Helper methods
0100   void ReadDataFile(G4int); 
0101   void ClearTables();
0102   void BuildFormFactorTable(const G4Material*);
0103   void GetPMaxTable(const G4Material*);
0104 
0105   G4double GetFSquared(const G4Material*,const G4double);
0106   void InitializeSamplingAlgorithm(const G4Material*);
0107 
0108   G4DataVector fLogQSquareGrid; //log(Q^2) grid for interpolation
0109   std::map<const G4Material*,G4PhysicsFreeVector*> *fLogFormFactorTable; //log(Q^2) vs. log(F^2)
0110  
0111   G4DataVector fLogEnergyGridPMax; //energy grid for PMac (and originally for the x-section)
0112   std::map<const G4Material*,G4PhysicsFreeVector*> *fPMaxTable; //E vs. Pmax
0113   std::map<const G4Material*,G4PenelopeSamplingData*> *fSamplingTable;
0114 
0115   //Internal tables and manager methods
0116   static const G4int fMaxZ =99;
0117   static G4PhysicsFreeVector* fLogAtomicCrossSection[fMaxZ+1];
0118   static G4PhysicsFreeVector* fAtomicFormFactor[fMaxZ+1];
0119 
0120   //Intrinsic energy limits of the model: cannot be extended by 
0121   //the parent process
0122   G4double fIntrinsicLowEnergyLimit;
0123   G4double fIntrinsicHighEnergyLimit;  
0124   G4int fVerboseLevel;
0125   G4bool fIsInitialised; 
0126   //Used only for G4EmCalculator and Unit Tests
0127   G4bool fLocalTable;
0128 };
0129 
0130 #endif
0131