48 for (
auto info : fHnVector ) {
84 fNofPlottingObjects++;
87 fNofPlottingObjects--;
97 auto hnFileName = fileName;
99 if (extension.size() != 0u) {
103 Warn(
"The file extension " + extension +
" is not supported.",
104 fkClass,
"SetFileName");
109 if (fDefaultFileType.size() != 0u) {
111 hnFileName = fileName +
"." + fDefaultFileType;
118 fFileManager->AddFileName(hnFileName);
120 Warn(
"Failed to set fileName " + fileName +
121 " for object " + info->
GetName() +
".\nFile manager is not set.",
122 fkClass,
"SetFileName");
126 if ( hnFileName !=
"" ) {
127 fNofFileNameObjects++;
129 fNofFileNameObjects--;
140 fMessenger = std::make_unique<G4HnMessenger>(*
this);
148 fHnVector.push_back(info);
159 auto previousInfo = fHnVector[index];
160 if (previousInfo->GetDeletedPair().second) {
161 info->
Update(*previousInfo);
165 fHnVector[index] = info;
168 if (info->
GetAscii()) { ++fNofAsciiObjects; }
169 if (info->
GetPlotting()) { ++fNofPlottingObjects; }
170 if (! info->
GetFileName().empty()) { ++fNofFileNameObjects; }
179 if (info->
GetAscii()) { --fNofAsciiObjects; }
180 if (info->
GetPlotting()) { --fNofPlottingObjects; }
181 if (! info->
GetFileName().empty()) { --fNofFileNameObjects; }
187 for (
auto info : fHnVector ) {
196 std::string_view functionName,
G4bool warn)
const
199 if ( index < 0 || index >=
G4int(fHnVector.size()) ) {
201 Warn(fHnType +
" histogram " + to_string(
id) +
" does not exist.",
202 fkClass, functionName);
206 return fHnVector[index];
212 std::string_view functionName,
G4bool warn)
const
215 if (info ==
nullptr)
return nullptr;
223 return ( fNofActiveObjects > 0 );
229 return ( fNofAsciiObjects > 0 );
235 return ( fNofPlottingObjects > 0 );
241 return ( fNofFileNameObjects > 0 );
251 if (info ==
nullptr)
return;
265 for (
auto info : fHnVector ) {
275 if (info ==
nullptr)
return;
278 if ( info->
GetAscii() == ascii )
return;
295 if (info ==
nullptr)
return;
305 for (
auto info : fHnVector ) {
315 if (info ==
nullptr)
return;
325 for (
auto info : fHnVector ) {
335 if (info ==
nullptr)
return false;
346 if (info ==
nullptr)
return "";
356 if (info ==
nullptr)
return 1.0;
366 if (info ==
nullptr)
return false;
376 if (info ==
nullptr)
return true;
386 if (info ==
nullptr)
return false;
396 if (info ==
nullptr)
return false;
406 if (info ==
nullptr)
return "";
void SetLockFirstId(G4bool lockFirstId)
G4HnDimensionInformation * GetHnDimensionInformation(G4int id, G4int dimension, std::string_view functionName, G4bool warn=true) const
G4bool GetPlotting(G4int id) const
G4bool SetAxisIsLog(unsigned int idim, G4int id, G4bool isLogAxis)
void SetActivation(G4bool activation)
G4String GetFileName(G4int id) const
void SetHnDeleted(G4HnInformation *info, G4bool keepSetting)
G4String GetName(G4int id) const
G4bool IsPlotting() const
void SetFileName(G4int id, const G4String &fileName)
G4bool GetActivation(G4int id) const
void AddHnInformation(G4HnInformation *info)
G4bool GetAxisIsLog(unsigned int idim, G4int id) const
G4double GetUnit(unsigned int idim, G4int id) const
void SetAscii(G4int id, G4bool ascii)
void SetPlotting(G4int id, G4bool plotting)
G4HnInformation * GetHnInformation(G4int id, std::string_view functionName, G4bool warn=true) const
G4bool GetAscii(G4int id) const
G4bool IsFileName() const
G4String GetExtension(const G4String &fileName, const G4String &defaultExtension="")
G4AnalysisOutput GetOutput(const G4String &outputName, G4bool warn=true)
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)