Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4BaseFileManager.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// Base class for analysis file managers.
28//
29// Author: Ivana Hrivnacova, 18/06/2013 ([email protected])
30
31#ifndef G4BaseFileManager_h
32#define G4BaseFileManager_h 1
33
35#include "globals.hh"
36
37#include <vector>
38
40{
41 public:
42 explicit G4BaseFileManager(const G4AnalysisManagerState& state);
43 virtual ~G4BaseFileManager();
44
45 virtual G4bool SetFileName(const G4String& fileName);
46 // Set the base file name (without extension)
47 virtual G4String GetFileType() const;
48 // Return the manager type (starts with a lowercase letter)
49
50 void AddFileName(const G4String& fileName);
51 // For handling multiple files
52 // Save file name in a vector if not yet present
53
54 G4String GetFileName() const;
55 // Return the base file name (without extension)
56 G4String GetFullFileName(const G4String& baseFileName = "",
57 G4bool isPerThread = true) const;
58 // Compose and return the full file name:
59 // - add _tN suffix to the file base name if isPerThread
60 // - add file extension if not present and available in state
61 const std::vector<G4String>& GetFileNames() const;
62 // Return the file names vector
63
64 G4String GetHnFileName(const G4String& hnType,
65 const G4String& hnName) const;
66 // Compose and return the histogram or profile specific file name:
67 // - add _hn_hnName suffix to the file base name
68 // - add file extension if not present
69
70 G4String GetNtupleFileName(const G4String& ntupleName) const;
71 // Compose and return the ntuple specific file name:
72 // - add _nt_ntupleName suffix to the file base name
73 // - add _tN suffix if called on thread worker
74 // - add file extension if not present
75
76 G4String GetNtupleFileName(G4int ntupleFileNumber) const;
77 // Compose and return the ntuple specific file name:
78 // - add _mN suffix to the file base name
79 // - add file extension if not present
80
82 // Return the file name for batch plotting output
83
84 protected:
85 // data members
87 G4String fFileName; // to be changed in fDefaultFileName
88 std::vector<G4String> fFileNames;
89};
90
92 // CHECK if still needed in this base class
93 fFileName = fileName;
94 return true;
95}
96
98 return fFileName;
99}
100
101inline const std::vector<G4String>& G4BaseFileManager::GetFileNames() const {
102 return fFileNames;
103}
104
105#endif
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
std::vector< G4String > fFileNames
G4String GetFullFileName(const G4String &baseFileName="", G4bool isPerThread=true) const
G4String GetPlotFileName() const
virtual G4bool SetFileName(const G4String &fileName)
const std::vector< G4String > & GetFileNames() const
virtual G4String GetFileType() const
G4String GetHnFileName(const G4String &hnType, const G4String &hnName) const
G4String GetFileName() const
const G4AnalysisManagerState & fState
G4String GetNtupleFileName(const G4String &ntupleName) const
virtual ~G4BaseFileManager()
void AddFileName(const G4String &fileName)