Geant4  10.02
ExG4HbookH3DummyManager.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: ExG4HbookH3DummyManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
27 
30 
31 // Author: Ivana Hrivnacova, 03/11/2014 (ivana@ipno.in2p3.fr)
32 
33 #ifndef ExG4HbookH3DummyManager_h
34 #define ExG4HbookH3DummyManager_h 1
35 
36 #include "G4VH3Manager.hh"
37 #include "G4THnManager.hh"
38 #include "G4HnManager.hh"
39 #include "globals.hh"
40 
41 #include <vector>
42 #include <map>
43 
44 namespace tools {
45 namespace histo {
46 class h3d;
47 }
48 }
49 
53 
55  public G4THnManager<G4int>
56 {
57  public:
59  virtual ~ExG4HbookH3DummyManager();
60 
61  protected:
62  // Virtual functions from base class
63  //
64 
65  // Methods to create histograms
66  //
67  virtual G4int CreateH3(const G4String& name, const G4String& title,
68  G4int nxbins, G4double xmin, G4double xmax,
69  G4int nybins, G4double ymin, G4double ymax,
70  G4int nzbins, G4double zmin, G4double zmax,
71  const G4String& xunitName = "none",
72  const G4String& yunitName = "none",
73  const G4String& zunitName = "none",
74  const G4String& xfcnName = "none",
75  const G4String& yfcnName = "none",
76  const G4String& zfcnName = "none",
77  const G4String& xbinScheme = "linear",
78  const G4String& ybinScheme = "linear",
79  const G4String& zbinScheme = "linear");
80 
81  virtual G4int CreateH3(const G4String& name, const G4String& title,
82  const std::vector<G4double>& xedges,
83  const std::vector<G4double>& yedges,
84  const std::vector<G4double>& zedges,
85  const G4String& xunitName = "none",
86  const G4String& yunitName = "none",
87  const G4String& zunitName = "none",
88  const G4String& xfcnName = "none",
89  const G4String& yfcnName = "none",
90  const G4String& zfcnName = "none");
91 
92  virtual G4bool SetH3(G4int id,
93  G4int nxbins, G4double xmin, G4double xmax,
94  G4int nybins, G4double ymin, G4double ymax,
95  G4int nzbins, G4double zmin, G4double zmax,
96  const G4String& xunitName = "none",
97  const G4String& yunitName = "none",
98  const G4String& zunitName = "none",
99  const G4String& xfcnName = "none",
100  const G4String& yfcnName = "none",
101  const G4String& zfcnName = "none",
102  const G4String& xbinScheme = "linear",
103  const G4String& ybinScheme = "linear",
104  const G4String& zbinScheme = "linear");
105 
106  virtual G4bool SetH3(G4int id,
107  const std::vector<G4double>& xedges,
108  const std::vector<G4double>& yedges,
109  const std::vector<G4double>& zedges,
110  const G4String& xunitName = "none",
111  const G4String& yunitName = "none",
112  const G4String& zunitName = "none",
113  const G4String& xfcnName = "none",
114  const G4String& yfcnName = "none",
115  const G4String& zfcnName = "none");
116 
117  virtual G4bool ScaleH3(G4int id, G4double factor);
118 
119  // Method to fill histograms
120  //
121  virtual G4bool FillH3(G4int id,
122  G4double xvalue, G4double yvalue, G4double zvalue,
123  G4double weight = 1.0);
124 
125 
126  // Methods to manipulate histograms
127  //
128 
129  // Access methods
130  virtual G4int GetH3Id(const G4String& name, G4bool warn = true) const;
131 
132  // Access to H3 parameters
133  virtual G4int GetH3Nxbins(G4int id) const;
134  virtual G4double GetH3Xmin(G4int id) const;
135  virtual G4double GetH3Xmax(G4int id) const;
136  virtual G4double GetH3XWidth(G4int id) const;
137  virtual G4int GetH3Nybins(G4int id) const;
138  virtual G4double GetH3Ymin(G4int id) const;
139  virtual G4double GetH3Ymax(G4int id) const;
140  virtual G4double GetH3YWidth(G4int id) const;
141  virtual G4int GetH3Nzbins(G4int id) const;
142  virtual G4double GetH3Zmin(G4int id) const;
143  virtual G4double GetH3Zmax(G4int id) const;
144  virtual G4double GetH3ZWidth(G4int id) const;
145 
146  // Setters for attributes for plotting
147  virtual G4bool SetH3Title(G4int id, const G4String& title);
148  virtual G4bool SetH3XAxisTitle(G4int id, const G4String& title);
149  virtual G4bool SetH3YAxisTitle(G4int id, const G4String& title);
150  virtual G4bool SetH3ZAxisTitle(G4int id, const G4String& title);
151 
152  // Access attributes for plotting
153  virtual G4String GetH3Title(G4int id) const;
154  virtual G4String GetH3XAxisTitle(G4int id) const;
155  virtual G4String GetH3YAxisTitle(G4int id) const;
156  virtual G4String GetH3ZAxisTitle(G4int id) const;
157 
158  // Write data on ASCII file
159  virtual G4bool WriteOnAscii(std::ofstream& output);
160 
161  // Access to Hn manager
162  virtual std::shared_ptr<G4HnManager> GetHnManager();
163 
164  private:
165  // methods
166  void ExceptionForHistograms(const G4String& functionName);
167  void ExceptionForHistogramsConst(const G4String& functionName) const;
168 
169  // data members
171 };
172 
173 // inline functions
174 
175 inline std::shared_ptr<G4HnManager> ExG4HbookH3DummyManager::GetHnManager()
176 { return std::shared_ptr<G4HnManager>(fHnManager); }
177 
178 #endif
179 
virtual G4bool SetH3(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4int nzbins, G4double zmin, G4double zmax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinScheme="linear", const G4String &ybinScheme="linear", const G4String &zbinScheme="linear")
virtual G4bool SetH3YAxisTitle(G4int id, const G4String &title)
virtual G4String GetH3YAxisTitle(G4int id) const
virtual G4double GetH3Ymax(G4int id) const
void ExceptionForHistogramsConst(const G4String &functionName) const
virtual G4bool FillH3(G4int id, G4double xvalue, G4double yvalue, G4double zvalue, G4double weight=1.0)
G4String name
Definition: TRTMaterials.hh:40
virtual G4bool SetH3ZAxisTitle(G4int id, const G4String &title)
void ExceptionForHistograms(const G4String &functionName)
virtual G4int GetH3Nxbins(G4int id) const
virtual G4String GetH3XAxisTitle(G4int id) const
int G4int
Definition: G4Types.hh:78
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
virtual G4int CreateH3(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4int nzbins, G4double zmin, G4double zmax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinScheme="linear", const G4String &ybinScheme="linear", const G4String &zbinScheme="linear")
virtual G4double GetH3Zmin(G4int id) const
virtual G4String GetH3Title(G4int id) const
virtual G4double GetH3YWidth(G4int id) const
virtual G4int GetH3Nybins(G4int id) const
bool G4bool
Definition: G4Types.hh:79
virtual std::shared_ptr< G4HnManager > GetHnManager()
virtual G4bool SetH3Title(G4int id, const G4String &title)
virtual G4double GetH3XWidth(G4int id) const
virtual G4double GetH3ZWidth(G4int id) const
Manager class for H3 with dummy implementation.
virtual G4bool ScaleH3(G4int id, G4double factor)
virtual G4int GetH3Nzbins(G4int id) const
virtual G4double GetH3Xmax(G4int id) const
virtual G4double GetH3Zmax(G4int id) const
static const G4double factor
ExG4HbookH3DummyManager(const G4AnalysisManagerState &state)
virtual G4bool SetH3XAxisTitle(G4int id, const G4String &title)
virtual G4String GetH3ZAxisTitle(G4int id) const
double G4double
Definition: G4Types.hh:76
virtual G4int GetH3Id(const G4String &name, G4bool warn=true) const
virtual G4double GetH3Xmin(G4int id) const
virtual G4bool WriteOnAscii(std::ofstream &output)
virtual G4double GetH3Ymin(G4int id) const