Back to home page

EIC code displayed by LXR

 
 

    


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

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 //
0028 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
0029 //
0030 // History:
0031 // -----------
0032 // 16 Jun 2008   MGP           Created on the basis of G4CrossSectionHandler
0033 
0034 // -------------------------------------------------------------------
0035 // Class description:
0036 // Cross section manager for hadron impact ionization
0037 // Documented in:
0038 // M.G. Pia et al., PIXE Simulation With Geant4,
0039 // IEEE Trans. Nucl. Sci., vol. 56, no. 6, pp. 3614-3649, Dec. 2009.
0040 
0041 // -------------------------------------------------------------------
0042 
0043 #ifndef G4PIXECROSSSECTIONHANDLER_HH
0044 #define G4PIXECROSSSECTIONHANDLER_HH 1
0045 
0046 #include <map>
0047 #include <vector>
0048 #include <CLHEP/Units/SystemOfUnits.h>
0049 
0050 #include "globals.hh"
0051 #include "G4DataVector.hh"
0052 #include "G4MaterialCutsCouple.hh"
0053 
0054 class G4IInterpolator;
0055 class G4IDataSet;
0056 class G4Material;
0057 class G4Element;
0058 
0059 class G4PixeCrossSectionHandler {
0060 
0061 public:
0062 
0063   G4PixeCrossSectionHandler();
0064 
0065   G4PixeCrossSectionHandler(G4IInterpolator* interpolation,
0066                 const G4String& modelK="ecpssr",
0067                 const G4String& modelL="ecpssr",
0068                 const G4String& modelM="ecpssr",
0069                 G4double minE = 1*CLHEP::keV,
0070                             G4double maxE = 0.1*CLHEP::GeV,
0071                 G4int nBins = 200,
0072                 G4double unitE = CLHEP::MeV,
0073                             G4double unitData = CLHEP::barn,
0074                 G4int minZ = 6, G4int maxZ = 92);
0075   
0076   virtual ~G4PixeCrossSectionHandler();
0077 
0078   void Initialise(G4IInterpolator* interpolation,
0079           const G4String& modelK="ecpssr",
0080           const G4String& modelL="ecpssr",
0081           const G4String& modelM="ecpssr",
0082           G4double minE = 1*CLHEP::keV,
0083                   G4double maxE = 0.1*CLHEP::GeV,
0084           G4int nBins = 200,
0085           G4double unitE = CLHEP::MeV,
0086                   G4double unitData = CLHEP::barn,
0087           G4int minZ = 6, G4int maxZ = 92);
0088 
0089   G4int SelectRandomAtom(const G4Material* material, G4double e) const;
0090 
0091   G4int SelectRandomShell(G4int Z, G4double e) const;
0092 
0093   G4double FindValue(G4int Z, G4double e) const;
0094 
0095   G4double FindValue(G4int Z, G4double e, G4int shellIndex) const;
0096 
0097   G4double ValueForMaterial(const G4Material* material, G4double e) const;
0098 
0099   // void LoadData(const G4String& dataFile);
0100 
0101   void LoadShellData(const G4String& dataFile);
0102 
0103   // Ionisation cross section as in Geant4 Physics Reference Manual
0104   G4double MicroscopicCrossSection(const G4ParticleDefinition* particleDef,
0105                    G4double kineticEnergy,
0106                    G4double Z,
0107                    G4double deltaCut) const;
0108 
0109   void PrintData() const;
0110 
0111   void Clear();
0112 
0113 private:
0114 
0115  // Hide copy constructor and assignment operator
0116   G4PixeCrossSectionHandler(const G4PixeCrossSectionHandler&);
0117   G4PixeCrossSectionHandler & operator=(const G4PixeCrossSectionHandler &right);
0118 
0119   G4int NumberOfComponents(G4int Z) const;
0120 
0121   void ActiveElements();
0122 
0123   void BuildForMaterials();
0124   // Factory method
0125   std::vector<G4IDataSet*>* BuildCrossSectionsForMaterials(const G4DataVector& energyVector);
0126 
0127   // Factory method
0128   G4IInterpolator* CreateInterpolation();
0129 
0130   const G4IInterpolator* GetInterpolation() const { return interpolation; }
0131  
0132   G4IInterpolator* interpolation;
0133 
0134   G4double eMin;
0135   G4double eMax;
0136   G4int nBins;
0137 
0138   G4double unit1;
0139   G4double unit2;
0140 
0141   G4int zMin;
0142   G4int zMax;
0143 
0144   G4DataVector activeZ;
0145 
0146   // Map of PixeShellDataSets with the shell cross sections for each element
0147   std::map<G4int,G4IDataSet*,std::less<G4int> > dataMap;
0148 
0149   // Vector of composite cross sections for each material in the MaterialTable 
0150   // The composite cross section is composed of cross sections for each element in material
0151   std::vector<G4IDataSet*>* crossSections;
0152 
0153   std::vector<G4String> crossModel;
0154 
0155 };
0156 
0157 #endif
0158 
0159 
0160 
0161 
0162 
0163 
0164 
0165 
0166 
0167 
0168