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

#include <G4CsvNtupleFileManager.hh>

+ Inheritance diagram for G4CsvNtupleFileManager:

Public Member Functions

 G4CsvNtupleFileManager (const G4AnalysisManagerState &state)
 
 G4CsvNtupleFileManager ()=delete
 
 ~G4CsvNtupleFileManager () 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< G4CsvFileManager > fileManager)
 
std::shared_ptr< G4CsvNtupleManagerGetNtupleManager () 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 void SetBookingManager (std::shared_ptr< G4NtupleBookingManager > bookingManager)
 
virtual G4bool IsNtupleMergingSupported () const
 
virtual G4NtupleMergeMode GetMergeMode () const
 
G4String GetFileType () const
 

Friends

class G4CsvAnalysisManager
 

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 G4CsvNtupleFileManager.hh.

Constructor & Destructor Documentation

◆ G4CsvNtupleFileManager() [1/2]

G4CsvNtupleFileManager::G4CsvNtupleFileManager ( const G4AnalysisManagerState & state)
explicit

Definition at line 38 of file G4CsvNtupleFileManager.cc.

39 : G4VNtupleFileManager(state, "csv")
40{}
G4VNtupleFileManager()=delete

◆ G4CsvNtupleFileManager() [2/2]

G4CsvNtupleFileManager::G4CsvNtupleFileManager ( )
delete

◆ ~G4CsvNtupleFileManager()

G4CsvNtupleFileManager::~G4CsvNtupleFileManager ( )
overridedefault

Member Function Documentation

◆ ActionAtCloseFile()

G4bool G4CsvNtupleFileManager::ActionAtCloseFile ( )
overridevirtual

Implements G4VNtupleFileManager.

Definition at line 88 of file G4CsvNtupleFileManager.cc.

89{
90 auto result = true;
91
92 // Close ntuple files
93 auto ntupleVector = fNtupleManager->GetNtupleDescriptionVector();
94 for ( auto ntupleDescription : ntupleVector) {
95 result &= fFileManager->CloseNtupleFile(ntupleDescription);
96 }
97
98 return result;
99}

◆ ActionAtOpenFile()

G4bool G4CsvNtupleFileManager::ActionAtOpenFile ( const G4String & fileName)
overridevirtual

Implements G4VNtupleFileManager.

Definition at line 58 of file G4CsvNtupleFileManager.cc.

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

◆ ActionAtWrite()

G4bool G4CsvNtupleFileManager::ActionAtWrite ( )
overridevirtual

Implements G4VNtupleFileManager.

Definition at line 71 of file G4CsvNtupleFileManager.cc.

72{
73 auto result = true;
74
75 auto ntupleVector = fNtupleManager->GetNtupleDescriptionVector();
76
77 for ( auto ntupleDescription : ntupleVector ) {
78 if (ntupleDescription->GetNtuple() != nullptr) {
79 // Notify not empty file
80 result &= fFileManager->NotifyNtupleFile(ntupleDescription);
81 }
82 }
83
84 return result;
85}

◆ CreateNtupleManager()

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

Implements G4VNtupleFileManager.

Definition at line 47 of file G4CsvNtupleFileManager.cc.

48{
49 // G4cout << "G4CsvNtupleFileManager::CreateNtupleManager" << G4endl;
50
51 fNtupleManager = std::make_shared<G4CsvNtupleManager>(fState);
52 fNtupleManager->SetFileManager(fFileManager);
53
54 return fNtupleManager;
55}
const G4AnalysisManagerState & fState

◆ GetNtupleManager()

std::shared_ptr< G4CsvNtupleManager > G4CsvNtupleFileManager::GetNtupleManager ( ) const
inline

Definition at line 83 of file G4CsvNtupleFileManager.hh.

84{ return fNtupleManager; }

◆ Reset()

G4bool G4CsvNtupleFileManager::Reset ( )
overridevirtual

Implements G4VNtupleFileManager.

Definition at line 102 of file G4CsvNtupleFileManager.cc.

103{
104 return fNtupleManager->Reset();
105}

◆ SetFileManager()

void G4CsvNtupleFileManager::SetFileManager ( std::shared_ptr< G4CsvFileManager > fileManager)
inline

Definition at line 77 of file G4CsvNtupleFileManager.hh.

79{
80 fFileManager = std::move(fileManager);
81}

Friends And Related Symbol Documentation

◆ G4CsvAnalysisManager

friend class G4CsvAnalysisManager
friend

Definition at line 47 of file G4CsvNtupleFileManager.hh.


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