Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4Analysis Namespace Reference

Functions

void Warn (const G4String &message, const std::string_view inClass, const std::string_view inFunction)
 
G4double GetUnitValue (const G4String &unit)
 
void Tokenize (const G4String &line, std::vector< G4String > &tokens)
 
G4AnalysisOutput GetOutput (const G4String &outputName, G4bool warn=true)
 
size_t GetOutputId (const G4String &outputName, G4bool warn=true)
 
G4String GetOutputName (G4AnalysisOutput outputType)
 
template<typename HT >
G4String GetHnType ()
 
template<typename HT >
G4bool IsProfile ()
 
template<typename T >
std::string ToString (const T &value)
 
template<>
std::string ToString< std::string > (const std::string &value)
 
G4String GetBaseName (const G4String &fileName)
 
G4String GetExtension (const G4String &fileName, const G4String &defaultExtension="")
 
G4String GetHnFileName (const G4String &fileName, const G4String &fileType, const G4String &hnType, const G4String &hnName)
 
G4String GetHnFileName (const G4String &fileName, const G4String &fileType, G4int cycle=0)
 
G4String GetNtupleFileName (const G4String &fileName, const G4String &fileType, const G4String &ntupleName, G4int cycle=0)
 
G4String GetNtupleFileName (const G4String &fileName, const G4String &fileType, G4int ntupleFileNumber, G4int cycle=0)
 
G4String GetTnFileName (const G4String &fileName, const G4String &fileType, G4int cycle=0)
 
G4String GetPlotFileName (const G4String &fileName)
 
G4BinScheme GetBinScheme (const G4String &binSchemeName)
 
void ComputeEdges (G4int nbins, G4double xmin, G4double xmax, G4double unit, G4Fcn fcn, G4BinScheme, std::vector< G4double > &edges)
 
void ComputeEdges (const std::vector< G4double > &edges, G4double unit, G4Fcn fcn, std::vector< G4double > &newEdges)
 
G4Fcn GetFunction (const G4String &fcnName)
 
void Update (G4double &value, const G4HnDimensionInformation &hnInfo)
 
void UpdateValues (G4HnDimension &bins, const G4HnDimensionInformation &hnInfo)
 
void Update (G4HnDimension &bins, const G4HnDimensionInformation &hnInfo)
 
void UpdateTitle (G4String &title, const G4HnDimensionInformation &hnInfo)
 
G4bool CheckMinMax (G4double min, G4double max)
 
G4bool CheckDimension (unsigned int idim, const G4HnDimension &dimension, const G4HnDimensionInformation &info)
 
template<unsigned int DIM>
G4bool CheckDimensions (const std::array< G4HnDimension, DIM > &bins, const std::array< G4HnDimensionInformation, DIM > &hnInfo, G4bool isProfile=false)
 

Variables

constexpr G4int kX { 0 }
 
constexpr G4int kY { 1 }
 
constexpr G4int kZ { 2 }
 
constexpr G4int kInvalidId { -1 }
 
constexpr G4int kVL0 { 0 }
 
constexpr G4int kVL1 { 1 }
 
constexpr G4int kVL2 { 2 }
 
constexpr G4int kVL3 { 3 }
 
constexpr G4int kVL4 { 4 }
 
constexpr unsigned int kDefaultBasketSize = 32000
 
constexpr unsigned int kDefaultBasketEntries = 4000
 
constexpr std::string_view kNamespaceName { "G4Analysis" }
 

Function Documentation

◆ CheckDimension()

G4bool G4Analysis::CheckDimension ( unsigned int  idim,
const G4HnDimension dimension,
const G4HnDimensionInformation info 
)

Definition at line 153 of file G4HnInformation.cc.

155{
156 auto result = true;
157 G4String xyz {"xyz"};
158
159 // Check nbins
160 if ( (dimension.fNBins <= 0) && (info.fBinScheme != G4BinScheme::kUser) ) {
161 Warn("Illegal value of number of " + xyz.substr(idim,1) + " bins: nbins <= 0.",
162 kNamespaceName, "CheckDimension");
163 result = false;
164 }
165
166 // Check edges
167 if ( dimension.fEdges.empty() && (info.fBinScheme == G4BinScheme::kUser) ) {
168 Warn("Illegal value of number of " + xyz.substr(idim,1) + " edges vector size",
169 kNamespaceName, "CheckDimension");
170 result = false;
171 }
172
173 // Check min/max
174 if ( dimension.fMaxValue <= dimension.fMinValue ) {
175 Warn("Illegal value of " + xyz.substr(idim,1) + " (min >= max)",
176 kNamespaceName, "CheckDimension");
177 result = false;
178 }
179
180 // Check function
181 if ( ( info.fFcnName != "none" ) && ( info.fBinScheme != G4BinScheme::kLinear ) ) {
182 Warn("Combining " + xyz.substr(idim,1) + " Function and Binning scheme is not supported.",
183 kNamespaceName, "CheckDimension");
184 result = false;
185 }
186
187 // Check minValue if log binning or log function
188 if ( ( info.fBinScheme == G4BinScheme::kLog ||
189 info.fFcnName == "log" || info.fFcnName == "log10" ) && ( dimension.fMinValue == 0 ) ) {
190 Warn("Illegal value of " + xyz.substr(idim,1) + " (min = 0) with logarithmic function or binning",
191 kNamespaceName, "CheckDimension");
192 result = false;
193 }
194
195 return result;
196}
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)
G4double fMaxValue
std::vector< G4double > fEdges
G4double fMinValue

Referenced by CheckDimensions().

◆ CheckDimensions()

template<unsigned int DIM>
G4bool G4Analysis::CheckDimensions ( const std::array< G4HnDimension, DIM > &  bins,
const std::array< G4HnDimensionInformation, DIM > &  hnInfo,
G4bool  isProfile = false 
)
inline

Definition at line 221 of file G4HnInformation.hh.

225{
226 G4bool result = true;
227
228 // Check bins parameters
229 // (the last dimension has special meaninh for profiles)
230 auto dimToCheck = (isProfile) ? DIM -1 : DIM ;
231 for (unsigned int idim = 0; idim < dimToCheck; ++idim) {
232 result &= CheckDimension(idim, bins[idim], hnInfo[idim]);
233 }
234
235 // Check profile min/max value
236 if (isProfile) {
237 result &= CheckMinMax(bins[DIM-1].fMinValue, bins[DIM-1].fMaxValue);
238 }
239
240 return result;
241}
bool G4bool
Definition: G4Types.hh:86
G4bool CheckDimension(unsigned int idim, const G4HnDimension &dimension, const G4HnDimensionInformation &info)

◆ CheckMinMax()

G4bool G4Analysis::CheckMinMax ( G4double  min,
G4double  max 
)

Definition at line 137 of file G4HnInformation.cc.

138{
139 auto result = true;
140
141 // Do not check default values
142 if ( minValue == 0. && maxValue == 0. ) return result;
143
144 if ( maxValue <= minValue ) {
145 Warn("Illegal value of (minValue >= maxMaxValue)", kNamespaceName, "CheckMinMax");
146 result = false;
147 }
148
149 return result;
150}

Referenced by CheckDimensions().

◆ ComputeEdges() [1/2]

void G4Analysis::ComputeEdges ( const std::vector< G4double > &  edges,
G4double  unit,
G4Fcn  fcn,
std::vector< G4double > &  newEdges 
)

Definition at line 105 of file G4BinScheme.cc.

108{
109// Apply function & unit to defined edges
110
111 if (unit == 0.) {
112 // Should never happen
113 Warn("Illegal unit value (0), 1. will be used instead",
114 kNamespaceName, "ComputeEdges");
115 unit = 1.;
116 }
117
118 for (auto element : edges) {
119 newBins.push_back(fcn(element/unit));
120 }
121}

◆ ComputeEdges() [2/2]

void G4Analysis::ComputeEdges ( G4int  nbins,
G4double  xmin,
G4double  xmax,
G4double  unit,
G4Fcn  fcn,
G4BinScheme  binScheme,
std::vector< G4double > &  edges 
)

Definition at line 50 of file G4BinScheme.cc.

53{
54// Compute edges from parameters
55
56 if ( binScheme == G4BinScheme::kUser ) {
57 // This call should never happen for user bin scheme
58 Warn("There is no need to compute edges for G4BinScheme::kUser\n"
59 "Call is ignored.", kNamespaceName, "GetBinScheme");
60 return;
61 }
62
63 if (unit == 0.) {
64 // Should never happen
65 Warn("Illegal unit value (0), 1. will be used instead",
66 kNamespaceName, "ComputeEdges");
67 unit = 1.;
68 }
69
70 if (nbins == 0) {
71 // Should never happen
72 Warn("Illegal number of nbins value (0), call will be ignored",
73 kNamespaceName, "ComputeEdges");
74 return;
75 }
76
77 // Apply units
78 auto xumin = xmin/unit;
79 auto xumax = xmax/unit;
80
81 if ( binScheme == G4BinScheme::kLinear ) {
82 auto dx = (fcn(xumax) - fcn(xumin) ) / nbins;
83 auto binValue = fcn(xumin);
84 while ( G4int(edges.size()) <= nbins ) { // Loop checking, 23.06.2015, I. Hrivnacova
85 edges.push_back(binValue);
86 binValue += dx;
87 }
88 return;
89 }
90
91 if ( binScheme == G4BinScheme::kLog ) {
92 // do not apply fcn
93 auto dlog = (std::log10(xumax) - std::log10(xumin))/ nbins;
94 auto dx = std::pow(10, dlog);
95 auto binValue = xumin;
96 while ( G4int(edges.size()) <= nbins ) { // Loop checking, 23.06.2015, I. Hrivnacova
97 edges.push_back(binValue);
98 binValue *= dx;
99 }
100 return;
101 }
102}
int G4int
Definition: G4Types.hh:85

Referenced by Update().

◆ GetBaseName()

G4String G4Analysis::GetBaseName ( const G4String fileName)

Definition at line 147 of file G4AnalysisUtilities.cc.

148{
149// Get file base name (without dot)
150
151 G4fs::path filePath(fileName.data());
152 if ( filePath.has_parent_path()) {
153 return filePath.parent_path().string() + "/" + filePath.stem().string();
154 }
155
156 return filePath.stem().string();
157}

Referenced by G4CsvFileManager::CreateNtupleFile(), G4BaseFileManager::GetFullFileName(), GetHnFileName(), GetNtupleFileName(), GetPlotFileName(), GetTnFileName(), G4VFileManager::SetFileName(), and G4NtupleBookingManager::SetFileType().

◆ GetBinScheme()

G4BinScheme G4Analysis::GetBinScheme ( const G4String binSchemeName)

Definition at line 36 of file G4BinScheme.cc.

37{
38 if (binSchemeName == "linear") return G4BinScheme::kLinear;
39 if (binSchemeName == "log") return G4BinScheme::kLog;
40 if (binSchemeName == "user") return G4BinScheme::kUser;
41
42 // No other name is supported
43 Warn("\"" + binSchemeName + "\" binning scheme is not supported.\n"
44 "Linear binning will be applied.", kNamespaceName, "GetBinScheme");
45
47}

◆ GetExtension()

G4String G4Analysis::GetExtension ( const G4String fileName,
const G4String defaultExtension = "" 
)

Definition at line 160 of file G4AnalysisUtilities.cc.

162{
163// Get file base extension (without dot)
164// If fileName is provided without extension, return defaultExtension
165
166 G4fs::path filePath(fileName.data());
167 if ( filePath.has_extension() ) {
168 auto extension = filePath.extension().string();
169 // remove "."
170 return extension.substr(1, extension.length());
171 }
172
173 return defaultExtension;
174}

Referenced by G4CsvFileManager::CreateNtupleFile(), G4GenericFileManager::GetFileManager(), G4VAnalysisManager::GetFileManager(), GetHnFileName(), GetNtupleFileName(), GetTnFileName(), G4GenericAnalysisManager::OpenFileImpl(), G4VFileManager::SetFileName(), G4NtupleBookingManager::SetFileName(), and G4NtupleBookingManager::SetFileType().

◆ GetFunction()

G4Fcn G4Analysis::GetFunction ( const G4String fcnName)

Definition at line 36 of file G4Fcn.cc.

37{
38 // clang-format off
39 G4Fcn fcn = G4FcnIdentity;
40 if ( fcnName != "none" ) {
41 if ( fcnName == "log" ) fcn = std::log;
42 else if ( fcnName == "log10") fcn = std::log10;
43 else if ( fcnName == "exp" ) fcn = std::exp;
44 else {
45 Warn(
46 "\"" + fcnName + "\" function is not supported.\n" +
47 "No function will be applied to histogram values.",
48 kNamespaceName, "GetFunction");
49 }
50 }
51 return fcn;
52 // clang-format on
53}
G4double G4FcnIdentity(G4double value)
Definition: G4Fcn.hh:38
G4double(*)(G4double) G4Fcn
Definition: G4Fcn.hh:35

◆ GetHnFileName() [1/2]

G4String G4Analysis::GetHnFileName ( const G4String fileName,
const G4String fileType,
const G4String hnType,
const G4String hnName 
)

Definition at line 177 of file G4AnalysisUtilities.cc.

182{
183// Compose and return the histogram or profile specific file name:
184// - add _hn_hnName suffix to the file base name
185// - add _vN suffix if cycle > 0
186// - add file extension if not present
187
188 auto name = GetBaseName(fileName);
189
190 // Add _hnType_hnName
191 name.append("_");
192 name.append(hnType);
193 name.append("_");
194 name.append(hnName);
195
196 // Add file extension
197 auto extension = GetExtension(fileName, fileType);
198 if (extension.size() != 0u) {
199 name.append(".");
200 name.append(extension);
201 }
202
203 return name;
204}
G4String GetExtension(const G4String &fileName, const G4String &defaultExtension="")
G4String GetBaseName(const G4String &fileName)

Referenced by G4BaseFileManager::GetHnFileName().

◆ GetHnFileName() [2/2]

G4String G4Analysis::GetHnFileName ( const G4String fileName,
const G4String fileType,
G4int  cycle = 0 
)

Definition at line 207 of file G4AnalysisUtilities.cc.

211{
212// Update Hn file name:
213// - add _vN suffix to the base namer if cycle > 0
214
215 auto name = GetBaseName(fileName);
216
217 // Add cycle number
218 if (cycle > 0) {
219 name.append("_v");
220 name.append(std::to_string(cycle));
221 }
222
223 // Add file extension
224 auto extension = GetExtension(fileName, fileType);
225 if (extension.size() != 0u) {
226 name.append(".");
227 name.append(extension);
228 }
229
230 return name;
231}
const char * name(G4int ptype)

◆ GetHnType()

template<typename HT >
G4String G4Analysis::GetHnType ( )

Definition at line 86 of file G4AnalysisUtilities.hh.

87{
88 // tools::histo::h1d etc.
89 G4String hnTypeLong = HT::s_class();
90
91 // tools::histo::h1d -> h1 etc.
92 return hnTypeLong.substr(14, 2);
93}

◆ GetNtupleFileName() [1/2]

G4String G4Analysis::GetNtupleFileName ( const G4String fileName,
const G4String fileType,
const G4String ntupleName,
G4int  cycle = 0 
)

Definition at line 234 of file G4AnalysisUtilities.cc.

239{
240// Compose and return the ntuple specific file name:
241// - add _nt_ntupleName suffix to the file base name
242// - add _vN suffix if cycle > 0
243// - add _tN suffix if called on thread worker
244// - add file extension if not present
245
246 auto name = GetBaseName(fileName);
247
248 // Add ntupleName
249 name.append("_nt_");
250 name.append(ntupleName);
251
252 // Add cycle number
253 if (cycle > 0) {
254 name.append("_v");
255 name.append(std::to_string(cycle));
256 }
257
258 // Add thread Id to a file name if MT processing
259 if ( ! G4Threading::IsMasterThread() ) {
260 std::ostringstream os;
262 name.append("_t");
263 name.append(os.str());
264 }
265
266 // Add file extension
267 auto extension = GetExtension(fileName, fileType);
268 if (extension.size() != 0u) {
269 name.append(".");
270 name.append(extension);
271 }
272
273 return name;
274}
G4bool IsMasterThread()
Definition: G4Threading.cc:124
G4int G4GetThreadId()
Definition: G4Threading.cc:122

Referenced by G4BaseFileManager::GetNtupleFileName().

◆ GetNtupleFileName() [2/2]

G4String G4Analysis::GetNtupleFileName ( const G4String fileName,
const G4String fileType,
G4int  ntupleFileNumber,
G4int  cycle = 0 
)

Definition at line 277 of file G4AnalysisUtilities.cc.

282{
283// Compose and return the ntuple specific file name:
284// - add _mFN suffix to the file base name where FN = ntupleFileNumber
285// - add _vN suffix if cycle > 0
286// - add file extension if not present
287
288 auto name = GetBaseName(fileName);
289
290 // Add _M followed by ntupleFileNumber
291 std::ostringstream os;
292 os << ntupleFileNumber;
293 name.append("_m");
294 name.append(os.str());
295
296 // Add cycle number
297 if (cycle > 0) {
298 name.append("_v");
299 name.append(std::to_string(cycle));
300 }
301
302 // Add file extension
303 auto extension = GetExtension(fileName, fileType);
304 if (extension.size() != 0u) {
305 name.append(".");
306 name.append(extension);
307 }
308
309 return name;
310}

◆ GetOutput()

G4AnalysisOutput G4Analysis::GetOutput ( const G4String outputName,
G4bool  warn = true 
)

Definition at line 105 of file G4AnalysisUtilities.cc.

106{
107 if (outputName == "csv") return G4AnalysisOutput::kCsv;
108 if (outputName == "hdf5") return G4AnalysisOutput::kHdf5;
109 if (outputName == "root") return G4AnalysisOutput::kRoot;
110 if (outputName == "xml") return G4AnalysisOutput::kXml;
111 if (outputName == "none") return G4AnalysisOutput::kNone;
112
113 if (warn) {
114 Warn("\"" + outputName + "\" output type is not supported.", kNamespaceName, "GetOutput");
115 }
117}

Referenced by G4GenericFileManager::GetFileManager(), G4GenericFileManager::SetDefaultFileType(), and G4NtupleBookingManager::SetFileName().

◆ GetOutputId()

size_t G4Analysis::GetOutputId ( const G4String outputName,
G4bool  warn = true 
)

◆ GetOutputName()

G4String G4Analysis::GetOutputName ( G4AnalysisOutput  outputType)

Definition at line 120 of file G4AnalysisUtilities.cc.

121{
122 switch ( output ) {
124 return "csv";
125 break;
127 return "hdf5";
128 break;
130 return "root";
131 break;
133 return "xml";
134 break;
136 return "none";
137 break;
138 }
139 // should never reach this line
140 Warn("\"" + to_string(static_cast<int>(output)) +
141 "\" output type is not supported.",
142 kNamespaceName, "CheckOutputName");
143 return "none";
144}

Referenced by G4GenericFileManager::CreateNtupleFileManager().

◆ GetPlotFileName()

G4String G4Analysis::GetPlotFileName ( const G4String fileName)

Definition at line 349 of file G4AnalysisUtilities.cc.

350{
351// Generate plot file name for an output file name
352
353 auto name = GetBaseName(fileName);
354
355 // Add .ps extension
356 name.append(".ps");
357
358 return name;
359}

Referenced by G4BaseFileManager::GetPlotFileName().

◆ GetTnFileName()

G4String G4Analysis::GetTnFileName ( const G4String fileName,
const G4String fileType,
G4int  cycle = 0 
)

Definition at line 313 of file G4AnalysisUtilities.cc.

317{
318// Update file base name with the thread suffix:
319// - add _tN suffix if called on thread worker
320// - add file extension if not present
321
322 auto name = GetBaseName(fileName);
323
324 // Add cycle number
325 if (cycle > 0) {
326 name.append("_v");
327 name.append(std::to_string(cycle));
328 }
329
330 // Add thread Id to a file name if MT processing
331 if ( ! G4Threading::IsMasterThread() ) {
332 std::ostringstream os;
334 name.append("_t");
335 name.append(os.str());
336 }
337
338 // Add file extension
339 auto extension = GetExtension(fileName, fileType);
340 if (extension.size() != 0u) {
341 name.append(".");
342 name.append(extension);
343 }
344
345 return name;
346}

◆ GetUnitValue()

G4double G4Analysis::GetUnitValue ( const G4String unit)

Definition at line 75 of file G4AnalysisUtilities.cc.

76{
77 G4double value = 1.;
78 if ( unit != "none" ) {
79 value = G4UnitDefinition::GetValueOf(unit);
80 if ( value == 0. ) value = 1.;
81 }
82 return value;
83}
double G4double
Definition: G4Types.hh:83
static G4double GetValueOf(const G4String &)

◆ IsProfile()

template<typename HT >
G4bool G4Analysis::IsProfile ( )

Definition at line 96 of file G4AnalysisUtilities.hh.

97{
98 // tools::histo::h1d etc.
99 G4String hnTypeLong = HT::s_class();
100
101 // tools::histo::h1d -> h1 etc.
102 return hnTypeLong[14] == 'p';
103}

◆ Tokenize()

void G4Analysis::Tokenize ( const G4String line,
std::vector< G4String > &  tokens 
)

Definition at line 86 of file G4AnalysisUtilities.cc.

87{
88 // Define start values
89 std::string::size_type begIdx = 0;
90 std::string::size_type endIdx = 0;
91 G4String token;
92
93 do {
94 if ( GetToken(line, token, begIdx, endIdx) ) {
95 //G4cout << "got token: '" << token << "'" << G4endl;
96 //G4cout << "beg, end: " << begIdx << ", " << endIdx << G4endl;
97 tokens.push_back(token);
98 }
99 begIdx = endIdx + 1;
100 }
101 while ( endIdx < line.length() ); // Loop checking, 23.06.2015, I. Hrivnacova
102}

Referenced by G4PlotMessenger::SetNewValue(), G4HnMessenger::SetNewValue(), and G4NtupleMessenger::SetNewValue().

◆ ToString()

template<typename T >
std::string G4Analysis::ToString ( const T &  value)
inline

Definition at line 108 of file G4AnalysisUtilities.hh.

109{ return std::to_string(value); }

◆ ToString< std::string >()

template<>
std::string G4Analysis::ToString< std::string > ( const std::string &  value)
inline

Definition at line 113 of file G4AnalysisUtilities.hh.

114{ return value; }

◆ Update() [1/2]

void G4Analysis::Update ( G4double value,
const G4HnDimensionInformation hnInfo 
)

Definition at line 58 of file G4HnInformation.cc.

59{
60// Apply hnInfo to a value
61
62 auto unit = hnInfo.fUnit;
63 auto fcn = hnInfo.fFcn;
64
65 if (unit == 0.) {
66 // Should never happen
67 Warn("Illegal unit value (0), 1. will be used instead",
68 kNamespaceName, "UpdateBins");
69 unit = 1.;
70 }
71 value = fcn(value/unit);
72}

◆ Update() [2/2]

void G4Analysis::Update ( G4HnDimension bins,
const G4HnDimensionInformation hnInfo 
)

Definition at line 95 of file G4HnInformation.cc.

97{
98// Apply hnInfo to bins, compute edges
99
100 auto unit = hnInfo.fUnit;
101 auto fcn = hnInfo.fFcn;
102 auto binScheme = hnInfo.fBinScheme;
103
104 if (binScheme == G4BinScheme::kLinear) {
105 // Compute edges, as they may be needed in the context of 2D or 3D histograms
106 // with log binning in other dimension
108 bins.fNBins, bins.fMinValue, bins.fMaxValue, unit, fcn, binScheme, bins.fEdges);
109
110 // Update min/max Values
111 UpdateValues(bins, hnInfo);
112
113 return;
114 }
115
116 if (binScheme == G4BinScheme::kLog) {
117 // Logarithmic bin scheme
118 // compute edges from parameters
120 bins.fNBins, bins.fMinValue, bins.fMaxValue, unit, fcn, binScheme, bins.fEdges);
121 }
122
123 if (binScheme == G4BinScheme::kUser) {
124 G4Analysis::ComputeEdges(bins.fEdges, unit, fcn, bins.fEdges);
125 }
126}
void UpdateValues(G4HnDimension &bins, const G4HnDimensionInformation &hnInfo)
void ComputeEdges(G4int nbins, G4double xmin, G4double xmax, G4double unit, G4Fcn fcn, G4BinScheme, std::vector< G4double > &edges)
Definition: G4BinScheme.cc:50

◆ UpdateTitle()

void G4Analysis::UpdateTitle ( G4String title,
const G4HnDimensionInformation hnInfo 
)

Definition at line 129 of file G4HnInformation.cc.

130{
131 if ( hnInfo.fFcnName != "none" ) { title += " "; title += hnInfo.fFcnName; title += "("; }
132 if ( hnInfo.fUnitName != "none" ) { title += " ["; title += hnInfo.fUnitName; title += "]";}
133 if ( hnInfo.fFcnName != "none" ) { title += ")"; }
134}

◆ UpdateValues()

void G4Analysis::UpdateValues ( G4HnDimension bins,
const G4HnDimensionInformation hnInfo 
)

Definition at line 75 of file G4HnInformation.cc.

77{
78// Apply hnInfo to bins min and max value
79
80 auto unit = hnInfo.fUnit;
81 auto fcn = hnInfo.fFcn;
82
83 if (unit == 0.) {
84 // Should never happen
85 Warn("Illegal unit value (0), 1. will be used instead",
86 kNamespaceName, "UpdateBins");
87 unit = 1.;
88 }
89 // Update min/max values
90 bins.fMinValue = fcn(bins.fMinValue/unit);
91 bins.fMaxValue = fcn(bins.fMaxValue/unit);
92}

Referenced by Update().

◆ Warn()

void G4Analysis::Warn ( const G4String message,
const std::string_view  inClass,
const std::string_view  inFunction 
)

Definition at line 66 of file G4AnalysisUtilities.cc.

69{
70 auto source = std::string(inClass) + "::" + std::string(inFunction);
71 G4Exception(source.data(), "Analysis_W001", JustWarning, message);
72}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59

Referenced by CheckDimension(), CheckMinMax(), G4PlotManager::CloseFile(), G4ToolsAnalysisManager::CloseFileImpl(), ComputeEdges(), G4CsvFileManager::CreateFileImpl(), G4Hdf5FileManager::CreateFileImpl(), G4RootFileManager::CreateFileImpl(), G4XmlFileManager::CreateFileImpl(), G4RootMainNtupleManager::CreateNtuple(), G4CsvFileManager::CreateNtupleFile(), G4GenericFileManager::CreateNtupleFileManager(), GetBinScheme(), G4GenericFileManager::GetFileManager(), G4VAnalysisManager::GetFileManager(), GetFunction(), G4HnManager::GetHnInformation(), G4VAnalysisReader::GetNtuple(), GetOutput(), GetOutputName(), G4PlotManager::OpenFile(), G4GenericFileManager::OpenFile(), G4Hdf5FileManager::OpenFile(), G4RootFileManager::OpenFile(), G4XmlFileManager::OpenFile(), G4VAnalysisManager::OpenFile(), G4CsvRFileManager::OpenRFile(), G4XmlRFileManager::OpenRFile(), G4RootRFileManager::OpenRFile(), G4VAnalysisReader::ReadH1(), G4VAnalysisReader::ReadH2(), G4VAnalysisReader::ReadH3(), G4VAnalysisReader::ReadP1(), G4VAnalysisReader::ReadP2(), G4GenericFileManager::SetDefaultFileType(), G4VFileManager::SetFileName(), G4NtupleBookingManager::SetFileName(), G4NtupleBookingManager::SetFileType(), G4BaseAnalysisManager::SetFirstId(), G4NtupleBookingManager::SetFirstNtupleColumnId(), G4VFileManager::SetHistoDirectoryName(), G4CsvFileManager::SetHistoDirectoryName(), G4PlotParameters::SetLayout(), G4PlotMessenger::SetNewValue(), G4HnMessenger::SetNewValue(), G4NtupleMessenger::SetNewValue(), G4VFileManager::SetNtupleDirectoryName(), G4CsvFileManager::SetNtupleDirectoryName(), G4RootNtupleFileManager::SetNtupleMerging(), G4PlotParameters::SetStyle(), Update(), UpdateValues(), and G4VAnalysisManager::WriteAscii().

Variable Documentation

◆ kDefaultBasketEntries

constexpr unsigned int G4Analysis::kDefaultBasketEntries = 4000
constexpr

Definition at line 64 of file G4AnalysisUtilities.hh.

◆ kDefaultBasketSize

constexpr unsigned int G4Analysis::kDefaultBasketSize = 32000
constexpr

Definition at line 63 of file G4AnalysisUtilities.hh.

◆ kInvalidId

◆ kNamespaceName

constexpr std::string_view G4Analysis::kNamespaceName { "G4Analysis" }
constexpr

◆ kVL0

constexpr G4int G4Analysis::kVL0 { 0 }
constexpr

Definition at line 58 of file G4AnalysisUtilities.hh.

◆ kVL1

◆ kVL2

◆ kVL3

◆ kVL4

◆ kX

constexpr G4int G4Analysis::kX { 0 }
constexpr

Definition at line 54 of file G4AnalysisUtilities.hh.

Referenced by G4PlotManager::PlotAndWrite().

◆ kY

constexpr G4int G4Analysis::kY { 1 }
constexpr

Definition at line 55 of file G4AnalysisUtilities.hh.

Referenced by G4PlotManager::PlotAndWrite().

◆ kZ

constexpr G4int G4Analysis::kZ { 2 }
constexpr

Definition at line 56 of file G4AnalysisUtilities.hh.

Referenced by G4PlotManager::PlotAndWrite().