ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VH3Manager.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VH3Manager.hh
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 
27 // Base class for H3 manager.
28 //
29 // Author: Ivana Hrivnacova, 24/07/2014 (ivana@ipno.in2p3.fr)
30 
31 #ifndef G4VH3Manager_h
32 #define G4VH3Manager_h 1
33 
34 #include "globals.hh"
35 
36 #include <vector>
37 #include <memory>
38 
39 class G4HnManager;
40 
42 {
43  // Disable using the object managers outside G4VAnalysisManager
44  friend class G4VAnalysisManager;
45  friend class G4VAnalysisReader;
46 
47  public:
49  virtual ~G4VH3Manager() {}
50 
51  // deleted copy constructor & assignment operator
52  G4VH3Manager(const G4VH3Manager& rhs) = delete;
53  G4VH3Manager& operator=(const G4VH3Manager& rhs) = delete;
54 
55  protected:
56  // Methods for handling histograms
57  virtual G4int CreateH3(const G4String& name, const G4String& title,
58  G4int nxbins, G4double xmin, G4double xmax,
59  G4int nybins, G4double ymin, G4double ymax,
60  G4int nzbins, G4double zmin, G4double zmax,
61  const G4String& xunitName = "none",
62  const G4String& yunitName = "none",
63  const G4String& zunitName = "none",
64  const G4String& xfcnName = "none",
65  const G4String& yfcnName = "none",
66  const G4String& zfcnName = "none",
67  const G4String& xbinScheme = "linear",
68  const G4String& ybinScheme = "linear",
69  const G4String& zbinScheme = "linear") = 0;
70 
71  virtual G4int CreateH3(const G4String& name, const G4String& title,
72  const std::vector<G4double>& xedges,
73  const std::vector<G4double>& yedges,
74  const std::vector<G4double>& zedges,
75  const G4String& xunitName = "none",
76  const G4String& yunitName = "none",
77  const G4String& zunitName = "none",
78  const G4String& xfcnName = "none",
79  const G4String& yfcnName = "none",
80  const G4String& zfcnName = "none") = 0;
81 
82  virtual G4bool SetH3(G4int id,
83  G4int nxbins, G4double xmin, G4double xmax,
84  G4int nzbins, G4double zmin, G4double zmax,
85  G4int nybins, G4double ymin, G4double ymax,
86  const G4String& xunitName = "none",
87  const G4String& yunitName = "none",
88  const G4String& zunitName = "none",
89  const G4String& xfcnName = "none",
90  const G4String& yfcnName = "none",
91  const G4String& zfcnName = "none",
92  const G4String& xbinScheme = "linear",
93  const G4String& ybinScheme = "linear",
94  const G4String& zbinScheme = "linear") = 0;
95 
96  virtual G4bool SetH3(G4int id,
97  const std::vector<G4double>& xedges,
98  const std::vector<G4double>& yedges,
99  const std::vector<G4double>& zedges,
100  const G4String& xunitName = "none",
101  const G4String& yunitName = "none",
102  const G4String& zunitName = "none",
103  const G4String& xfcnName = "none",
104  const G4String& yfcnName = "none",
105  const G4String& zfcnName = "none") = 0;
106 
107  virtual G4bool ScaleH3(G4int id, G4double factor) = 0;
108 
109  // Methods to fill histograms
110  virtual G4bool FillH3(G4int id,
111  G4double xvalue, G4double yvalue, G4double zvalue,
112  G4double weight = 1.0) = 0;
113 
114  // Access methods
115  virtual G4int GetH3Id(const G4String& name, G4bool warn = true) const = 0;
116 
117  // Access to H3 parameters
118  virtual G4int GetH3Nxbins(G4int id) const = 0;
119  virtual G4double GetH3Xmin(G4int id) const = 0;
120  virtual G4double GetH3Xmax(G4int id) const = 0;
121  virtual G4double GetH3XWidth(G4int id) const = 0;
122  virtual G4int GetH3Nybins(G4int id) const = 0;
123  virtual G4double GetH3Ymin(G4int id) const = 0;
124  virtual G4double GetH3Ymax(G4int id) const = 0;
125  virtual G4double GetH3YWidth(G4int id) const = 0;
126  virtual G4int GetH3Nzbins(G4int id) const = 0;
127  virtual G4double GetH3Zmin(G4int id) const = 0;
128  virtual G4double GetH3Zmax(G4int id) const = 0;
129  virtual G4double GetH3ZWidth(G4int id) const = 0;
130 
131  // Setters for attributes for plotting
132  virtual G4bool SetH3Title(G4int id, const G4String& title) = 0;
133  virtual G4bool SetH3XAxisTitle(G4int id, const G4String& title) = 0;
134  virtual G4bool SetH3YAxisTitle(G4int id, const G4String& title) = 0;
135  virtual G4bool SetH3ZAxisTitle(G4int id, const G4String& title) = 0;
136 
137  // Access attributes for plotting
138  virtual G4String GetH3Title(G4int id) const = 0;
139  virtual G4String GetH3XAxisTitle(G4int id) const = 0;
140  virtual G4String GetH3YAxisTitle(G4int id) const = 0;
141  virtual G4String GetH3ZAxisTitle(G4int id) const = 0;
142 
143  // Methods to manipulate histograms
144  virtual G4bool WriteOnAscii(std::ofstream& output) = 0;
145 
146  // Access to Hn manager
147  virtual std::shared_ptr<G4HnManager> GetHnManager() = 0;
148 };
149 
150 #endif
151