Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Analysis Namespace Reference

Typedefs

using G4ToolsBaseHisto = tools::histo::base_histo< double, unsigned int, unsigned int, double, double >
 

Functions

G4ToolsAnalysisManagerManagerInstance (const G4String &outputType)
 
G4int GetNbins (const G4ToolsBaseHisto &baseHisto, G4int dimension)
 
G4double GetMin (const G4ToolsBaseHisto &baseHisto, G4int dimension)
 
G4double GetMax (const G4ToolsBaseHisto &baseHisto, G4int dimension)
 
G4double GetWidth (const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
 
G4bool SetTitle (G4ToolsBaseHisto &baseHisto, const G4String &title)
 
G4bool SetAxisTitle (G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)
 
G4String GetTitle (const G4ToolsBaseHisto &baseHisto)
 
G4String GetAxisTitle (const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
 
G4bool CheckNbins (G4int nbins)
 
G4bool CheckMinMax (G4double xmin, G4double xmax, const G4String &fcnName="none", const G4String &binSchemeName="linear")
 
G4bool CheckEdges (const std::vector< G4double > &edges)
 
G4bool CheckName (const G4String &name, const G4String &objectType)
 
G4double GetUnitValue (const G4String &unit)
 
void UpdateTitle (G4String &title, const G4String &unitName, const G4String &fcnName)
 
void Tokenize (const G4String &line, std::vector< G4String > &tokens)
 
template<typename T , typename... Args>
std::unique_ptr< T > make_unique (Args &&... args)
 
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 ()
 
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 GetNtupleFileName (const G4String &fileName, const G4String &fileType, const G4String &ntupleName)
 
G4String GetNtupleFileName (const G4String &fileName, const G4String &fileType, G4int ntupleFileNumber)
 
G4String GetTnFileName (const G4String &fileName, const G4String &fileType)
 
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)
 

Variables

const G4int kX = 0
 
const G4int kY = 1
 
const G4int kZ = 2
 
const G4int kInvalidId = -1
 

Typedef Documentation

◆ G4ToolsBaseHisto

using G4Analysis::G4ToolsBaseHisto = typedef tools::histo::base_histo<double, unsigned int, unsigned int, double, double>

Definition at line 41 of file G4BaseHistoUtilities.hh.

Function Documentation

◆ CheckEdges()

G4bool G4Analysis::CheckEdges ( const std::vector< G4double > &  edges)

Definition at line 120 of file G4AnalysisUtilities.cc.

121{
122 if ( edges.size() <= 1 ) {
123 G4ExceptionDescription description;
124 description
125 << " Illegal edges vector (size <= 1)" << G4endl;
126 G4Exception("G4VAnalysisManager::CheckEdges",
127 "Analysis_W013", JustWarning, description);
128 return false;
129 }
130 else
131 return true;
132
133}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
#define G4endl
Definition: G4ios.hh:57

Referenced by G4VAnalysisManager::CreateH1(), G4VAnalysisManager::CreateH2(), G4VAnalysisManager::CreateH3(), G4VAnalysisManager::CreateP1(), G4VAnalysisManager::CreateP2(), G4VAnalysisManager::SetH1(), G4VAnalysisManager::SetH2(), G4VAnalysisManager::SetH3(), G4VAnalysisManager::SetP1(), and G4VAnalysisManager::SetP2().

◆ CheckMinMax()

G4bool G4Analysis::CheckMinMax ( G4double  xmin,
G4double  xmax,
const G4String fcnName = "none",
const G4String binSchemeName = "linear" 
)

Definition at line 78 of file G4AnalysisUtilities.cc.

80{
81 auto result = true;
82
83 if ( xmax <= xmin ) {
84 G4ExceptionDescription description;
85 description
86 << " Illegal values of (xmin >= xmax)" << G4endl;
87 G4Exception("G4VAnalysisManager::CheckMinMax",
88 "Analysis_W013", JustWarning, description);
89
90 result = false;
91 }
92
93 if ( ( fcnName != "none" ) && ( binSchemeName != "linear" ) ) {
94 G4ExceptionDescription description;
95 description
96 << " Combining Function and Binning scheme is not supported."
97 << G4endl;
98 G4Exception("G4VAnalysisManager::CheckMinMax",
99 "Analysis_W013", JustWarning, description);
100
101 result = false;
102 }
103
104 if ( ( GetBinScheme(binSchemeName) == G4BinScheme::kLog ||
105 fcnName == "log" || fcnName == "log10" ) && ( xmin == 0 ) ) {
106 G4ExceptionDescription description;
107 description
108 << " Illegal value of (xmin = 0) with logarithmic function or binning"
109 << G4endl;
110 G4Exception("G4VAnalysisManager::CheckMinMax",
111 "Analysis_W013", JustWarning, description);
112
113 result = false;
114 }
115
116 return result;
117}
G4BinScheme GetBinScheme(const G4String &binSchemeName)
Definition: G4BinScheme.cc:35

Referenced by G4VAnalysisManager::CreateH1(), G4VAnalysisManager::CreateH2(), G4VAnalysisManager::CreateH3(), G4VAnalysisManager::CreateP1(), G4VAnalysisManager::CreateP2(), G4VAnalysisManager::SetH1(), G4VAnalysisManager::SetH2(), G4VAnalysisManager::SetH3(), G4VAnalysisManager::SetP1(), and G4VAnalysisManager::SetP2().

◆ CheckName()

G4bool G4Analysis::CheckName ( const G4String name,
const G4String objectType 
)

Definition at line 136 of file G4AnalysisUtilities.cc.

137{
138 if ( ! name.size() ) {
139 G4ExceptionDescription description;
140 description
141 << " Empty " << objectType << " name is not allowed." << G4endl
142 << " " << objectType << " was not created." << G4endl;
143 G4Exception("G4VAnalysisManager::CheckName",
144 "Analysis_W013", JustWarning, description);
145 return false;
146 }
147 else
148 return true;
149}

Referenced by G4VAnalysisManager::CreateH1(), G4VAnalysisManager::CreateH2(), G4VAnalysisManager::CreateH3(), G4VAnalysisManager::CreateNtuple(), G4VAnalysisManager::CreateNtupleDColumn(), G4VAnalysisManager::CreateNtupleFColumn(), G4VAnalysisManager::CreateNtupleIColumn(), G4VAnalysisManager::CreateNtupleSColumn(), G4VAnalysisManager::CreateP1(), and G4VAnalysisManager::CreateP2().

◆ CheckNbins()

G4bool G4Analysis::CheckNbins ( G4int  nbins)

Definition at line 62 of file G4AnalysisUtilities.cc.

63{
64 if ( nbins <= 0 ) {
65 G4ExceptionDescription description;
66 description
67 << " Illegal value of number of bins: nbins <= 0" << G4endl;
68 G4Exception("G4VAnalysisManager::CheckNbins",
69 "Analysis_W013", JustWarning, description);
70 return false;
71 }
72 else
73 return true;
74}

Referenced by G4VAnalysisManager::CreateH1(), G4VAnalysisManager::CreateH2(), G4VAnalysisManager::CreateH3(), G4VAnalysisManager::CreateP1(), G4VAnalysisManager::CreateP2(), G4VAnalysisManager::SetH1(), G4VAnalysisManager::SetH2(), G4VAnalysisManager::SetH3(), G4VAnalysisManager::SetP1(), and G4VAnalysisManager::SetP2().

◆ ComputeEdges() [1/2]

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

Definition at line 97 of file G4BinScheme.cc.

100{
101// Apply function to defined edges
102
103 for (auto element : edges) {
104 newBins.push_back(fcn(element/unit));
105 }
106}

◆ 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 55 of file G4BinScheme.cc.

58{
59// Compute edges from parameters
60
61 // Apply units
62 auto xumin = xmin/unit;
63 auto xumax = xmax/unit;
64
65 if ( binScheme == G4BinScheme::kLinear ) {
66 auto dx = (fcn(xumax) - fcn(xumin) ) / nbins;
67 auto binValue = fcn(xumin);
68 while ( G4int(edges.size()) <= nbins ) { // Loop checking, 23.06.2015, I. Hrivnacova
69 edges.push_back(binValue);
70 binValue += dx;
71 }
72 }
73 else if ( binScheme == G4BinScheme::kLog ) {
74 // do not apply fcn
75 auto dlog
76 = (std::log10(xumax) - std::log10(xumin))/ nbins;
77 auto dx = std::pow(10, dlog);
78 auto binValue = xumin;
79 while ( G4int(edges.size()) <= nbins ) { // Loop checking, 23.06.2015, I. Hrivnacova
80 edges.push_back(binValue);
81 binValue *= dx;
82 }
83 }
84 else if ( binScheme == G4BinScheme::kUser ) {
85 // This should never happen, but let's make sure about it
86 // by issuing a warning
87 G4ExceptionDescription description;
88 description
89 << " User binning scheme setting was ignored." << G4endl
90 << " Linear binning will be applied with given (nbins, xmin, xmax) values";
91 G4Exception("G4Analysis::ComputeEdges",
92 "Analysis_W013", JustWarning, description);
93 }
94}
int G4int
Definition: G4Types.hh:85

◆ GetAxisTitle()

G4String G4Analysis::GetAxisTitle ( const G4ToolsBaseHisto baseHisto,
G4int  dimension,
const G4String hnType 
)

Definition at line 109 of file G4BaseHistoUtilities.cc.

111{
112 G4String title;
113 G4bool result = false;
114 if ( dimension == kX ) {
115 result = baseHisto.annotation(tools::histo::key_axis_x_title(), title);
116 }
117 else if ( dimension == kY ) {
118 result = baseHisto.annotation(tools::histo::key_axis_y_title(), title);
119 }
120 else if ( dimension == kZ ) {
121 result = baseHisto.annotation(tools::histo::key_axis_z_title(), title);
122 }
123
124 if ( ! result ) {
125 G4String axes("xyz");
126 G4String axis = axes(dimension, 1);
127 G4String functionName = "Get";
128 functionName += hnType;
129 functionName += axis;
130 functionName += "Title";
131 G4ExceptionDescription description;
132 description << " Failed to get " << axis << " axis " << hnType << " title.";
133 G4Exception(functionName, "Analysis_W014", JustWarning, description);
134 return "";
135 }
136
137 return title;
138}
bool G4bool
Definition: G4Types.hh:86

Referenced by G4H1ToolsManager::GetH1XAxisTitle(), G4H1ToolsManager::GetH1YAxisTitle(), G4H2ToolsManager::GetH2XAxisTitle(), G4H2ToolsManager::GetH2YAxisTitle(), G4H2ToolsManager::GetH2ZAxisTitle(), G4H3ToolsManager::GetH3XAxisTitle(), G4H3ToolsManager::GetH3YAxisTitle(), G4H3ToolsManager::GetH3ZAxisTitle(), G4P1ToolsManager::GetP1XAxisTitle(), G4P1ToolsManager::GetP1YAxisTitle(), G4P2ToolsManager::GetP2XAxisTitle(), G4P2ToolsManager::GetP2YAxisTitle(), and G4P2ToolsManager::GetP2ZAxisTitle().

◆ GetBaseName()

G4String G4Analysis::GetBaseName ( const G4String fileName)

Definition at line 240 of file G4AnalysisUtilities.cc.

241{
242// Get file base name (without dot)
243
244 G4String name = fileName;
245 if ( name.rfind(".") != std::string::npos ) {
246 name = name.substr(0, name.rfind("."));
247 }
248 return name;
249}

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

◆ GetBinScheme()

G4BinScheme G4Analysis::GetBinScheme ( const G4String binSchemeName)

Definition at line 35 of file G4BinScheme.cc.

36{
38 if ( binSchemeName != "linear" ) {
39 if ( binSchemeName == "log" )
40 binScheme = G4BinScheme::kLog;
41 else {
42 // There is no name associated with G4BinScheme::kUser
43 G4ExceptionDescription description;
44 description
45 << " \"" << binSchemeName << "\" binning scheme is not supported." << G4endl
46 << " " << "Linear binning will be applied.";
47 G4Exception("G4Analysis::GetBinScheme",
48 "Analysis_W013", JustWarning, description);
49 }
50 }
51 return binScheme;
52}
G4BinScheme
Definition: G4BinScheme.hh:39

Referenced by CheckMinMax(), G4H1ToolsManager::CreateH1(), G4H2ToolsManager::CreateH2(), G4H3ToolsManager::CreateH3(), G4P1ToolsManager::CreateP1(), G4P2ToolsManager::CreateP2(), G4H1ToolsManager::SetH1(), G4H2ToolsManager::SetH2(), G4H3ToolsManager::SetH3(), G4P1ToolsManager::SetP1(), and G4P2ToolsManager::SetP2().

◆ GetExtension()

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

Definition at line 252 of file G4AnalysisUtilities.cc.

254{
255// Get file base extension (without dot)
256// If fileName is provided without extension, return defaultExtension
257
258 G4String extension;
259 if ( fileName.rfind(".") != std::string::npos ) {
260 extension = fileName.substr(fileName.rfind(".") + 1);
261 }
262 if ( ! extension.size() ) {
263 extension = defaultExtension;
264 }
265 return extension;
266}

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

◆ GetFunction()

G4Fcn G4Analysis::GetFunction ( const G4String fcnName)

Definition at line 35 of file G4Fcn.cc.

36{
37 G4Fcn fcn = G4FcnIdentity;
38 if ( fcnName != "none" ) {
39 if ( fcnName == "log" ) fcn = std::log;
40 else if ( fcnName == "log10") fcn = std::log10;
41 else if ( fcnName == "exp" ) fcn = std::exp;
42 else {
43 G4ExceptionDescription description;
44 description
45 << " \"" << fcnName << "\" function is not supported." << G4endl
46 << " " << "No function will be applied to histogram values.";
47 G4Exception("G4Analysis::GetFunction",
48 "Analysis_W013", JustWarning, description);
49 }
50 }
51 return fcn;
52}
G4double G4FcnIdentity(G4double value)
Definition: G4Fcn.hh:38
G4double(*)(G4double) G4Fcn
Definition: G4Fcn.hh:35

Referenced by G4HnInformation::AddDimension(), and G4HnInformation::SetDimension().

◆ GetHnFileName()

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

Definition at line 269 of file G4AnalysisUtilities.cc.

274{
275// Compose and return the histogram or profile specific file name:
276// - add _hn_hnName suffix to the file base name
277// - add file extension if not present
278
279 auto name = GetBaseName(fileName);
280
281 // Add _hnType_hnName
282 name.append("_");
283 name.append(hnType);
284 name.append("_");
285 name.append(hnName);
286
287 // Add file extension
288 auto extension = GetExtension(fileName, fileType);
289 if ( extension.size() ) {
290 name.append(".");
291 name.append(extension);
292 }
293
294 return name;
295}
G4String GetExtension(const G4String &fileName, const G4String &defaultExtension="")
G4String GetBaseName(const G4String &fileName)

Referenced by G4BaseFileManager::GetHnFileName().

◆ GetHnType()

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

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.substr(14, 2);
103}

◆ GetMax()

◆ GetMin()

◆ GetNbins()

◆ GetNtupleFileName() [1/2]

G4String G4Analysis::GetNtupleFileName ( const G4String fileName,
const G4String fileType,
const G4String ntupleName 
)

Definition at line 298 of file G4AnalysisUtilities.cc.

302{
303// Compose and return the ntuple specific file name:
304// - add _nt_ntupleName suffix to the file base name
305// - add _tN suffix if called on thread worker
306// - add file extension if not present
307
308 auto name = GetBaseName(fileName);
309
310 // Add ntupleName
311 name.append("_nt_");
312 name.append(ntupleName);
313
314 // Add thread Id to a file name if MT processing
315 if ( ! G4Threading::IsMasterThread() ) {
316 std::ostringstream os;
318 name.append("_t");
319 name.append(os.str());
320 }
321
322 // Add file extension
323 auto extension = GetExtension(fileName, fileType);
324 if ( extension.size() ) {
325 name.append(".");
326 name.append(extension);
327 }
328
329 return name;
330}
const char * name(G4int ptype)
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 
)

Definition at line 333 of file G4AnalysisUtilities.cc.

337{
338// Compose and return the ntuple specific file name:
339// - add _mFN suffix to the file base name where FN = ntupleFileNumber
340// - add file extension if not present
341
342 auto name = GetBaseName(fileName);
343
344 // Add _M followed by ntupleFileNumber
345 std::ostringstream os;
346 os << ntupleFileNumber;
347 name.append("_m");
348 name.append(os.str());
349
350 // Add file extension
351 auto extension = GetExtension(fileName, fileType);
352 if ( extension.size() ) {
353 name.append(".");
354 name.append(extension);
355 }
356
357 return name;
358}

◆ GetOutput()

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

Definition at line 192 of file G4AnalysisUtilities.cc.

192 {
193 if ( outputName == "csv" ) { return G4AnalysisOutput::kCsv; }
194 else if ( outputName == "hdf5" ) { return G4AnalysisOutput::kHdf5; }
195 else if ( outputName == "root" ) { return G4AnalysisOutput::kRoot; }
196 else if ( outputName == "xml" ) { return G4AnalysisOutput::kXml; }
197 else if ( outputName == "none" ) { return G4AnalysisOutput::kNone; }
198 else {
199 if (warn) {
200 G4ExceptionDescription description;
201 description
202 << " \"" << outputName << "\" output type is not supported." << G4endl;
203 G4Exception("G4Analysis::GetOutputType",
204 "Analysis_W051", JustWarning, description);
205 }
207 }
208}

Referenced by ManagerInstance(), 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 211 of file G4AnalysisUtilities.cc.

211 {
212 switch ( output ) {
214 return "csv";
215 break;
217 return "hdf5";
218 break;
220 return "root";
221 break;
223 return "xml";
224 break;
226 return "none";
227 break;
228 }
229 // should never reach this line
230 G4ExceptionDescription description;
231 description
232 << " \"" << static_cast<int>(output) << "\" is not handled." << G4endl
233 << " " << "none type will be used.";
234 G4Exception("G4Analysis::GetOutputName",
235 "Analysis_W051", JustWarning, description);
236 return "none";
237}

Referenced by G4GenericFileManager::CreateNtupleFileManager().

◆ GetPlotFileName()

G4String G4Analysis::GetPlotFileName ( const G4String fileName)

Definition at line 390 of file G4AnalysisUtilities.cc.

391{
392// Generate plot file name for an output file name
393
394 auto name = GetBaseName(fileName);
395
396 // Add .ps extension
397 name.append(".ps");
398
399 return name;
400}

Referenced by G4BaseFileManager::GetPlotFileName().

◆ GetTitle()

G4String G4Analysis::GetTitle ( const G4ToolsBaseHisto baseHisto)

◆ GetTnFileName()

G4String G4Analysis::GetTnFileName ( const G4String fileName,
const G4String fileType 
)

Definition at line 361 of file G4AnalysisUtilities.cc.

364{
365// Update file base name with the thread suffix:
366// - add _tN suffix if called on thread worker
367// - add file extension if not present
368
369 auto name = GetBaseName(fileName);
370
371 // Add thread Id to a file name if MT processing
372 if ( ! G4Threading::IsMasterThread() ) {
373 std::ostringstream os;
375 name.append("_t");
376 name.append(os.str());
377 }
378
379 // Add file extension
380 auto extension = GetExtension(fileName, fileType);
381 if ( extension.size() ) {
382 name.append(".");
383 name.append(extension);
384 }
385
386 return name;
387}

◆ GetUnitValue()

G4double G4Analysis::GetUnitValue ( const G4String unit)

Definition at line 152 of file G4AnalysisUtilities.cc.

153{
154 G4double value = 1.;
155 if ( unit != "none" ) {
156 value = G4UnitDefinition::GetValueOf(unit);
157 if ( value == 0. ) value = 1.;
158 }
159 return value;
160}
double G4double
Definition: G4Types.hh:83
static G4double GetValueOf(const G4String &)

Referenced by G4HnInformation::AddDimension(), G4HnInformation::SetDimension(), G4H1Messenger::SetNewValue(), G4H2Messenger::SetNewValue(), G4H3Messenger::SetNewValue(), G4P1Messenger::SetNewValue(), and G4P2Messenger::SetNewValue().

◆ GetWidth()

G4double G4Analysis::GetWidth ( const G4ToolsBaseHisto baseHisto,
G4int  dimension,
const G4String hnType 
)

Definition at line 60 of file G4BaseHistoUtilities.cc.

62{
63 auto nbins = baseHisto.get_axis(dimension).bins();
64 if ( ! nbins ) {
65 G4String functionName = "Get";
66 functionName += hnType;
67 functionName += "Width";
68 G4ExceptionDescription description;
69 description << " nbins = 0 (for " << hnType << ").";
70 G4Exception(functionName, "Analysis_W014", JustWarning, description);
71 return 0.;
72 }
73
74 return ( baseHisto.get_axis(dimension).upper_edge()
75 - baseHisto.get_axis(dimension).lower_edge() )/nbins;
76}

Referenced by G4H1ToolsManager::GetH1Width(), G4H2ToolsManager::GetH2XWidth(), G4H2ToolsManager::GetH2YWidth(), G4H3ToolsManager::GetH3XWidth(), G4H3ToolsManager::GetH3YWidth(), G4H3ToolsManager::GetH3ZWidth(), G4P1ToolsManager::GetP1XWidth(), G4P2ToolsManager::GetP2XWidth(), and G4P2ToolsManager::GetP2YWidth().

◆ make_unique()

template<typename T , typename... Args>
std::unique_ptr< T > G4Analysis::make_unique ( Args &&...  args)

Definition at line 84 of file G4AnalysisUtilities.hh.

85{
86 return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
87}

◆ ManagerInstance()

G4ToolsAnalysisManager * G4Analysis::ManagerInstance ( const G4String outputType)

Definition at line 56 of file g4analysis.cc.

57{
58 // Get output type
59 G4AnalysisOutput outputType = GetOutput(outputName, false);
60 if ( outputType == G4AnalysisOutput::kNone ) {
61 DoFatalException(outputName);
62 return nullptr;
63 }
64
65 // Create the analysis manager of a selected type
66 switch ( outputType ) {
69 break;
70#ifdef TOOLS_USE_HDF5
73 break;
74#endif
77 break;
80 break;
82 default:
83 break;
84 }
85
86 // should never reach this line
87 DoFatalException(outputName);
88 return nullptr;
89}
G4AnalysisOutput
static G4CsvAnalysisManager * Instance()
static G4Hdf5AnalysisManager * Instance()
static G4RootAnalysisManager * Instance()
static G4XmlAnalysisManager * Instance()
G4AnalysisOutput GetOutput(const G4String &outputName, G4bool warn=true)

◆ SetAxisTitle()

G4bool G4Analysis::SetAxisTitle ( G4ToolsBaseHisto baseHisto,
G4int  dimension,
const G4String title 
)

Definition at line 85 of file G4BaseHistoUtilities.cc.

87{
88 if ( dimension == kX ) {
89 baseHisto.add_annotation(tools::histo::key_axis_x_title(), title);
90 }
91 else if ( dimension == kY ) {
92 baseHisto.add_annotation(tools::histo::key_axis_y_title(), title);
93 }
94 else if ( dimension == kZ ) {
95 baseHisto.add_annotation(tools::histo::key_axis_z_title(), title);
96 }
97
98 return true;
99}

Referenced by G4H1ToolsManager::SetH1XAxisTitle(), G4H1ToolsManager::SetH1YAxisTitle(), G4H2ToolsManager::SetH2XAxisTitle(), G4H2ToolsManager::SetH2YAxisTitle(), G4H2ToolsManager::SetH2ZAxisTitle(), G4H3ToolsManager::SetH3XAxisTitle(), G4H3ToolsManager::SetH3YAxisTitle(), G4H3ToolsManager::SetH3ZAxisTitle(), G4P1ToolsManager::SetP1XAxisTitle(), G4P1ToolsManager::SetP1YAxisTitle(), G4P2ToolsManager::SetP2XAxisTitle(), G4P2ToolsManager::SetP2YAxisTitle(), and G4P2ToolsManager::SetP2ZAxisTitle().

◆ SetTitle()

G4bool G4Analysis::SetTitle ( G4ToolsBaseHisto baseHisto,
const G4String title 
)

◆ Tokenize()

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

Definition at line 173 of file G4AnalysisUtilities.cc.

174{
175 // Define start values
176 std::string::size_type begIdx = 0;
177 std::string::size_type endIdx = 0;
178 G4String token;
179
180 do {
181 if ( GetToken(line, token, begIdx, endIdx) ) {
182 //G4cout << "got token: '" << token << "'" << G4endl;
183 //G4cout << "beg, end: " << begIdx << ", " << endIdx << G4endl;
184 tokens.push_back(token);
185 }
186 begIdx = endIdx + 1;
187 }
188 while ( endIdx < line.length() ); // Loop checking, 23.06.2015, I. Hrivnacova
189}

Referenced by G4H1Messenger::SetNewValue(), G4H2Messenger::SetNewValue(), G4H3Messenger::SetNewValue(), G4HnMessenger::SetNewValue(), G4NtupleMessenger::SetNewValue(), G4P1Messenger::SetNewValue(), G4P2Messenger::SetNewValue(), and G4PlotMessenger::SetNewValue().

◆ UpdateTitle()

void G4Analysis::UpdateTitle ( G4String title,
const G4String unitName,
const G4String fcnName 
)

Definition at line 163 of file G4AnalysisUtilities.cc.

166{
167 if ( fcnName != "none" ) { title += " "; title += fcnName; title += "("; }
168 if ( unitName != "none" ) { title += " ["; title += unitName; title += "]";}
169 if ( fcnName != "none" ) { title += ")"; }
170}

Variable Documentation

◆ kInvalidId

const G4int G4Analysis::kInvalidId = -1

Definition at line 62 of file G4AnalysisUtilities.hh.

Referenced by G4VAnalysisManager::CreateH1(), G4VAnalysisManager::CreateH2(), G4VAnalysisManager::CreateH3(), G4VAnalysisManager::CreateNtuple(), G4VAnalysisManager::CreateNtupleDColumn(), G4VAnalysisManager::CreateNtupleFColumn(), G4VAnalysisManager::CreateNtupleIColumn(), G4VAnalysisManager::CreateNtupleSColumn(), G4VAnalysisManager::CreateP1(), G4VAnalysisManager::CreateP2(), G4Hdf5FileManager::GetHistoDirectory(), G4VAnalysisReader::GetNtuple(), G4Hdf5FileManager::GetNtupleDirectory(), G4Hdf5RFileManager::GetRFile(), G4VAnalysisReader::ReadH1(), G4CsvAnalysisReader::ReadH1Impl(), G4Hdf5AnalysisReader::ReadH1Impl(), G4RootAnalysisReader::ReadH1Impl(), G4XmlAnalysisReader::ReadH1Impl(), G4VAnalysisReader::ReadH2(), G4XmlAnalysisReader::ReadH2Impl(), G4CsvAnalysisReader::ReadH2Impl(), G4Hdf5AnalysisReader::ReadH2Impl(), G4RootAnalysisReader::ReadH2Impl(), G4VAnalysisReader::ReadH3(), G4XmlAnalysisReader::ReadH3Impl(), G4CsvAnalysisReader::ReadH3Impl(), G4Hdf5AnalysisReader::ReadH3Impl(), G4RootAnalysisReader::ReadH3Impl(), G4CsvAnalysisReader::ReadNtupleImpl(), G4Hdf5AnalysisReader::ReadNtupleImpl(), G4RootAnalysisReader::ReadNtupleImpl(), G4XmlAnalysisReader::ReadNtupleImpl(), G4VAnalysisReader::ReadP1(), G4XmlAnalysisReader::ReadP1Impl(), G4CsvAnalysisReader::ReadP1Impl(), G4Hdf5AnalysisReader::ReadP1Impl(), G4RootAnalysisReader::ReadP1Impl(), G4VAnalysisReader::ReadP2(), G4XmlAnalysisReader::ReadP2Impl(), G4CsvAnalysisReader::ReadP2Impl(), G4Hdf5AnalysisReader::ReadP2Impl(), G4RootAnalysisReader::ReadP2Impl(), G4VAnalysisManager::SetH1(), G4VAnalysisManager::SetH2(), G4VAnalysisManager::SetH3(), G4VAnalysisManager::SetP1(), and G4VAnalysisManager::SetP2().

◆ kX

◆ kY

◆ kZ