Geant4  10.00.p01
G4VH1Manager.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: G4VH1Manager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
27 
28 // Base class for H1 manager.
29 //
30 // Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
31 
32 #ifndef G4VH1Manager_h
33 #define G4VH1Manager_h 1
34 
35 #include "G4BaseAnalysisManager.hh"
36 #include "globals.hh"
37 
38 #include <vector>
39 
40 class G4HnManager;
42 
44 {
45  // Disable using the object managers outside
46  friend class G4VAnalysisManager;
47 
48  protected:
50  virtual ~G4VH1Manager();
51 
52  // Methods for handling histogrammes
53  virtual G4int CreateH1(const G4String& name, const G4String& title,
54  G4int nbins, G4double xmin, G4double xmax,
55  const G4String& unitName = "none",
56  const G4String& fcnName = "none",
57  const G4String& binSchemeName = "linear") = 0;
58  virtual G4int CreateH1(const G4String& name, const G4String& title,
59  const std::vector<G4double>& edges,
60  const G4String& unitName = "none",
61  const G4String& fcnName = "none") = 0;
62 
63  virtual G4bool SetH1(G4int id,
64  G4int nbins, G4double xmin, G4double xmax,
65  const G4String& unitName = "none",
66  const G4String& fcnName = "none",
67  const G4String& binSchemeName = "linear") = 0;
68  virtual G4bool SetH1(G4int id,
69  const std::vector<G4double>& edges,
70  const G4String& unitName = "none",
71  const G4String& fcnName = "none") = 0;
72 
73  virtual G4bool ScaleH1(G4int id, G4double factor) = 0;
74 
75  // Methods to fill histograms
76  virtual G4bool FillH1(G4int id, G4double value, G4double weight = 1.0) = 0;
77 
78  // Access methods
79  virtual G4int GetH1Id(const G4String& name, G4bool warn = true) const = 0;
80 
81  // Access to H1 parameters
82  virtual G4int GetH1Nbins(G4int id) const = 0;
83  virtual G4double GetH1Xmin(G4int id) const = 0;
84  virtual G4double GetH1Xmax(G4int id) const = 0;
85  virtual G4double GetH1Width(G4int id) const = 0;
86 
87  // Setters for attributes for plotting
88  virtual G4bool SetH1Title(G4int id, const G4String& title) = 0;
89  virtual G4bool SetH1XAxisTitle(G4int id, const G4String& title) = 0;
90  virtual G4bool SetH1YAxisTitle(G4int id, const G4String& title) = 0;
91 
92  // Access attributes for plotting
93  virtual G4String GetH1Title(G4int id) const = 0;
94  virtual G4String GetH1XAxisTitle(G4int id) const = 0;
95  virtual G4String GetH1YAxisTitle(G4int id) const = 0;
96 
97  // Methods to manipulate histograms
98  virtual G4bool WriteOnAscii(std::ofstream& output) = 0;
99 
100  // data members
102 
103  private:
104  // Not implemented copy constructor
105  G4VH1Manager(const G4VH1Manager& rhs);
106  // Not implemented assignment operator
107  G4VH1Manager& operator=(const G4VH1Manager& rhs);
108 };
109 
110 #endif
111 
virtual G4bool SetH1YAxisTitle(G4int id, const G4String &title)=0
virtual G4double GetH1Width(G4int id) const =0
G4String name
Definition: TRTMaterials.hh:40
virtual G4String GetH1Title(G4int id) const =0
G4VH1Manager(const G4AnalysisManagerState &state)
Definition: G4VH1Manager.cc:34
int G4int
Definition: G4Types.hh:78
virtual G4String GetH1YAxisTitle(G4int id) const =0
virtual G4double GetH1Xmin(G4int id) const =0
bool G4bool
Definition: G4Types.hh:79
G4VH1Manager & operator=(const G4VH1Manager &rhs)
virtual G4int GetH1Nbins(G4int id) const =0
virtual G4double GetH1Xmax(G4int id) const =0
virtual G4int GetH1Id(const G4String &name, G4bool warn=true) const =0
virtual G4bool SetH1XAxisTitle(G4int id, const G4String &title)=0
G4HnManager * fHnManager
virtual G4bool FillH1(G4int id, G4double value, G4double weight=1.0)=0
virtual G4String GetH1XAxisTitle(G4int id) const =0
virtual G4bool SetH1Title(G4int id, const G4String &title)=0
virtual G4bool SetH1(G4int id, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")=0
virtual G4bool ScaleH1(G4int id, G4double factor)=0
double G4double
Definition: G4Types.hh:76
virtual G4bool WriteOnAscii(std::ofstream &output)=0
virtual ~G4VH1Manager()
Definition: G4VH1Manager.cc:42
virtual G4int CreateH1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")=0