Geant4-11
G4VP2Manager.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
27// Base class for P2 manager.
28//
29// Author: Ivana Hrivnacova, 24/07/2014 (ivana@ipno.in2p3.fr)
30
31#ifndef G4VP2Manager_h
32#define G4VP2Manager_h 1
33
34#include "globals.hh"
35
36#include <vector>
37#include <memory>
38
39class G4HnManager;
40
42{
43 // Disable using the object managers outside G4VAnalysisManager
44 friend class G4VAnalysisManager;
45 friend class G4VAnalysisReader;
46
47 public:
48 G4VP2Manager() = default;
49 virtual ~G4VP2Manager() = default;
50
51 // deleted copy constructor & assignment operator
52 G4VP2Manager(const G4VP2Manager& rhs) = delete;
53 G4VP2Manager& operator=(const G4VP2Manager& rhs) = delete;
54
55 protected:
56 // Methods for handling histograms
57 virtual G4int CreateP2(const G4String& name, const G4String& title,
58 G4int nxbins, G4double xmin, G4double xmax,
59 G4int nybins, G4double ymin, G4double ymax,
60 G4double zmin = 0, G4double zmax = 0,
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") = 0;
69
70 virtual G4int CreateP2(const G4String& name, const G4String& title,
71 const std::vector<G4double>& xedges,
72 const std::vector<G4double>& yedges,
73 G4double zmin = 0, G4double zmax = 0,
74 const G4String& xunitName = "none",
75 const G4String& yunitName = "none",
76 const G4String& zunitName = "none",
77 const G4String& xfcnName = "none",
78 const G4String& yfcnName = "none",
79 const G4String& zfcnName = "none") = 0;
80
81 virtual G4bool SetP2(G4int id,
82 G4int nxbins, G4double xmin, G4double xmax,
83 G4int nybins, G4double ymin, G4double ymax,
84 G4double zmin = 0, G4double zmax = 0,
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 const G4String& xbinScheme = "linear",
92 const G4String& ybinScheme = "linear") = 0;
93
94 virtual G4bool SetP2(G4int id,
95 const std::vector<G4double>& xedges,
96 const std::vector<G4double>& yedges,
97 G4double zmin = 0, G4double zmax = 0,
98 const G4String& xunitName = "none",
99 const G4String& yunitName = "none",
100 const G4String& zunitName = "none",
101 const G4String& xfcnName = "none",
102 const G4String& yfcnName = "none",
103 const G4String& zfcnName = "none") = 0;
104
105 virtual G4bool ScaleP2(G4int id, G4double factor) = 0;
106
107 // Methods to fill histograms
108 virtual G4bool FillP2(G4int id,
109 G4double xvalue, G4double yvalue, G4double zvalue,
110 G4double weight = 1.0) = 0;
111
112 // Access methods
113 virtual G4int GetP2Id(const G4String& name, G4bool warn = true) const = 0;
114
115 // Access to P2 parameters
116 virtual G4int GetP2Nxbins(G4int id) const = 0;
117 virtual G4double GetP2Xmin(G4int id) const = 0;
118 virtual G4double GetP2Xmax(G4int id) const = 0;
119 virtual G4double GetP2XWidth(G4int id) const = 0;
120 virtual G4int GetP2Nybins(G4int id) const = 0;
121 virtual G4double GetP2Ymin(G4int id) const = 0;
122 virtual G4double GetP2Ymax(G4int id) const = 0;
123 virtual G4double GetP2YWidth(G4int id) const = 0;
124 virtual G4double GetP2Zmin(G4int id) const = 0;
125 virtual G4double GetP2Zmax(G4int id) const = 0;
126
127 // Setters for attributes for plotting
128 virtual G4bool SetP2Title(G4int id, const G4String& title) = 0;
129 virtual G4bool SetP2XAxisTitle(G4int id, const G4String& title) = 0;
130 virtual G4bool SetP2YAxisTitle(G4int id, const G4String& title) = 0;
131 virtual G4bool SetP2ZAxisTitle(G4int id, const G4String& title) = 0;
132
133 // Access attributes for plotting
134 virtual G4String GetP2Title(G4int id) const = 0;
135 virtual G4String GetP2XAxisTitle(G4int id) const = 0;
136 virtual G4String GetP2YAxisTitle(G4int id) const = 0;
137 virtual G4String GetP2ZAxisTitle(G4int id) const = 0;
138
139 // Methods to manipulate histograms
140 virtual G4bool WriteOnAscii(std::ofstream& output) = 0;
141
142 // Access to Hn manager
143 virtual std::shared_ptr<G4HnManager> GetHnManager() = 0;
144};
145
146#endif
147
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
virtual G4bool SetP2(G4int id, const std::vector< G4double > &xedges, const std::vector< G4double > &yedges, 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")=0
G4VP2Manager & operator=(const G4VP2Manager &rhs)=delete
virtual G4bool SetP2Title(G4int id, const G4String &title)=0
virtual G4double GetP2YWidth(G4int id) const =0
virtual G4bool SetP2XAxisTitle(G4int id, const G4String &title)=0
virtual G4double GetP2XWidth(G4int id) const =0
virtual G4bool SetP2ZAxisTitle(G4int id, const G4String &title)=0
virtual G4String GetP2YAxisTitle(G4int id) const =0
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
virtual G4double GetP2Ymax(G4int id) const =0
virtual G4String GetP2Title(G4int id) const =0
virtual G4int GetP2Id(const G4String &name, G4bool warn=true) const =0
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")=0
virtual G4double GetP2Ymin(G4int id) const =0
virtual G4bool WriteOnAscii(std::ofstream &output)=0
virtual ~G4VP2Manager()=default
G4VP2Manager()=default
virtual G4bool SetP2YAxisTitle(G4int id, const G4String &title)=0
virtual G4String GetP2ZAxisTitle(G4int id) const =0
virtual G4String GetP2XAxisTitle(G4int id) const =0
virtual G4int CreateP2(const G4String &name, const G4String &title, const std::vector< G4double > &xedges, const std::vector< G4double > &yedges, 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")=0
virtual G4double GetP2Zmin(G4int id) const =0
virtual G4int GetP2Nxbins(G4int id) const =0
virtual G4bool ScaleP2(G4int id, G4double factor)=0
virtual G4double GetP2Xmax(G4int id) const =0
virtual G4int GetP2Nybins(G4int id) const =0
virtual G4double GetP2Xmin(G4int id) const =0
G4VP2Manager(const G4VP2Manager &rhs)=delete
virtual G4bool FillP2(G4int id, G4double xvalue, G4double yvalue, G4double zvalue, G4double weight=1.0)=0
virtual G4double GetP2Zmax(G4int id) const =0
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")=0
const char * name(G4int ptype)