Geant4  10.02.p01
ExG4HbookP2DummyManager.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: ExG4HbookP2DummyManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
27 
30 
31 // Author: Ivana Hrivnacova, 24/07/2014 (ivana@ipno.in2p3.fr)
32 
33 #ifndef ExG4HbookP2DummyManager_h
34 #define ExG4HbookP2DummyManager_h 1
35 
36 #include "G4VP2Manager.hh"
37 #include "G4THnManager.hh"
38 #include "G4HnManager.hh"
39 
40 namespace tools {
41 namespace histo {
42 class h3d;
43 }
44 }
45 
49 
51  public G4THnManager<G4int>
52 {
53  public:
55  virtual ~ExG4HbookP2DummyManager();
56 
57  protected:
58  // Virtual functions from base class
59  //
60 
61  // Methods to create histograms
62  //
63  virtual G4int CreateP2(const G4String& name, const G4String& title,
64  G4int nxbins, G4double xmin, G4double xmax,
65  G4int nybins, G4double ymin, G4double ymax,
66  G4double zmin = 0, G4double zmax = 0,
67  const G4String& xunitName = "none",
68  const G4String& yunitName = "none",
69  const G4String& zunitName = "none",
70  const G4String& xfcnName = "none",
71  const G4String& yfcnName = "none",
72  const G4String& zfcnName = "none",
73  const G4String& xbinScheme = "linear",
74  const G4String& ybinScheme = "linear");
75 
76  virtual G4int CreateP2(const G4String& name, const G4String& title,
77  const std::vector<G4double>& xedges,
78  const std::vector<G4double>& yedges,
79  G4double zmin = 0, G4double zmax = 0,
80  const G4String& xunitName = "none",
81  const G4String& yunitName = "none",
82  const G4String& zunitName = "none",
83  const G4String& xfcnName = "none",
84  const G4String& yfcnName = "none",
85  const G4String& zfcnName = "none");
86 
87  virtual G4bool SetP2(G4int id,
88  G4int nxbins, G4double xmin, G4double xmax,
89  G4int nybins, G4double ymin, G4double ymax,
90  G4double zmin = 0, G4double zmax = 0,
91  const G4String& xunitName = "none",
92  const G4String& yunitName = "none",
93  const G4String& zunitName = "none",
94  const G4String& xfcnName = "none",
95  const G4String& yfcnName = "none",
96  const G4String& zfcnName = "none",
97  const G4String& xbinScheme = "linear",
98  const G4String& ybinScheme = "linear");
99 
100  virtual G4bool SetP2(G4int id,
101  const std::vector<G4double>& xedges,
102  const std::vector<G4double>& yedges,
103  G4double zmin = 0, G4double zmax = 0,
104  const G4String& xunitName = "none",
105  const G4String& yunitName = "none",
106  const G4String& zunitName = "none",
107  const G4String& xfcnName = "none",
108  const G4String& yfcnName = "none",
109  const G4String& zfcnName = "none");
110 
111  virtual G4bool ScaleP2(G4int id, G4double factor);
112 
113  // Method to fill histograms
114  //
115  virtual G4bool FillP2(G4int id,
116  G4double xvalue, G4double yvalue, G4double zvalue,
117  G4double weight = 1.0);
118 
119 
120  // Methods to manipulate histograms
121  //
122 
123  // Access methods
124  virtual G4int GetP2Id(const G4String& name, G4bool warn = true) const;
125 
126  // Access to P2 parameters
127  virtual G4int GetP2Nxbins(G4int id) const;
128  virtual G4double GetP2Xmin(G4int id) const;
129  virtual G4double GetP2Xmax(G4int id) const;
130  virtual G4double GetP2XWidth(G4int id) const;
131  virtual G4int GetP2Nybins(G4int id) const;
132  virtual G4double GetP2Ymin(G4int id) const;
133  virtual G4double GetP2Ymax(G4int id) const;
134  virtual G4double GetP2YWidth(G4int id) const;
135  virtual G4double GetP2Zmin(G4int id) const;
136  virtual G4double GetP2Zmax(G4int id) const;
137 
138  // Setters for attributes for plotting
139  virtual G4bool SetP2Title(G4int id, const G4String& title);
140  virtual G4bool SetP2XAxisTitle(G4int id, const G4String& title);
141  virtual G4bool SetP2YAxisTitle(G4int id, const G4String& title);
142  virtual G4bool SetP2ZAxisTitle(G4int id, const G4String& title);
143 
144  // Access attributes for plotting
145  virtual G4String GetP2Title(G4int id) const;
146  virtual G4String GetP2XAxisTitle(G4int id) const;
147  virtual G4String GetP2YAxisTitle(G4int id) const;
148  virtual G4String GetP2ZAxisTitle(G4int id) const;
149 
150  // Write data on ASCII file
151  virtual G4bool WriteOnAscii(std::ofstream& output);
152 
153  // Access to Hn manager
154  virtual std::shared_ptr<G4HnManager> GetHnManager();
155 
156  private:
157  // methods
158  void ExceptionForProfiles(const G4String& functionName);
159  void ExceptionForProfilesConst(const G4String& functionName) const;
160 
161  // data members
163 };
164 // inline functions
165 
166 inline std::shared_ptr<G4HnManager> ExG4HbookP2DummyManager::GetHnManager()
167 { return std::shared_ptr<G4HnManager>(fHnManager); }
168 
169 #endif
170 
virtual G4String GetP2ZAxisTitle(G4int id) const
virtual G4int CreateP2(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4double zmin=0, G4double zmax=0, 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")
G4String name
Definition: TRTMaterials.hh:40
virtual G4String GetP2Title(G4int id) const
virtual G4double GetP2Xmax(G4int id) const
virtual G4bool SetP2ZAxisTitle(G4int id, const G4String &title)
virtual G4String GetP2XAxisTitle(G4int id) const
virtual G4String GetP2YAxisTitle(G4int id) const
void ExceptionForProfiles(const G4String &functionName)
int G4int
Definition: G4Types.hh:78
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
virtual G4bool SetP2XAxisTitle(G4int id, const G4String &title)
void ExceptionForProfilesConst(const G4String &functionName) const
virtual G4double GetP2Ymax(G4int id) const
virtual G4int GetP2Nxbins(G4int id) const
Manager class for P2 with dummy implementation.
virtual G4bool ScaleP2(G4int id, G4double factor)
bool G4bool
Definition: G4Types.hh:79
ExG4HbookP2DummyManager(const G4AnalysisManagerState &state)
virtual G4double GetP2YWidth(G4int id) const
virtual G4double GetP2Xmin(G4int id) const
virtual G4double GetP2XWidth(G4int id) const
virtual G4bool SetP2Title(G4int id, const G4String &title)
static const G4double factor
virtual G4bool WriteOnAscii(std::ofstream &output)
virtual G4int GetP2Nybins(G4int id) const
virtual G4bool SetP2(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4double zmin=0, G4double zmax=0, 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")
virtual G4int GetP2Id(const G4String &name, G4bool warn=true) const
virtual G4double GetP2Zmax(G4int id) const
virtual G4bool SetP2YAxisTitle(G4int id, const G4String &title)
double G4double
Definition: G4Types.hh:76
virtual std::shared_ptr< G4HnManager > GetHnManager()
virtual G4bool FillP2(G4int id, G4double xvalue, G4double yvalue, G4double zvalue, G4double weight=1.0)
virtual G4double GetP2Zmin(G4int id) const
virtual G4double GetP2Ymin(G4int id) const