19#ifndef BDSAPERTUREPOINTSLOADER_H
20#define BDSAPERTUREPOINTSLOADER_H
21#include "BDSFourVector.hh"
24#include "G4TwoVector.hh"
51 std::vector<G4TwoVector>*
Load(
const G4String& fileName,
52 G4double unit = 1.0)
const;
79 std::vector<G4TwoVector>*
FindCachedFile(
const G4String& fileNameAndUnits)
const;
82 void CacheFile(
const G4String& fileNameAndUnits,
83 std::vector<G4TwoVector>* contents);
90 std::map<G4String, std::vector<G4TwoVector>*> cachedFiles;
99 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="")