Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
@@ -24,6 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#include "G4HnInformation.hh"
|
||||
#include "G4H1ToolsManager.hh"
|
||||
#include "G4H2ToolsManager.hh"
|
||||
#include "G4H3ToolsManager.hh"
|
||||
@@ -31,41 +32,98 @@
|
||||
#include "G4P2ToolsManager.hh"
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
template <typename HT>
|
||||
inline
|
||||
G4bool G4ToolsAnalysisManager::WriteT(const std::vector<HT*>& htVector,
|
||||
const std::vector<G4HnInformation*>& hnVector)
|
||||
{
|
||||
auto result = true;
|
||||
|
||||
for ( G4int i=0; i<G4int(htVector.size()); ++i ) {
|
||||
auto info = hnVector[i];
|
||||
auto activation = info->GetActivation();
|
||||
// skip writing if activation is enabled and H1 is inactivated
|
||||
if ( fState.GetIsActivation() && ( ! activation ) ) continue;
|
||||
|
||||
auto name = info->GetName();
|
||||
auto ht = htVector[i];
|
||||
|
||||
auto fileName = info->GetFileName();
|
||||
auto fileManager = GetFileManager(fileName);
|
||||
|
||||
// skip writing if cannot get file manager (wrong file extension)
|
||||
if ( ! fileManager ) {
|
||||
G4Analysis::Warn(
|
||||
"Cannot get file manager for file " + fileName + ".\n" +
|
||||
"Writing " + G4Analysis::GetHnType<HT>() + " " + name + " will be skipped.",
|
||||
fkClass, "WriteT");
|
||||
continue;
|
||||
}
|
||||
|
||||
auto fileKind = " in file ";
|
||||
if ( fileName != "" ) {
|
||||
fileKind = " in extra file ";
|
||||
} else {
|
||||
fileName = fileManager->GetFullFileName();
|
||||
}
|
||||
|
||||
Message(G4Analysis::kVL4, "write", G4Analysis::GetHnType<HT>(),
|
||||
name + fileKind + fileName);
|
||||
|
||||
if ( ! fileManager->GetHnFileManager<HT>()->Write(ht, name, fileName) ) {
|
||||
G4Analysis::Warn(
|
||||
"Writing " + G4Analysis::GetHnType<HT>() + " " + name +
|
||||
" to file " + fileName + " failed.",
|
||||
fkClass, "WriteT");
|
||||
result = false;
|
||||
}
|
||||
|
||||
// notify that file has a written object
|
||||
fileManager->SetIsEmpty(fileName, false);
|
||||
|
||||
Message(G4Analysis::kVL3, "write", G4Analysis::GetHnType<HT>(),
|
||||
name + " in the " + fileKind + " file " + fileName);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
tools::histo::h1d* G4ToolsAnalysisManager::GetH1(G4int id, G4bool warn,
|
||||
G4bool onlyIfActive) const
|
||||
G4bool onlyIfActive) const
|
||||
{
|
||||
return fH1Manager->GetH1(id, warn, onlyIfActive);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
inline
|
||||
tools::histo::h2d* G4ToolsAnalysisManager::GetH2(G4int id, G4bool warn,
|
||||
G4bool onlyIfActive) const
|
||||
G4bool onlyIfActive) const
|
||||
{
|
||||
return fH2Manager->GetH2(id, warn, onlyIfActive);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
inline
|
||||
tools::histo::h3d* G4ToolsAnalysisManager::GetH3(G4int id, G4bool warn,
|
||||
G4bool onlyIfActive) const
|
||||
G4bool onlyIfActive) const
|
||||
{
|
||||
return fH3Manager->GetH3(id, warn, onlyIfActive);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
inline
|
||||
tools::histo::p1d* G4ToolsAnalysisManager::GetP1(G4int id, G4bool warn,
|
||||
G4bool onlyIfActive) const
|
||||
G4bool onlyIfActive) const
|
||||
{
|
||||
return fP1Manager->GetP1(id, warn, onlyIfActive);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
inline
|
||||
tools::histo::p2d* G4ToolsAnalysisManager::GetP2(G4int id, G4bool warn,
|
||||
G4bool onlyIfActive) const
|
||||
G4bool onlyIfActive) const
|
||||
{
|
||||
return fP2Manager->GetP2(id, warn, onlyIfActive);
|
||||
}
|
||||
@@ -75,148 +133,148 @@ inline
|
||||
std::vector<tools::histo::h1d*>::iterator G4ToolsAnalysisManager::BeginH1()
|
||||
{
|
||||
return fH1Manager->BeginH1();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h1d*>::iterator G4ToolsAnalysisManager::EndH1()
|
||||
{
|
||||
return fH1Manager->EndH1();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h1d*>::const_iterator
|
||||
std::vector<tools::histo::h1d*>::const_iterator
|
||||
G4ToolsAnalysisManager::BeginConstH1() const
|
||||
{
|
||||
return fH1Manager->BeginConstH1();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h1d*>::const_iterator
|
||||
std::vector<tools::histo::h1d*>::const_iterator
|
||||
G4ToolsAnalysisManager::EndConstH1() const
|
||||
{
|
||||
return fH1Manager->EndConstH1();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h2d*>::iterator G4ToolsAnalysisManager::BeginH2()
|
||||
{
|
||||
return fH2Manager->BeginH2();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h2d*>::iterator G4ToolsAnalysisManager::EndH2()
|
||||
{
|
||||
return fH2Manager->EndH2();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h2d*>::const_iterator
|
||||
std::vector<tools::histo::h2d*>::const_iterator
|
||||
G4ToolsAnalysisManager::BeginConstH2() const
|
||||
{
|
||||
return fH2Manager->BeginConstH2();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h2d*>::const_iterator
|
||||
std::vector<tools::histo::h2d*>::const_iterator
|
||||
G4ToolsAnalysisManager::EndConstH2() const
|
||||
{
|
||||
return fH2Manager->EndConstH2();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h3d*>::iterator G4ToolsAnalysisManager::BeginH3()
|
||||
{
|
||||
return fH3Manager->BeginH3();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h3d*>::iterator G4ToolsAnalysisManager::EndH3()
|
||||
{
|
||||
return fH3Manager->EndH3();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h3d*>::const_iterator
|
||||
std::vector<tools::histo::h3d*>::const_iterator
|
||||
G4ToolsAnalysisManager::BeginConstH3() const
|
||||
{
|
||||
return fH3Manager->BeginConstH3();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::h3d*>::const_iterator
|
||||
std::vector<tools::histo::h3d*>::const_iterator
|
||||
G4ToolsAnalysisManager::EndConstH3() const
|
||||
{
|
||||
return fH3Manager->EndConstH3();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p1d*>::iterator G4ToolsAnalysisManager::BeginP1()
|
||||
{
|
||||
return fP1Manager->BeginP1();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p1d*>::iterator G4ToolsAnalysisManager::EndP1()
|
||||
{
|
||||
return fP1Manager->EndP1();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p1d*>::const_iterator
|
||||
std::vector<tools::histo::p1d*>::const_iterator
|
||||
G4ToolsAnalysisManager::BeginConstP1() const
|
||||
{
|
||||
return fP1Manager->BeginConstP1();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p1d*>::const_iterator
|
||||
std::vector<tools::histo::p1d*>::const_iterator
|
||||
G4ToolsAnalysisManager::EndConstP1() const
|
||||
{
|
||||
return fP1Manager->EndConstP1();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p2d*>::iterator G4ToolsAnalysisManager::BeginP2()
|
||||
{
|
||||
return fP2Manager->BeginP2();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p2d*>::iterator G4ToolsAnalysisManager::EndP2()
|
||||
{
|
||||
return fP2Manager->EndP2();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p2d*>::const_iterator
|
||||
std::vector<tools::histo::p2d*>::const_iterator
|
||||
G4ToolsAnalysisManager::BeginConstP2() const
|
||||
{
|
||||
return fP2Manager->BeginConstP2();
|
||||
}
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline
|
||||
std::vector<tools::histo::p2d*>::const_iterator
|
||||
std::vector<tools::histo::p2d*>::const_iterator
|
||||
G4ToolsAnalysisManager::EndConstP2() const
|
||||
{
|
||||
return fP2Manager->EndConstP2();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user