Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4H2ToolsManager.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 // $Id: G4H2ToolsManager.cc 70604 2013-06-03 11:27:06Z ihrivnac $
27 
28 // Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
29 
30 #include "G4H2ToolsManager.hh"
32 #include "G4BaseHistoUtilities.hh"
33 #include "G4AnalysisUtilities.hh"
34 
35 #include "tools/histo/h2d"
36 
37 #include <fstream>
38 
39 using namespace G4Analysis;
40 
41 // static definitions
42 const G4int G4H2ToolsManager::kDimension = 2;
43 
44 //_____________________________________________________________________________
46  : G4VH2Manager(),
47  G4THnManager<tools::histo::h2d>(state, "H2")
48 {}
49 
50 //_____________________________________________________________________________
52 {}
53 
54 //
55 // Utility functions
56 //
57 
58 namespace {
59 
60 //_____________________________________________________________________________
61 void UpdateH2Information(G4HnInformation* hnInformation,
62  const G4String& xunitName,
63  const G4String& yunitName,
64  const G4String& xfcnName,
65  const G4String& yfcnName,
66  G4BinScheme xbinScheme,
67  G4BinScheme ybinScheme)
68 {
69  hnInformation->SetDimension(kX, xunitName, xfcnName, xbinScheme);
70  hnInformation->SetDimension(kY, yunitName, yfcnName, ybinScheme);
71 }
72 
73 //_____________________________________________________________________________
74 void AddH2Annotation(tools::histo::h2d* h2d,
75  const G4String& xunitName,
76  const G4String& yunitName,
77  const G4String& xfcnName,
78  const G4String& yfcnName)
79 {
80  G4String xaxisTitle;
81  G4String yaxisTitle;
82  UpdateTitle(xaxisTitle, xunitName, xfcnName);
83  UpdateTitle(yaxisTitle, yunitName, yfcnName);
84  h2d->add_annotation(tools::histo::key_axis_x_title(), xaxisTitle);
85  h2d->add_annotation(tools::histo::key_axis_y_title(), yaxisTitle);
86 }
87 
88 //_____________________________________________________________________________
89 tools::histo::h2d* CreateToolsH2(
90  const G4String& title,
91  G4int nxbins, G4double xmin, G4double xmax,
92  G4int nybins, G4double ymin, G4double ymax,
93  const G4String& xunitName,
94  const G4String& yunitName,
95  const G4String& xfcnName,
96  const G4String& yfcnName,
97  const G4String& xbinSchemeName,
98  const G4String& ybinSchemeName)
99 {
100  auto xunit = GetUnitValue(xunitName);
101  auto yunit = GetUnitValue(yunitName);
102  auto xfcn = GetFunction(xfcnName);
103  auto yfcn = GetFunction(yfcnName);
104  auto xbinScheme = GetBinScheme(xbinSchemeName);
105  auto ybinScheme = GetBinScheme(ybinSchemeName);
106 
107  if ( xbinScheme != G4BinScheme::kLog && ybinScheme != G4BinScheme::kLog) {
108  if ( xbinScheme == G4BinScheme::kUser || ybinScheme == G4BinScheme::kUser) {
109  // This should never happen, but let's make sure about it
110  // by issuing a warning
111  G4ExceptionDescription description;
112  description
113  << " User binning scheme setting was ignored." << G4endl
114  << " Linear binning will be applied with given (nbins, xmin, xmax) values";
115  G4Exception("G4H2ToolsManager::CreateH2",
116  "Analysis_W013", JustWarning, description);
117  }
118  return new tools::histo::h2d(title,
119  nxbins, xfcn(xmin/xunit), xfcn(xmax/xunit),
120  nybins, yfcn(ymin/yunit), yfcn(ymax/yunit));
121  // h2 objects are deleted in destructor and reset when
122  // closing a file.
123  }
124  else {
125  // Compute edges
126  std::vector<G4double> xedges;
127  ComputeEdges(nxbins, xmin, xmax, xunit, xfcn, xbinScheme, xedges);
128  std::vector<G4double> yedges;
129  ComputeEdges(nybins, ymin, ymax, yunit, yfcn, ybinScheme, yedges);
130  return new tools::histo::h2d(title, xedges, yedges);
131  }
132 }
133 
134 //_____________________________________________________________________________
135 tools::histo::h2d* CreateToolsH2(
136  const G4String& title,
137  const std::vector<G4double>& xedges,
138  const std::vector<G4double>& yedges,
139  const G4String& xunitName,
140  const G4String& yunitName,
141  const G4String& xfcnName,
142  const G4String& yfcnName)
143 {
144  auto xunit = GetUnitValue(xunitName);
145  auto yunit = GetUnitValue(yunitName);
146  auto xfcn = GetFunction(xfcnName);
147  auto yfcn = GetFunction(yfcnName);
148 
149  // Apply function
150  std::vector<G4double> xnewEdges;
151  ComputeEdges(xedges, xunit, xfcn, xnewEdges);
152  std::vector<G4double> ynewEdges;
153  ComputeEdges(yedges, yunit, yfcn, ynewEdges);
154 
155  return new tools::histo::h2d(title, xnewEdges, ynewEdges);
156  // h2 objects are deleted in destructor and reset when
157  // closing a file.
158 }
159 
160 //_____________________________________________________________________________
161 void ConfigureToolsH2(tools::histo::h2d* h2d,
162  G4int nxbins, G4double xmin, G4double xmax,
163  G4int nybins, G4double ymin, G4double ymax,
164  const G4String& xunitName,
165  const G4String& yunitName,
166  const G4String& xfcnName,
167  const G4String& yfcnName,
168  const G4String& xbinSchemeName,
169  const G4String& ybinSchemeName)
170 {
171  auto xunit = GetUnitValue(xunitName);
172  auto yunit = GetUnitValue(yunitName);
173  auto xfcn = GetFunction(xfcnName);
174  auto yfcn = GetFunction(yfcnName);
175  auto xbinScheme = GetBinScheme(xbinSchemeName);
176  auto ybinScheme = GetBinScheme(ybinSchemeName);
177 
178  if ( xbinScheme != G4BinScheme::kLog && ybinScheme != G4BinScheme::kLog) {
179  if ( xbinScheme == G4BinScheme::kUser || ybinScheme == G4BinScheme::kUser) {
180  // This should never happen, but let's make sure about it
181  // by issuing a warning
182  G4ExceptionDescription description;
183  description
184  << " User binning scheme setting was ignored." << G4endl
185  << " Linear binning will be applied with given (nbins, xmin, xmax) values";
186  G4Exception("G4H2ToolsManager::CreateH2",
187  "Analysis_W013", JustWarning, description);
188  }
189  h2d->configure(nxbins, xfcn(xmin/xunit), xfcn(xmax/xunit),
190  nybins, yfcn(ymin/yunit), yfcn(ymax/yunit));
191  }
192  else {
193  // Compute bins
194  std::vector<G4double> xedges;
195  ComputeEdges(nxbins, xmin, xmax, xunit, xfcn, xbinScheme, xedges);
196  std::vector<G4double> yedges;
197  ComputeEdges(nybins, ymin, ymax, yunit, yfcn, ybinScheme, yedges);
198  h2d->configure(xedges, yedges);
199  }
200 }
201 
202 //_____________________________________________________________________________
203 void ConfigureToolsH2(tools::histo::h2d* h2d,
204  const std::vector<G4double>& xedges,
205  const std::vector<G4double>& yedges,
206  const G4String& xunitName,
207  const G4String& yunitName,
208  const G4String& xfcnName,
209  const G4String& yfcnName)
210 {
211  auto xunit = GetUnitValue(xunitName);
212  auto xfcn = GetFunction(xfcnName);
213  std::vector<G4double> xnewEdges;
214  ComputeEdges(xedges, xunit, xfcn, xnewEdges);
215 
216  auto yunit = GetUnitValue(yunitName);
217  auto yfcn = GetFunction(yfcnName);
218  std::vector<G4double> ynewEdges;
219  ComputeEdges(yedges, yunit, yfcn, ynewEdges);
220 
221  h2d->configure(xnewEdges, ynewEdges);
222 }
223 
224 }
225 
226 
227 //
228 // private methods
229 //
230 
231 //_____________________________________________________________________________
232 void G4H2ToolsManager::AddH2Information(const G4String& name,
233  const G4String& xunitName,
234  const G4String& yunitName,
235  const G4String& xfcnName,
236  const G4String& yfcnName,
237  G4BinScheme xbinScheme,
238  G4BinScheme ybinScheme) const
239 {
240  auto hnInformation = fHnManager->AddHnInformation(name, 2);
241  hnInformation->AddDimension(xunitName, xfcnName, xbinScheme);
242  hnInformation->AddDimension(yunitName, yfcnName, ybinScheme);
243 }
244 
245 //
246 // protected methods
247 //
248 
249 //_____________________________________________________________________________
251  G4int nxbins, G4double xmin, G4double xmax,
252  G4int nybins, G4double ymin, G4double ymax,
253  const G4String& xunitName, const G4String& yunitName,
254  const G4String& xfcnName, const G4String& yfcnName,
255  const G4String& xbinSchemeName,
256  const G4String& ybinSchemeName)
257 
258 {
259 #ifdef G4VERBOSE
260  if ( fState.GetVerboseL4() )
261  fState.GetVerboseL4()->Message("create", "H2", name);
262 #endif
263  tools::histo::h2d* h2d
264  = CreateToolsH2(title, nxbins, xmin, xmax, nybins, ymin, ymax,
265  xunitName, yunitName, xfcnName, yfcnName,
266  xbinSchemeName, ybinSchemeName);
267 
268  // Add annotation
269  AddH2Annotation(h2d, xunitName, yunitName, xfcnName, yfcnName);
270 
271  // Save H2 information
272  auto xbinScheme = GetBinScheme(xbinSchemeName);
273  auto ybinScheme = GetBinScheme(ybinSchemeName);
274  AddH2Information(
275  name, xunitName, yunitName, xfcnName, yfcnName, xbinScheme, ybinScheme);
276 
277  // Register histogram
278  G4int id = RegisterT(h2d, name);
279 
280 #ifdef G4VERBOSE
281  if ( fState.GetVerboseL2() )
282  fState.GetVerboseL2()->Message("create", "H2", name);
283 #endif
284 
285  return id;
286 }
287 
288 //_____________________________________________________________________________
290  const std::vector<G4double>& xedges,
291  const std::vector<G4double>& yedges,
292  const G4String& xunitName, const G4String& yunitName,
293  const G4String& xfcnName, const G4String& yfcnName)
294 
295 {
296 #ifdef G4VERBOSE
297  if ( fState.GetVerboseL4() )
298  fState.GetVerboseL4()->Message("create", "H2", name);
299 #endif
300  tools::histo::h2d* h2d
301  = CreateToolsH2(title, xedges, yedges,
302  xunitName, yunitName, xfcnName, yfcnName);
303 
304  // Add annotation
305  AddH2Annotation(h2d, xunitName, yunitName, xfcnName, yfcnName);
306 
307  // Save H2 information
308  AddH2Information(
309  name, xunitName, yunitName, xfcnName, yfcnName, G4BinScheme::kUser, G4BinScheme::kUser);
310 
311  // Register histogram
312  G4int id = RegisterT(h2d, name);
313 
314 #ifdef G4VERBOSE
315  if ( fState.GetVerboseL2() )
316  fState.GetVerboseL2()->Message("create", "H2", name);
317 #endif
318 
319  return id;
320 }
321 
322 //_____________________________________________________________________________
324  G4int nxbins, G4double xmin, G4double xmax,
325  G4int nybins, G4double ymin, G4double ymax,
326  const G4String& xunitName, const G4String& yunitName,
327  const G4String& xfcnName, const G4String& yfcnName,
328  const G4String& xbinSchemeName,
329  const G4String& ybinSchemeName)
330 {
331  auto h2d = GetTInFunction(id, "SetH2", false, false);
332  if ( ! h2d ) return false;
333 
334  auto info = fHnManager->GetHnInformation(id, "SetH2");
335 #ifdef G4VERBOSE
336  if ( fState.GetVerboseL4() )
337  fState.GetVerboseL4()->Message("configure", "H2", info->GetName());
338 #endif
339 
340  // Configure tools h2
341  ConfigureToolsH2(
342  h2d, nxbins, xmin, xmax, nybins, ymin, ymax,
343  xunitName, yunitName, xfcnName, yfcnName, xbinSchemeName, ybinSchemeName);
344 
345  // Add annotation
346  AddH2Annotation(h2d, xunitName, yunitName, xfcnName, yfcnName);
347 
348  // Update information
349  auto xbinScheme = GetBinScheme(xbinSchemeName);
350  auto ybinScheme = GetBinScheme(ybinSchemeName);
351  UpdateH2Information(
352  info, xunitName, yunitName, xfcnName, yfcnName, xbinScheme, ybinScheme);
353 
354  // Set activation
355  fHnManager->SetActivation(id, true);
356 
357  return true;
358 }
359 
360 //_____________________________________________________________________________
362  const std::vector<G4double>& xedges,
363  const std::vector<G4double>& yedges,
364  const G4String& xunitName, const G4String& yunitName,
365  const G4String& xfcnName, const G4String& yfcnName)
366 {
367  auto h2d = GetTInFunction(id, "SetH2", false, false);
368  if ( ! h2d ) return false;
369 
370  auto info = fHnManager->GetHnInformation(id, "SetH2");
371 #ifdef G4VERBOSE
372  if ( fState.GetVerboseL4() )
373  fState.GetVerboseL4()->Message("configure", "H2", info->GetName());
374 #endif
375 
376  // Configure tools h2
377  ConfigureToolsH2(h2d, xedges, yedges, xunitName, yunitName, xfcnName, yfcnName);
378 
379  // Add annotation
380  AddH2Annotation(h2d, xunitName, yunitName, xfcnName, yfcnName);
381 
382  // Update information
383  UpdateH2Information(
384  info, xunitName, yunitName, xfcnName, yfcnName, G4BinScheme::kUser, G4BinScheme::kUser);
385 
386  // Set activation
387  fHnManager->SetActivation(id, true);
388 
389  return true;
390 }
391 
392 //_____________________________________________________________________________
394 {
395  auto h2d = GetTInFunction(id, "ScaleH2", false, false);
396  if ( ! h2d ) return false;
397 
398  return h2d->scale(factor);
399 }
400 
401 //_____________________________________________________________________________
403  G4double xvalue, G4double yvalue,
404  G4double weight)
405 {
406  auto h2d = GetTInFunction(id, "FillH2", true, false);
407  if ( ! h2d ) return false;
408 
409  if ( fState.GetIsActivation() && ( ! fHnManager->GetActivation(id) ) ) {
410  return false;
411  }
412 
414  = fHnManager->GetHnDimensionInformation(id, kX, "FillH2");
416  = fHnManager->GetHnDimensionInformation(id, kY, "FillH2");
417 
418  h2d->fill(xInfo->fFcn(xvalue/xInfo->fUnit),
419  yInfo->fFcn(yvalue/yInfo->fUnit), weight);
420 #ifdef G4VERBOSE
421  if ( fState.GetVerboseL4() ) {
422  G4ExceptionDescription description;
423  description << " id " << id
424  << " xvalue " << xvalue
425  << " xfcn(xvalue/xunit) " << xInfo->fFcn(xvalue/xInfo->fUnit)
426  << " yvalue " << yvalue
427  << " yfcn(yvalue/yunit) " << yInfo->fFcn(yvalue/yInfo->fUnit)
428  << " weight " << weight;
429  fState.GetVerboseL4()->Message("fill", "H2", description);
430  }
431 #endif
432  return true;
433 }
434 
435 //_____________________________________________________________________________
437 {
438  return GetTId(name, warn);
439 }
440 
441 //_____________________________________________________________________________
443 {
444  auto h2d = GetTInFunction(id, "GetH2NXbins");
445  if ( ! h2d ) return 0;
446 
447  return GetNbins(*h2d, kX);
448 }
449 
450 //_____________________________________________________________________________
452 {
453 // Returns xmin value with applied unit and histogram function
454 
455  auto h2d = GetTInFunction(id, "GetH2Xmin");
456  if ( ! h2d ) return 0.;
457 
458  return GetMin(*h2d, kX);
459 }
460 
461 //_____________________________________________________________________________
463 {
464  auto h2d = GetTInFunction(id, "GetH2Xmax");
465  if ( ! h2d ) return 0.;
466 
467  return GetMax(*h2d, kX);
468 }
469 
470 //_____________________________________________________________________________
472 {
473  auto h2d = GetTInFunction(id, "GetH2XWidth", true, false);
474  if ( ! h2d ) return 0.;
475 
476  return GetWidth(*h2d, kX, fHnManager->GetHnType());
477 }
478 
479 //_____________________________________________________________________________
481 {
482  auto h2d = GetTInFunction(id, "GetH2NYbins");
483  if ( ! h2d ) return 0;
484 
485  return GetNbins(*h2d, kY);
486 }
487 
488 //_____________________________________________________________________________
490 {
491 // Returns xmin value with applied unit and histogram function
492 
493  auto h2d = GetTInFunction(id, "GetH2Ymin");
494  if ( ! h2d ) return 0.;
495 
496  return GetMin(*h2d, kY);
497 }
498 
499 //_____________________________________________________________________________
501 {
502  auto h2d = GetTInFunction(id, "GetH2Ymax");
503  if ( ! h2d ) return 0.;
504 
505  return GetMax(*h2d, kY);
506 }
507 
508 //_____________________________________________________________________________
510 {
511  auto h2d = GetTInFunction(id, "GetH2YWidth", true, false);
512  if ( ! h2d ) return 0.;
513 
514  return GetWidth(*h2d, kY, fHnManager->GetHnType());
515 }
516 
517 //_____________________________________________________________________________
519 {
520  auto h2d = GetTInFunction(id, "SetH2Title");
521  if ( ! h2d ) return false;
522 
523  return SetTitle(*h2d, title);
524 }
525 
526 //_____________________________________________________________________________
528 {
529  auto h2d = GetTInFunction(id, "SetH2XAxisTitle");
530  if ( ! h2d ) return false;
531 
532  return SetAxisTitle(*h2d, kX, title);
533 }
534 
535 //_____________________________________________________________________________
537 {
538  auto h2d = GetTInFunction(id, "SetH2YAxisTitle");
539  if ( ! h2d ) return false;
540 
541  return SetAxisTitle(*h2d, kY, title);
542 }
543 
544 //_____________________________________________________________________________
546 {
547  auto h2d = GetTInFunction(id, "SetH2ZAxisTitle");
548  if ( ! h2d ) return false;
549 
550  return SetAxisTitle(*h2d, kZ, title);
551 }
552 
553 //_____________________________________________________________________________
555 {
556  auto h2d = GetTInFunction(id, "GetH2Title");
557  if ( ! h2d ) return "";
558 
559  return GetTitle(*h2d);
560 }
561 
562 //_____________________________________________________________________________
564 {
565  auto h2d = GetTInFunction(id, "GetH2XAxisTitle");
566  if ( ! h2d ) return "";
567 
568  return GetAxisTitle(*h2d, kX, fHnManager->GetHnType());
569 }
570 
571 //_____________________________________________________________________________
573 {
574  auto h2d = GetTInFunction(id, "GetH2YAxisTitle");
575  if ( ! h2d ) return "";
576 
577  return GetAxisTitle(*h2d, kY, fHnManager->GetHnType());
578 }
579 
580 //_____________________________________________________________________________
582 {
583  auto h2d = GetTInFunction(id, "GetH2ZAxisTitle");
584  if ( ! h2d ) return "";
585 
586  return GetAxisTitle(*h2d, kZ, fHnManager->GetHnType());
587 }
588 
589 //_____________________________________________________________________________
590 G4bool G4H2ToolsManager::WriteOnAscii(std::ofstream& /*output*/)
591 {
592 // Write selected objects on ASCII file
593 // According to the implementation by Michel Maire, originally in
594 // extended examples.
595 // Not yet available for H2
596 
597  return ! fHnManager->IsAscii();
598 }
599 
600 //
601 // public methods
602 //
603 
604 //_____________________________________________________________________________
605 G4int G4H2ToolsManager::AddH2(const G4String& name, tools::histo::h2d* h2d)
606 {
607 #ifdef G4VERBOSE
608  if ( fState.GetVerboseL4() )
609  fState.GetVerboseL4()->Message("add", "H2", name);
610 #endif
611 
612  // Add annotation
613  AddH2Annotation(h2d, "none", "none", "none", "none");
614  // Add information
615  AddH2Information(name, "none", "none", "none", "none",
617 
618  // Register histogram
619  G4int id = RegisterT(h2d, name);
620 
621 #ifdef G4VERBOSE
622  if ( fState.GetVerboseL2() )
623  fState.GetVerboseL2()->Message("add", "H2", name);
624 #endif
625  return id;
626 }
627 
628 //_____________________________________________________________________________
630  const std::vector<tools::histo::h2d*>& h2Vector)
631 {
632  AddTVector(h2Vector);
633 }
634 //_____________________________________________________________________________
635 tools::histo::h2d* G4H2ToolsManager::GetH2(G4int id, G4bool warn,
636  G4bool onlyIfActive) const
637 {
638  return GetTInFunction(id, "GetH2", warn, onlyIfActive);
639 }
640 
G4double GetWidth(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
const XML_Char XML_Encoding * info
Definition: expat.h:530
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
const XML_Char * name
Definition: expat.h:151
G4String GetTitle(const G4ToolsBaseHisto &baseHisto)
const G4int kZ
G4String GetAxisTitle(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
virtual G4double GetH2XWidth(G4int id) const final
virtual G4int GetH2Nxbins(G4int id) const final
G4double GetMin(const G4ToolsBaseHisto &baseHisto, G4int dimension)
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
virtual G4String GetH2XAxisTitle(G4int id) const final
virtual G4bool WriteOnAscii(std::ofstream &output) final
void ComputeEdges(G4int nbins, G4double xmin, G4double xmax, G4double unit, G4Fcn fcn, G4BinScheme, std::vector< G4double > &edges)
Definition: G4BinScheme.cc:56
virtual G4double GetH2YWidth(G4int id) const final
virtual ~G4H2ToolsManager()
virtual G4double GetH2Ymin(G4int id) const final
virtual G4int CreateH2(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinScheme="linear", const G4String &ybinScheme="linear") final
virtual G4bool SetH2YAxisTitle(G4int id, const G4String &title) final
G4bool SetAxisTitle(G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)
virtual G4int GetH2Nybins(G4int id) const final
virtual G4double GetH2Ymax(G4int id) const final
int G4int
Definition: G4Types.hh:78
std::shared_ptr< G4HnManager > fHnManager
Definition: G4THnManager.hh:83
G4int RegisterT(tools::histo::h2d *t, const G4String &name)
virtual G4String GetH2Title(G4int id) const final
const G4AnalysisVerbose * GetVerboseL2() const
void UpdateTitle(G4String &title, const G4String &unitName, const G4String &fcnName)
const G4AnalysisManagerState & fState
Definition: G4THnManager.hh:80
void AddH2Vector(const std::vector< tools::histo::h2d * > &h2Vector)
G4int GetTId(const G4String &name, G4bool warn=true) const
const G4AnalysisVerbose * GetVerboseL4() const
bool G4bool
Definition: G4Types.hh:79
const G4int kX
virtual G4bool SetH2ZAxisTitle(G4int id, const G4String &title) final
virtual G4bool SetH2(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinScheme="linear", const G4String &ybinScheme="linear") final
tools::histo::h2d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
G4double GetUnitValue(const G4String &unit)
virtual G4String GetH2ZAxisTitle(G4int id) const final
G4bool SetTitle(G4ToolsBaseHisto &baseHisto, const G4String &title)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
virtual G4String GetH2YAxisTitle(G4int id) const final
tools::histo::h2d * GetH2(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
G4Fcn GetFunction(const G4String &fcnName)
Definition: G4Fcn.cc:36
void AddTVector(const std::vector< tools::histo::h2d * > &tVector)
G4int AddH2(const G4String &name, tools::histo::h2d *h2d)
virtual G4double GetH2Xmin(G4int id) const final
G4BinScheme GetBinScheme(const G4String &binSchemeName)
Definition: G4BinScheme.cc:36
#define G4endl
Definition: G4ios.hh:61
G4double GetMax(const G4ToolsBaseHisto &baseHisto, G4int dimension)
virtual G4bool FillH2(G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0) final
G4BinScheme
Definition: G4BinScheme.hh:40
G4int GetNbins(const G4ToolsBaseHisto &baseHisto, G4int dimension)
double G4double
Definition: G4Types.hh:76
virtual G4bool ScaleH2(G4int id, G4double factor) final
void AddDimension(const G4String &unitName, const G4String &fcnName, G4BinScheme binScheme)
const G4int kY
virtual G4bool SetH2XAxisTitle(G4int id, const G4String &title) final
virtual G4int GetH2Id(const G4String &name, G4bool warn=true) const final
virtual G4bool SetH2Title(G4int id, const G4String &title) final
G4H2ToolsManager(const G4AnalysisManagerState &state)
void SetDimension(G4int dimension, const G4String &unitName, const G4String &fcnName, G4BinScheme binScheme)
virtual G4double GetH2Xmax(G4int id) const final