Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VNtupleFileManager.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26
27// The abstract base class for ntuple file output.
28//
29// Author: Ivana Hrivnacova, 15/09/2020 ([email protected])
30
31#ifndef G4VNtupleFileManager_h
32#define G4VNtupleFileManager_h 1
33
35#include "globals.hh"
36
39
41{
42 // Disable using the object managers outside G4VAnalysisManager and
43 // its messenger
44 friend class G4VAnalysisManager;
45
46 public:
47 explicit G4VNtupleFileManager(const G4AnalysisManagerState& state,
48 const G4String& fileType);
49 virtual ~G4VNtupleFileManager();
50
51 // deleted copy constructor & assignment operator
54
55 // MT/MPI
56 virtual void SetNtupleMerging(G4bool mergeNtuples,
57 G4int nofReducedNtupleFiles = 0);
58 virtual void SetNtupleRowWise(G4bool rowWise, G4bool rowMode = true);
59 virtual void SetBasketSize(unsigned int basketSize);
60 virtual void SetBasketEntries(unsigned int basketEntries);
61
62 virtual std::shared_ptr<G4VNtupleManager> CreateNtupleManager() = 0;
63 virtual void SetBookingManager(std::shared_ptr<G4NtupleBookingManager> bookingManager);
64
65 // Methods to be performed at file management
66 virtual G4bool ActionAtOpenFile(const G4String& /*fileName*/) = 0;
67 virtual G4bool ActionAtWrite() = 0;
68 virtual G4bool ActionAtCloseFile(G4bool /*reset*/) = 0;
69 virtual G4bool Reset() = 0;
70 virtual G4bool IsNtupleMergingSupported() const;
71
72 // Get methods
73 G4String GetFileType() const;
74
75 protected:
76 // static data members
79 std::shared_ptr<G4NtupleBookingManager> fBookingManager;
80};
81
82// inline functions
83
85 std::shared_ptr<G4NtupleBookingManager> bookingManager)
86{ fBookingManager = bookingManager; }
87
89 return false;
90}
91
93 return fFileType;
94}
95
96#endif
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4VNtupleFileManager & operator=(const G4VNtupleFileManager &rhs)=delete
virtual void SetNtupleMerging(G4bool mergeNtuples, G4int nofReducedNtupleFiles=0)
virtual G4bool IsNtupleMergingSupported() const
G4VNtupleFileManager(const G4VNtupleFileManager &rhs)=delete
virtual G4bool ActionAtWrite()=0
virtual G4bool ActionAtCloseFile(G4bool)=0
virtual void SetNtupleRowWise(G4bool rowWise, G4bool rowMode=true)
virtual void SetBookingManager(std::shared_ptr< G4NtupleBookingManager > bookingManager)
virtual std::shared_ptr< G4VNtupleManager > CreateNtupleManager()=0
virtual void SetBasketSize(unsigned int basketSize)
virtual void SetBasketEntries(unsigned int basketEntries)
std::shared_ptr< G4NtupleBookingManager > fBookingManager
G4String GetFileType() const
virtual G4bool ActionAtOpenFile(const G4String &)=0
virtual G4bool Reset()=0
const G4AnalysisManagerState & fState