Geant4-11
G4VP1Manager.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 P1 manager.
28//
29// Author: Ivana Hrivnacova, 24/07/2014 (ivana@ipno.in2p3.fr)
30
31#ifndef G4VP1Manager_h
32#define G4VP1Manager_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
44 friend class G4VAnalysisManager;
45 friend class G4VAnalysisReader;
46
47 public:
48 G4VP1Manager() = default;
49 virtual ~G4VP1Manager() = default;
50
51 // deleted copy constructor & assignment operator
52 G4VP1Manager(const G4VP1Manager& rhs) = delete;
53 G4VP1Manager& operator=(const G4VP1Manager& rhs) = delete;
54
55 protected:
56 // Methods for handling profiles
57 virtual G4int CreateP1(const G4String& name, const G4String& title,
58 G4int nbins, G4double xmin, G4double xmax,
59 G4double ymin = 0, G4double ymax = 0,
60 const G4String& xunitName = "none",
61 const G4String& yunitName = "none",
62 const G4String& xfcnName = "none",
63 const G4String& yfcnName = "none",
64 const G4String& xbinScheme = "linear") = 0;
65 virtual G4int CreateP1(const G4String& name, const G4String& title,
66 const std::vector<G4double>& edges,
67 G4double ymin = 0, G4double ymax = 0,
68 const G4String& xunitName = "none",
69 const G4String& yunitName = "none",
70 const G4String& xfcnName = "none",
71 const G4String& yfcnName = "none") = 0;
72
73 virtual G4bool SetP1(G4int id,
74 G4int nbins, G4double xmin, G4double xmax,
75 G4double ymin = 0, G4double ymax = 0,
76 const G4String& xunitName = "none",
77 const G4String& yunitName = "none",
78 const G4String& xfcnName = "none",
79 const G4String& yfcnName = "none",
80 const G4String& xbinScheme = "linear") = 0;
81 virtual G4bool SetP1(G4int id,
82 const std::vector<G4double>& edges,
83 G4double ymin = 0, G4double ymax = 0,
84 const G4String& xunitName = "none",
85 const G4String& yunitName = "none",
86 const G4String& xfcnName = "none",
87 const G4String& yfcnName = "none") = 0;
88
89 virtual G4bool ScaleP1(G4int id, G4double factor) = 0;
90
91 // Methods to fill profiles
92 virtual G4bool FillP1(G4int id, G4double xvalue, G4double yvalue,
93 G4double weight = 1.0) = 0;
94
95 // Access methods
96 virtual G4int GetP1Id(const G4String& name, G4bool warn = true) const = 0;
97
98 // Access to P1 parameters
99 virtual G4int GetP1Nbins(G4int id) const = 0;
100 virtual G4double GetP1Xmin(G4int id) const = 0;
101 virtual G4double GetP1Xmax(G4int id) const = 0;
102 virtual G4double GetP1XWidth(G4int id) const = 0;
103 virtual G4double GetP1Ymin(G4int id) const = 0;
104 virtual G4double GetP1Ymax(G4int id) const = 0;
105
106 // Setters for attributes for plotting
107 virtual G4bool SetP1Title(G4int id, const G4String& title) = 0;
108 virtual G4bool SetP1XAxisTitle(G4int id, const G4String& title) = 0;
109 virtual G4bool SetP1YAxisTitle(G4int id, const G4String& title) = 0;
110
111 // Access attributes for plotting
112 virtual G4String GetP1Title(G4int id) const = 0;
113 virtual G4String GetP1XAxisTitle(G4int id) const = 0;
114 virtual G4String GetP1YAxisTitle(G4int id) const = 0;
115
116 // Methods to manipulate profiles
117 virtual G4bool WriteOnAscii(std::ofstream& output) = 0;
118
119 // Access to Hn manager
120 virtual std::shared_ptr<G4HnManager> GetHnManager() = 0;
121};
122
123#endif
124
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
virtual G4bool FillP1(G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0)=0
virtual G4double GetP1Ymin(G4int id) const =0
virtual G4String GetP1YAxisTitle(G4int id) const =0
virtual G4double GetP1Xmax(G4int id) const =0
G4VP1Manager(const G4VP1Manager &rhs)=delete
virtual G4int GetP1Id(const G4String &name, G4bool warn=true) const =0
virtual G4int CreateP1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinScheme="linear")=0
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
virtual G4bool SetP1YAxisTitle(G4int id, const G4String &title)=0
G4VP1Manager()=default
virtual G4int CreateP1(const G4String &name, const G4String &title, const std::vector< G4double > &edges, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none")=0
virtual G4bool SetP1XAxisTitle(G4int id, const G4String &title)=0
virtual G4double GetP1Ymax(G4int id) const =0
virtual G4String GetP1XAxisTitle(G4int id) const =0
G4VP1Manager & operator=(const G4VP1Manager &rhs)=delete
virtual G4bool SetP1(G4int id, G4int nbins, G4double xmin, G4double xmax, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinScheme="linear")=0
virtual G4bool ScaleP1(G4int id, G4double factor)=0
virtual ~G4VP1Manager()=default
virtual G4double GetP1Xmin(G4int id) const =0
virtual G4bool WriteOnAscii(std::ofstream &output)=0
virtual G4bool SetP1(G4int id, const std::vector< G4double > &edges, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none")=0
virtual G4String GetP1Title(G4int id) const =0
virtual G4int GetP1Nbins(G4int id) const =0
virtual G4bool SetP1Title(G4int id, const G4String &title)=0
virtual G4double GetP1XWidth(G4int id) const =0
const char * name(G4int ptype)