Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59: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 // 31 Jul 2001   MGP                 Created
0033 //  9 Mar 2008   MGP                 Cleaned up unreadable code modified by former developer
0034 //                                   (Further clean-up needed)
0035 // 15 Jul 2009   N.A.Karakatsanis    New methods added for loading logarithmic data
0036 //                                   to enhance computing performance of interpolation 
0037 //
0038 // -------------------------------------------------------------------
0039 
0040 // Class description:
0041 // Low Energy Electromagnetic Physics
0042 // Data set for an electromagnetic physics process
0043 // A strategy pattern is used to encapsulate algorithms for data interpolation
0044 // Further documentation available from http://www.ge.infn.it/geant4/lowE
0045 
0046 // -------------------------------------------------------------------
0047 
0048 #ifndef  G4SHELLEMDATASET_HH
0049 #define  G4SHELLEMDATASET_HH 1
0050 
0051 #include <vector>
0052 #include <CLHEP/Units/SystemOfUnits.h>
0053 
0054 #include "globals.hh"
0055 #include "G4VEMDataSet.hh"
0056 
0057 class G4VDataSetAlgorithm;
0058 
0059 class G4ShellEMDataSet : public G4VEMDataSet 
0060 { 
0061 public:
0062   explicit G4ShellEMDataSet(G4int Z, 
0063            G4VDataSetAlgorithm* algo, 
0064            G4double eUnit=CLHEP::MeV, 
0065            G4double dataUnit=CLHEP::barn);
0066   virtual ~G4ShellEMDataSet();
0067  
0068   G4double FindValue(G4double energy, G4int componentId=0) const override;
0069   
0070   void PrintData(void) const override;
0071 
0072   const G4VEMDataSet*  GetComponent(G4int componentId) const override { return components[componentId]; }
0073   void AddComponent(G4VEMDataSet* dataSet) override { components.push_back(dataSet); }
0074   size_t NumberOfComponents(void) const override { return components.size(); }
0075 
0076   const G4DataVector& GetEnergies(G4int componentId) const override { return GetComponent(componentId)->GetEnergies(0); }
0077   const G4DataVector& GetData(G4int componentId) const override { return GetComponent(componentId)->GetData(0); }
0078   const G4DataVector& GetLogEnergies(G4int componentId) const override
0079   { return GetComponent(componentId)->GetLogEnergies(0); }
0080   const G4DataVector& GetLogData(G4int componentId) const override { return GetComponent(componentId)->GetLogData(0); }
0081 
0082   void SetEnergiesData(G4DataVector* energies, G4DataVector* data, G4int componentId) override;
0083   void SetLogEnergiesData(G4DataVector* energies,
0084               G4DataVector* data,
0085               G4DataVector* log_energies, 
0086               G4DataVector* log_data,
0087               G4int componentId) override;
0088 
0089   G4bool LoadData(const G4String& fileName) override;
0090   G4bool LoadNonLogData(const G4String& fileName) override;
0091   G4bool SaveData(const G4String& fileName) const override;
0092   G4double RandomSelect(G4int /*componentId = 0*/) const override { return -1.; };
0093 
0094   G4ShellEMDataSet(const G4ShellEMDataSet& copy) = delete;
0095   G4ShellEMDataSet& operator=(const G4ShellEMDataSet& right) = delete;
0096 
0097 protected:
0098   G4double GetUnitEnergies() const { return unitEnergies; }
0099   G4double GetUnitData() const { return unitData; }
0100   const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; }   
0101   void CleanUpComponents();
0102 
0103 private:
0104   G4String FullFileName(const G4String& fileName) const;
0105 
0106   std::vector<G4VEMDataSet*> components;          // Owned pointers
0107   G4VDataSetAlgorithm* algorithm;           // Owned pointer 
0108   
0109   G4double unitEnergies;
0110   G4double unitData;
0111   G4int z;
0112 };
0113 #endif /* G4SHELLEMDATASET_HH */