Geant4-11
G4P1ToolsManager.cc
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// Author: Ivana Hrivnacova, 24/07/2014 (ivana@ipno.in2p3.fr)
28
29#include "G4P1ToolsManager.hh"
33
34#include "tools/histo/p1d"
35
36#include <fstream>
37
38using namespace G4Analysis;
39using std::to_string;
40
41//
42// Constructors, destructor
43//
44
45//_____________________________________________________________________________
47 : G4VP1Manager(),
48 G4THnManager<tools::histo::p1d>(state, "P1")
49{}
50
51//
52// Utility functions
53//
54
55namespace {
56
57//_____________________________________________________________________________
59 const G4String& xunitName,
60 const G4String& yunitName,
61 const G4String& xfcnName,
62 const G4String& yfcnName,
63 G4BinScheme xbinScheme)
64{
65 hnInformation->SetDimension(kX, xunitName, xfcnName, xbinScheme);
66 hnInformation->SetDimension(kY, yunitName, yfcnName, G4BinScheme::kLinear);
67}
68
69//_____________________________________________________________________________
70void AddP1Annotation(tools::histo::p1d* p1d,
71 const G4String& xunitName,
72 const G4String& yunitName,
73 const G4String& xfcnName,
74 const G4String& yfcnName)
75{
76 G4String xaxisTitle;
77 G4String yaxisTitle;
78 UpdateTitle(xaxisTitle, xunitName, xfcnName);
79 UpdateTitle(yaxisTitle, yunitName, yfcnName);
80 p1d->add_annotation(tools::histo::key_axis_x_title(), xaxisTitle);
81 p1d->add_annotation(tools::histo::key_axis_y_title(), yaxisTitle);
82}
83
84//_____________________________________________________________________________
85tools::histo::p1d* CreateToolsP1(const G4String& title,
86 G4int nbins, G4double xmin, G4double xmax,
87 G4double ymin, G4double ymax,
88 const G4String& xunitName,
89 const G4String& yunitName,
90 const G4String& xfcnName,
91 const G4String& yfcnName,
92 const G4String& xbinSchemeName,
93 std::string_view className)
94{
95 auto xunit = GetUnitValue(xunitName);
96 auto yunit = GetUnitValue(yunitName);
97 auto xfcn = GetFunction(xfcnName);
98 auto yfcn = GetFunction(yfcnName);
99 auto xbinScheme = GetBinScheme(xbinSchemeName);
100
101 if ( xbinScheme != G4BinScheme::kLog ) {
102 if ( xbinScheme == G4BinScheme::kUser ) {
103 // This should never happen, but let's make sure about it
104 // by issuing a warning
105 Warn("User binning scheme setting was ignored.\n"
106 "Linear binning will be applied with given (nbins, xmin, xmax) values.",
107 className, "CreateToolsP1");
108 }
109 if ( ymin == 0. && ymax == 0.) {
110 return new tools::histo::p1d(title,
111 nbins, xfcn(xmin/xunit), xfcn(xmax/xunit));
112 } else {
113 return new tools::histo::p1d(title,
114 nbins, xfcn(xmin/xunit), xfcn(xmax/xunit),
115 yfcn(ymin/yunit), yfcn(ymax/yunit));
116 }
117 }
118 else {
119 // Compute edges
120 std::vector<G4double> edges;
121 ComputeEdges(nbins, xmin, xmax, xunit, xfcn, xbinScheme, edges);
122 if ( ymin == 0. && ymax == 0.) {
123 return new tools::histo::p1d(title, edges);
124 } else {
125 return new tools::histo::p1d(title, edges, yfcn(ymin/yunit), yfcn(ymax/yunit));
126 }
127 }
128}
129
130//_____________________________________________________________________________
131tools::histo::p1d* CreateToolsP1(const G4String& title,
132 const std::vector<G4double>& edges,
133 G4double ymin, G4double ymax,
134 const G4String& xunitName,
135 const G4String& yunitName,
136 const G4String& xfcnName,
137 const G4String& yfcnName)
138{
139 auto xunit = GetUnitValue(xunitName);
140 auto yunit = GetUnitValue(yunitName);
141 auto xfcn = GetFunction(xfcnName);
142 auto yfcn = GetFunction(yfcnName);
143
144 // Apply function
145 std::vector<G4double> newEdges;
146 ComputeEdges(edges, xunit, xfcn, newEdges);
147
148 return new tools::histo::p1d(title, newEdges, yfcn(ymin/yunit), yfcn(ymax/yunit));
149}
150
151//_____________________________________________________________________________
152void ConfigureToolsP1(tools::histo::p1d* p1d,
153 G4int nbins, G4double xmin, G4double xmax,
154 G4double ymin, G4double ymax,
155 const G4String& xunitName,
156 const G4String& yunitName,
157 const G4String& xfcnName,
158 const G4String& yfcnName,
159 const G4String& xbinSchemeName,
160 std::string_view className)
161{
162 auto xunit = GetUnitValue(xunitName);
163 auto yunit = GetUnitValue(yunitName);
164 auto xfcn = GetFunction(xfcnName);
165 auto yfcn = GetFunction(yfcnName);
166 auto xbinScheme = GetBinScheme(xbinSchemeName);
167
168 if ( xbinScheme != G4BinScheme::kLog ) {
169 if ( xbinScheme == G4BinScheme::kUser ) {
170 // This should never happen, but let's make sure about it
171 // by issuing a warning
172 Warn("User binning scheme setting was ignored.\n"
173 "Linear binning will be applied with given (nbins, xmin, xmax) values.",
174 className, "ConfigureToolsP1");
175 }
176 if ( ymin == 0. && ymax == 0. ) {
177 p1d->configure(nbins, xfcn(xmin/xunit), xfcn(xmax/xunit));
178 } else {
179 p1d->configure(nbins, xfcn(xmin/xunit), xfcn(xmax/xunit),
180 yfcn(ymin/yunit), yfcn(ymax/yunit));
181 }
182 }
183 else {
184 // Compute bins
185 std::vector<G4double> edges;
186 ComputeEdges(nbins, xmin, xmax, xunit, xfcn, xbinScheme, edges);
187 if ( ymin == 0. && ymax == 0. ) {
188 p1d->configure(edges);
189 } else {
190 p1d->configure(edges, yfcn(ymin/yunit), yfcn(ymax/yunit));
191 }
192 }
193}
194
195//_____________________________________________________________________________
196void ConfigureToolsP1(tools::histo::p1d* p1d,
197 const std::vector<G4double>& edges,
198 G4double ymin, G4double ymax,
199 const G4String& xunitName,
200 const G4String& yunitName,
201 const G4String& xfcnName,
202 const G4String& yfcnName)
203{
204 // Apply function to edges
205 auto xunit = GetUnitValue(xunitName);
206 auto yunit = GetUnitValue(yunitName);
207 auto xfcn = GetFunction(xfcnName);
208 auto yfcn = GetFunction(yfcnName);
209 std::vector<G4double> newEdges;
210 ComputeEdges(edges, xunit, xfcn, newEdges);
211
212 if ( ymin == 0. && ymax == 0. ) {
213 p1d->configure(newEdges);
214 } else {
215 p1d->configure(newEdges, yfcn(ymin/yunit), yfcn(ymax/yunit));
216 }
217}
218
219}
220
221//
222// private methods
223//
224
225//_____________________________________________________________________________
227 const G4String& xunitName,
228 const G4String& yunitName,
229 const G4String& xfcnName,
230 const G4String& yfcnName,
231 G4BinScheme xbinScheme) const
232{
233 auto hnInformation = fHnManager->AddHnInformation(name, fkDimension);
234 hnInformation->AddDimension(xunitName, xfcnName, xbinScheme);
235 hnInformation->AddDimension(yunitName, yfcnName, G4BinScheme::kLinear);
236}
237
238//
239// protected methods
240//
241
242//_____________________________________________________________________________
244 G4int nbins, G4double xmin, G4double xmax,
245 G4double ymin, G4double ymax,
246 const G4String& xunitName, const G4String& yunitName,
247 const G4String& xfcnName, const G4String& yfcnName,
248 const G4String& xbinSchemeName)
249{
250 Message(kVL4, "create", "P1", name);
251
252 tools::histo::p1d* p1d
253 = CreateToolsP1(title, nbins, xmin, xmax, ymin, ymax,
254 xunitName, yunitName, xfcnName, yfcnName,
255 xbinSchemeName, fkClass);
256
257 // Add annotation
258 AddP1Annotation(p1d, xunitName, yunitName, xfcnName, yfcnName);
259
260 // Save P1 information
261 auto xbinScheme = GetBinScheme(xbinSchemeName);
263 name, xunitName, yunitName, xfcnName, yfcnName, xbinScheme);
264
265 // Register profile
266 G4int id = RegisterT(p1d, name);
267
268 Message(kVL2, "create", "P1", name);
269
270 return id;
271}
272
273//_____________________________________________________________________________
275 const std::vector<G4double>& edges,
276 G4double ymin, G4double ymax,
277 const G4String& xunitName, const G4String& yunitName,
278 const G4String& xfcnName, const G4String& yfcnName)
279{
280 Message(kVL4, "create", "P1", name);
281
282 tools::histo::p1d* p1d
283 = CreateToolsP1(title, edges, ymin, ymax,
284 xunitName, yunitName, xfcnName, yfcnName);
285
286 // Add annotation
287 AddP1Annotation(p1d, xunitName, yunitName, xfcnName, yfcnName);
288
289 // Save P1 information
291 name, xunitName, yunitName, xfcnName, yfcnName, G4BinScheme::kUser);
292
293 // Register profile
294 G4int id = RegisterT(p1d, name);
295
296 Message(kVL2, "create", "P1", name);
297
298 return id;
299}
300
301//_____________________________________________________________________________
303 G4int nbins, G4double xmin, G4double xmax,
304 G4double ymin, G4double ymax,
305 const G4String& xunitName, const G4String& yunitName,
306 const G4String& xfcnName, const G4String& yfcnName,
307 const G4String& xbinSchemeName)
308{
309 auto p1d = GetTInFunction(id, "SetP1", false, false);
310 if ( ! p1d ) return false;
311
312 auto info = fHnManager->GetHnInformation(id,"SetP1");
313
314 Message(kVL4, "configure", "P1", info->GetName());
315
316 // Configure tools p1
318 p1d, nbins, xmin, xmax, ymin, ymax,
319 xunitName, yunitName, xfcnName, yfcnName, xbinSchemeName, fkClass);
320
321 // Add annotation
322 AddP1Annotation(p1d, xunitName, yunitName, xfcnName, yfcnName);
323
324 // Update information
325 auto xbinScheme = GetBinScheme(xbinSchemeName);
327 info, xunitName, yunitName, xfcnName, yfcnName, xbinScheme);
328
329 // Set activation
330 fHnManager->SetActivation(id, true);
331
332 return true;
333}
334
335//_____________________________________________________________________________
337 const std::vector<G4double>& edges,
338 G4double ymin, G4double ymax,
339 const G4String& xunitName, const G4String& yunitName,
340 const G4String& xfcnName, const G4String& yfcnName)
341{
342 auto p1d = GetTInFunction(id, "SetP1", false, false);
343 if ( ! p1d ) return false;
344
345 auto info = fHnManager->GetHnInformation(id,"SetP1");
346
347 Message(kVL4, "configure", "P1", info->GetName());
348
349 // Configure tools p1
350 ConfigureToolsP1(p1d, edges, ymin, ymax,
351 xunitName, yunitName, xfcnName, yfcnName);
352
353 // Add annotation
354 AddP1Annotation(p1d, xunitName, yunitName, xfcnName, yfcnName);
355
356 // Update information
358 info, xunitName, yunitName, xfcnName, yfcnName, G4BinScheme::kUser);
359
360 // Set activation
361 fHnManager->SetActivation(id, true);
362
363 return true;
364}
365
366
367//_____________________________________________________________________________
369{
370 auto p1d = GetTInFunction(id, "ScaleP1", false, false);
371 if ( ! p1d ) return false;
372
373 return p1d->scale(factor);
374}
375
376//_____________________________________________________________________________
378 G4double weight)
379{
380 auto p1d = GetTInFunction(id, "FillP1", true, false);
381 if ( ! p1d ) return false;
382
383 if ( fState.GetIsActivation() && ( ! fHnManager->GetActivation(id) ) ) {
384 //G4cout << "Skipping FillP1 for " << id << G4endl;
385 return false;
386 }
387
388 auto xInfo
389 = fHnManager->GetHnDimensionInformation(id, kX, "FillP1");
390 auto yInfo
391 = fHnManager->GetHnDimensionInformation(id, kY, "FillP1");
392
393 p1d->fill(xInfo->fFcn(xvalue/xInfo->fUnit),
394 yInfo->fFcn(yvalue/yInfo->fUnit), weight);
395
396 if ( IsVerbose(kVL4) ) {
397 Message(kVL4, "fill", "P1",
398 " id " + to_string(id) +
399 " xvalue " + to_string(xvalue) +
400 " xfcn(xvalue/xunit) " + to_string(xInfo->fFcn(xvalue/xInfo->fUnit)) +
401 " yvalue " + to_string(yvalue) +
402 " yfcn(yvalue/yunit) " + to_string(yInfo->fFcn(yvalue/yInfo->fUnit)) +
403 " weight " + to_string(weight));
404 }
405
406 return true;
407}
408
409//_____________________________________________________________________________
411{
412 return GetTId(name, warn);
413}
414
415//_____________________________________________________________________________
417{
418 auto p1d = GetTInFunction(id, "GetP1Nbins");
419 if ( ! p1d ) return 0;
420
421 return GetNbins(*p1d, kX);
422}
423
424//_____________________________________________________________________________
426{
427// Returns xmin value with applied unit and profile function
428
429 auto p1d = GetTInFunction(id, "GetP1Xmin");
430 if ( ! p1d ) return 0.;
431
432 return GetMin(*p1d, kX);
433}
434
435//_____________________________________________________________________________
437{
438 auto p1d = GetTInFunction(id, "GetP1Xmax");
439 if ( ! p1d ) return 0.;
440
441 return GetMax(*p1d, kX);
442}
443
444//_____________________________________________________________________________
446{
447 auto p1d = GetTInFunction(id, "GetP1XWidth", true, false);
448 if ( ! p1d ) return 0.;
449
450 return GetWidth(*p1d, kX, fHnManager->GetHnType());
451}
452
453//_____________________________________________________________________________
455{
456// Returns xmin value with applied unit and profile function
457
458 auto p1d = GetTInFunction(id, "GetP1Ymin");
459 if ( ! p1d ) return 0.;
460
461 return p1d->min_v();
462}
463
464//_____________________________________________________________________________
466{
467 auto p1d = GetTInFunction(id, "GetP1Ymax");
468 if ( ! p1d ) return 0.;
469
470 return p1d->max_v();
471}
472
473//_____________________________________________________________________________
475{
476 auto p1d = GetTInFunction(id, "SetP1Title");
477 if ( ! p1d ) return false;
478
479 return SetTitle(*p1d, title);
480}
481
482//_____________________________________________________________________________
484{
485 auto p1d = GetTInFunction(id, "SetP1XAxisTitle");
486 if ( ! p1d ) return false;
487
488 return SetAxisTitle(*p1d, kX, title);
489}
490
491//_____________________________________________________________________________
493{
494 auto p1d = GetTInFunction(id, "SetP1YAxisTitle");
495 if ( ! p1d ) return false;
496
497 return SetAxisTitle(*p1d, kY, title);
498}
499
500//_____________________________________________________________________________
502{
503 auto p1d = GetTInFunction(id, "GetP1Title");
504 if ( ! p1d ) return "";
505
506 return GetTitle(*p1d);
507}
508
509
510//_____________________________________________________________________________
512{
513 auto p1d = GetTInFunction(id, "GetP1XAxisTitle");
514 if ( ! p1d ) return "";
515
516 return GetAxisTitle(*p1d, kX, fHnManager->GetHnType());
517}
518
519//_____________________________________________________________________________
521{
522 auto p1d = GetTInFunction(id, "GetP1YAxisTitle");
523 if ( ! p1d ) return "";
524
525 return GetAxisTitle(*p1d, kY, fHnManager->GetHnType());
526}
527
528//_____________________________________________________________________________
530{
531// Write selected objects on ASCII file
532
533 // Do nothing if no histograms are selected
534 if ( ! fHnManager->IsAscii() ) return true;
535
536 // Write p1 histograms
537 for ( G4int i=0; i<G4int(fTVector.size()); ++i ) {
538 auto id = i + fHnManager->GetFirstId();
539 auto info = fHnManager->GetHnInformation(id,"WriteOnAscii");
540 // skip writing if activation is enabled and H1 is inactivated
541 if ( ! info->GetAscii() ) continue;
542 auto p1 = fTVector[i];
543
544 Message(kVL3, "write on ascii", "p1d", info->GetName());
545
546 output << "\n 1D profile " << id << ": " << p1->title()
547 << "\n \n \t X \t\t MeanY" << G4endl;
548
549 for (G4int j=0; j< G4int(p1->axis().bins()); ++j) {
550 auto sw = p1->bin_Sw(j);
551 auto svw = p1->bin_Svw(j);
552 auto mean = ( sw != 0. ) ? (svw / sw) : 0.;
553 output << " " << j << "\t"
554 << p1->axis().bin_center(j) << "\t"
555 << mean << G4endl;
556 }
557 }
558
559 return output.good();
560}
561
562//
563// public methods
564//
565
566//_____________________________________________________________________________
567G4int G4P1ToolsManager::AddP1(const G4String& name, tools::histo::p1d* p1d)
568{
569 Message(kVL4, "add", "P1", name);
570
571 // Add annotation
572 AddP1Annotation(p1d, "none", "none", "none", "none");
573 // Add information
574 AddP1Information(name, "none", "none", "none", "none", G4BinScheme::kLinear);
575
576 // Register profile
577 auto id = RegisterT(p1d, name);
578
579 Message(kVL2, "add", "P1", name);
580
581 return id;
582}
583
584//_____________________________________________________________________________
586 const std::vector<tools::histo::p1d*>& p1Vector)
587{
588 AddTVector(p1Vector);
589}
590
591//_____________________________________________________________________________
592tools::histo::p1d* G4P1ToolsManager::GetP1(G4int id, G4bool warn,
593 G4bool onlyIfActive) const
594{
595 return GetTInFunction(id, "GetP1", warn, onlyIfActive);
596}
597
G4BinScheme
Definition: G4BinScheme.hh:39
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
static char className[]
Definition: G4Win32.cc:36
#define G4endl
Definition: G4ios.hh:57
void SetDimension(G4int dimension, const G4String &unitName, const G4String &fcnName, G4BinScheme binScheme)
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") final
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") final
tools::histo::p1d * GetP1(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
virtual G4bool SetP1Title(G4int id, const G4String &title) final
virtual G4int GetP1Id(const G4String &name, G4bool warn=true) const final
static constexpr std::string_view fkClass
virtual G4String GetP1YAxisTitle(G4int id) const final
virtual G4bool WriteOnAscii(std::ofstream &output) final
virtual G4int GetP1Nbins(G4int id) const final
virtual G4double GetP1Xmax(G4int id) const final
virtual G4double GetP1Ymin(G4int id) const final
virtual G4bool FillP1(G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0) final
virtual G4double GetP1Xmin(G4int id) const final
void AddP1Information(const G4String &name, const G4String &xunitName, const G4String &yunitName, const G4String &xfcnName, const G4String &yfcnName, G4BinScheme xbinScheme) const
virtual G4double GetP1Ymax(G4int id) const final
virtual G4double GetP1XWidth(G4int id) const final
virtual G4bool ScaleP1(G4int id, G4double factor) final
virtual G4String GetP1XAxisTitle(G4int id) const final
virtual G4bool SetP1YAxisTitle(G4int id, const G4String &title) final
static constexpr G4int fkDimension
virtual G4bool SetP1XAxisTitle(G4int id, const G4String &title) final
void AddP1Vector(const std::vector< tools::histo::p1d * > &p1Vector)
virtual G4String GetP1Title(G4int id) const final
G4P1ToolsManager()=delete
G4int AddP1(const G4String &name, tools::histo::p1d *p1d)
std::vector< tools::histo::p1d * > fTVector
tools::histo::p1d * GetTInFunction(G4int id, std::string_view functionName, G4bool warn=true, G4bool onlyIfActive=true) const
const G4AnalysisManagerState & fState
G4int GetTId(const G4String &name, G4bool warn=true) const
G4int RegisterT(tools::histo::p1d *t, const G4String &name)
void AddTVector(const std::vector< tools::histo::p1d * > &tVector)
void Message(G4int level, const G4String &action, const G4String &objectType, const G4String &objectName="", G4bool success=true) const
std::shared_ptr< G4HnManager > fHnManager
G4bool IsVerbose(G4int verboseLevel) const
G4int GetNbins(const G4ToolsBaseHisto &baseHisto, G4int dimension)
G4BinScheme GetBinScheme(const G4String &binSchemeName)
Definition: G4BinScheme.cc:36
G4bool SetTitle(G4ToolsBaseHisto &baseHisto, const G4String &title)
G4double GetMin(const G4ToolsBaseHisto &baseHisto, G4int dimension)
G4double GetMax(const G4ToolsBaseHisto &baseHisto, G4int dimension)
constexpr G4int kVL2
G4double GetUnitValue(const G4String &unit)
constexpr G4int kVL3
void ComputeEdges(G4int nbins, G4double xmin, G4double xmax, G4double unit, G4Fcn fcn, G4BinScheme, std::vector< G4double > &edges)
Definition: G4BinScheme.cc:53
G4bool SetAxisTitle(G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)
constexpr G4int kVL4
G4String GetAxisTitle(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
G4double GetWidth(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
void UpdateTitle(G4String &title, const G4String &unitName, const G4String &fcnName)
constexpr G4int kX
G4String GetTitle(const G4ToolsBaseHisto &baseHisto)
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)
G4Fcn GetFunction(const G4String &fcnName)
Definition: G4Fcn.cc:36
constexpr G4int kY
const char * name(G4int ptype)
void UpdateP1Information(G4HnInformation *hnInformation, const G4String &xunitName, const G4String &yunitName, const G4String &xfcnName, const G4String &yfcnName, G4BinScheme xbinScheme)
tools::histo::p1d * CreateToolsP1(const G4String &title, const std::vector< G4double > &edges, G4double ymin, G4double ymax, const G4String &xunitName, const G4String &yunitName, const G4String &xfcnName, const G4String &yfcnName)
void ConfigureToolsP1(tools::histo::p1d *p1d, const std::vector< G4double > &edges, G4double ymin, G4double ymax, const G4String &xunitName, const G4String &yunitName, const G4String &xfcnName, const G4String &yfcnName)
void AddP1Annotation(tools::histo::p1d *p1d, const G4String &xunitName, const G4String &yunitName, const G4String &xfcnName, const G4String &yfcnName)