Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:05

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 Sep 2001   MGP           Created
0033 // 26 Sep 2001   V.Ivanchenko  Hide copy constructor and assignement operator
0034 // 18 Apr 2002   V.Ivanchenko  Move member function ValueForMaterial to public
0035 // 21 Jan 2003   V.Ivanchenko  Cut per region
0036 //
0037 // -------------------------------------------------------------------
0038 
0039 // Class description:
0040 // Low Energy Electromagnetic Physics
0041 // Base class for cross section manager for an electromagnetic physics process
0042 // Further documentation available from http://www.ge.infn.it/geant4/lowE
0043 
0044 // -------------------------------------------------------------------
0045 
0046 #ifndef G4RDVCROSSSECTIONHANDLER_HH
0047 #define G4RDVCROSSSECTIONHANDLER_HH 1
0048 
0049 #include <map>
0050 #include <vector>
0051 #include <CLHEP/Units/SystemOfUnits.h>
0052 
0053 #include "globals.hh"
0054 #include "G4DataVector.hh"
0055 #include "G4MaterialCutsCouple.hh"
0056 
0057 class G4RDVDataSetAlgorithm;
0058 class G4RDVEMDataSet;
0059 class G4Material;
0060 class G4Element;
0061 
0062 class G4RDVCrossSectionHandler {
0063 
0064 public:
0065 
0066   G4RDVCrossSectionHandler();
0067 
0068   G4RDVCrossSectionHandler(G4RDVDataSetAlgorithm* interpolation,
0069              G4double minE = 250*CLHEP::eV, G4double maxE = 100*CLHEP::GeV,
0070              G4int nBins = 200,
0071              G4double unitE = CLHEP::MeV, G4double unitData = CLHEP::barn,
0072              G4int minZ = 1, G4int maxZ = 99);
0073 
0074   virtual ~G4RDVCrossSectionHandler();
0075 
0076   void Initialise(G4RDVDataSetAlgorithm* interpolation = 0,
0077           G4double minE = 250*CLHEP::eV, G4double maxE = 100*CLHEP::GeV,
0078           G4int numberOfBins = 200,
0079           G4double unitE = CLHEP::MeV, G4double unitData = CLHEP::barn,
0080           G4int minZ = 1, G4int maxZ = 99);
0081 
0082   G4int SelectRandomAtom(const G4MaterialCutsCouple* couple, G4double e) const;
0083 
0084   const G4Element* SelectRandomElement(const G4MaterialCutsCouple* material,
0085                              G4double e) const;
0086 
0087   G4int SelectRandomShell(G4int Z, G4double e) const;
0088 
0089   G4RDVEMDataSet* BuildMeanFreePathForMaterials(const G4DataVector* energyCuts = 0);
0090 
0091   G4double FindValue(G4int Z, G4double e) const;
0092 
0093   G4double FindValue(G4int Z, G4double e, G4int shellIndex) const;
0094 
0095   G4double ValueForMaterial(const G4Material* material, G4double e) const;
0096 
0097   void LoadData(const G4String& dataFile);
0098 
0099   void LoadShellData(const G4String& dataFile);
0100 
0101   void PrintData() const;
0102 
0103   void Clear();
0104 
0105 protected:
0106 
0107   G4int NumberOfComponents(G4int Z) const;
0108 
0109   void ActiveElements();
0110 
0111   // Factory method
0112   virtual std::vector<G4RDVEMDataSet*>* BuildCrossSectionsForMaterials(const G4DataVector& energyVector,
0113                                        const G4DataVector* energyCuts = 0) = 0;
0114 
0115   // Factory method
0116   virtual G4RDVDataSetAlgorithm* CreateInterpolation();
0117 
0118   const G4RDVDataSetAlgorithm* GetInterpolation() const { return interpolation; }
0119 
0120 
0121 private:
0122 
0123   // Hide copy constructor and assignment operator
0124   G4RDVCrossSectionHandler(const G4RDVCrossSectionHandler&);
0125   G4RDVCrossSectionHandler & operator=(const G4RDVCrossSectionHandler &right);
0126 
0127   G4RDVDataSetAlgorithm* interpolation;
0128 
0129   G4double eMin;
0130   G4double eMax;
0131   G4int nBins;
0132 
0133   G4double unit1;
0134   G4double unit2;
0135 
0136   G4int zMin;
0137   G4int zMax;
0138 
0139   G4DataVector activeZ;
0140 
0141   std::map<G4int,G4RDVEMDataSet*,std::less<G4int> > dataMap;
0142 
0143   std::vector<G4RDVEMDataSet*>* crossSections;
0144 };
0145 
0146 #endif