Back to home page

EIC code displayed by LXR

 
 

    


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

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: Riccardo Capra <capra@ge.infn.it>
0029 //
0030 // History:
0031 // -----------
0032 // 30 Jun 2005  RC                  Created
0033 // 14 Oct 2007  MGP                 Removed inheritance from concrete class G4ShellEMDataSet
0034 // 15 Jul 2009  N.A.Karakatsanis    New methods added for loading logarithmic data
0035 //                                  to enhance computing performance of interpolation
0036 //
0037 // -------------------------------------------------------------------
0038 
0039 // Class description:
0040 // Low Energy Electromagnetic Physics
0041 // Data set for an electromagnetic physics process
0042 // A strategy pattern is used to encapsulate algorithms for data interpolation
0043 // -------------------------------------------------------------------
0044 
0045 #ifndef  G4CrossSectionDataSet_HH
0046 #define  G4CrossSectionDataSet_HH 1
0047 
0048 #include <CLHEP/Units/SystemOfUnits.h>
0049 
0050 #include "G4ShellEMDataSet.hh"
0051 
0052 class G4CrossSectionDataSet : public G4VEMDataSet
0053 { 
0054 
0055 public:
0056   explicit G4CrossSectionDataSet(G4VDataSetAlgorithm* algo, 
0057                  G4double xUnit=CLHEP::MeV, 
0058                  G4double dataUnit=CLHEP::barn);
0059 
0060   virtual ~G4CrossSectionDataSet();
0061 
0062   virtual G4double FindValue(G4double e, G4int componentId=0) const;
0063   
0064   virtual void PrintData(void) const;
0065 
0066   virtual const G4VEMDataSet*  GetComponent(G4int componentId) const 
0067   { return components[componentId]; }
0068 
0069   virtual void AddComponent(G4VEMDataSet* dataSet) 
0070   { components.push_back(dataSet); }
0071 
0072   virtual size_t NumberOfComponents(void) const 
0073   { return components.size(); }
0074 
0075   virtual const G4DataVector& GetEnergies(G4int componentId) const 
0076   { return GetComponent(componentId)->GetEnergies(0); }
0077 
0078   virtual const G4DataVector& GetData(G4int componentId) const 
0079   { return GetComponent(componentId)->GetData(0); }
0080 
0081   virtual const G4DataVector& GetLogEnergies(G4int componentId) const 
0082   { return GetComponent(componentId)->GetLogEnergies(0); }
0083 
0084   virtual const G4DataVector& GetLogData(G4int componentId) const 
0085   { return GetComponent(componentId)->GetLogData(0); }
0086 
0087   virtual void SetEnergiesData(G4DataVector* x, G4DataVector* values, G4int componentId);
0088 
0089   virtual void SetLogEnergiesData(G4DataVector* x,
0090                                   G4DataVector* values,
0091                                   G4DataVector* log_x, 
0092                                   G4DataVector* log_values,
0093                                   G4int componentId);
0094 
0095   virtual G4bool LoadData(const G4String & argFileName);
0096   virtual G4bool LoadNonLogData(const G4String & argFileName);
0097 
0098   virtual G4bool SaveData(const G4String & argFileName) const;
0099  
0100   virtual G4double RandomSelect(G4int /*componentId */) const { return -1.; };
0101 
0102 private:
0103 
0104   G4String FullFileName(const G4String & argFileName) const;
0105 
0106   // Hide copy constructor and assignment operator 
0107   explicit G4CrossSectionDataSet();
0108   G4CrossSectionDataSet(const G4CrossSectionDataSet & copy) = delete;
0109   G4CrossSectionDataSet& operator=(const G4CrossSectionDataSet & right) = delete;
0110 
0111   G4double GetUnitEnergies() const { return unitEnergies; }
0112   G4double GetUnitData() const { return unitData; }
0113   const G4VDataSetAlgorithm* GetAlgorithm() const { return algorithm; }
0114    
0115   void CleanUpComponents(void);
0116 
0117   std::vector<G4VEMDataSet*> components;          // Owned pointers
0118 
0119   G4VDataSetAlgorithm* algorithm;           // Owned pointer 
0120   
0121   G4double unitEnergies;
0122   G4double unitData; 
0123 
0124   G4int z = 0;
0125 };
0126 #endif /* G4CrossSectionDataSet_HH */