Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  // Access methofd
68  G4String functionName = "",
69  G4bool warn = true) const;
70 
71  const std::vector<G4HnInformation*>& GetHnVector() const;
72  G4int GetNofHns() const;
73  G4String GetHnType() const;
74 
75  // Activation option
76 
77  // Return false if activation is enabled and there is no object activated,
78  // return true otherwise
79  G4bool IsActive() const;
80 
81  // ASCII option
82 
83  // Return false if there is no object selected for ASCII output,
84  // return true otherwise
85  G4bool IsAscii() const;
86 
87  // Function implementing public analsi manager interface
88  //
89 
90  void SetActivation(G4bool activation);
91  void SetActivation(G4int id, G4bool activation);
92  void SetAscii(G4int id, G4bool ascii);
93 
94  // Access to Hn additional information
95  G4String GetName(G4int id) const;
96  G4double GetXUnit(G4int id) const;
97  G4double GetYUnit(G4int id) const;
98  G4bool GetActivation(G4int id) const;
99  G4bool GetAscii(G4int id) const;
100 
101  private:
102  // Data members
103  G4String fHnType;
104  G4int fNofActiveObjects;
105  G4int fNofAsciiObjects;
106 
107  // Additional histograms/ntuple properties not included in tools
108  std::vector<G4HnInformation*> fHnVector;
109 };
110 
112 { return fHnVector.size(); }
113 
115 { return fHnType; }
116 
117 inline const std::vector<G4HnInformation*>& G4HnManager::GetHnVector() const
118 { return fHnVector; }
119 
120 #endif
121 
G4bool IsAscii() const
Definition: G4HnManager.cc:114
G4bool GetAscii(G4int id) const
Definition: G4HnManager.cc:219
G4String GetHnType() const
Definition: G4HnManager.hh:114
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
const XML_Char * name
G4HnManager(const G4String &hnType, const G4AnalysisManagerState &state)
Definition: G4HnManager.cc:33
int G4int
Definition: G4Types.hh:78
G4HnInformation * GetHnInformation(G4int id, G4String functionName="", G4bool warn=true) const
Definition: G4HnManager.cc:86
G4bool GetActivation(G4int id) const
Definition: G4HnManager.cc:209
G4double GetXUnit(G4int id) const
Definition: G4HnManager.cc:189
bool G4bool
Definition: G4Types.hh:79
void SetAscii(G4int id, G4bool ascii)
Definition: G4HnManager.cc:161
G4String GetName(G4int id) const
Definition: G4HnManager.cc:179
const std::vector< G4HnInformation * > & GetHnVector() const
Definition: G4HnManager.hh:117
G4BinScheme
Definition: G4BinScheme.hh:40
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:70
double G4double
Definition: G4Types.hh:76
G4bool IsActive() const
Definition: G4HnManager.cc:108
virtual ~G4HnManager()
Definition: G4HnManager.cc:44
void SetActivation(G4bool activation)
Definition: G4HnManager.cc:140
G4double GetYUnit(G4int id) const
Definition: G4HnManager.cc:199
G4int GetNofHns() const
Definition: G4HnManager.hh:111