Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
@@ -35,13 +35,16 @@
|
||||
#include "G4VTHnFileManager.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
namespace tools {
|
||||
namespace histo {
|
||||
class h1d;
|
||||
class h2d;
|
||||
class h3d;
|
||||
class p1d;
|
||||
class p2d;
|
||||
namespace histo {
|
||||
class h1d;
|
||||
class h2d;
|
||||
class h3d;
|
||||
class p1d;
|
||||
class p2d;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,8 +52,9 @@ class G4VFileManager : public G4BaseFileManager
|
||||
{
|
||||
public:
|
||||
explicit G4VFileManager(const G4AnalysisManagerState& state);
|
||||
virtual ~G4VFileManager();
|
||||
|
||||
G4VFileManager() = delete;
|
||||
virtual ~G4VFileManager() = default;
|
||||
|
||||
// Method to open default file
|
||||
virtual G4bool OpenFile(const G4String& fileName) = 0;
|
||||
|
||||
@@ -65,12 +69,16 @@ class G4VFileManager : public G4BaseFileManager
|
||||
virtual G4bool CloseFiles() = 0;
|
||||
virtual G4bool DeleteEmptyFiles() = 0;
|
||||
|
||||
// Clear all data
|
||||
virtual void Clear() = 0;
|
||||
|
||||
// Methods for handling files and directories names
|
||||
virtual G4bool SetFileName(const G4String& fileName) final;
|
||||
G4bool SetHistoDirectoryName(const G4String& dirName);
|
||||
G4bool SetNtupleDirectoryName(const G4String& dirName);
|
||||
virtual G4bool SetHistoDirectoryName(const G4String& dirName);
|
||||
virtual G4bool SetNtupleDirectoryName(const G4String& dirName);
|
||||
|
||||
void LockDirectoryNames();
|
||||
void UnlockDirectoryNames();
|
||||
|
||||
G4bool IsOpenFile() const;
|
||||
G4String GetHistoDirectoryName() const;
|
||||
@@ -81,18 +89,21 @@ class G4VFileManager : public G4BaseFileManager
|
||||
std::shared_ptr<G4VTHnFileManager<HT>> GetHnFileManager() const;
|
||||
|
||||
protected:
|
||||
// data members
|
||||
// Static data members
|
||||
static constexpr std::string_view fkClass { "G4VFileManager" };
|
||||
|
||||
// Data members
|
||||
G4String fHistoDirectoryName;
|
||||
G4String fNtupleDirectoryName;
|
||||
G4bool fIsOpenFile;
|
||||
G4bool fLockDirectoryNames;
|
||||
G4String fNtupleDirectoryName;
|
||||
G4bool fIsOpenFile { false };
|
||||
G4bool fLockDirectoryNames { false };
|
||||
|
||||
// FileManagers per object type
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h1d>> fH1FileManager;
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h2d>> fH2FileManager;
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h3d>> fH3FileManager;
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::p1d>> fP1FileManager;
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::p2d>> fP2FileManager;
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h1d>> fH1FileManager { nullptr };
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h2d>> fH2FileManager { nullptr };
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h3d>> fH3FileManager { nullptr };
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::p1d>> fP1FileManager { nullptr };
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::p2d>> fP2FileManager { nullptr };
|
||||
};
|
||||
|
||||
// inline functions
|
||||
@@ -100,42 +111,45 @@ class G4VFileManager : public G4BaseFileManager
|
||||
inline void G4VFileManager::LockDirectoryNames()
|
||||
{ fLockDirectoryNames = true; }
|
||||
|
||||
inline void G4VFileManager::UnlockDirectoryNames()
|
||||
{ fLockDirectoryNames = false; }
|
||||
|
||||
inline G4bool G4VFileManager::IsOpenFile() const
|
||||
{ return fIsOpenFile; }
|
||||
|
||||
inline G4String G4VFileManager::GetHistoDirectoryName() const
|
||||
{ return fHistoDirectoryName; }
|
||||
inline G4String G4VFileManager::GetHistoDirectoryName() const
|
||||
{ return fHistoDirectoryName; }
|
||||
|
||||
inline G4String G4VFileManager::GetNtupleDirectoryName() const
|
||||
inline G4String G4VFileManager::GetNtupleDirectoryName() const
|
||||
{ return fNtupleDirectoryName; }
|
||||
|
||||
template <>
|
||||
inline
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h1d>>
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h1d>>
|
||||
G4VFileManager::GetHnFileManager<tools::histo::h1d>() const
|
||||
{ return fH1FileManager; }
|
||||
|
||||
template <>
|
||||
inline
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h2d>>
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h2d>>
|
||||
G4VFileManager::GetHnFileManager<tools::histo::h2d>() const
|
||||
{ return fH2FileManager; }
|
||||
|
||||
template <>
|
||||
inline
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h3d>>
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::h3d>>
|
||||
G4VFileManager::GetHnFileManager<tools::histo::h3d>() const
|
||||
{ return fH3FileManager; }
|
||||
|
||||
template <>
|
||||
inline
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::p1d>>
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::p1d>>
|
||||
G4VFileManager::GetHnFileManager<tools::histo::p1d>() const
|
||||
{ return fP1FileManager; }
|
||||
|
||||
template <>
|
||||
inline
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::p2d>>
|
||||
std::shared_ptr<G4VTHnFileManager<tools::histo::p2d>>
|
||||
G4VFileManager::GetHnFileManager<tools::histo::p2d>() const
|
||||
{ return fP2FileManager; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user