35 #include "tools/histo/h1d" 
   75 void AddH1Annotation(tools::histo::h1d* h1d,
 
   81   h1d->add_annotation(tools::histo::key_axis_x_title(), axisTitle);
 
   85 tools::histo::h1d* CreateToolsH1(
const G4String& title,
 
  101         << 
"    User binning scheme setting was ignored." << 
G4endl 
  102         << 
"    Linear binning will be applied with given (nbins, xmin, xmax) values";
 
  106     return new tools::histo::h1d(title, nbins, fcn(xmin/unit), fcn(xmax/unit));
 
  110     std::vector<G4double> edges;
 
  111     ComputeEdges(nbins, xmin, xmax, unit, fcn, binScheme, edges);
 
  112     return new tools::histo::h1d(title, edges); 
 
  117 tools::histo::h1d* CreateToolsH1(
const G4String& title,
 
  118                                  const std::vector<G4double>& edges,
 
  126   std::vector<G4double> newEdges;
 
  129   return new tools::histo::h1d(title, newEdges); 
 
  133 void ConfigureToolsH1(tools::histo::h1d* h1d,
 
  149         << 
"    User binning scheme setting was ignored." << 
G4endl 
  150         << 
"    Linear binning will be applied with given (nbins, xmin, xmax) values";
 
  154     h1d->configure(nbins, fcn(xmin/unit), fcn(xmax/unit));
 
  158     std::vector<G4double> edges;
 
  159     ComputeEdges(nbins, xmin, xmax, unit, fcn, binScheme, edges);
 
  160     h1d->configure(edges);
 
  165 void ConfigureToolsH1(tools::histo::h1d* h1d,
 
  166                       const std::vector<G4double>& edges,
 
  173   std::vector<G4double> newEdges;
 
  176   h1d->configure(newEdges);
 
  192   hnInformation->
AddDimension(unitName, fcnName, binScheme);
 
  212     = CreateToolsH1(title, nbins, xmin, xmax, unitName, fcnName, binSchemeName);
 
  215   AddH1Annotation(h1d, unitName, fcnName);        
 
  233                                  const std::vector<G4double>& edges,
 
  241     = CreateToolsH1(title, edges, unitName, fcnName);
 
  244   AddH1Annotation(h1d, unitName, fcnName);        
 
  266   if ( ! h1d ) 
return false;
 
  268   auto info = 
fHnManager->GetHnInformation(
id,
"SetH1");
 
  275   ConfigureToolsH1(h1d, nbins, xmin, xmax, unitName, fcnName, binSchemeName);
 
  278   AddH1Annotation(h1d, unitName, fcnName);        
 
  282   UpdateH1Information(info, unitName, fcnName, binScheme);
 
  292                            const std::vector<G4double>& edges,
 
  297   if ( ! h1d ) 
return false;
 
  299   auto info = 
fHnManager->GetHnInformation(
id,
"SetH1");
 
  306   ConfigureToolsH1(h1d, edges, unitName, fcnName);
 
  309   AddH1Annotation(h1d, unitName, fcnName);        
 
  325   if ( ! h1d ) 
return false;
 
  327   return h1d->scale(factor);
 
  334   if ( ! h1d ) 
return false;
 
  342     = 
fHnManager->GetHnDimensionInformation(
id, 
kX, 
"FillH1");
 
  343   h1d->fill(info->fFcn(value/info->fUnit), weight);
 
  347     description << 
" id " << 
id << 
" value " << value 
 
  348                 << 
" fcn(value/unit) " << info->fFcn(value/info->fUnit)  
 
  349                 << 
" weight " << weight;
 
  359   return GetTId(name, warn);
 
  366   if ( ! h1d ) 
return 0;
 
  377   if ( ! h1d ) 
return 0;
 
  386   if ( ! h1d ) 
return 0;
 
  395   if ( ! h1d ) 
return 0;
 
  404   if ( ! h1d ) 
return false;
 
  413   if ( ! h1d ) 
return false;
 
  422   if ( ! h1d ) 
return false;
 
  431   if ( ! h1d ) 
return "";
 
  441   if ( ! h1d ) 
return "";
 
  450   if ( ! h1d ) 
return "";
 
  465     auto info = 
fHnManager->GetHnInformation(
id,
"WriteOnAscii"); 
 
  467     if ( ! info->GetAscii() ) 
continue; 
 
  475     output << 
"\n  1D histogram " << 
id << 
": " << h1->title() 
 
  476            << 
"\n \n \t     X \t\t     Y" << 
G4endl;
 
  478     for (
G4int j=0; j< 
G4int(h1->axis().bins()); ++j) {
 
  479        output << 
"  " << j << 
"\t"  
  480               << h1->axis().bin_center(j) << 
"\t" 
  481               << h1->bin_height(j) << 
G4endl;
 
  501   AddH1Annotation(h1d, 
"none", 
"none");        
 
  518                           const std::vector<tools::histo::h1d*>& h1Vector)
 
  525                                             G4bool onlyIfActive)
 const  
G4double GetWidth(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
 
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const 
 
G4String GetTitle(const G4ToolsBaseHisto &baseHisto)
 
G4String GetAxisTitle(const G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &hnType)
 
G4double GetMin(const G4ToolsBaseHisto &baseHisto, G4int dimension)
 
std::ostringstream G4ExceptionDescription
 
void ComputeEdges(G4int nbins, G4double xmin, G4double xmax, G4double unit, G4Fcn fcn, G4BinScheme, std::vector< G4double > &edges)
 
G4bool SetAxisTitle(G4ToolsBaseHisto &baseHisto, G4int dimension, const G4String &title)
 
std::shared_ptr< G4HnManager > fHnManager
 
G4int RegisterT(tools::histo::h1d *t, const G4String &name)
 
const G4AnalysisVerbose * GetVerboseL2() const 
 
void UpdateTitle(G4String &title, const G4String &unitName, const G4String &fcnName)
 
const G4AnalysisManagerState & fState
 
const G4AnalysisVerbose * GetVerboseL3() const 
 
G4int GetTId(const G4String &name, G4bool warn=true) const
 
const G4AnalysisVerbose * GetVerboseL4() const 
 
tools::histo::h1d * GetTInFunction(G4int id, G4String functionName, G4bool warn=true, G4bool onlyIfActive=true) const
 
G4double GetUnitValue(const G4String &unit)
 
G4bool SetTitle(G4ToolsBaseHisto &baseHisto, const G4String &title)
 
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
 
static const G4double factor
 
G4Fcn GetFunction(const G4String &fcnName)
 
void AddTVector(const std::vector< tools::histo::h1d * > &tVector)
 
G4BinScheme GetBinScheme(const G4String &binSchemeName)
 
G4double GetMax(const G4ToolsBaseHisto &baseHisto, G4int dimension)
 
G4int GetNbins(const G4ToolsBaseHisto &baseHisto, G4int dimension)
 
std::vector< tools::histo::h1d * > fTVector
 
G4bool GetIsActivation() const