Geant4  10.01.p03
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 // $Id$
27 
28 // Author: Ivana Hrivnacova, 24/07/2014 (ivana@ipno.in2p3.fr)
29 
30 #include "G4P1ToolsManager.hh"
31 #include "G4HnManager.hh"
33 #include "G4AnalysisUtilities.hh"
34 
35 #include "tools/histo/p1d"
36 
37 #include <fstream>
38 
39 using namespace G4Analysis;
40 
41 //
42 // Constructors, destructor
43 //
44 
45 //_____________________________________________________________________________
47  : G4VP1Manager(state),
48  fBaseToolsManager("P1"),
49  fP1Vector(),
50  fP1NameIdMap()
51 {
52 }
53 
54 //_____________________________________________________________________________
56 {
57  std::vector<tools::histo::p1d*>::iterator it;
58  for (it = fP1Vector.begin(); it != fP1Vector.end(); it++ ) {
59  delete (*it);
60  }
61 }
62 
63 //
64 // Utility functions
65 //
66 
67 namespace {
68 
69 //_____________________________________________________________________________
70 void UpdateP1Information(G4HnInformation* hnInformation,
71  const G4String& xunitName,
72  const G4String& yunitName,
73  const G4String& xfcnName,
74  const G4String& yfcnName,
75  G4BinScheme xbinScheme)
76 {
77  G4double xunit = GetUnitValue(xunitName);
78  G4double yunit = GetUnitValue(yunitName);
79  G4Fcn xfcn = GetFunction(xfcnName);
80  G4Fcn yfcn = GetFunction(yfcnName);
81 
82  G4HnDimensionInformation* xInformation
84  xInformation->fUnitName = xunitName;
85  xInformation->fFcnName = xfcnName;
86  xInformation->fUnit = xunit;
87  xInformation->fFcn = xfcn;
88  xInformation->fBinScheme = xbinScheme;
89 
90  G4HnDimensionInformation* yInformation
92  yInformation->fUnitName = yunitName;
93  yInformation->fFcnName = yfcnName;
94  yInformation->fUnit = yunit;
95  yInformation->fFcn = yfcn;
96  yInformation->fBinScheme = kLinearBinScheme;
97 }
98 
99 //_____________________________________________________________________________
100 void AddP1Annotation(tools::histo::p1d* p1d,
101  const G4String& xunitName,
102  const G4String& yunitName,
103  const G4String& xfcnName,
104  const G4String& yfcnName)
105 {
106  G4String xaxisTitle;
107  G4String yaxisTitle;
108  UpdateTitle(xaxisTitle, xunitName, xfcnName);
109  UpdateTitle(yaxisTitle, yunitName, yfcnName);
110  p1d->add_annotation(tools::histo::key_axis_x_title(), xaxisTitle);
111  p1d->add_annotation(tools::histo::key_axis_y_title(), yaxisTitle);
112 }
113 
114 //_____________________________________________________________________________
115 tools::histo::p1d* CreateToolsP1(const G4String& title,
116  G4int nbins, G4double xmin, G4double xmax,
117  G4double ymin, G4double ymax,
118  const G4String& xunitName,
119  const G4String& yunitName,
120  const G4String& xfcnName,
121  const G4String& yfcnName,
122  const G4String& xbinSchemeName)
123 {
124  G4double xunit = GetUnitValue(xunitName);
125  G4double yunit = GetUnitValue(yunitName);
126  G4Fcn xfcn = GetFunction(xfcnName);
127  G4Fcn yfcn = GetFunction(yfcnName);
128  G4BinScheme xbinScheme = GetBinScheme(xbinSchemeName);
129 
130  if ( xbinScheme != kLogBinScheme ) {
131  if ( xbinScheme == kUserBinScheme ) {
132  // This should never happen, but let's make sure about it
133  // by issuing a warning
134  G4ExceptionDescription description;
135  description
136  << " User binning scheme setting was ignored." << G4endl
137  << " Linear binning will be applied with given (nbins, xmin, xmax) values";
138  G4Exception("G4P1ToolsManager::CreateP1",
139  "Analysis_W013", JustWarning, description);
140  }
141  return new tools::histo::p1d(title,
142  nbins, xfcn(xmin/xunit), xfcn(xmax/xunit),
143  yfcn(ymin/yunit), yfcn(ymax/yunit));
144  }
145  else {
146  // Compute edges
147  std::vector<G4double> edges;
148  ComputeEdges(nbins, xmin, xmax, xunit, xfcn, xbinScheme, edges);
149  return new tools::histo::p1d(title, edges, yfcn(ymin/yunit), yfcn(ymax/yunit));
150  }
151 }
152 
153 //_____________________________________________________________________________
154 tools::histo::p1d* CreateToolsP1(const G4String& title,
155  const std::vector<G4double>& edges,
156  G4double ymin, G4double ymax,
157  const G4String& xunitName,
158  const G4String& yunitName,
159  const G4String& xfcnName,
160  const G4String& yfcnName)
161 {
162  G4double xunit = GetUnitValue(xunitName);
163  G4double yunit = GetUnitValue(yunitName);
164  G4Fcn xfcn = GetFunction(xfcnName);
165  G4Fcn yfcn = GetFunction(yfcnName);
166 
167  // Apply function
168  std::vector<G4double> newEdges;
169  ComputeEdges(edges, xunit, xfcn, newEdges);
170 
171  return new tools::histo::p1d(title, newEdges, yfcn(ymin/yunit), yfcn(ymax/yunit));
172 }
173 
174 //_____________________________________________________________________________
175 void ConfigureToolsP1(tools::histo::p1d* p1d,
176  G4int nbins, G4double xmin, G4double xmax,
177  G4double ymin, G4double ymax,
178  const G4String& xunitName,
179  const G4String& yunitName,
180  const G4String& xfcnName,
181  const G4String& yfcnName,
182  const G4String& xbinSchemeName)
183 {
184  G4double xunit = GetUnitValue(xunitName);
185  G4double yunit = GetUnitValue(yunitName);
186  G4Fcn xfcn = GetFunction(xfcnName);
187  G4Fcn yfcn = GetFunction(yfcnName);
188  G4BinScheme xbinScheme = GetBinScheme(xbinSchemeName);
189 
190  if ( xbinScheme != kLogBinScheme ) {
191  if ( xbinScheme == kUserBinScheme ) {
192  // This should never happen, but let's make sure about it
193  // by issuing a warning
194  G4ExceptionDescription description;
195  description
196  << " User binning scheme setting was ignored." << G4endl
197  << " Linear binning will be applied with given (nbins, xmin, xmax) values";
198  G4Exception("G4P1ToolsManager::SetP1",
199  "Analysis_W013", JustWarning, description);
200  }
201  p1d->configure(nbins, xfcn(xmin/xunit), xfcn(xmax/xunit),
202  yfcn(ymin/yunit), yfcn(ymax/yunit));
203  }
204  else {
205  // Compute bins
206  std::vector<G4double> edges;
207  ComputeEdges(nbins, xmin, xmax, xunit, xfcn, xbinScheme, edges);
208  p1d->configure(edges, yfcn(ymin/yunit), yfcn(ymax/yunit));
209  }
210 }
211 
212 //_____________________________________________________________________________
213 void ConfigureToolsP1(tools::histo::p1d* p1d,
214  const std::vector<G4double>& edges,
215  G4double ymin, G4double ymax,
216  const G4String& xunitName,
217  const G4String& yunitName,
218  const G4String& xfcnName,
219  const G4String& yfcnName)
220 {
221  // Apply function to edges
222  G4double xunit = GetUnitValue(xunitName);
223  G4double yunit = GetUnitValue(yunitName);
224  G4Fcn xfcn = GetFunction(xfcnName);
225  G4Fcn yfcn = GetFunction(yfcnName);
226  std::vector<G4double> newEdges;
227  ComputeEdges(edges, xunit, xfcn, newEdges);
228 
229  p1d->configure(newEdges, yfcn(ymin/yunit), yfcn(ymax/yunit));
230 }
231 }
232 
233 //
234 // private methods
235 //
236 
237 //_____________________________________________________________________________
239  G4String functionName, G4bool warn,
240  G4bool onlyIfActive) const
241 {
242  G4int index = id - fFirstId;
243  if ( index < 0 || index >= G4int(fP1Vector.size()) ) {
244  if ( warn) {
245  G4String inFunction = "G4P1ToolsManager::";
246  inFunction += functionName;
247  G4ExceptionDescription description;
248  description << " " << "profile " << id << " does not exist.";
249  G4Exception(inFunction, "Analysis_W011", JustWarning, description);
250  }
251  return 0;
252  }
253 
254  // Do not return profile if inactive
255  if ( fState.GetIsActivation() && onlyIfActive && ( ! fHnManager->GetActivation(id) ) ) {
256  return 0;
257  }
258 
259  return fP1Vector[index];
260 }
261 
262 //_____________________________________________________________________________
264  const G4String& xunitName,
265  const G4String& yunitName,
266  const G4String& xfcnName,
267  const G4String& yfcnName,
268  G4BinScheme xbinScheme) const
269 {
270  G4double xunit = GetUnitValue(xunitName);
271  G4double yunit = GetUnitValue(yunitName);
272  G4Fcn xfcn = GetFunction(xfcnName);
273  G4Fcn yfcn = GetFunction(yfcnName);
274  fHnManager
275  ->AddH2Information(name, xunitName, yunitName, xfcnName, yfcnName,
276  xunit, yunit, xfcn, yfcn,
277  xbinScheme, xbinScheme);
278 }
279 
280 //_____________________________________________________________________________
281 G4int G4P1ToolsManager::RegisterToolsP1(tools::histo::p1d* p1d,
282  const G4String& name)
283 {
284  G4int index = fP1Vector.size();
285  fP1Vector.push_back(p1d);
286 
287  fLockFirstId = true;
288  fP1NameIdMap[name] = index + fFirstId;
289  return index + fFirstId;
290 }
291 
292 //
293 // protected methods
294 //
295 
296 //_____________________________________________________________________________
298  G4int nbins, G4double xmin, G4double xmax,
299  G4double ymin, G4double ymax,
300  const G4String& xunitName, const G4String& yunitName,
301  const G4String& xfcnName, const G4String& yfcnName,
302  const G4String& xbinSchemeName)
303 {
304 #ifdef G4VERBOSE
305  if ( fState.GetVerboseL4() )
306  fState.GetVerboseL4()->Message("create", "P1", name);
307 #endif
308  tools::histo::p1d* p1d
309  = CreateToolsP1(title, nbins, xmin, xmax, ymin, ymax,
310  xunitName, yunitName, xfcnName, yfcnName,
311  xbinSchemeName);
312 
313  // Add annotation
314  AddP1Annotation(p1d, xunitName, yunitName, xfcnName, yfcnName);
315 
316  // Save P1 information
317  G4BinScheme xbinScheme = GetBinScheme(xbinSchemeName);
319  name, xunitName, yunitName, xfcnName, yfcnName, xbinScheme);
320 
321  // Register profile
322  G4int id = RegisterToolsP1(p1d, name);
323 
324 #ifdef G4VERBOSE
325  if ( fState.GetVerboseL2() )
326  fState.GetVerboseL2()->Message("create", "P1", name);
327 #endif
328  return id;
329 }
330 
331 //_____________________________________________________________________________
333  const std::vector<G4double>& edges,
334  G4double ymin, G4double ymax,
335  const G4String& xunitName, const G4String& yunitName,
336  const G4String& xfcnName, const G4String& yfcnName)
337 {
338 #ifdef G4VERBOSE
339  if ( fState.GetVerboseL4() )
340  fState.GetVerboseL4()->Message("create", "P1", name);
341 #endif
342  tools::histo::p1d* p1d
343  = CreateToolsP1(title, edges, ymin, ymax,
344  xunitName, yunitName, xfcnName, yfcnName);
345 
346  // Add annotation
347  AddP1Annotation(p1d, xunitName, yunitName, xfcnName, yfcnName);
348 
349  // Save P1 information
351  name, xunitName, yunitName, xfcnName, yfcnName, kUserBinScheme);
352 
353  // Register profile
354  G4int id = RegisterToolsP1(p1d, name);
355 
356 #ifdef G4VERBOSE
357  if ( fState.GetVerboseL2() )
358  fState.GetVerboseL2()->Message("create", "P1", name);
359 #endif
360  return id;
361 }
362 
363 //_____________________________________________________________________________
365  G4int nbins, G4double xmin, G4double xmax,
366  G4double ymin, G4double ymax,
367  const G4String& xunitName, const G4String& yunitName,
368  const G4String& xfcnName, const G4String& yfcnName,
369  const G4String& xbinSchemeName)
370 {
371  tools::histo::p1d* p1d = GetP1InFunction(id, "SetP1", false, false);
372  if ( ! p1d ) return false;
373 
374  G4HnInformation* info = fHnManager->GetHnInformation(id,"SetP1");
375 #ifdef G4VERBOSE
376  if ( fState.GetVerboseL4() )
377  fState.GetVerboseL4()->Message("configure", "P1", info->GetName());
378 #endif
379 
380  // Configure tools p1
381  ConfigureToolsP1(
382  p1d, nbins, xmin, xmax, ymin, ymax,
383  xunitName, yunitName, xfcnName, yfcnName, xbinSchemeName);
384 
385  // Add annotation
386  AddP1Annotation(p1d, xunitName, yunitName, xfcnName, yfcnName);
387 
388  // Update information
389  G4BinScheme xbinScheme = GetBinScheme(xbinSchemeName);
390  UpdateP1Information(
391  info, xunitName, yunitName, xfcnName, yfcnName, xbinScheme);
392 
393  // Set activation
394  fHnManager->SetActivation(id, true);
395 
396  return true;
397 }
398 
399 //_____________________________________________________________________________
401  const std::vector<G4double>& edges,
402  G4double ymin, G4double ymax,
403  const G4String& xunitName, const G4String& yunitName,
404  const G4String& xfcnName, const G4String& yfcnName)
405 {
406  tools::histo::p1d* p1d = GetP1InFunction(id, "SetP1", false, false);
407  if ( ! p1d ) return false;
408 
409  G4HnInformation* info = fHnManager->GetHnInformation(id,"SetP1");
410 #ifdef G4VERBOSE
411  if ( fState.GetVerboseL4() )
412  fState.GetVerboseL4()->Message("configure", "P1", info->GetName());
413 #endif
414 
415  // Configure tools p1
416  ConfigureToolsP1(p1d, edges, ymin, ymax,
417  xunitName, yunitName, xfcnName, yfcnName);
418 
419  // Add annotation
420  AddP1Annotation(p1d, xunitName, yunitName, xfcnName, yfcnName);
421 
422  // Update information
423  UpdateP1Information(
424  info, xunitName, yunitName, xfcnName, yfcnName, kUserBinScheme);
425 
426  // Set activation
427  fHnManager->SetActivation(id, true);
428 
429  return true;
430 }
431 
432 
433 //_____________________________________________________________________________
435 {
436  tools::histo::p1d* p1d = GetP1InFunction(id, "ScaleP1", false, false);
437  if ( ! p1d ) return false;
438 
439  return p1d->scale(factor);
440 }
441 
442 //_____________________________________________________________________________
444  G4double weight)
445 {
446  tools::histo::p1d* p1d = GetP1InFunction(id, "FillP1", true, false);
447  if ( ! p1d ) return false;
448 
449  if ( fState.GetIsActivation() && ( ! fHnManager->GetActivation(id) ) ) {
450  //G4cout << "Skipping FillP1 for " << id << G4endl;
451  return false;
452  }
453 
458 
459  p1d->fill(xInfo->fFcn(xvalue/xInfo->fUnit),
460  yInfo->fFcn(yvalue/yInfo->fUnit), weight);
461 
462 #ifdef G4VERBOSE
463  if ( fState.GetVerboseL4() ) {
464  G4ExceptionDescription description;
465  description << " id " << id
466  << " xvalue " << xvalue
467  << " xfcn(xvalue/xunit) " << xInfo->fFcn(xvalue/xInfo->fUnit)
468  << " yvalue " << yvalue
469  << " yfcn(yvalue/yunit) " << yInfo->fFcn(yvalue/yInfo->fUnit)
470  << " weight " << weight;
471  fState.GetVerboseL4()->Message("fill", "P1", description);
472  }
473 #endif
474  return true;
475 }
476 
477 //_____________________________________________________________________________
479 {
480  std::map<G4String, G4int>::const_iterator it = fP1NameIdMap.find(name);
481  if ( it == fP1NameIdMap.end() ) {
482  if ( warn) {
483  G4String inFunction = "G4P1ToolsManager::GetP1Id";
484  G4ExceptionDescription description;
485  description << " " << "profile " << name << " does not exist.";
486  G4Exception(inFunction, "Analysis_W011", JustWarning, description);
487  }
488  return kInvalidId;
489  }
490  return it->second;
491 }
492 
493 //_____________________________________________________________________________
495 {
496  tools::histo::p1d* p1d = GetP1InFunction(id, "GetP1Nbins");
497  if ( ! p1d ) return 0;
498 
500 }
501 
502 //_____________________________________________________________________________
504 {
505 // Returns xmin value with applied unit and profile function
506 
507  tools::histo::p1d* p1d = GetP1InFunction(id, "GetP1Xmin");
508  if ( ! p1d ) return 0;
509 
511 }
512 
513 //_____________________________________________________________________________
515 {
516  tools::histo::p1d* p1d = GetP1InFunction(id, "GetP1Xmax");
517  if ( ! p1d ) return 0;
518 
520 }
521 
522 //_____________________________________________________________________________
524 {
525  tools::histo::p1d* p1d = GetP1InFunction(id, "GetP1XWidth", true, false);
526  if ( ! p1d ) return 0;
527 
529 }
530 
531 //_____________________________________________________________________________
533 {
534 // Returns xmin value with applied unit and profile function
535 
536  tools::histo::p1d* p1d = GetP1InFunction(id, "GetP1Ymin");
537  if ( ! p1d ) return 0;
538 
539  return p1d->min_v();
540 }
541 
542 //_____________________________________________________________________________
544 {
545  tools::histo::p1d* p1d = GetP1InFunction(id, "GetP1Ymax");
546  if ( ! p1d ) return 0;
547 
548  return p1d->max_v();
549 }
550 
551 //_____________________________________________________________________________
553 {
554  tools::histo::p1d* p1d = GetP1InFunction(id, "SetP1Title");
555  if ( ! p1d ) return false;
556 
557  return fBaseToolsManager.SetTitle(*p1d, title);
558 }
559 
560 //_____________________________________________________________________________
562 {
563  tools::histo::p1d* p1d = GetP1InFunction(id, "SetP1XAxisTitle");
564  if ( ! p1d ) return false;
565 
567 }
568 
569 //_____________________________________________________________________________
571 {
572  tools::histo::p1d* p1d = GetP1InFunction(id, "SetP1YAxisTitle");
573  if ( ! p1d ) return false;
574 
576 }
577 
578 //_____________________________________________________________________________
580 {
581  tools::histo::p1d* p1d = GetP1InFunction(id, "GetP1Title");
582  if ( ! p1d ) return "";
583 
584  return fBaseToolsManager.GetTitle(*p1d);
585 }
586 
587 
588 //_____________________________________________________________________________
590 {
591  tools::histo::p1d* p1d = GetP1InFunction(id, "GetP1XAxisTitle");
592  if ( ! p1d ) return "";
593 
595 }
596 
597 //_____________________________________________________________________________
599 {
600  tools::histo::p1d* p1d = GetP1InFunction(id, "GetP1YAxisTitle");
601  if ( ! p1d ) return "";
602 
604 }
605 
606 //
607 // public methods
608 //
609 
610 //_____________________________________________________________________________
611 G4int G4P1ToolsManager::AddP1(const G4String& name, tools::histo::p1d* p1d)
612 {
613 #ifdef G4VERBOSE
614  if ( fState.GetVerboseL4() )
615  fState.GetVerboseL4()->Message("add", "P1", name);
616 #endif
617 
618  // Add annotation
619  AddP1Annotation(p1d, "none", "none", "none", "none");
620  // Add information
621  AddP1Information(name, "none", "none", "none", "none", kLinearBinScheme);
622 
623  // Register profile
624  G4int id = RegisterToolsP1(p1d, name);
625 
626 #ifdef G4VERBOSE
627  if ( fState.GetVerboseL2() )
628  fState.GetVerboseL2()->Message("add", "P1", name);
629 #endif
630  return id;
631 }
632 
633 //_____________________________________________________________________________
635  const std::vector<tools::histo::p1d*>& p1Vector)
636 {
637 #ifdef G4VERBOSE
638  if ( fState.GetVerboseL4() )
639  fState.GetVerboseL4()->Message("merge", "all p1", "");
640 #endif
641  std::vector<tools::histo::p1d*>::const_iterator itw = p1Vector.begin();
642  std::vector<tools::histo::p1d*>::iterator it;
643  for (it = fP1Vector.begin(); it != fP1Vector.end(); it++ ) {
644  (*it)->add(*(*itw++));
645  }
646 #ifdef G4VERBOSE
647  if ( fState.GetVerboseL1() )
648  fState.GetVerboseL1()->Message("merge", "all p1", "");
649 #endif
650 }
651 
652 //_____________________________________________________________________________
654 {
655 // Reset profiles and ntuple
656 
657  G4bool finalResult = true;
658 
659  std::vector<tools::histo::p1d*>::iterator it;
660  for (it = fP1Vector.begin(); it != fP1Vector.end(); it++ ) {
661  G4bool result = (*it)->reset();
662  if ( ! result ) finalResult = false;
663  }
664 
665  return finalResult;
666 }
667 
668 //_____________________________________________________________________________
670 {
671  return ! fP1Vector.size();
672 }
673 
674 //_____________________________________________________________________________
675 tools::histo::p1d* G4P1ToolsManager::GetP1(G4int id, G4bool warn,
676  G4bool onlyIfActive) const
677 {
678  return GetP1InFunction(id, "GetP1", warn, onlyIfActive);
679 }
680 
void AddP1Information(const G4String &name, const G4String &xunitName, const G4String &yunitName, const G4String &xfcnName, const G4String &yfcnName, G4BinScheme xbinScheme) const
virtual ~G4P1ToolsManager()
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
G4bool SetTitle(G4ToolsBaseHisto &baseHisto, const G4String &title)
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4String GetTitle(const G4ToolsBaseHisto &baseHisto) const
void ComputeEdges(G4int nbins, G4double xmin, G4double xmax, G4double unit, G4Fcn fcn, G4BinScheme, std::vector< G4double > &edges)
Definition: G4BinScheme.cc:56
virtual G4double GetP1Ymin(G4int id) const
static const G4int kY
G4String name
Definition: TRTMaterials.hh:40
void AddP1Vector(const std::vector< tools::histo::p1d * > &p1Vector)
G4double(* G4Fcn)(G4double)
Definition: G4Fcn.hh:36
virtual G4String GetP1Title(G4int id) const
virtual G4double GetP1Ymax(G4int id) const
virtual G4String GetP1XAxisTitle(G4int id) const
virtual G4double GetP1XWidth(G4int id) const
std::vector< tools::histo::p1d * > fP1Vector
int G4int
Definition: G4Types.hh:78
G4HnManager * fHnManager
std::map< G4String, G4int > fP1NameIdMap
G4String GetAxisTitle(const G4ToolsBaseHisto &baseHisto, G4int dimension) const
G4HnInformation * GetHnInformation(G4int id, G4String functionName="", G4bool warn=true) const
Definition: G4HnManager.cc:123
G4bool GetActivation(G4int id) const
Definition: G4HnManager.cc:270
const G4AnalysisVerbose * GetVerboseL2() const
void UpdateTitle(G4String &title, const G4String &unitName, const G4String &fcnName)
virtual G4String GetP1YAxisTitle(G4int id) const
G4BaseToolsManager fBaseToolsManager
G4int GetNbins(const G4ToolsBaseHisto &baseHisto, G4int dimension) const
const G4AnalysisVerbose * GetVerboseL4() const
bool G4bool
Definition: G4Types.hh:79
virtual G4bool FillP1(G4int id, G4double xvalue, G4double yvalue, G4double weight=1.0)
G4double GetWidth(const G4ToolsBaseHisto &baseHisto, G4int dimension) const
virtual G4bool ScaleP1(G4int id, G4double factor)
G4double GetUnitValue(const G4String &unit)
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")
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
virtual G4bool SetP1XAxisTitle(G4int id, const G4String &title)
G4bool IsEmpty() const
virtual G4bool SetP1YAxisTitle(G4int id, const G4String &title)
G4int AddP1(const G4String &name, tools::histo::p1d *p1d)
static const G4double factor
G4Fcn GetFunction(const G4String &fcnName)
Definition: G4Fcn.cc:36
G4int RegisterToolsP1(tools::histo::p1d *p1d, const G4String &name)
G4double GetMax(const G4ToolsBaseHisto &baseHisto, G4int dimension) const
G4HnDimensionInformation * GetHnDimensionInformation(G4int dimension)
G4BinScheme GetBinScheme(const G4String &binSchemeName)
Definition: G4BinScheme.cc:36
virtual G4double GetP1Xmin(G4int id) const
virtual tools::histo::p1d * GetP1InFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
#define G4endl
Definition: G4ios.hh:61
G4String GetName() const
G4BinScheme
Definition: G4BinScheme.hh:40
void AddH2Information(const G4String &name, const G4String &xunitName, const G4String &yunitName, const G4String &xfcnName, const G4String &yfcnName, G4double xunit, G4double yunit, G4Fcn fx, G4Fcn fy, G4BinScheme xBinScheme, G4BinScheme yBinScheme)
Definition: G4HnManager.cc:73
virtual G4double GetP1Xmax(G4int id) const
double G4double
Definition: G4Types.hh:76
virtual G4int GetP1Nbins(G4int id) const
virtual G4bool SetP1Title(G4int id, const G4String &title)
G4double GetMin(const G4ToolsBaseHisto &baseHisto, G4int dimension) const
G4P1ToolsManager(const G4AnalysisManagerState &state)
virtual G4int GetP1Id(const G4String &name, G4bool warn=true) const
const G4int kInvalidId
const G4AnalysisVerbose * GetVerboseL1() const
void SetActivation(G4bool activation)
Definition: G4HnManager.cc:188
const G4AnalysisManagerState & fState
G4bool SetAxisTitle(G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)
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")
static const G4int kX
G4HnDimensionInformation * GetHnDimensionInformation(G4int id, G4int dimension, G4String functionName="", G4bool warn=true) const
Definition: G4HnManager.cc:145
tools::histo::p1d * GetP1(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const