Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4EmDataHandler.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// -------------------------------------------------------------------
28//
29// GEANT4 Class header file
30//
31// File name: G4EmDataHandler
32//
33// Author: V. Ivanchenko
34//
35// Creation date: 16 August 2016
36//
37// Modifications:
38//
39// Class Description:
40//
41// A storage of G4PhysicsTable
42//
43// Class Description: End
44
45// -------------------------------------------------------------------
46//
47
48#ifndef G4EmDataHandler_h
49#define G4EmDataHandler_h 1
50
51#include "globals.hh"
52#include "G4PhysicsTable.hh"
53#include "G4PhysicsVector.hh"
54#include <vector>
55
56//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57
59class G4VEmProcess;
61
63{
64public:
65
66 explicit G4EmDataHandler(size_t nTable);
67
69
70 // add table
71 size_t SetTable(G4PhysicsTable*);
72
73 // update existing table
74 void UpdateTable(G4PhysicsTable*, size_t idx);
75
76 // assuming that the table is already defined
77 G4PhysicsTable* MakeTable(size_t idx);
78
79 // existing table may be substituted
81
82 // clean existing table
83 void CleanTable(size_t idx);
84
85 G4bool StorePhysicsTable(size_t idx,
86 const G4ParticleDefinition* part,
87 const G4String& fname,
88 G4bool ascii);
89
91 const G4ParticleDefinition* part,
92 const G4String& fname,
93 G4bool ascii, G4bool spline);
94
95 void SetMasterProcess(const G4VEmProcess*);
96
97 const G4VEmProcess* GetMasterProcess(size_t idx) const;
98
99 inline const G4PhysicsTable* GetTable(size_t idx) const {
100 return (idx < tLength) ? data[idx] : nullptr;
101 }
102
103 inline G4PhysicsTable* Table(size_t idx) const {
104 return (idx < tLength) ? data[idx] : nullptr;
105 }
106
107 inline const G4PhysicsVector* GetVector(size_t itable, size_t ivec) const
108 { return (*(data[itable]))[ivec]; }
109
110 inline const std::vector<G4PhysicsTable*>& GetTables() const { return data; }
111
112 // hide assignment operator
113 G4EmDataHandler & operator=(const G4EmDataHandler &right) = delete;
115
116private:
117
118 std::vector<G4PhysicsTable*> data;
119 size_t tLength;
120 std::vector<const G4VEmProcess*> masterProcess;
121};
122
123//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124
125#endif
126
bool G4bool
Definition: G4Types.hh:86
void SetMasterProcess(const G4VEmProcess *)
void CleanTable(size_t idx)
G4PhysicsTable * MakeTable(size_t idx)
G4bool RetrievePhysicsTable(size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii, G4bool spline)
void UpdateTable(G4PhysicsTable *, size_t idx)
const G4VEmProcess * GetMasterProcess(size_t idx) const
G4EmDataHandler & operator=(const G4EmDataHandler &right)=delete
G4PhysicsTable * Table(size_t idx) const
size_t SetTable(G4PhysicsTable *)
G4EmDataHandler(const G4EmDataHandler &)=delete
const G4PhysicsVector * GetVector(size_t itable, size_t ivec) const
const std::vector< G4PhysicsTable * > & GetTables() const
const G4PhysicsTable * GetTable(size_t idx) const
G4bool StorePhysicsTable(size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii)