Back to home page

EIC code displayed by LXR

 
 

    


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

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 //
0029 // GEANT4 Class header file
0030 //
0031 // File name:     G4EmDataHandler
0032 //
0033 // Author:        V. Ivanchenko 
0034 // 
0035 // Creation date: 16 August 2016
0036 //
0037 // Modifications: 
0038 //
0039 // Class Description: 
0040 //
0041 // A storage of G4PhysicsTable
0042 //
0043 // Class Description: End 
0044 
0045 // -------------------------------------------------------------------
0046 //
0047 
0048 #ifndef G4EmDataHandler_h
0049 #define G4EmDataHandler_h 1
0050 
0051 #include "globals.hh"
0052 #include "G4PhysicsTable.hh"
0053 #include "G4PhysicsVector.hh"
0054 #include <vector>
0055 
0056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0057 
0058 class G4ParticleDefinition;
0059 class G4VEmProcess;
0060 class G4VEnergyLossProcess;
0061 
0062 class G4EmDataHandler
0063 {
0064 public:
0065 
0066   explicit G4EmDataHandler(size_t nTable);
0067 
0068   ~G4EmDataHandler();
0069 
0070   // add table
0071   size_t SetTable(G4PhysicsTable*);
0072 
0073   // update existing table
0074   void UpdateTable(G4PhysicsTable*, size_t idx);
0075 
0076   // assuming that the table is already defined
0077   G4PhysicsTable* MakeTable(size_t idx);
0078 
0079   // existing table may be substituted
0080   G4PhysicsTable* MakeTable(G4PhysicsTable*, size_t idx);
0081 
0082   // clean existing table 
0083   void CleanTable(size_t idx);
0084 
0085   G4bool StorePhysicsTable(size_t idx,
0086                            const G4ParticleDefinition* part,
0087                const G4String& fname, 
0088                G4bool ascii);
0089 
0090   G4bool RetrievePhysicsTable(size_t idx,
0091                   const G4ParticleDefinition* part,
0092                   const G4String& fname,
0093                   G4bool ascii, G4bool spline);
0094   
0095   void SetMasterProcess(const G4VEmProcess*);
0096 
0097   const G4VEmProcess* GetMasterProcess(size_t idx) const;
0098 
0099   inline const G4PhysicsTable* GetTable(size_t idx) const { 
0100     return (idx < tLength) ? data[idx] : nullptr; 
0101   }
0102 
0103   inline G4PhysicsTable* Table(size_t idx) const {
0104     return (idx < tLength) ? data[idx] : nullptr; 
0105   }
0106 
0107   inline const G4PhysicsVector* GetVector(size_t itable, size_t ivec) const
0108   { return (*(data[itable]))[ivec]; }
0109 
0110   inline const std::vector<G4PhysicsTable*>& GetTables() const { return data; }
0111 
0112   // hide assignment operator 
0113   G4EmDataHandler & operator=(const G4EmDataHandler &right) = delete;
0114   G4EmDataHandler(const G4EmDataHandler&) = delete;
0115 
0116 private:
0117 
0118   std::vector<G4PhysicsTable*> data;
0119   size_t tLength;
0120   std::vector<const G4VEmProcess*> masterProcess;
0121 };
0122 
0123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0124 
0125 #endif
0126