ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4HnInformation.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4HnInformation.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
// Data class for the added Hn/Pn information (not available in g4tools).
28
//
29
// Author: Ivana Hrivnacova, 04/07/2012 (ivana@ipno.in2p3.fr)
30
31
#ifndef G4HnInformation_h
32
#define G4HnInformation_h 1
33
34
#include "
globals.hh
"
35
#include "
G4Fcn.hh
"
36
#include "
G4BinScheme.hh
"
37
#include "
G4AnalysisUtilities.hh
"
38
39
// The additional Hn information per dimension
40
41
struct
G4HnDimensionInformation
42
{
43
G4HnDimensionInformation
()
44
:
fUnitName
(),
45
fFcnName
(),
46
fUnit
(),
47
fFcn
(nullptr),
48
fBinScheme
(
G4BinScheme
::kLinear)
49
{}
50
51
G4HnDimensionInformation
(
52
const
G4String
& unitName,
53
const
G4String
& fcnName,
54
G4double
unit,
55
G4Fcn
fcn,
56
G4BinScheme
binScheme)
57
:
fUnitName
(unitName),
58
fFcnName
(fcnName),
59
fUnit
(unit),
60
fFcn
(fcn),
61
fBinScheme
(binScheme)
62
{}
63
64
G4HnDimensionInformation
(
const
G4HnDimensionInformation
& rhs)
65
:
fUnitName
(rhs.
fUnitName
),
66
fFcnName
(rhs.
fFcnName
),
67
fUnit
(rhs.
fUnit
),
68
fFcn
(rhs.
fFcn
),
69
fBinScheme
(rhs.
fBinScheme
)
70
{}
71
72
G4HnDimensionInformation
&
operator=
(
const
G4HnDimensionInformation
& rhs)
73
{
74
// check assignment to self
75
if
(
this
== &rhs)
return
*
this
;
76
77
fUnitName
= rhs.
fUnitName
;
78
fFcnName
= rhs.
fFcnName
;
79
fUnit
= rhs.
fUnit
;
80
fFcn
= rhs.
fFcn
;
81
fBinScheme
= rhs.
fBinScheme
;
82
83
return
*
this
;
84
}
85
86
//G4String fName;
87
G4String
fUnitName
;
88
G4String
fFcnName
;
89
G4double
fUnit
;
90
G4Fcn
fFcn
;
91
G4BinScheme
fBinScheme
;
92
};
93
94
class
G4HnInformation
95
{
96
public
:
97
G4HnInformation
(
const
G4String
&
name
,
G4int
nofDimensions)
98
:
fName
(name),
99
fHnDimensionInformations
(),
100
fIsLogAxis
({
false
,
false
,
false
}),
101
fActivation
(
true
),
102
fAscii
(
false
),
103
fPlotting
(
false
) {
fHnDimensionInformations
.reserve(nofDimensions); }
104
105
// Deleted default constructor
106
G4HnInformation
() =
delete
;
107
108
// Set methods
109
void
AddHnDimensionInformation
(
110
const
G4HnDimensionInformation
& hnDimensionInformation);
111
void
AddDimension
(
112
const
G4String
& unitName,
const
G4String
& fcnName,
G4BinScheme
binScheme);
113
void
SetDimension
(
G4int
dimension,
114
const
G4String
& unitName,
const
G4String
& fcnName,
G4BinScheme
binScheme);
115
void
SetIsLogAxis
(
G4int
axis,
G4bool
isLog);
116
void
SetActivation
(
G4bool
activation);
117
void
SetAscii
(
G4bool
ascii);
118
void
SetPlotting
(
G4bool
plotting);
119
120
// Get methods
121
G4String
GetName
()
const
;
122
G4HnDimensionInformation
*
GetHnDimensionInformation
(
G4int
dimension);
123
G4bool
GetIsLogAxis
(
G4int
axis)
const
;
124
G4bool
GetActivation
()
const
;
125
G4bool
GetAscii
()
const
;
126
G4bool
GetPlotting
()
const
;
127
128
private
:
129
// Data members
130
G4String
fName
;
131
std::vector<G4HnDimensionInformation>
fHnDimensionInformations
;
132
std::vector<G4bool>
fIsLogAxis
;
133
G4bool
fActivation
;
134
G4bool
fAscii
;
135
G4bool
fPlotting
;
136
};
137
138
// inline functions
139
140
inline
void
G4HnInformation::AddHnDimensionInformation
(
141
const
G4HnDimensionInformation
& hnDimensionInformation)
142
{
fHnDimensionInformations
.push_back(hnDimensionInformation); }
143
144
inline
void
G4HnInformation::AddDimension
(
145
const
G4String
& unitName,
const
G4String
& fcnName,
G4BinScheme
binScheme)
146
{
147
auto
unit =
G4Analysis::GetUnitValue
(unitName);
148
auto
fcn =
G4Analysis::GetFunction
(fcnName);
149
fHnDimensionInformations
.push_back(
150
G4HnDimensionInformation
(unitName, fcnName, unit, fcn, binScheme));
151
}
152
153
inline
void
G4HnInformation::SetDimension
(
G4int
dimension,
154
const
G4String
& unitName,
const
G4String
& fcnName,
G4BinScheme
binScheme)
155
{
156
auto
info
=
GetHnDimensionInformation
(dimension);
157
auto
unit =
G4Analysis::GetUnitValue
(unitName);
158
auto
fcn =
G4Analysis::GetFunction
(fcnName);
159
info
->fUnitName = unitName;
160
info
->fFcnName = fcnName;
161
info
->fUnit = unit;
162
info
->fFcn = fcn;
163
info
->fBinScheme = binScheme;
164
}
165
166
inline
void
G4HnInformation::SetIsLogAxis
(
G4int
axis,
G4bool
isLog)
167
{
fIsLogAxis
[axis] = isLog; }
168
169
inline
void
G4HnInformation::SetActivation
(
G4bool
activation)
170
{
fActivation
= activation; }
171
172
inline
void
G4HnInformation::SetAscii
(
G4bool
ascii)
173
{
fAscii
= ascii; }
174
175
inline
void
G4HnInformation::SetPlotting
(
G4bool
plotting)
176
{
fPlotting
= plotting; }
177
178
inline
G4String
G4HnInformation::GetName
()
const
179
{
return
fName
; }
180
181
inline
G4HnDimensionInformation
*
G4HnInformation::GetHnDimensionInformation
(
G4int
dimension)
182
{
return
&(
fHnDimensionInformations
[dimension]); }
183
184
inline
G4bool
G4HnInformation::GetIsLogAxis
(
G4int
axis)
const
185
{
return
fIsLogAxis
[axis]; }
186
187
inline
G4bool
G4HnInformation::GetActivation
()
const
188
{
return
fActivation
; }
189
190
inline
G4bool
G4HnInformation::GetAscii
()
const
191
{
return
fAscii
; }
192
193
inline
G4bool
G4HnInformation::GetPlotting
()
const
194
{
return
fPlotting
; }
195
196
#endif
geant4
tree
geant4-10.6-release
source
analysis
management
include
G4HnInformation.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:11
using
1.8.2 with
ECCE GitHub integration