ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4EmDataHandler.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4EmDataHandler.hh
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 
59 class G4VEmProcess;
60 
62 {
63 public:
64 
65  explicit G4EmDataHandler(size_t nTable);
66 
68 
69  size_t SetTable(G4PhysicsTable*);
70 
71  G4PhysicsTable* MakeTable(size_t idx);
72 
73  void CleanTable(size_t idx);
74 
75  G4bool StorePhysicsTable(size_t idx,
77  const G4String& fname,
78  G4bool ascii);
79 
80  G4bool RetrievePhysicsTable(size_t idx,
81  const G4ParticleDefinition* part,
82  const G4String& fname,
83  G4bool ascii);
84 
85  void SetMasterProcess(const G4VEmProcess*);
86 
87  const G4VEmProcess* GetMasterProcess(size_t idx) const;
88 
89  inline const G4PhysicsTable* GetTable(size_t idx) const {
90  return (idx < tLength) ? data[idx] : nullptr;
91  }
92 
93  inline G4PhysicsTable* Table(size_t idx) const {
94  return (idx < tLength) ? data[idx] : nullptr;
95  }
96 
97  inline const G4PhysicsVector* GetVector(size_t itable, size_t ivec) const
98  { return (*(data[itable]))[ivec]; }
99 
100  inline const std::vector<G4PhysicsTable*>& GetTables() const { return data; }
101 
102  // hide assignment operator
103  G4EmDataHandler & operator=(const G4EmDataHandler &right) = delete;
104  G4EmDataHandler(const G4EmDataHandler&) = delete;
105 
106 private:
107 
108  std::vector<G4PhysicsTable*> data;
109  size_t tLength;
110  std::vector<const G4VEmProcess*> masterProcess;
111 };
112 
113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
114 
115 #endif
116