Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4RootAnalysisManager.cc
이 파일의 문서화 페이지로 가기
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: G4RootAnalysisManager.cc 106985 2017-10-31 10:07:18Z gcosmo $
27 
28 // Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
29 
30 #include "G4RootAnalysisManager.hh"
31 #include "G4RootFileManager.hh"
32 #include "G4RootNtupleManager.hh"
34 #include "G4RootPNtupleManager.hh"
35 #include "G4AnalysisVerbose.hh"
37 
38 #include "G4Threading.hh"
39 #include "G4AutoLock.hh"
40 
41 #include <iostream>
42 #include <cstdio>
43 
44 // mutex in a file scope
45 
46 namespace {
47  //Mutex to lock master manager when merging H1 histograms
48  G4Mutex mergeH1Mutex = G4MUTEX_INITIALIZER;
49  //Mutex to lock master manager when merging H1 histograms
50  G4Mutex mergeH2Mutex = G4MUTEX_INITIALIZER;
51  //Mutex to lock master manager when merging H1 histograms
52  G4Mutex mergeH3Mutex = G4MUTEX_INITIALIZER;
53  //Mutex to lock master manager when merging P1 profiles
54  G4Mutex mergeP1Mutex = G4MUTEX_INITIALIZER;
55  //Mutex to lock master manager when merging P2 profiles
56  G4Mutex mergeP2Mutex = G4MUTEX_INITIALIZER;
57 }
58 
61 
62 //_____________________________________________________________________________
64 {
65  if ( fgInstance == nullptr ) {
66  G4bool isMaster = ! G4Threading::IsWorkerThread();
67  fgInstance = new G4RootAnalysisManager(isMaster);
68  }
69 
70  return fgInstance;
71 }
72 
73 //_____________________________________________________________________________
75 {
76  return ( fgInstance != 0 );
77 }
78 
79 //_____________________________________________________________________________
81  : G4ToolsAnalysisManager("Root", isMaster),
82  fNofNtupleFiles(0),
83  fNtupleRowWise(true),
84  fNtupleMergeMode(G4NtupleMergeMode::kNone),
85  fNtupleManager(nullptr),
86  fSlaveNtupleManager(nullptr),
87  fFileManager(nullptr)
88 {
89  if ( ( isMaster && fgMasterInstance ) || ( fgInstance ) ) {
90  G4ExceptionDescription description;
91  description
92  << " "
93  << "G4RootAnalysisManager already exists."
94  << "Cannot create another instance.";
95  G4Exception("G4RootAnalysisManager::G4RootAnalysisManager()",
96  "Analysis_F001", FatalException, description);
97  }
98  if ( isMaster ) fgMasterInstance = this;
99  fgInstance = this;
100 
101  // File manager
102  fFileManager = std::make_shared<G4RootFileManager>(fState);
104  fFileManager->SetBasketSize(fgkDefaultBasketSize);
105 
106  // Do not merge ntuples by default
107  // Merging may require user code migration as analysis manager
108  // must be created both on master and workers.
109  auto mergeNtuples = false;
110  SetNtupleMergingMode(mergeNtuples, fNofNtupleFiles);
111 
112  // Create ntuple managers
114 }
115 
116 //_____________________________________________________________________________
118 {
119  if ( fState.GetIsMaster() ) fgMasterInstance = nullptr;
120  fgInstance = nullptr;
121 }
122 
123 //
124 // private methods
125 //
126 
127 //_____________________________________________________________________________
129  G4int nofNtupleFiles)
130 
131 {
132 #ifdef G4VERBOSE
133  if ( fState.GetVerboseL4() )
135  ->Message("set", "ntuple merging mode", "");
136 #endif
137 
138  auto canMerge = true;
139 
140  // Illegal situations
141  if ( mergeNtuples && ( ! G4Threading::IsMultithreadedApplication() ) ) {
142  if ( nofNtupleFiles > 0 ) {
143  G4ExceptionDescription description;
144  description
145  << " " << "Merging ntuples is not applicable in sequential application."
146  << G4endl
147  << " " << "Setting was ignored.";
148  G4Exception("G4RootAnalysisManager::SetNtupleMergingMode()",
149  "Analysis_W013", JustWarning, description);
150  }
151  canMerge = false;
152  }
153 
154  // Illegal situations
155  if ( mergeNtuples && G4Threading::IsMultithreadedApplication() &&
156  ( ! fgMasterInstance ) ) {
157  G4ExceptionDescription description;
158  description
159  << " " << "Merging ntuples requires G4AnalysisManager instance on master."
160  << G4endl
161  << " " << "Setting was ignored.";
162  G4Exception("G4RootAnalysisManager::SetNtupleMergingMode()",
163  "Analysis_W013", JustWarning, description);
164  canMerge = false;
165  }
166 
167  G4String mergingMode;
168  if ( ( ! mergeNtuples ) || ( ! canMerge ) ) {
170  mergingMode = "G4NtupleMergeMode::kNone";
171  }
172  else {
173  // Set the number of reduced ntuple files
174  // G4int nofThreads = G4Threading::GetNumberOfThreads();
175  fNofNtupleFiles = nofNtupleFiles;
176 
177  // Check the number of reduced ntuple files
178  // if ( fNofNtupleFiles < 0 || fNofNtupleFiles > nofThreads ) {
179  if ( fNofNtupleFiles < 0 ) {
180  G4ExceptionDescription description;
181  description
182  << " " << "Number of reduced files must be [0, nofThreads]."
183  << G4endl
184  << " " << "Cannot set " << nofNtupleFiles
185  // << " files when nofThreads is " << nofThreads << G4endl
186  << " files" << G4endl
187  << " " << "Ntuples will be merged in a single file.";
188  G4Exception("G4RootAnalysisManager::SetNtupleMergingMode()",
189  "Analysis_W013", JustWarning, description);
190  fNofNtupleFiles = 0;
191  }
192 
193  // if ( fNofNtupleFiles == nofThreads ) {
194  // // add warning that no merging will be applied
195  // fNtupleMergeMode = G4NtupleMergeMode::kNone;
196  // fNofNtupleFiles = 0;
197  // mergingMode = "G4NtupleMergeMode::kNone";
198  // }
199  // else {
200  // G4bool isMaster = ! G4Threading::IsWorkerThread();
201  // if ( isMaster ) {
202  // fNtupleMergeMode = G4NtupleMergeMode::kMain;
203  // mergingMode = "G4NtupleMergeMode::kMain";
204  // } else {
205  // fNtupleMergeMode = G4NtupleMergeMode::kSlave;
206  // mergingMode = "G4NtupleMergeMode::kSlave";
207  // }
208  // }
209 
210  // Forced merging mode
211  G4bool isMaster = ! G4Threading::IsWorkerThread();
212  if ( isMaster ) {
214  mergingMode = "G4NtupleMergeMode::kMain";
215  } else {
217  mergingMode = "G4NtupleMergeMode::kSlave";
218  }
219  }
220 
221 #ifdef G4VERBOSE
222  if ( fState.GetVerboseL2() )
224  ->Message("set", "ntuple merging mode", mergingMode);
225 #endif
226 }
227 
228 //_____________________________________________________________________________
230 {
231 #ifdef G4VERBOSE
232  if ( fState.GetVerboseL4() )
233  fState.GetVerboseL4()->Message("clear", "ntuple managers", "");
234 #endif
235 
237  // Do not reset master ntuple manager
238  delete fNtupleManager;
239  fNtupleManager = nullptr;
240  // SetNtupleManager(fNtupleManager);
241  }
242 
243  delete fSlaveNtupleManager;
244  fSlaveNtupleManager = nullptr;
245 
246 #ifdef G4VERBOSE
247  if ( fState.GetVerboseL3() )
248  fState.GetVerboseL3()->Message("clear", "ntuple managers", "");
249 #endif
250 }
251 
252 //_____________________________________________________________________________
254 {
255 #ifdef G4VERBOSE
256  if ( fState.GetVerboseL4() )
257  fState.GetVerboseL4()->Message("create", "ntuple managers", "");
258 #endif
259 
260  switch ( fNtupleMergeMode )
261  {
266  break;
267 
269  G4int nofMainManagers = fNofNtupleFiles;
270  if ( ! nofMainManagers ) nofMainManagers = 1;
271  // create one manager if merging required into the histos & profiles files
272  fNtupleManager = new G4RootNtupleManager(fState, nofMainManagers, fNtupleRowWise);
275  break;
276  }
277 
280  // The master class is used only in Get* functions
281  auto mainNtupleManager
283  fSlaveNtupleManager = new G4RootPNtupleManager(mainNtupleManager, fState);
285  break;
286  }
287 
288 #ifdef G4VERBOSE
289  if ( fState.GetVerboseL3() )
290  fState.GetVerboseL3()->Message("create", "ntuple managers", "");
291 #endif
292 }
293 
294 //_____________________________________________________________________________
296 {
297  if ( ! fNofNtupleFiles ) return 0;
298 
299  G4int nofMainManagers = fNofNtupleFiles;
300  if ( ! nofMainManagers ) nofMainManagers = 1;
301 
302  // Debug - check G4Threading::GetNumberOfRunningWorkerThreads()
303  G4cout << "In GetNtupleFileNumber: "
305 
306  auto fileNumber = G4Threading::G4GetThreadId() % nofMainManagers;
307  return fileNumber;
308 }
309 
310 //_____________________________________________________________________________
312 {
313  auto h1Vector = fH1Manager->GetH1Vector();
314  auto hnVector = fH1Manager->GetHnVector();
315 
316  if ( ! h1Vector.size() ) return true;
317 
318  auto result = true;
319 
320  if ( ! G4Threading::IsWorkerThread() ) {
321  auto directory = fFileManager->GetHistoDirectory();
322  result = WriteT(h1Vector, hnVector, directory, "h1");
323  }
324  else {
325  // The worker manager just adds its histograms to the master
326  // This operation needs a lock
327  G4AutoLock lH1(&mergeH1Mutex);
329  lH1.unlock();
330  }
331 
332  return result;
333 }
334 
335 //_____________________________________________________________________________
337 {
338  auto h2Vector = fH2Manager->GetH2Vector();
339  auto hnVector = fH2Manager->GetHnVector();
340 
341  if ( ! h2Vector.size() ) return true;
342 
343  auto result = true;
344 
345  if ( ! G4Threading::IsWorkerThread() ) {
346  auto directory = fFileManager->GetHistoDirectory();
347  result = WriteT(h2Vector, hnVector, directory, "h2");
348  }
349  else {
350  // The worker manager just adds its histograms to the master
351  // This operation needs a lock
352  G4AutoLock lH2(&mergeH2Mutex);
354  lH2.unlock();
355  }
356 
357  return result;
358 }
359 
360 //_____________________________________________________________________________
362 {
363  auto h3Vector = fH3Manager->GetH3Vector();
364  auto hnVector = fH3Manager->GetHnVector();
365 
366  if ( ! h3Vector.size() ) return true;
367 
368  auto result = true;
369 
370  if ( ! G4Threading::IsWorkerThread() ) {
371  auto directory = fFileManager->GetHistoDirectory();
372  result = WriteT(h3Vector, hnVector, directory, "h3");
373  }
374  else {
375  // The worker manager just adds its histograms to the master
376  // This operation needs a lock
377  G4AutoLock lH3(&mergeH3Mutex);
379  lH3.unlock();
380  }
381 
382  return result;
383 }
384 
385 //_____________________________________________________________________________
387 {
388  auto p1Vector = fP1Manager->GetP1Vector();
389  auto hnVector = fP1Manager->GetHnVector();
390 
391  if ( ! p1Vector.size() ) return true;
392 
393  auto result = true;
394 
395  if ( ! G4Threading::IsWorkerThread() ) {
396  auto directory = fFileManager->GetHistoDirectory();
397  result = WriteT(p1Vector, hnVector, directory, "p1");
398  }
399  else {
400  // The worker manager just adds its histograms to the master
401  // This operation needs a lock
402  G4AutoLock lP1(&mergeP1Mutex);
404  lP1.unlock();
405  }
406 
407  return result;
408 }
409 
410 //_____________________________________________________________________________
412 {
413  auto p2Vector = fP2Manager->GetP2Vector();
414  auto hnVector = fP2Manager->GetHnVector();
415 
416  if ( ! p2Vector.size() ) return true;
417 
418  auto result = true;
419 
420  if ( ! G4Threading::IsWorkerThread() ) {
421  auto directory = fFileManager->GetHistoDirectory();
422  result = WriteT(p2Vector, hnVector, directory, "p2");
423  }
424  else {
425  // The worker manager just adds its histograms to the master
426  // This operation needs a lock
427  G4AutoLock lP2(&mergeP2Mutex);
429  lP2.unlock();
430  }
431 
432  return result;
433 }
434 
435 //_____________________________________________________________________________
437 {
438  if ( fNtupleMergeMode == G4NtupleMergeMode::kNone ) return true;
439 
440  auto finalResult = true;
441 
442  G4String ntupleType;
443  if ( fNtupleMergeMode == G4NtupleMergeMode::kMain ) ntupleType = "main ntuples";
444  if ( fNtupleMergeMode == G4NtupleMergeMode::kSlave ) ntupleType = "slave ntuples";
445 
446 #ifdef G4VERBOSE
447  if ( fState.GetVerboseL4() )
448  fState.GetVerboseL4()->Message("merge", ntupleType, "");
449 #endif
450 
452  auto result = fNtupleManager->Merge();
453  finalResult = result && finalResult;
454  }
455 
457  auto result = fSlaveNtupleManager->Merge();
458  finalResult = result && finalResult;
459  }
460 
461 #ifdef G4VERBOSE
462  if ( fState.GetVerboseL1() )
463  fState.GetVerboseL1()->Message("merge", ntupleType, "");
464 #endif
465 
466  return finalResult;
467 }
468 
469 //_____________________________________________________________________________
471 {
472 // Reset histograms and ntuple
473 
474  auto finalResult = true;
475 
477  finalResult = finalResult && result;
478 
481  result = fNtupleManager->Reset(false);
482  finalResult = result && finalResult;
483  }
484 
485  finalResult = finalResult && result;
486 
487  return finalResult;
488 }
489 
490 //
491 // protected methods
492 //
493 
494 //_____________________________________________________________________________
496 {
497  auto finalResult = true;
498  auto result = fFileManager->SetFileName(fileName);
499  finalResult = finalResult && result;
500 
502 
503 #ifdef G4VERBOSE
504  G4String name = fFileManager->GetFullFileName();
505  if ( fState.GetVerboseL4() )
506  fState.GetVerboseL4()->Message("open", "analysis file", name);
507 #endif
508 
509  result = fFileManager->OpenFile(fileName);
510  finalResult = finalResult && result;
511 
512  fNtupleManager->SetNtupleDirectory(fFileManager->GetNtupleDirectory());
514 
515 #ifdef G4VERBOSE
516  if ( fState.GetVerboseL1() )
517  fState.GetVerboseL1()->Message("open", "analysis file", name, finalResult);
518 #endif
519 
520  }
521 
523 
524 #ifdef G4VERBOSE
525  G4String name = fFileManager->GetFullFileName();
526  if ( fState.GetVerboseL4() )
527  fState.GetVerboseL4()->Message("open", "main analysis file", name);
528 #endif
529 
530  fFileManager->SetNofNtupleFiles(fNofNtupleFiles);
531  result = fFileManager->OpenFile(fileName);
532  finalResult = finalResult && result;
533 
535 
536 #ifdef G4VERBOSE
537  if ( fState.GetVerboseL1() )
538  fState.GetVerboseL1()->Message("open", "main analysis file", name, finalResult);
539 #endif
540  }
541 
543  G4cout << "Going to create slave ntuples from main" << G4endl;
544  // No file is open by Slave manager
546  }
547 
548  return finalResult;
549 }
550 
551 //_____________________________________________________________________________
553 {
554 
555  auto finalResult = true;
556 
557  if ( ! fgMasterInstance &&
558  ( ( ! fH1Manager->IsEmpty() ) || ( ! fH2Manager->IsEmpty() ) ||
559  ( ! fH3Manager->IsEmpty() ) || ( ! fP1Manager->IsEmpty() ) ||
560  ( ! fP2Manager->IsEmpty() ) ) ) {
561  G4ExceptionDescription description;
562  description
563  << " " << "No master G4RootAnalysisManager instance exists."
564  << G4endl
565  << " " << "Histogram/profile data will not be merged.";
566  G4Exception("G4RootAnalysisManager::Write()",
567  "Analysis_W031", JustWarning, description);
568  }
569 
570  // H1
571  auto result = WriteH1();
572  finalResult = finalResult && result;
573 
574  // H2
575  result = WriteH2();
576  finalResult = finalResult && result;
577 
578  // H3
579  result = WriteH3();
580  finalResult = finalResult && result;
581 
582  // P1
583  result = WriteP1();
584  finalResult = finalResult && result;
585 
586  // P2
587  result = WriteP2();
588  finalResult = finalResult && result;
589 
590  // Ntuples
591  result = WriteNtuple();
592  finalResult = finalResult && result;
593 
594  // File
596  result = fFileManager->WriteFile();
597  finalResult = finalResult && result;
598  }
599 
600  // Write ASCII if activated
601  if ( IsAscii() ) {
602  result = WriteAscii(fFileManager->GetFileName());
603  finalResult = finalResult && result;
604  }
605 
606  return finalResult;
607 }
608 
609 //_____________________________________________________________________________
611 {
612  auto finalResult = true;
613 
614  G4bool isNtupleManagerEmpty = fNtupleManager->IsEmpty();
615  // the ntuple decription vector is cleared on Reset()
616  // in kNoMergeAfterOpen ntuple manager mode
617 
618  // reset data
619  auto result = Reset();
620  if ( ! result ) {
621  G4ExceptionDescription description;
622  description << " " << "Resetting data failed";
623  G4Exception("G4RootAnalysisManager::Write()",
624  "Analysis_W021", JustWarning, description);
625  }
626  finalResult = finalResult && result;
627 
629  // close file
630  fFileManager->CloseFile();
631  }
632 
633  // No files clean-up in sequential mode
634  if ( ! G4Threading::IsMultithreadedApplication() ) return finalResult;
635 
636  // Delete files if empty in MT mode
637  if ( ( fState.GetIsMaster() &&
639  fP1Manager->IsEmpty() && fP2Manager->IsEmpty() && isNtupleManagerEmpty ) ||
640  ( ( ! fState.GetIsMaster() ) && isNtupleManagerEmpty &&
642  result = ! std::remove(fFileManager->GetFullFileName());
643  // std::remove returns 0 when success
644  if ( ! result ) {
645  G4ExceptionDescription description;
646  description << " " << "Removing file "
647  << fFileManager->GetFullFileName() << " failed";
648  G4Exception("G4XmlAnalysisManager::CloseFile()",
649  "Analysis_W021", JustWarning, description);
650  }
651  finalResult = finalResult && result;
652 #ifdef G4VERBOSE
653  if ( fState.GetVerboseL1() )
655  ->Message("delete", "empty file", fFileManager->GetFullFileName());
656 #endif
657  }
658 
659  return finalResult;
660 }
661 
662 //
663 // public methods
664 //
665 
666 //_____________________________________________________________________________
668  G4int nofNtupleFiles,
669  G4bool rowWise,
670  unsigned int basketSize)
671 
672 {
673  // Keep basketSize in file manager
674  fFileManager->SetBasketSize(basketSize);
675  fNtupleRowWise = rowWise;
676 
677  // Set ntuple merging mode
678  SetNtupleMergingMode(mergeNtuples, nofNtupleFiles);
679 
680  // Clear existing managers
682 
683  // Re-create managers
685 }
const std::vector< tools::histo::p2d * > & GetP2Vector() const
const XML_Char * name
Definition: expat.h:151
const G4AnalysisVerbose * GetVerboseL2() const
G4RootPNtupleManager * fSlaveNtupleManager
G4RootMainNtupleManager * GetMainNtupleManager(G4int index) const
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:45
static constexpr unsigned int fgkDefaultBasketSize
virtual G4bool Merge() final
#define G4endl
Definition: G4ios.hh:61
void CreateNtuplesFromBooking()
void AddP2Vector(const std::vector< tools::histo::p2d * > &p2Vector)
std::shared_ptr< G4RootFileManager > fFileManager
virtual G4bool OpenFileImpl(const G4String &fileName) final
G4bool WriteT(const std::vector< T * > &htVector, const std::vector< G4HnInformation * > &hnVector, tools::wroot::directory *directory, const G4String &hnType)
#define G4ThreadLocal
Definition: tls.hh:69
const std::vector< tools::histo::h1d * > & GetH1Vector() const
G4bool IsEmpty() const
virtual G4bool WriteImpl() final
void SetNtupleDirectory(tools::wroot::directory *directory)
G4int GetNumberOfRunningWorkerThreads()
Definition: G4Threading.cc:139
const std::vector< tools::histo::h3d * > & GetH3Vector() const
bool G4bool
Definition: G4Types.hh:79
#define G4MUTEX_INITIALIZER
Definition: G4Threading.hh:88
const std::vector< G4HnInformation * > & GetHnVector() const
G4AnalysisManagerState fState
const std::vector< G4HnInformation * > & GetHnVector() const
G4bool IsWorkerThread()
Definition: G4Threading.cc:129
void AddP1Vector(const std::vector< tools::histo::p1d * > &p1Vector)
void SetNtupleMergingMode(G4bool mergeNtuples, G4int nofNtupleFiles)
const G4AnalysisVerbose * GetVerboseL4() const
virtual G4bool CloseFileImpl() final
virtual G4bool Reset(G4bool deleteNtuple)
const std::vector< G4HnInformation * > & GetHnVector() const
const G4AnalysisVerbose * GetVerboseL3() const
G4NtupleMergeMode fNtupleMergeMode
const std::vector< G4HnInformation * > & GetHnVector() const
void AddH2Vector(const std::vector< tools::histo::h2d * > &h2Vector)
void AddH3Vector(const std::vector< tools::histo::h3d * > &h3Vector)
void SetFileManager(std::shared_ptr< G4VFileManager > fileManager)
G4double G4ParticleHPJENDLHEData::G4double result
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.hh:65
G4bool IsEmpty() const
const std::vector< tools::histo::h2d * > & GetH2Vector() const
G4bool IsMultithreadedApplication()
Definition: G4Threading.cc:136
int G4int
Definition: G4Types.hh:78
void SetNtupleManager(G4VNtupleManager *ntupleManager)
G4RootAnalysisManager(G4bool isMaster=true)
static G4RootAnalysisManager * Instance()
const std::vector< tools::histo::p1d * > & GetP1Vector() const
G4RootNtupleManager * fNtupleManager
void Message(const G4String &action, const G4String &object, const G4String &objectName, G4bool success=true) const
G4GLOB_DLL std::ostream G4cout
void AddH1Vector(const std::vector< tools::histo::h1d * > &h1Vector)
static G4ThreadLocal G4RootAnalysisManager * fgInstance
void SetFileManager(std::shared_ptr< G4RootFileManager > fileManager)
G4bool IsAscii() const
void SetNtupleMerging(G4bool mergeNtuples, G4int nofReducedNtupleFiles=0, G4bool rowWise=0, unsigned int basketSize=fgkDefaultBasketSize)
const std::vector< G4HnInformation * > & GetHnVector() const
const G4AnalysisVerbose * GetVerboseL1() const
static G4RootAnalysisManager * fgMasterInstance
G4bool WriteAscii(const G4String &fileName)
std::mutex G4Mutex
Definition: G4Threading.hh:84
G4int G4GetThreadId()
Definition: G4Threading.cc:128