Geant4-11
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 size_t SetTable(G4PhysicsTable*);
71
72 G4PhysicsTable* MakeTable(size_t idx);
73
74 void CleanTable(size_t idx);
75
76 G4bool StorePhysicsTable(size_t idx,
77 const G4ParticleDefinition* part,
78 const G4String& fname,
79 G4bool ascii);
80
82 const G4ParticleDefinition* part,
83 const G4String& fname,
84 G4bool ascii, G4bool spline);
85
86 void SetMasterProcess(const G4VEmProcess*);
87
88 const G4VEmProcess* GetMasterProcess(size_t idx) const;
89
90 inline const G4PhysicsTable* GetTable(size_t idx) const {
91 return (idx < tLength) ? data[idx] : nullptr;
92 }
93
94 inline G4PhysicsTable* Table(size_t idx) const {
95 return (idx < tLength) ? data[idx] : nullptr;
96 }
97
98 inline const G4PhysicsVector* GetVector(size_t itable, size_t ivec) const
99 { return (*(data[itable]))[ivec]; }
100
101 inline const std::vector<G4PhysicsTable*>& GetTables() const { return data; }
102
103 // hide assignment operator
104 G4EmDataHandler & operator=(const G4EmDataHandler &right) = delete;
106
107private:
108
109 std::vector<G4PhysicsTable*> data;
110 size_t tLength;
111 std::vector<const G4VEmProcess*> masterProcess;
112};
113
114//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115
116#endif
117
bool G4bool
Definition: G4Types.hh:86
void SetMasterProcess(const G4VEmProcess *)
void CleanTable(size_t idx)
std::vector< G4PhysicsTable * > data
G4PhysicsTable * MakeTable(size_t idx)
std::vector< const G4VEmProcess * > masterProcess
G4bool RetrievePhysicsTable(size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii, G4bool spline)
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
G4EmDataHandler(size_t nTable)
G4bool StorePhysicsTable(size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii)
string fname
Definition: test.py:308