Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4XmlNtupleFileManager Class Reference

#include <G4XmlNtupleFileManager.hh>

+ Inheritance diagram for G4XmlNtupleFileManager:

Public Member Functions

 G4XmlNtupleFileManager (const G4AnalysisManagerState &state)
 
 G4XmlNtupleFileManager ()=delete
 
 ~G4XmlNtupleFileManager () override=default
 
std::shared_ptr< G4VNtupleManagerCreateNtupleManager () override
 
G4bool ActionAtOpenFile (const G4String &fileName) override
 
G4bool ActionAtWrite () override
 
G4bool ActionAtCloseFile () override
 
G4bool Reset () override
 
void SetFileManager (std::shared_ptr< G4XmlFileManager > fileManager)
 
std::shared_ptr< G4XmlNtupleManagerGetNtupleManager () const
 
- Public Member Functions inherited from G4VNtupleFileManager
 G4VNtupleFileManager (const G4AnalysisManagerState &state, G4String fileType)
 
 G4VNtupleFileManager ()=delete
 
virtual ~G4VNtupleFileManager ()=default
 
 G4VNtupleFileManager (const G4VNtupleFileManager &rhs)=delete
 
G4VNtupleFileManageroperator= (const G4VNtupleFileManager &rhs)=delete
 
virtual void SetNtupleMerging (G4bool mergeNtuples, G4int nofReducedNtupleFiles=0)
 
virtual void SetNtupleRowWise (G4bool rowWise, G4bool rowMode=true)
 
virtual void SetBasketSize (unsigned int basketSize)
 
virtual void SetBasketEntries (unsigned int basketEntries)
 
virtual std::shared_ptr< G4VNtupleManagerCreateNtupleManager ()=0
 
virtual void SetBookingManager (std::shared_ptr< G4NtupleBookingManager > bookingManager)
 
virtual G4bool ActionAtOpenFile (const G4String &)=0
 
virtual G4bool ActionAtWrite ()=0
 
virtual G4bool ActionAtCloseFile ()=0
 
virtual G4bool Reset ()=0
 
virtual G4bool IsNtupleMergingSupported () const
 
virtual G4NtupleMergeMode GetMergeMode () const
 
G4String GetFileType () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VNtupleFileManager
void Message (G4int level, const G4String &action, const G4String &objectType, const G4String &objectName="", G4bool success=true) const
 
- Protected Attributes inherited from G4VNtupleFileManager
const G4AnalysisManagerStatefState
 
G4String fFileType
 
std::shared_ptr< G4NtupleBookingManagerfBookingManager { nullptr }
 

Detailed Description

Definition at line 45 of file G4XmlNtupleFileManager.hh.

Constructor & Destructor Documentation

◆ G4XmlNtupleFileManager() [1/2]

G4XmlNtupleFileManager::G4XmlNtupleFileManager ( const G4AnalysisManagerState state)
explicit

Definition at line 40 of file G4XmlNtupleFileManager.cc.

41 : G4VNtupleFileManager(state, "csv")
42{}
G4VNtupleFileManager()=delete

◆ G4XmlNtupleFileManager() [2/2]

G4XmlNtupleFileManager::G4XmlNtupleFileManager ( )
delete

◆ ~G4XmlNtupleFileManager()

G4XmlNtupleFileManager::~G4XmlNtupleFileManager ( )
overridedefault

Member Function Documentation

◆ ActionAtCloseFile()

G4bool G4XmlNtupleFileManager::ActionAtCloseFile ( )
overridevirtual

Implements G4VNtupleFileManager.

Definition at line 83 of file G4XmlNtupleFileManager.cc.

84{
85 auto result = true;
86
87 // Close ntuple files
88 auto ntupleVector = fNtupleManager->GetNtupleDescriptionVector();
89 for ( auto ntupleDescription : ntupleVector) {
90 result &= fFileManager->CloseNtupleFile(ntupleDescription);
91 }
92
93 return result;
94}

◆ ActionAtOpenFile()

G4bool G4XmlNtupleFileManager::ActionAtOpenFile ( const G4String fileName)
overridevirtual

Implements G4VNtupleFileManager.

Definition at line 58 of file G4XmlNtupleFileManager.cc.

59{
60 // Create ntuples if they are booked
61 // (The files will be created with creating ntuples)
62 fNtupleManager->CreateNtuplesFromBooking(
63 fBookingManager->GetNtupleBookingVector());
64
65 return true;
66}
std::shared_ptr< G4NtupleBookingManager > fBookingManager

◆ ActionAtWrite()

G4bool G4XmlNtupleFileManager::ActionAtWrite ( )
overridevirtual

Implements G4VNtupleFileManager.

Definition at line 69 of file G4XmlNtupleFileManager.cc.

70{
71 auto ntupleVector = fNtupleManager->GetNtupleDescriptionVector();
72
73 for ( auto ntupleDescription : ntupleVector ) {
74 if (ntupleDescription->GetNtuple() != nullptr) {
75 ntupleDescription->GetNtuple()->write_trailer();
76 }
77 }
78
79 return true;
80}

◆ CreateNtupleManager()

std::shared_ptr< G4VNtupleManager > G4XmlNtupleFileManager::CreateNtupleManager ( )
overridevirtual

Implements G4VNtupleFileManager.

Definition at line 49 of file G4XmlNtupleFileManager.cc.

50{
51 fNtupleManager = std::make_shared<G4XmlNtupleManager>(fState);
52 fNtupleManager->SetFileManager(fFileManager);
53
54 return fNtupleManager;
55}
const G4AnalysisManagerState & fState

◆ GetNtupleManager()

std::shared_ptr< G4XmlNtupleManager > G4XmlNtupleFileManager::GetNtupleManager ( ) const
inline

Definition at line 81 of file G4XmlNtupleFileManager.hh.

82{ return fNtupleManager; }

◆ Reset()

G4bool G4XmlNtupleFileManager::Reset ( )
overridevirtual

Implements G4VNtupleFileManager.

Definition at line 97 of file G4XmlNtupleFileManager.cc.

98{
99// Reset histograms and ntuple
100
101 return fNtupleManager->Reset();
102}

◆ SetFileManager()

void G4XmlNtupleFileManager::SetFileManager ( std::shared_ptr< G4XmlFileManager fileManager)
inline

Definition at line 75 of file G4XmlNtupleFileManager.hh.

77{
78 fFileManager = std::move(fileManager);
79}

The documentation for this class was generated from the following files: