44 #include "tools/wcsv_histo"
91 <<
"G4CsvAnalysisManager already exists."
92 <<
"Cannot create another instance.";
93 G4Exception(
"G4CsvAnalysisManager::G4CsvAnalysisManager()",
135 const std::vector<G4CsvNtupleDescription*>& ntupleVector
139 std::vector<G4CsvNtupleDescription*>::const_iterator it;
140 for (it = ntupleVector.begin(); it != ntupleVector.end(); it++ ) {
159 const std::vector<tools::histo::h1d*>& h1Vector
161 const std::vector<G4HnInformation*>& hnVector
164 if ( ! h1Vector.size() )
return true;
168 for (
G4int i=0; i<
G4int(h1Vector.size()); ++i ) {
174 tools::histo::h1d* h1 = h1Vector[i];
176 std::ofstream hnFile(fileName);
179 = tools::wcsv::hto(hnFile, h1->s_cls(), *h1);
182 description <<
" " <<
"saving histogram " << name <<
" failed";
209 const std::vector<tools::histo::h2d*>& h2Vector
211 const std::vector<G4HnInformation*>& hnVector
214 if ( ! h2Vector.size() )
return true;
219 for (
G4int i=0; i<
G4int(h2Vector.size()); ++i ) {
225 tools::histo::h2d* h2 = h2Vector[i];
227 std::ofstream hnFile(fileName);
229 = tools::wcsv::hto(hnFile, h2->s_cls(), *h2);
232 description <<
" " <<
"saving histogram " << name <<
" failed";
259 const std::vector<tools::histo::h3d*>& h3Vector
261 const std::vector<G4HnInformation*>& hnVector
264 if ( ! h3Vector.size() )
return true;
269 for (
G4int i=0; i<
G4int(h3Vector.size()); ++i ) {
275 tools::histo::h3d* h3 = h3Vector[i];
277 std::ofstream hnFile(fileName);
279 = tools::wcsv::hto(hnFile, h3->s_cls(), *h3);
282 description <<
" " <<
"saving histogram " << name <<
" failed";
309 const std::vector<tools::histo::p1d*>& p1Vector
311 const std::vector<G4HnInformation*>& hnVector
314 if ( ! p1Vector.size() )
return true;
318 for (
G4int i=0; i<
G4int(p1Vector.size()); ++i ) {
324 tools::histo::p1d*
p1 = p1Vector[i];
326 std::ofstream hnFile(fileName);
328 = tools::wcsv::pto(hnFile, p1->s_cls(), *
p1);
331 description <<
" " <<
"saving profile " << name <<
" failed";
358 const std::vector<tools::histo::p2d*>& p2Vector
360 const std::vector<G4HnInformation*>& hnVector
363 if ( ! p2Vector.size() )
return true;
367 for (
G4int i=0; i<
G4int(p2Vector.size()); ++i ) {
373 tools::histo::p2d*
p2 = p2Vector[i];
375 std::ofstream hnFile(fileName);
377 = tools::wcsv::pto(hnFile, p2->s_cls(), *
p2);
380 description <<
" " <<
"saving profile " << name <<
" failed";
409 G4bool finalResult =
true;
412 finalResult = finalResult && result;
415 finalResult = finalResult && result;
418 finalResult = finalResult && result;
421 finalResult = finalResult && result;
424 finalResult = finalResult && result;
427 finalResult = finalResult && result;
435 G4bool finalResult =
true;
437 finalResult = finalResult && result;
441 finalResult = finalResult && result;
457 G4bool finalResult =
true;
472 <<
" " <<
"No master G4CsvAnalysisManager instance exists."
474 <<
" " <<
"Histogram data will not be merged.";
481 finalResult = finalResult && result;
485 finalResult = finalResult && result;
489 finalResult = finalResult && result;
493 finalResult = finalResult && result;
497 finalResult = finalResult && result;
511 ->
Message(
"write",
"files",
"", finalResult);
520 G4bool finalResult =
true;
524 finalResult = finalResult && result;
531 finalResult = finalResult && result;
537 description <<
" " <<
"Resetting data failed";
542 finalResult = finalResult && result;
void SetP1Manager(G4VP1Manager *p1Manager)
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
void SetFileManager(G4CsvFileManager *fileManager)
G4H3ToolsManager * fH3Manager
std::ostringstream G4ExceptionDescription
G4H2ToolsManager * fH2Manager
static G4ThreadLocal G4CsvAnalysisManager * fgInstance
virtual G4bool CloseFile()
void SetH1Manager(G4VH1Manager *h1Manager)
G4CsvFileManager * fFileManager
G4P1ToolsManager * fP1Manager
virtual G4bool WriteImpl()
virtual G4bool OpenFileImpl(const G4String &fileName)
G4CsvAnalysisManager(G4bool isMaster=true)
G4P2ToolsManager * fP2Manager
G4bool CloseNtupleFile(G4CsvNtupleDescription *ntupleDescription)
G4String GetHnFileName(const G4String &hnType, const G4String &hnName) const
#define G4MUTEX_INITIALIZER
static G4CsvAnalysisManager * Instance()
void CreateNtuplesFromBooking()
void SetH3Manager(G4VH3Manager *h3Manager)
G4bool CloseNtupleFiles()
void LockProfileDirectoryName()
void SetP2Manager(G4VP2Manager *p2Manager)
const G4AnalysisVerbose * GetVerboseL4() const
virtual G4bool CloseFileImpl()
G4CsvNtupleManager * fNtupleManager
void SetFileManager(G4VFileManager *fileManager)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetH2Manager(G4VH2Manager *h2Manager)
const std::vector< G4CsvNtupleDescription * > & GetNtupleDescriptionVector() const
G4bool GetIsMaster() const
virtual G4bool SetFileName(const G4String &fileName)
void LockHistoDirectoryName()
static G4CsvAnalysisManager * fgMasterInstance
virtual G4bool OpenFile(const G4String &fileName)
G4AnalysisManagerState fState
G4bool GetIsActivation() const
const G4AnalysisVerbose * GetVerboseL1() const
void SetNtupleManager(G4VNtupleManager *ntupleManager)
G4H1ToolsManager * fH1Manager