1 #ifndef G4DarkBREM_ELEMENTXSECCACHE_H
2 #define G4DarkBREM_ELEMENTXSECCACHE_H
44 G4double
get(G4double energy, G4double A, G4double Z);
51 void stream(std::ostream& o)
const;
67 typedef unsigned long int key_t;
97 std::shared_ptr<PrototypeModel>
model_;
Class providing a prototype model for dark brem.
The cache of already computed cross sections.
Definition: ElementXsecCache.h:17
std::shared_ptr< PrototypeModel > model_
shared pointer to the model for calculating cross sections
Definition: ElementXsecCache.h:97
friend std::ostream & operator<<(std::ostream &o, const ElementXsecCache c)
Overload the streaming operator for ease.
Definition: ElementXsecCache.h:60
static const key_t MAX_E
The maximum value for energy [MeV].
Definition: ElementXsecCache.h:73
G4double get(G4double energy, G4double A, G4double Z)
Get the value of the cross section for the input variables and calculate the cross section if it wasn...
Definition: ElementXsecCache.cxx:5
key_t computeKey(G4double energy, G4double A, G4double Z) const
Compute a key for the cache map Generating a unique key after making the energy [MeV] an integer.
Definition: ElementXsecCache.cxx:33
void stream(std::ostream &o) const
Stream the entire table into the output stream.
Definition: ElementXsecCache.cxx:18
std::map< key_t, G4double > the_cache_
the actual map from cache keys to calculated cross sections
Definition: ElementXsecCache.h:94
static const key_t MAX_A
The maximum value of A.
Definition: ElementXsecCache.h:70
ElementXsecCache(std::shared_ptr< PrototypeModel > model)
Constructor with a model to calculate the cross section.
Definition: ElementXsecCache.h:30
ElementXsecCache()=default
Default constructor.
unsigned long int key_t
The type for the key we use in the cache.
Definition: ElementXsecCache.h:67
G4DarkBreM internal namespace.
Definition: ElementXsecCache.cxx:3