Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4HnManager.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// Class for management of G4HnInformation.
28// It implements functions handling the added H1/H2 information
29// (not available in g4tools).
30//
31// Author: Ivana Hrivnacova, 18/06/2013 ([email protected])
32
33#ifndef G4HnManager_h
34#define G4HnManager_h 1
35
37#include "G4HnInformation.hh"
38#include "globals.hh"
39
40#include <vector>
41
42class G4VFileManager;
43
45{
46 public:
47 G4HnManager(const G4String& hnType,
48 const G4AnalysisManagerState& state);
49 virtual ~G4HnManager();
50
51 // Methods to manipulate additional information
52
53 G4HnInformation* AddHnInformation(const G4String& name, G4int nofDimensions);
54
55 // Access methofd
57 G4String functionName = "",
58 G4bool warn = true) const;
59
61 G4int dimension,
62 G4String functionName = "",
63 G4bool warn = true) const;
64
65 const std::vector<G4HnInformation*>& GetHnVector() const;
66 G4int GetNofHns() const;
67 G4String GetHnType() const;
68
69 // Activation option
70
71 // Return false if activation is enabled and there is no object activated,
72 // return true otherwise
73 G4bool IsActive() const;
74
75 // ASCII option
76
77 // Return false if there is no object selected for ASCII output,
78 // return true otherwise
79 G4bool IsAscii() const;
80
81 // Plotting option
82
83 // Return false if there is no object selected for plotting,
84 // return true otherwise
85 G4bool IsPlotting() const;
86
87 // Return false if there is no object with a specific file name
88 G4bool IsFileName() const;
89
90 // Function implementing public analysis manager interface
91 //
92 void SetActivation(G4bool activation);
93 void SetActivation(G4int id, G4bool activation);
94 void SetAscii(G4int id, G4bool ascii);
95 void SetPlotting(G4int id, G4bool plotting);
96 void SetPlotting(G4bool plotting);
97 void SetFileName(G4int id, const G4String& fileName);
98 void SetFileName(const G4String& fileName);
99 G4bool SetXAxisIsLog(G4int id, G4bool isLogAxis);
100 G4bool SetYAxisIsLog(G4int id, G4bool isLogAxis);
101 G4bool SetZAxisIsLog(G4int id, G4bool isLogAxis);
102
103
104 // Access to Hn additional information
105 G4String GetName(G4int id) const;
106 G4double GetXUnit(G4int id) const;
107 G4double GetYUnit(G4int id) const;
108 G4double GetZUnit(G4int id) const;
109 G4bool GetXAxisIsLog(G4int id) const;
110 G4bool GetYAxisIsLog(G4int id) const;
111 G4bool GetZAxisIsLog(G4int id) const;
112 G4bool GetActivation(G4int id) const;
113 G4bool GetAscii(G4int id) const;
114 G4bool GetPlotting(G4int id) const;
115 G4String GetFileName(G4int id) const;
116
117 void SetFileManager(std::shared_ptr<G4VFileManager> fileManager);
118
119 private:
120 // Methods
121 void SetActivation(G4HnInformation* info, G4bool activation);
122 void SetPlotting(G4HnInformation* info, G4bool plotting);
123 void SetFileName(G4HnInformation* info, const G4String& fileName);
124
125 // Data members
126 G4String fHnType;
127 G4int fNofActiveObjects;
128 G4int fNofAsciiObjects;
129 G4int fNofPlottingObjects;
130 G4int fNofFileNameObjects;
131
132 // Additional histograms/ntuple properties not included in tools
133 std::vector<G4HnInformation*> fHnVector;
134 std::shared_ptr<G4VFileManager> fFileManager;
135};
136
138{ return G4int(fHnVector.size()); }
139
141{ return fHnType; }
142
143inline const std::vector<G4HnInformation*>& G4HnManager::GetHnVector() const
144{ return fHnVector; }
145
146inline void G4HnManager::SetFileManager(std::shared_ptr<G4VFileManager> fileManager)
147{ fFileManager = fileManager; }
148
149#endif
150
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
virtual ~G4HnManager()
Definition: G4HnManager.cc:50
G4bool GetPlotting(G4int id) const
Definition: G4HnManager.cc:397
void SetActivation(G4bool activation)
Definition: G4HnManager.cc:202
G4int GetNofHns() const
Definition: G4HnManager.hh:137
void SetFileManager(std::shared_ptr< G4VFileManager > fileManager)
Definition: G4HnManager.hh:146
G4String GetFileName(G4int id) const
Definition: G4HnManager.cc:407
G4double GetYUnit(G4int id) const
Definition: G4HnManager.cc:327
G4HnDimensionInformation * GetHnDimensionInformation(G4int id, G4int dimension, G4String functionName="", G4bool warn=true) const
Definition: G4HnManager.cc:155
G4bool SetZAxisIsLog(G4int id, G4bool isLogAxis)
Definition: G4HnManager.cc:296
G4bool SetYAxisIsLog(G4int id, G4bool isLogAxis)
Definition: G4HnManager.cc:285
G4String GetName(G4int id) const
Definition: G4HnManager.cc:307
G4HnInformation * GetHnInformation(G4int id, G4String functionName="", G4bool warn=true) const
Definition: G4HnManager.cc:133
G4bool SetXAxisIsLog(G4int id, G4bool isLogAxis)
Definition: G4HnManager.cc:274
G4bool IsAscii() const
Definition: G4HnManager.cc:172
G4bool IsPlotting() const
Definition: G4HnManager.cc:178
void SetFileName(G4int id, const G4String &fileName)
Definition: G4HnManager.cc:254
G4bool GetActivation(G4int id) const
Definition: G4HnManager.cc:377
G4bool GetZAxisIsLog(G4int id) const
Definition: G4HnManager.cc:367
const std::vector< G4HnInformation * > & GetHnVector() const
Definition: G4HnManager.hh:143
G4bool GetXAxisIsLog(G4int id) const
Definition: G4HnManager.cc:347
G4bool IsActive() const
Definition: G4HnManager.cc:166
void SetAscii(G4int id, G4bool ascii)
Definition: G4HnManager.cc:216
G4double GetZUnit(G4int id) const
Definition: G4HnManager.cc:337
G4bool GetYAxisIsLog(G4int id) const
Definition: G4HnManager.cc:357
G4String GetHnType() const
Definition: G4HnManager.hh:140
void SetPlotting(G4int id, G4bool plotting)
Definition: G4HnManager.cc:234
G4double GetXUnit(G4int id) const
Definition: G4HnManager.cc:317
G4bool GetAscii(G4int id) const
Definition: G4HnManager.cc:387
G4bool IsFileName() const
Definition: G4HnManager.cc:184
G4HnInformation * AddHnInformation(const G4String &name, G4int nofDimensions)
Definition: G4HnManager.cc:123