18#ifndef BDSAPERTUREPOINTSLOADER_H
19#define BDSAPERTUREPOINTSLOADER_H
20#include "BDSFourVector.hh"
23#include "G4TwoVector.hh"
50 std::vector<G4TwoVector>*
Load(
const G4String& fileName,
51 G4double unit = 1.0)
const;
78 std::vector<G4TwoVector>*
FindCachedFile(
const G4String& fileNameAndUnits)
const;
81 void CacheFile(
const G4String& fileNameAndUnits,
82 std::vector<G4TwoVector>* contents);
89 std::map<G4String, std::vector<G4TwoVector>*> cachedFiles;
98 const G4String& unit =
"");
A holder for loaded aperture points files.
void CacheFile(const G4String &fileNameAndUnits, std::vector< G4TwoVector > *contents)
Add an entry to the cache.
static BDSAperturePointsCache * Instance()
Access the singleton instance.
void ClearCachedFiles()
Delete all cached points from memory and clear the map of files loaded.
std::vector< G4TwoVector > * FindCachedFile(const G4String &fileNameAndUnits) const
Retrieve a cached files. Will return nullptr if not found.
A loader for up to set of XY points for an aperture.
std::vector< G4TwoVector > * Load(const G4String &fileName, G4double unit=1.0) const
Return either G4Tubs or G4CutTubs depending on flat face.
std::vector< G4TwoVector > * LoadAperturePoints(const G4String &fileName, const G4String &unit="")