Geant4  10.01.p02
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 // $Id: G4HnManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
27 
28 // Class for management of G4HnInformation.
29 // It implements functions handling the added H1/H2 information
30 // (not available in g4tools).
31 //
32 // Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
33 
34 #ifndef G4HnManager_h
35 #define G4HnManager_h 1
36 
37 #include "G4BaseAnalysisManager.hh"
38 #include "G4HnInformation.hh"
39 #include "globals.hh"
40 
41 #include <vector>
42 
44 {
45  public:
46  G4HnManager(const G4String& hnType,
47  const G4AnalysisManagerState& state);
48  virtual ~G4HnManager();
49 
50  // Methods to manipulate additional information
51 
52  void AddH1Information(const G4String& name,
53  const G4String& unitName,
54  const G4String& fcnName,
55  G4double unit,
56  G4Fcn fx,
57  G4BinScheme binScheme);
58  void AddH2Information(const G4String& name,
59  const G4String& xunitName,
60  const G4String& yunitName,
61  const G4String& xfcnName,
62  const G4String& yfcnName,
63  G4double xunit, G4double yunit,
64  G4Fcn fx, G4Fcn fy,
65  G4BinScheme xBinScheme, G4BinScheme yBinScheme);
66  void AddH3Information(const G4String& name,
67  const G4String& xunitName,
68  const G4String& yunitName,
69  const G4String& zunitName,
70  const G4String& xfcnName,
71  const G4String& yfcnName,
72  const G4String& zfcnName,
73  G4double xunit, G4double yunit, G4double zunit,
74  G4Fcn fx, G4Fcn fy, G4Fcn fz,
75  G4BinScheme xBinScheme, G4BinScheme yBinScheme,
76  G4BinScheme zBinScheme);
77  // Access methofd
79  G4String functionName = "",
80  G4bool warn = true) const;
81 
83  G4int dimension,
84  G4String functionName = "",
85  G4bool warn = true) const;
86 
87  const std::vector<G4HnInformation*>& GetHnVector() const;
88  G4int GetNofHns() const;
89  G4String GetHnType() const;
90 
91  // Activation option
92 
93  // Return false if activation is enabled and there is no object activated,
94  // return true otherwise
95  G4bool IsActive() const;
96 
97  // ASCII option
98 
99  // Return false if there is no object selected for ASCII output,
100  // return true otherwise
101  G4bool IsAscii() const;
102 
103  // Function implementing public analsi manager interface
104  //
105 
106  void SetActivation(G4bool activation);
107  void SetActivation(G4int id, G4bool activation);
108  void SetAscii(G4int id, G4bool ascii);
109 
110  // Access to Hn additional information
111  G4String GetName(G4int id) const;
112  G4double GetXUnit(G4int id) const;
113  G4double GetYUnit(G4int id) const;
114  G4double GetZUnit(G4int id) const;
115  G4bool GetActivation(G4int id) const;
116  G4bool GetAscii(G4int id) const;
117 
118  private:
119  // Data members
123 
124  // Additional histograms/ntuple properties not included in tools
125  std::vector<G4HnInformation*> fHnVector;
126 };
127 
129 { return fHnVector.size(); }
130 
132 { return fHnType; }
133 
134 inline const std::vector<G4HnInformation*>& G4HnManager::GetHnVector() const
135 { return fHnVector; }
136 
137 #endif
138 
G4bool IsAscii() const
Definition: G4HnManager.cc:162
G4bool GetAscii(G4int id) const
Definition: G4HnManager.cc:280
G4String GetHnType() const
Definition: G4HnManager.hh:131
G4double GetZUnit(G4int id) const
Definition: G4HnManager.cc:259
G4String name
Definition: TRTMaterials.hh:40
void AddH1Information(const G4String &name, const G4String &unitName, const G4String &fcnName, G4double unit, G4Fcn fx, G4BinScheme binScheme)
Definition: G4HnManager.cc:57
G4double(* G4Fcn)(G4double)
Definition: G4Fcn.hh:36
G4HnManager(const G4String &hnType, const G4AnalysisManagerState &state)
Definition: G4HnManager.cc:33
G4String fHnType
Definition: G4HnManager.hh:120
int G4int
Definition: G4Types.hh:78
G4HnInformation * GetHnInformation(G4int id, G4String functionName="", G4bool warn=true) const
Definition: G4HnManager.cc:123
G4bool GetActivation(G4int id) const
Definition: G4HnManager.cc:270
G4double GetXUnit(G4int id) const
Definition: G4HnManager.cc:237
bool G4bool
Definition: G4Types.hh:79
G4int fNofAsciiObjects
Definition: G4HnManager.hh:122
void SetAscii(G4int id, G4bool ascii)
Definition: G4HnManager.cc:209
G4String GetName(G4int id) const
Definition: G4HnManager.cc:227
void AddH3Information(const G4String &name, const G4String &xunitName, const G4String &yunitName, const G4String &zunitName, const G4String &xfcnName, const G4String &yfcnName, const G4String &zfcnName, G4double xunit, G4double yunit, G4double zunit, G4Fcn fx, G4Fcn fy, G4Fcn fz, G4BinScheme xBinScheme, G4BinScheme yBinScheme, G4BinScheme zBinScheme)
Definition: G4HnManager.cc:95
const std::vector< G4HnInformation * > & GetHnVector() const
Definition: G4HnManager.hh:134
G4BinScheme
Definition: G4BinScheme.hh:40
std::vector< G4HnInformation * > fHnVector
Definition: G4HnManager.hh:125
void AddH2Information(const G4String &name, const G4String &xunitName, const G4String &yunitName, const G4String &xfcnName, const G4String &yfcnName, G4double xunit, G4double yunit, G4Fcn fx, G4Fcn fy, G4BinScheme xBinScheme, G4BinScheme yBinScheme)
Definition: G4HnManager.cc:73
double G4double
Definition: G4Types.hh:76
G4bool IsActive() const
Definition: G4HnManager.cc:156
virtual ~G4HnManager()
Definition: G4HnManager.cc:44
void SetActivation(G4bool activation)
Definition: G4HnManager.cc:188
G4int fNofActiveObjects
Definition: G4HnManager.hh:121
G4double GetYUnit(G4int id) const
Definition: G4HnManager.cc:248
G4int GetNofHns() const
Definition: G4HnManager.hh:128
G4HnDimensionInformation * GetHnDimensionInformation(G4int id, G4int dimension, G4String functionName="", G4bool warn=true) const
Definition: G4HnManager.cc:145