Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
@@ -24,86 +24,18 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#include "G4Hdf5RFileManager.hh"
|
||||
|
||||
#include <tools/hdf5/h2file>
|
||||
|
||||
// //_____________________________________________________________________________
|
||||
// inline
|
||||
// tools::hdf5::ntuple* G4Hdf5AnalysisReader::GetNtuple() const
|
||||
// {
|
||||
// return fNtupleManager->GetNtuple();
|
||||
// }
|
||||
|
||||
// //_____________________________________________________________________________
|
||||
// inline
|
||||
// tools::hdf5::ntuple* G4Hdf5AnalysisReader::GetNtuple(G4int ntupleId) const
|
||||
// {
|
||||
// return fNtupleManager->GetNtuple(ntupleId);
|
||||
// }
|
||||
#include "G4Hdf5RNtupleManager.hh"
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
T* G4Hdf5AnalysisReader::ReadHnImpl(
|
||||
const G4String& htName, const G4String& fileName,
|
||||
const G4String& dirName)
|
||||
{
|
||||
// Get directory
|
||||
auto directory = fFileManager->GetHistoRDirectory(fileName, dirName, false);
|
||||
if ( directory < 0 ) return nullptr;
|
||||
|
||||
// Read hn
|
||||
T* ht;
|
||||
auto result = tools::hdf5::read_histo(G4cout, directory, htName, ht);
|
||||
if ( ! result ) return nullptr;
|
||||
|
||||
if ( ! ht ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< " "
|
||||
<< "Streaming " << htName << " from file " << fileName << " failed.";
|
||||
G4Exception("G4Hdf5AnalysisReader::ReadHnImpl",
|
||||
"Analysis_WR011", JustWarning, description);
|
||||
|
||||
// when failure, directory and file should be closed
|
||||
// ::H5Gclose(histos);
|
||||
// ::H5Fclose(file);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ht;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
T* G4Hdf5AnalysisReader::ReadPnImpl(
|
||||
const G4String& ptName, const G4String& fileName,
|
||||
const G4String& dirName)
|
||||
inline
|
||||
tools::hdf5::ntuple* G4Hdf5AnalysisReader::GetNtuple() const
|
||||
{
|
||||
// Get directory
|
||||
auto directory = fFileManager->GetHistoRDirectory(fileName, dirName, false);
|
||||
if ( directory < 0 ) return nullptr;
|
||||
return fNtupleManager->GetNtuple();
|
||||
}
|
||||
|
||||
// Read hn
|
||||
T* pt;
|
||||
auto result = tools::hdf5::read_profile(G4cout, directory, ptName, pt);
|
||||
if ( ! result ) return nullptr;
|
||||
|
||||
if ( ! pt ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< " "
|
||||
<< "Streaming " << ptName << " from file " << fileName << " failed.";
|
||||
G4Exception("G4Hdf5AnalysisReader::ReadPnImpl",
|
||||
"Analysis_WR011", JustWarning, description);
|
||||
|
||||
// when failure, directory and file should be closed
|
||||
// ::H5Gclose(histos);
|
||||
// ::H5Fclose(file);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return pt;
|
||||
}
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::hdf5::ntuple* G4Hdf5AnalysisReader::GetNtuple(G4int ntupleId) const
|
||||
{
|
||||
return fNtupleManager->GetNtuple(ntupleId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user