Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VAnalysisManager.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
27// Author: Ivana Hrivnacova, 09/07/2013 ([email protected])
28
29#include "G4VAnalysisManager.hh"
31#include "G4HnManager.hh"
32#include "G4VNtupleManager.hh"
34#include "G4VFileManager.hh"
36#include "G4Threading.hh"
37#include "G4AutoLock.hh"
38
39using namespace G4Analysis;
40
41namespace {
42 //Mutex to lock master manager when merging histograms
43 G4Mutex registerWorkerMutex = G4MUTEX_INITIALIZER;
44}
45
46namespace {
47
48//_____________________________________________________________________________
49void NtupleMergingWarning(std::string_view className,
50 std::string_view functionName,
51 const G4String& outputType)
52{
54 "Ntuple merging is not available with " + outputType + " output.\n" +
55 "Setting is ignored.", className, functionName);
56}
57
58}
59
60//
61// ctor/dtor
62//
63
64//_____________________________________________________________________________
66 : fState(type, ! G4Threading::IsWorkerThread())
67{
68 fMessenger = std::make_unique<G4AnalysisMessenger>(this);
69 fNtupleBookingManager = std::make_shared<G4NtupleBookingManager>(fState);
70
71 // Set master/worker instances
72 // used only in "FromUI" functions
74 fgMasterInstance = this;
75 }
76 else {
77 if (fgMasterInstance != nullptr) {
78 G4AutoLock lock(&registerWorkerMutex);
79 fgMasterInstance->fWorkerManagers.push_back(this);
80 lock.unlock();
81 }
82 }
83}
84
85//_____________________________________________________________________________
87
88//
89// private methods
90//
91
92//_____________________________________________________________________________
93G4bool G4VAnalysisManager::WriteFromUI()
94{
95// Write is performed on workers first, then on master
96
97 if (! fState.GetIsMaster() ) return true;
98
99 auto result = true;
100
101 // Process first all workers
102 for (auto workerManger : fWorkerManagers) {
103 // Update G4Threading
104 auto g4ThreadingValue = G4Threading::G4GetThreadId();
105 G4Threading::G4SetThreadId(workerManger->fState.GetThreadId());
106
107 result &= workerManger->Write();
108
109 // Set G4Threading back
110 G4Threading::G4SetThreadId(g4ThreadingValue);
111 }
112
113 // Process write on master
114 result &= Write();
115
116 return result;
117}
118
119//_____________________________________________________________________________
120G4bool G4VAnalysisManager::CloseFileFromUI(G4bool reset)
121{
122// Close file is performed on workers first, then on master
123
124 if (! fState.GetIsMaster() ) return true;
125
126 auto result = true;
127
128 // Process first all workers
129 for (auto workerManger : fWorkerManagers) {
130 // Update G4Threading
131 auto g4ThreadingValue = G4Threading::G4GetThreadId();
132 G4Threading::G4SetThreadId(workerManger->fState.GetThreadId());
133
134 result &= workerManger->CloseFile(reset);
135
136 // Set G4Threading back
137 G4Threading::G4SetThreadId(g4ThreadingValue);
138 }
139
140 // Process write on master
141 result &= CloseFile(reset);
142
143 return result;
144}
145
146//_____________________________________________________________________________
147G4bool G4VAnalysisManager::ResetFromUI()
148{
149// Reset file is performed on workers first, then on master
150
151 if (! fState.GetIsMaster() ) return true;
152
153 auto result = true;
154
155 // Process first all workers
156 for (auto workerManger : fWorkerManagers) {
157 // Update G4Threading
158 auto g4ThreadingValue = G4Threading::G4GetThreadId();
159 G4Threading::G4SetThreadId(workerManger->fState.GetThreadId());
160
161 result &= workerManger->Reset();
162
163 // Set G4Threading back
164 G4Threading::G4SetThreadId(g4ThreadingValue);
165 }
166
167 // Process write on master
168 result &= Reset();
169
170 return result;
171}
172
173//
174// protected methods
175//
176
177//_____________________________________________________________________________
179{
180 if ( (! GetType().empty()) && (GetFileType() != value) ) {
181 // If not generic analysis manager (which does not define FileType)
182 // the file type cannot be different from the analysis manager type
183 Warn("Cannot set default file type " + value +
184 " different than the analysis manager type " + GetType(),
185 fkClass, "SetDefault");
186 return;
187 }
188
189 fH1HnManager->SetDefaultFileType(value);
190 fH2HnManager->SetDefaultFileType(value);
191 fH3HnManager->SetDefaultFileType(value);
192 fP1HnManager->SetDefaultFileType(value);
193 fP2HnManager->SetDefaultFileType(value);
194}
195
196//_____________________________________________________________________________
201
202//_____________________________________________________________________________
204{
205 fVH1Manager.reset(h1Manager);
206 fH1HnManager = h1Manager->GetHnManager();
207 if (fVFileManager != nullptr ) fH1HnManager->SetFileManager(fVFileManager);
208 if (! GetFileType().empty() ) fH1HnManager->SetDefaultFileType(GetFileType());
209}
210
211//_____________________________________________________________________________
213{
214 fVH2Manager.reset(h2Manager);
215 fH2HnManager = h2Manager->GetHnManager();
216 if (fVFileManager != nullptr ) fH2HnManager->SetFileManager(fVFileManager);
217 if (! GetFileType().empty() ) fH2HnManager->SetDefaultFileType(GetFileType());
218}
219
220//_____________________________________________________________________________
222{
223 fVH3Manager.reset(h3Manager);
224 fH3HnManager = h3Manager->GetHnManager();
225 if (fVFileManager != nullptr ) fH3HnManager->SetFileManager(fVFileManager);
226 if (! GetFileType().empty() ) fH3HnManager->SetDefaultFileType(GetFileType());
227}
228
229//_____________________________________________________________________________
231{
232 fVP1Manager.reset(p1Manager);
233 fP1HnManager = p1Manager->GetHnManager();
234 if (fVFileManager != nullptr ) fP1HnManager->SetFileManager(fVFileManager);
235 if (! GetFileType().empty() ) fP1HnManager->SetDefaultFileType(GetFileType());
236}
237
238//_____________________________________________________________________________
240{
241 fVP2Manager.reset(p2Manager);
242 fP2HnManager = p2Manager->GetHnManager();
243 if (fVFileManager != nullptr ) fP2HnManager->SetFileManager(fVFileManager);
244 if (! GetFileType().empty() ) fP2HnManager->SetDefaultFileType(GetFileType());
245}
246
247//_____________________________________________________________________________
248void G4VAnalysisManager::SetNtupleManager(std::shared_ptr<G4VNtupleManager> ntupleManager)
249{
250 fVNtupleManager = std::move(ntupleManager);
251 fVNtupleManager->SetFirstId(fNtupleBookingManager->GetFirstId());
252 fVNtupleManager->SetFirstNtupleColumnId(fNtupleBookingManager->GetFirstNtupleColumnId());
253}
254
255//_____________________________________________________________________________
257 std::shared_ptr<G4VNtupleFileManager> ntupleFileManager)
258{
259 fVNtupleFileManager = std::move(ntupleFileManager);
260}
261
262//_____________________________________________________________________________
263void G4VAnalysisManager::SetFileManager(std::shared_ptr<G4VFileManager> fileManager)
264{
265 fVFileManager = fileManager;
266
267 if ( fH1HnManager != nullptr ) fH1HnManager->SetFileManager(fileManager);
268 if ( fH2HnManager != nullptr ) fH2HnManager->SetFileManager(fileManager);
269 if ( fH3HnManager != nullptr ) fH3HnManager->SetFileManager(fileManager);
270 if ( fP1HnManager != nullptr ) fP1HnManager->SetFileManager(fileManager);
271 if ( fP2HnManager != nullptr ) fP2HnManager->SetFileManager(std::move(fileManager));
272}
273
274//_____________________________________________________________________________
276{
277 // Do not write on workers
278 if ( ! fState.GetIsMaster() ) return true;
279
280 auto result = true;
281
282 // Replace or add file extension .ascii
283 G4String name(fileName);
284 if (name.find('.') != std::string::npos) {
285 name.erase(name.find('.'), name.length());
286 }
287 name.append(".ascii");
288
289 Message(kVL3, "write ASCII", "file", name);
290
291 std::ofstream output(name, std::ios::out);
292 if ( ! output ) {
293 Warn("Cannot open file. File name is not defined.",
294 fkClass, "WriteAscii");
295 return false;
296 }
297 output.setf( std::ios::scientific, std::ios::floatfield );
298
299 result &= fVH1Manager->WriteOnAscii(output);
300 result &= fVH2Manager->WriteOnAscii(output);
301 result &= fVH3Manager->WriteOnAscii(output);
302 result &= fVP1Manager->WriteOnAscii(output);
303 result &= fVP2Manager->WriteOnAscii(output);
304
305 Message(kVL1, "write ASCII", "file", name, result);
306
307 return result;
308}
309
310//_____________________________________________________________________________
311std::shared_ptr<G4VFileManager>
313{
314 // Check if file type corresponds the manager output type
315 G4String extension = GetExtension(fileName);
316 if ((extension.size() != 0u) && extension != GetFileType()) {
317 Warn(
318 "The file extension differs from " + GetFileType() + " output type.\n" +
319 GetFileType() + " output type will be used.",
320 fkClass, "GetFileManager");
321 }
322
323 return fVFileManager;
324}
325
326//
327// public methods
328//
329
330//_____________________________________________________________________________
332{
333 // Protection against opening file twice
334 // (Seems to happen when opening file via UI command after the first run)
335 if (IsOpenFile()) {
336 // G4cout << "Skipping OpenFile. File is already open" << G4endl;
337 return true;
338 }
339
340 if ( fileName != "" ) {
341 return OpenFileImpl(fileName);
342 }
343 if (fVFileManager->GetFileName() == "") {
344 Warn("Cannot open file. File name is not defined.", fkClass, "OpenFile");
345 return false;
346 }
347 return OpenFileImpl(fVFileManager->GetFileName());
348}
349
350//_____________________________________________________________________________
352{
353 auto result = true;
354
355 result &= WriteImpl();
356 if ( IsPlotting() ) {
357 result &= PlotImpl();
358 }
359
360 // Increment cycle number
362
363 return result;
364}
365
366//_____________________________________________________________________________
368{
369 auto result = CloseFileImpl(reset);
370
371 // Notify about new cycle
373 if (fVNtupleManager != nullptr) {
374 fVNtupleManager->SetNewCycle(false);
375 }
376
377 return result;
378}
379
380//_____________________________________________________________________________
382{
383 // Notify about new cycle
384 // (as reset causes deleting ntuples)
385 if (fVNtupleManager != nullptr) {
386 fVNtupleManager->SetNewCycle(true);
387 }
388
389 return ResetImpl();
390}
391
392//_____________________________________________________________________________
394{
395 Message(kVL4, "clear", "all data");
396
397 // clear hntools objects
398 ClearImpl();
399
400 // clear remaining data
401 fNtupleBookingManager->ClearData();
402 if ( fVNtupleManager != nullptr ) fVNtupleManager->Clear();
403 if ( fVFileManager != nullptr ) fVFileManager->Clear();
404
405 Message(kVL1, "clear", "all data");
406}
407
408//_____________________________________________________________________________
409G4bool G4VAnalysisManager::Merge(tools::histo::hmpi* hmpi)
410{
411 return MergeImpl(hmpi);
412}
413
414//_____________________________________________________________________________
416{
417 return PlotImpl();
418}
419
420//_____________________________________________________________________________
425
426//_____________________________________________________________________________
431
432//_____________________________________________________________________________
437
438//_____________________________________________________________________________
440{
441 return fVFileManager->SetFileName(fileName);
442}
443
444//_____________________________________________________________________________
446{
447 return fVFileManager->SetHistoDirectoryName(dirName);
448}
449
450//_____________________________________________________________________________
452{
453 return fVFileManager->SetNtupleDirectoryName(dirName);
454}
455
456//_____________________________________________________________________________
458{
459 fVFileManager->SetCompressionLevel(level);
460}
461
462//_____________________________________________________________________________
464{
465 return fVFileManager->GetFileName();
466}
467
468//_____________________________________________________________________________
470{
471 return fVFileManager->GetHistoDirectoryName();
472}
473
474//_____________________________________________________________________________
476{
477 return fVFileManager->GetNtupleDirectoryName();
478}
479
480//_____________________________________________________________________________
482{
483 return fVFileManager->GetCompressionLevel();
484}
485
486//_____________________________________________________________________________
488 G4int nbins, G4double xmin, G4double xmax,
489 const G4String& unitName, const G4String& fcnName,
490 const G4String& binSchemeName)
491{
492 std::array<G4HnDimension, kDim1> bins = {
493 G4HnDimension(nbins, xmin, xmax)};
494 std::array<G4HnDimensionInformation, kDim1> info = {
495 G4HnDimensionInformation(unitName, fcnName, binSchemeName) };
496
497 return fVH1Manager->Create(name, title, bins, info);
498}
499
500//_____________________________________________________________________________
502 const std::vector<G4double>& edges,
503 const G4String& unitName, const G4String& fcnName)
504{
505 std::array<G4HnDimension, kDim1> bins = {
506 G4HnDimension(edges)};
507 std::array<G4HnDimensionInformation, kDim1> info = {
508 G4HnDimensionInformation(unitName, fcnName, "user")};
509
510 return fVH1Manager->Create(name, title, bins, info);
511}
512
513//_____________________________________________________________________________
515 G4int nxbins, G4double xmin, G4double xmax,
516 G4int nybins, G4double ymin, G4double ymax,
517 const G4String& xunitName, const G4String& yunitName,
518 const G4String& xfcnName, const G4String& yfcnName,
519 const G4String& xbinSchemeName,
520 const G4String& ybinSchemeName)
521
522{
523 std::array<G4HnDimension, kDim2> bins = {
524 G4HnDimension(nxbins, xmin, xmax),
525 G4HnDimension(nybins, ymin, ymax) };
526 std::array<G4HnDimensionInformation, kDim2> info = {
527 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
528 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName)};
529
530 return fVH2Manager->Create(name, title, bins, info);
531}
532
533//_____________________________________________________________________________
535 const std::vector<G4double>& xedges,
536 const std::vector<G4double>& yedges,
537 const G4String& xunitName, const G4String& yunitName,
538 const G4String& xfcnName, const G4String& yfcnName)
539
540{
541 std::array<G4HnDimension, kDim2> bins = {
542 G4HnDimension(xedges), G4HnDimension(yedges)};
543 std::array<G4HnDimensionInformation, kDim2> info = {
544 G4HnDimensionInformation(xunitName, xfcnName, "user"),
545 G4HnDimensionInformation(yunitName, yfcnName, "user")};
546
547 return fVH2Manager->Create(name, title, bins, info);
548}
549
550//_____________________________________________________________________________
552 G4int nxbins, G4double xmin, G4double xmax,
553 G4int nybins, G4double ymin, G4double ymax,
554 G4int nzbins, G4double zmin, G4double zmax,
555 const G4String& xunitName, const G4String& yunitName,
556 const G4String& zunitName,
557 const G4String& xfcnName, const G4String& yfcnName,
558 const G4String& zfcnName,
559 const G4String& xbinSchemeName,
560 const G4String& ybinSchemeName,
561 const G4String& zbinSchemeName)
562
563{
564 std::array<G4HnDimension, kDim3> bins = {
565 G4HnDimension(nxbins, xmin, xmax),
566 G4HnDimension(nybins, ymin, ymax),
567 G4HnDimension(nzbins, zmin, zmax)};
568 std::array<G4HnDimensionInformation, kDim3> info = {
569 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
570 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName),
571 G4HnDimensionInformation(zunitName, zfcnName, zbinSchemeName)};
572
573 return fVH3Manager->Create(name, title, bins, info);
574}
575
576//_____________________________________________________________________________
578 const std::vector<G4double>& xedges,
579 const std::vector<G4double>& yedges,
580 const std::vector<G4double>& zedges,
581 const G4String& xunitName, const G4String& yunitName,
582 const G4String& zunitName,
583 const G4String& xfcnName, const G4String& yfcnName,
584 const G4String& zfcnName)
585
586{
587 std::array<G4HnDimension, kDim3> bins = {
588 G4HnDimension(xedges), G4HnDimension(yedges), G4HnDimension(zedges) };
589 std::array<G4HnDimensionInformation, kDim3> info = {
590 G4HnDimensionInformation(xunitName, xfcnName, "user"),
591 G4HnDimensionInformation(yunitName, yfcnName, "user"),
592 G4HnDimensionInformation(zunitName, zfcnName, "user")};
593
594 return fVH3Manager->Create(name, title, bins, info);
595}
596
597//_____________________________________________________________________________
599 G4int nbins, G4double xmin, G4double xmax,
600 const G4String& unitName, const G4String& fcnName,
601 const G4String& binSchemeName)
602{
603 std::array<G4HnDimension, kDim1> bins = {
604 G4HnDimension(nbins, xmin, xmax)};
605 std::array<G4HnDimensionInformation, kDim1> info = {
606 G4HnDimensionInformation(unitName, fcnName, binSchemeName) };
607
608 return fVH1Manager->Set(id, bins, info);
609}
610
611//_____________________________________________________________________________
613 const std::vector<G4double>& edges,
614 const G4String& unitName, const G4String& fcnName)
615{
616 std::array<G4HnDimension, kDim1> bins = {
617 G4HnDimension(edges)};
618 std::array<G4HnDimensionInformation, kDim1> info = {
619 G4HnDimensionInformation(unitName, fcnName, "user")};
620
621 return fVH1Manager->Set(id, bins, info);
622}
623
624//_____________________________________________________________________________
626 G4int nxbins, G4double xmin, G4double xmax,
627 G4int nybins, G4double ymin, G4double ymax,
628 const G4String& xunitName, const G4String& yunitName,
629 const G4String& xfcnName, const G4String& yfcnName,
630 const G4String& xbinSchemeName,
631 const G4String& ybinSchemeName)
632{
633 std::array<G4HnDimension, kDim2> bins = {
634 G4HnDimension(nxbins, xmin, xmax),
635 G4HnDimension(nybins, ymin, ymax) };
636 std::array<G4HnDimensionInformation, kDim2> info = {
637 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
638 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName)};
639
640 return fVH2Manager->Set(id, bins, info);
641}
642
643//_____________________________________________________________________________
645 const std::vector<G4double>& xedges,
646 const std::vector<G4double>& yedges,
647 const G4String& xunitName, const G4String& yunitName,
648 const G4String& xfcnName, const G4String& yfcnName)
649{
650 std::array<G4HnDimension, kDim2> bins = {
651 G4HnDimension(xedges), G4HnDimension(yedges)};
652 std::array<G4HnDimensionInformation, kDim2> info = {
653 G4HnDimensionInformation(xunitName, xfcnName, "user"),
654 G4HnDimensionInformation(yunitName, yfcnName, "user")};
655
656 return fVH2Manager->Set(id, bins, info);
657}
658
659//_____________________________________________________________________________
661 G4int nxbins, G4double xmin, G4double xmax,
662 G4int nybins, G4double ymin, G4double ymax,
663 G4int nzbins, G4double zmin, G4double zmax,
664 const G4String& xunitName, const G4String& yunitName,
665 const G4String& zunitName,
666 const G4String& xfcnName, const G4String& yfcnName,
667 const G4String& zfcnName,
668 const G4String& xbinSchemeName,
669 const G4String& ybinSchemeName,
670 const G4String& zbinSchemeName)
671{
672 std::array<G4HnDimension, kDim3> bins = {
673 G4HnDimension(nxbins, xmin, xmax),
674 G4HnDimension(nybins, ymin, ymax),
675 G4HnDimension(nzbins, zmin, zmax)};
676 std::array<G4HnDimensionInformation, kDim3> info = {
677 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
678 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName),
679 G4HnDimensionInformation(zunitName, zfcnName, zbinSchemeName)};
680
681 return fVH3Manager->Set(id, bins, info);
682}
683
684//_____________________________________________________________________________
686 const std::vector<G4double>& xedges,
687 const std::vector<G4double>& yedges,
688 const std::vector<G4double>& zedges,
689 const G4String& xunitName, const G4String& yunitName,
690 const G4String& zunitName,
691 const G4String& xfcnName, const G4String& yfcnName,
692 const G4String& zfcnName)
693{
694 std::array<G4HnDimension, kDim3> bins = {
695 G4HnDimension(xedges), G4HnDimension(yedges), G4HnDimension(zedges) };
696 std::array<G4HnDimensionInformation, kDim3> info = {
697 G4HnDimensionInformation(xunitName, xfcnName, "user"),
698 G4HnDimensionInformation(yunitName, yfcnName, "user"),
699 G4HnDimensionInformation(zunitName, zfcnName, "user")};
700
701 return fVH3Manager->Set(id, bins, info);
702}
703
704//_____________________________________________________________________________
706{
707 return fVH1Manager->Scale(id, factor);
708}
709
710//_____________________________________________________________________________
712{
713 return fVH2Manager->Scale(id, factor);
714}
715
716//_____________________________________________________________________________
718{
719 return fVH3Manager->Scale(id, factor);
720}
721
722//_____________________________________________________________________________
724 G4int nbins, G4double xmin, G4double xmax,
725 G4double ymin, G4double ymax,
726 const G4String& xunitName, const G4String& yunitName,
727 const G4String& xfcnName, const G4String& yfcnName,
728 const G4String& xbinSchemeName)
729{
730 std::array<G4HnDimension, kDim2> bins = {
731 G4HnDimension(nbins, xmin, xmax),
732 G4HnDimension(0, ymin, ymax) };
733 std::array<G4HnDimensionInformation, kDim2> info = {
734 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
735 G4HnDimensionInformation(yunitName, yfcnName)};
736
737 return fVP1Manager->Create(name, title, bins, info);
738}
739
740//_____________________________________________________________________________
742 const std::vector<G4double>& edges,
743 G4double ymin, G4double ymax,
744 const G4String& xunitName, const G4String& yunitName,
745 const G4String& xfcnName, const G4String& yfcnName)
746{
747 std::array<G4HnDimension, kDim2> bins = {
748 G4HnDimension(edges), G4HnDimension(0, ymin, ymax)};
749 std::array<G4HnDimensionInformation, kDim2> info = {
750 G4HnDimensionInformation(xunitName, xfcnName),
751 G4HnDimensionInformation(yunitName, yfcnName)};
752
753 return fVP1Manager->Create(name, title, bins, info);
754}
755
756//_____________________________________________________________________________
758 G4int nxbins, G4double xmin, G4double xmax,
759 G4int nybins, G4double ymin, G4double ymax,
760 G4double zmin, G4double zmax,
761 const G4String& xunitName, const G4String& yunitName,
762 const G4String& zunitName,
763 const G4String& xfcnName, const G4String& yfcnName,
764 const G4String& zfcnName,
765 const G4String& xbinSchemeName,
766 const G4String& ybinSchemeName)
767{
768 std::array<G4HnDimension, kDim3> bins = {
769 G4HnDimension(nxbins, xmin, xmax),
770 G4HnDimension(nybins, ymin, ymax),
771 G4HnDimension(0, zmin, zmax)};
772 std::array<G4HnDimensionInformation, kDim3> info = {
773 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
774 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName),
775 G4HnDimensionInformation(zunitName, zfcnName)};
776
777 return fVP2Manager->Create(name, title, bins, info);
778}
779
780//_____________________________________________________________________________
782 const std::vector<G4double>& xedges,
783 const std::vector<G4double>& yedges,
784 G4double zmin, G4double zmax,
785 const G4String& xunitName, const G4String& yunitName,
786 const G4String& zunitName,
787 const G4String& xfcnName, const G4String& yfcnName,
788 const G4String& zfcnName)
789{
790 std::array<G4HnDimension, kDim3> bins = {
791 G4HnDimension(xedges), G4HnDimension(yedges), G4HnDimension(0, zmin, zmax)};
792 std::array<G4HnDimensionInformation, kDim3> info = {
793 G4HnDimensionInformation(xunitName, xfcnName),
794 G4HnDimensionInformation(yunitName, yfcnName),
795 G4HnDimensionInformation(zunitName, zfcnName)};
796
797 return fVP2Manager->Create(name, title, bins, info);
798}
799
800//_____________________________________________________________________________
802 G4int nbins, G4double xmin, G4double xmax,
803 G4double ymin, G4double ymax,
804 const G4String& xunitName, const G4String& yunitName,
805 const G4String& xfcnName, const G4String& yfcnName,
806 const G4String& xbinSchemeName)
807{
808 std::array<G4HnDimension, kDim2> bins = {
809 G4HnDimension(nbins, xmin, xmax),
810 G4HnDimension(0, ymin, ymax) };
811 std::array<G4HnDimensionInformation, kDim2> info = {
812 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
813 G4HnDimensionInformation(yunitName, yfcnName)};
814
815 return fVP1Manager->Set(id, bins, info);
816}
817
818//_____________________________________________________________________________
820 const std::vector<G4double>& edges,
821 G4double ymin, G4double ymax,
822 const G4String& xunitName, const G4String& yunitName,
823 const G4String& xfcnName, const G4String& yfcnName)
824{
825 std::array<G4HnDimension, kDim2> bins = {
826 G4HnDimension(edges), G4HnDimension(0, ymin, ymax)};
827 std::array<G4HnDimensionInformation, kDim2> info = {
828 G4HnDimensionInformation(xunitName, xfcnName),
829 G4HnDimensionInformation(yunitName, yfcnName)};
830
831 return fVP1Manager->Set(id, bins, info);
832}
833
834//_____________________________________________________________________________
836 G4int nxbins, G4double xmin, G4double xmax,
837 G4int nybins, G4double ymin, G4double ymax,
838 G4double zmin, G4double zmax,
839 const G4String& xunitName, const G4String& yunitName,
840 const G4String& zunitName,
841 const G4String& xfcnName, const G4String& yfcnName,
842 const G4String& zfcnName,
843 const G4String& xbinSchemeName,
844 const G4String& ybinSchemeName)
845{
846 std::array<G4HnDimension, kDim3> bins = {
847 G4HnDimension(nxbins, xmin, xmax),
848 G4HnDimension(nybins, ymin, ymax),
849 G4HnDimension(0, zmin, zmax)};
850 std::array<G4HnDimensionInformation, kDim3> info = {
851 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
852 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName),
853 G4HnDimensionInformation(zunitName, zfcnName)};
854
855 return fVP2Manager->Set(id, bins, info);
856}
857
858//_____________________________________________________________________________
860 const std::vector<G4double>& xedges,
861 const std::vector<G4double>& yedges,
862 G4double zmin, G4double zmax,
863 const G4String& xunitName,
864 const G4String& yunitName,
865 const G4String& zunitName,
866 const G4String& xfcnName,
867 const G4String& yfcnName,
868 const G4String& zfcnName)
869{
870 std::array<G4HnDimension, kDim3> bins = {
871 G4HnDimension(xedges), G4HnDimension(yedges), G4HnDimension(0, zmin, zmax)};
872 std::array<G4HnDimensionInformation, kDim3> info = {
873 G4HnDimensionInformation(xunitName, xfcnName),
874 G4HnDimensionInformation(yunitName, yfcnName),
875 G4HnDimensionInformation(zunitName, zfcnName)};
876
877 return fVP2Manager->Set(id, bins, info);
878}
879
880//_____________________________________________________________________________
882{
883 return fVP1Manager->Scale(id, factor);
884}
885
886//_____________________________________________________________________________
888{
889 return fVP2Manager->Scale(id, factor);
890}
891
892//_____________________________________________________________________________
894 const G4String& title)
895{
896 return fNtupleBookingManager->CreateNtuple(name, title);
897}
898
899//_____________________________________________________________________________
901{
902 return fNtupleBookingManager->CreateNtupleIColumn(name, nullptr);
903}
904
905//_____________________________________________________________________________
907{
908 return fNtupleBookingManager->CreateNtupleFColumn(name, nullptr);
909}
910
911//_____________________________________________________________________________
913{
914 return fNtupleBookingManager->CreateNtupleDColumn(name, nullptr);
915}
916
917//_____________________________________________________________________________
919{
920 return fNtupleBookingManager->CreateNtupleSColumn(name, nullptr);
921}
922
923//_____________________________________________________________________________
925 std::vector<int>& vector)
926{
927 return fNtupleBookingManager->CreateNtupleIColumn(name, &vector);
928}
929
930//_____________________________________________________________________________
932 std::vector<float>& vector)
933{
934 return fNtupleBookingManager->CreateNtupleFColumn(name, &vector);
935}
936
937//_____________________________________________________________________________
939 std::vector<double>& vector)
940{
941 return fNtupleBookingManager->CreateNtupleDColumn(name, &vector);
942}
943
944//_____________________________________________________________________________
946 std::vector<std::string>& vector)
947{
948 return fNtupleBookingManager->CreateNtupleSColumn(name, &vector);
949}
950
951//_____________________________________________________________________________
953{
954 auto ntupleBooking = fNtupleBookingManager->FinishNtuple();
955
956 if ( fVNtupleManager ) {
957 fVNtupleManager->CreateNtuple(ntupleBooking);
958 }
959}
960
961//_____________________________________________________________________________
963 G4int /*nofReducedNtupleFiles*/)
964{
965// The function is overridden in the managers which supports ntuple merging
966// Here we give just a warning that the feature is not available.
967
968 NtupleMergingWarning(fkClass, "SetNtupleMerging", GetType());
969}
970
971//_____________________________________________________________________________
973 G4bool /*rowMode*/)
974{
975// The function is overridden in the managers which supports ntuple merging
976// Here we give just a warning that the feature is not available.
977
978 NtupleMergingWarning(fkClass, "SetNtupleRowWise", GetType());
979}
980
981//_____________________________________________________________________________
982void G4VAnalysisManager::SetBasketSize(unsigned int /*basketSize*/)
983{
984// The function is overridden in the managers which supports ntuple merging
985// Here we give just a warning that the feature is not available.
986
987 NtupleMergingWarning(fkClass, "SetBasketSize", GetType());
988}
989
990//_____________________________________________________________________________
991void G4VAnalysisManager::SetBasketEntries(unsigned int /*basketEntries*/)
992{
993// The function is overridden in the managers which supports ntuple merging
994// Here we give just a warning that the feature is not available.
995
996 NtupleMergingWarning(fkClass, "SetBasketEntries", GetType());
997}
998
999//_____________________________________________________________________________
1001 const G4String& name)
1002{
1003 return fNtupleBookingManager->CreateNtupleIColumn(ntupleId, name, nullptr);
1004}
1005
1006//_____________________________________________________________________________
1008 const G4String& name)
1009{
1010 return fNtupleBookingManager->CreateNtupleFColumn(ntupleId, name, nullptr);
1011}
1012
1013
1014//_____________________________________________________________________________
1016 const G4String& name)
1017{
1018 return fNtupleBookingManager->CreateNtupleDColumn(ntupleId, name, nullptr);
1019}
1020
1021//_____________________________________________________________________________
1023 const G4String& name)
1024{
1025 return fNtupleBookingManager->CreateNtupleSColumn(ntupleId, name, nullptr);
1026}
1027
1028//_____________________________________________________________________________
1030 const G4String& name,
1031 std::vector<int>& vector)
1032{
1033 return fNtupleBookingManager->CreateNtupleIColumn(ntupleId, name, &vector);
1034}
1035
1036//_____________________________________________________________________________
1038 const G4String& name,
1039 std::vector<float>& vector)
1040{
1041 return fNtupleBookingManager->CreateNtupleFColumn(ntupleId, name, &vector);
1042}
1043
1044//_____________________________________________________________________________
1046 const G4String& name,
1047 std::vector<double>& vector)
1048{
1049 return fNtupleBookingManager->CreateNtupleDColumn(ntupleId, name, &vector);
1050}
1051
1052//_____________________________________________________________________________
1054 const G4String& name,
1055 std::vector<std::string>& vector)
1056{
1057 return fNtupleBookingManager->CreateNtupleSColumn(ntupleId, name, &vector);
1058}
1059
1060//_____________________________________________________________________________
1062{
1063 auto ntupleBooking = fNtupleBookingManager->FinishNtuple(ntupleId);
1064
1065 if ( fVNtupleManager ) {
1066 fVNtupleManager->CreateNtuple(ntupleBooking);
1067 }
1068}
1069
1070//_____________________________________________________________________________
1072{
1073 auto result = true;
1074
1075 result &= SetFirstH1Id(firstId);
1076 result &= SetFirstH2Id(firstId);
1077 result &= SetFirstH3Id(firstId);
1078
1079 return result;
1080}
1081
1082//_____________________________________________________________________________
1084{
1085 return fH1HnManager->SetFirstId(firstId);
1086}
1087
1088//_____________________________________________________________________________
1090{
1091 return fH2HnManager->SetFirstId(firstId);
1092}
1093
1094//_____________________________________________________________________________
1096{
1097 return fH3HnManager->SetFirstId(firstId);
1098}
1099
1100//_____________________________________________________________________________
1102{
1103 auto result = true;
1104
1105 result &= SetFirstP1Id(firstId);
1106 result &= SetFirstP2Id(firstId);
1107
1108 return result;
1109}
1110
1111//_____________________________________________________________________________
1113{
1114 return fP1HnManager->SetFirstId(firstId);
1115}
1116
1117//_____________________________________________________________________________
1119{
1120 return fP2HnManager->SetFirstId(firstId);
1121}
1122
1123//_____________________________________________________________________________
1125{
1126 auto result = true;
1127
1128 result &= fNtupleBookingManager->SetFirstId(firstId);
1129 if ( fVNtupleManager ) {
1130 result &= fVNtupleManager->SetFirstId(firstId);
1131 }
1132
1133 return result;
1134}
1135
1136//_____________________________________________________________________________
1138{
1139 auto result = true;
1140
1141 result &= fNtupleBookingManager->SetFirstNtupleColumnId(firstId);
1142 if ( fVNtupleManager ) {
1143 result &= fVNtupleManager->SetFirstNtupleColumnId(firstId);
1144 }
1145
1146 return result;
1147}
1148
1149// Fill methods in .icc
1150
1151//_____________________________________________________________________________
1153{
1154 fState.SetIsActivation(activation);
1155}
1156
1157// GetActivation() in .icc
1158
1159//_____________________________________________________________________________
1161{
1162// Return true if activation option is selected and any of managers has
1163// an activated object.
1164
1165 return fState.GetIsActivation() &&
1166 ( fH1HnManager->IsActive() ||
1167 fH2HnManager->IsActive() ||
1168 fH3HnManager->IsActive() ||
1169 fP1HnManager->IsActive() ||
1170 fP2HnManager->IsActive() );
1171}
1172
1173//_____________________________________________________________________________
1175{
1176// Return true any of managers has an object with activated ASCII option.
1177
1178 return ( fH1HnManager->IsAscii() ||
1179 fH2HnManager->IsAscii() ||
1180 fH3HnManager->IsAscii() ||
1181 fP1HnManager->IsAscii() ||
1182 fP2HnManager->IsAscii() );
1183}
1184
1185//_____________________________________________________________________________
1187{
1188// Return true any of managers has an object with activated plotting option.
1189
1190 return ( fH1HnManager->IsPlotting() ||
1191 fH2HnManager->IsPlotting() ||
1192 fH3HnManager->IsPlotting() ||
1193 fP1HnManager->IsPlotting() ||
1194 fP2HnManager->IsPlotting() );
1195}
1196
1197//_____________________________________________________________________________
1199{
1200// Return first H1 id
1201
1202 return fH1HnManager->GetFirstId();
1203}
1204
1205//_____________________________________________________________________________
1207{
1208// Return first H2 id
1209
1210 return fH2HnManager->GetFirstId();
1211}
1212
1213//_____________________________________________________________________________
1215{
1216// Return first H3 id
1217
1218 return fH3HnManager->GetFirstId();
1219}
1220
1221//_____________________________________________________________________________
1223{
1224// Return first P1 id
1225
1226 return fP1HnManager->GetFirstId();
1227}
1228
1229//_____________________________________________________________________________
1231{
1232// Return first P2 id
1233
1234 return fP2HnManager->GetFirstId();
1235}
1236
1237//_____________________________________________________________________________
1239{
1240// Return first Ntuple id
1241
1242 return fNtupleBookingManager->GetFirstId();
1243}
1244
1245//_____________________________________________________________________________
1247{
1248// Return first Ntuple column id
1249
1250 return fNtupleBookingManager->GetFirstNtupleColumnId();
1251}
1252
1253//_____________________________________________________________________________
1255{
1256 return fVH1Manager->GetNofHns(onlyIfExist);
1257}
1258
1259//_____________________________________________________________________________
1261{
1262 return fVH2Manager->GetNofHns(onlyIfExist);
1263}
1264
1265//_____________________________________________________________________________
1267{
1268 return fVH3Manager->GetNofHns(onlyIfExist);
1269}
1270
1271//_____________________________________________________________________________
1273{
1274 return fVP1Manager->GetNofHns(onlyIfExist);
1275}
1276
1277//_____________________________________________________________________________
1279{
1280 return fVP2Manager->GetNofHns(onlyIfExist);
1281}
1282
1283//_____________________________________________________________________________
1285{
1286 return fNtupleBookingManager->GetNofNtuples(onlyIfExist);
1287}
1288
1289// GetH1Id(), GetH2Id in .icc
1290
1291//_____________________________________________________________________________
1293{
1294 return fVH1Manager->List(G4cout, onlyIfActive);
1295}
1296
1297//_____________________________________________________________________________
1299{
1300 return fVH2Manager->List(G4cout, onlyIfActive);
1301}
1302
1303//_____________________________________________________________________________
1305{
1306 return fVH3Manager->List(G4cout, onlyIfActive);
1307}
1308
1309//_____________________________________________________________________________
1311{
1312 return fVP1Manager->List(G4cout, onlyIfActive);
1313}
1314
1315//_____________________________________________________________________________
1317{
1318 return fVP2Manager->List(G4cout, onlyIfActive);
1319}
1320
1321//_____________________________________________________________________________
1323{
1324 return fNtupleBookingManager->List(G4cout, onlyIfActive);
1325}
1326
1327//_____________________________________________________________________________
1329{
1330 auto result = true;
1331 result &= ListH1(onlyIfActive);
1332 result &= ListH2(onlyIfActive);
1333 result &= ListH3(onlyIfActive);
1334 result &= ListP1(onlyIfActive);
1335 result &= ListP2(onlyIfActive);
1336 result &= ListNtuple(onlyIfActive);
1337
1338 return result;
1339}
1340
1341//_____________________________________________________________________________
1343{
1344// Set activation to a given H1 object
1345
1346 fH1HnManager->SetActivation(id, activation);
1347}
1348
1349//_____________________________________________________________________________
1351{
1352// Set activation to all H1 objects
1353
1354 fH1HnManager->SetActivation(activation);
1355}
1356
1357//_____________________________________________________________________________
1359{
1360 fH1HnManager->SetAscii(id, ascii);
1361}
1362
1363//_____________________________________________________________________________
1365{
1366 fH1HnManager->SetPlotting(id, plotting);
1367}
1368
1369//_____________________________________________________________________________
1371{
1372 fH1HnManager->SetFileName(id, fileName);
1373}
1374
1375//_____________________________________________________________________________
1377{
1378// Set activation to a given H2 object
1379
1380 fH2HnManager->SetActivation(id, activation);
1381}
1382
1383//_____________________________________________________________________________
1385{
1386// Set activation to all H2 objects
1387
1388 fH2HnManager->SetActivation(activation);
1389}
1390
1391//_____________________________________________________________________________
1393{
1394 fH2HnManager->SetAscii(id, ascii);
1395}
1396
1397//_____________________________________________________________________________
1399{
1400 fH2HnManager->SetPlotting(id, plotting);
1401}
1402
1403//_____________________________________________________________________________
1405{
1406 fH2HnManager->SetFileName(id, fileName);
1407}
1408
1409//_____________________________________________________________________________
1411{
1412// Set activation to a given H3 object
1413
1414 fH3HnManager->SetActivation(id, activation);
1415}
1416
1417//_____________________________________________________________________________
1419{
1420// Set activation to all H3 objects
1421
1422 fH3HnManager->SetActivation(activation);
1423}
1424
1425//_____________________________________________________________________________
1427{
1428 fH3HnManager->SetAscii(id, ascii);
1429}
1430
1431//_____________________________________________________________________________
1433{
1434 fH3HnManager->SetPlotting(id, plotting);
1435}
1436
1437//_____________________________________________________________________________
1439{
1440 fH3HnManager->SetFileName(id, fileName);
1441}
1442
1443//_____________________________________________________________________________
1445{
1446// Set activation to a given P1 object
1447
1448 fP1HnManager->SetActivation(id, activation);
1449}
1450
1451//_____________________________________________________________________________
1453{
1454// Set activation to all P1 objects
1455
1456 fP1HnManager->SetActivation(activation);
1457}
1458
1459//_____________________________________________________________________________
1461{
1462 fP1HnManager->SetAscii(id, ascii);
1463}
1464
1465//_____________________________________________________________________________
1467{
1468 fP1HnManager->SetPlotting(id, plotting);
1469}
1470
1471//_____________________________________________________________________________
1473{
1474 fP1HnManager->SetFileName(id, fileName);
1475}
1476
1477//_____________________________________________________________________________
1479{
1480// Set activation to a given P2 object
1481
1482 fP2HnManager->SetActivation(id, activation);
1483}
1484
1485//_____________________________________________________________________________
1487{
1488// Set activation to all P2 objects
1489
1490 fP2HnManager->SetActivation(activation);
1491}
1492
1493//_____________________________________________________________________________
1495{
1496 fP2HnManager->SetAscii(id, ascii);
1497}
1498
1499//_____________________________________________________________________________
1501{
1502 fP2HnManager->SetPlotting(id, plotting);
1503}
1504
1505//_____________________________________________________________________________
1507{
1508 fP2HnManager->SetFileName(id, fileName);
1509}
1510
1511//_____________________________________________________________________________
1513{
1514// Set activation to a given ntuple object
1515
1516 fNtupleBookingManager->SetActivation(id, activation);
1517 if ( fVNtupleManager ) {
1518 fVNtupleManager->SetActivation(id, activation);
1519 }
1520}
1521
1522//_____________________________________________________________________________
1524{
1525// Set activation to all ntuple objects
1526
1527 fNtupleBookingManager->SetActivation(activation);
1528 if ( fVNtupleManager ) {
1529 fVNtupleManager->SetActivation(activation);
1530 }
1531}
1532
1533//_____________________________________________________________________________
1535{
1536// Set activation to a given P2 object
1537
1538 fNtupleBookingManager->SetFileName(id, fileName);
1539}
1540
1541//_____________________________________________________________________________
1543{
1544// Set activation to all P2 objects
1545
1546 fNtupleBookingManager->SetFileName(fileName);
1547}
1548
1549//_____________________________________________________________________________
1551{
1552 return fVH1Manager->Delete(id, keepSetting);
1553}
1554
1555//_____________________________________________________________________________
1557{
1558 return fVH2Manager->Delete(id, keepSetting);
1559}
1560
1561//_____________________________________________________________________________
1563{
1564 return fVH3Manager->Delete(id, keepSetting);
1565}
1566
1567//_____________________________________________________________________________
1569{
1570 return fVP1Manager->Delete(id, keepSetting);
1571}
1572
1573//_____________________________________________________________________________
1575{
1576 return fVP2Manager->Delete(id, keepSetting);
1577}
1578
1579//_____________________________________________________________________________
1581{
1582 auto result = fNtupleBookingManager->Delete(id, keepSetting);
1583
1584 if (fVNtupleManager != nullptr) {
1585 result &= fVNtupleManager->Delete(id);
1586 }
1587
1588 return result;
1589}
1590
1591// Access methods in .icc
1592
1593//_____________________________________________________________________________
1595{
1596 fState.SetVerboseLevel(verboseLevel);
1597}
1598
1599// GetVerboseLevel() in .icc
1600
#define G4MUTEX_INITIALIZER
std::mutex G4Mutex
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4GLOB_DLL std::ostream G4cout
G4bool ListNtuple(G4bool onlyIfActive=true) const
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 &xbinSchemeName="linear")
virtual G4bool MergeImpl(tools::histo::hmpi *hmpi)=0
void SetH1Ascii(G4int id, G4bool ascii)
G4bool DeleteH1(G4int id, G4bool keepSetting=false)
void SetP1Manager(G4VTBaseHnManager< kDim2 > *p1Manager)
virtual G4bool IsOpenFileImpl() const =0
G4int CreateP2(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4double zmin=0, G4double zmax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
void SetP2Manager(G4VTBaseHnManager< kDim3 > *p2Manager)
G4int GetNofH3s(G4bool onlyIfExist=false) const
void SetH2FileName(G4int id, const G4String &fileName)
G4VAnalysisManager()=delete
void SetH1Activation(G4bool activation)
G4bool DeleteNtuple(G4int id, G4bool clear=false)
G4bool ListH1(G4bool onlyIfActive=true) const
virtual std::shared_ptr< G4VFileManager > GetFileManager(const G4String &fileName)
virtual ~G4VAnalysisManager()
virtual void SetDefaultFileTypeImpl(const G4String &value)
void SetH1Plotting(G4int id, G4bool plotting)
void SetH3Ascii(G4int id, G4bool ascii)
G4int GetNofH2s(G4bool onlyIfExist=false) const
void SetH3Activation(G4bool activation)
G4bool DeleteP1(G4int id, G4bool keepSetting=false)
G4int CreateH1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
G4int CreateNtupleIColumn(const G4String &name)
virtual G4bool WriteImpl()=0
G4String GetHistoDirectoryName() const
G4int GetNofH1s(G4bool onlyIfExist=false) const
G4int CreateNtupleDColumn(const G4String &name)
void SetH3Plotting(G4int id, G4bool plotting)
G4int GetNofP1s(G4bool onlyIfExist=false) const
void SetP2FileName(G4int id, const G4String &fileName)
void SetNtupleFileName(const G4String &fileName)
G4int CreateNtupleFColumn(const G4String &name)
G4bool SetH3(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nzbins, G4double zmin, G4double zmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear", const G4String &zbinSchemeName="linear")
G4bool DeleteP2(G4int id, G4bool keepSetting=false)
void SetP2Plotting(G4int id, G4bool plotting)
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 &xbinSchemeName="linear")
G4bool SetFirstP1Id(G4int firstId)
G4bool SetP2(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4double zmin=0, G4double zmax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
G4int GetNofP2s(G4bool onlyIfExist=false) const
std::shared_ptr< G4VNtupleFileManager > fVNtupleFileManager
void SetH1Manager(G4VTBaseHnManager< kDim1 > *h1Manager)
virtual G4bool OpenFileImpl(const G4String &fileName)=0
void SetH3Manager(G4VTBaseHnManager< kDim3 > *h3Manager)
void SetActivation(G4bool activation)
G4bool SetFirstNtupleColumnId(G4int firstId)
G4String GetFileName() const
G4bool ListH2(G4bool onlyIfActive=true) const
G4String GetType() const
G4String GetDefaultFileType() const
G4bool CloseFile(G4bool reset=true)
G4bool OpenFile(const G4String &fileName="")
void SetH3FileName(G4int id, const G4String &fileName)
virtual void ClearImpl()=0
std::shared_ptr< G4NtupleBookingManager > fNtupleBookingManager
G4bool ScaleP1(G4int id, G4double factor)
G4bool ScaleH3(G4int id, G4double factor)
void SetH2Ascii(G4int id, G4bool ascii)
G4bool DeleteH2(G4int id, G4bool keepSetting=false)
G4bool ListP2(G4bool onlyIfActive=true) const
void Message(G4int level, const G4String &action, const G4String &objectType, const G4String &objectName="", G4bool success=true) const
G4int CreateNtupleSColumn(const G4String &name)
virtual G4bool PlotImpl()=0
void SetP1Ascii(G4int id, G4bool ascii)
G4int CreateH3(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4int nzbins, G4double zmin, G4double zmax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear", const G4String &zbinSchemeName="linear")
G4bool SetFirstH3Id(G4int firstId)
G4bool SetHistoDirectoryName(const G4String &dirName)
G4AnalysisManagerState fState
void SetP2Activation(G4bool activation)
void SetH1FileName(G4int id, const G4String &fileName)
virtual void SetNtupleRowWise(G4bool rowWise, G4bool rowMode=true)
void SetP1Plotting(G4int id, G4bool plotting)
virtual void SetBasketSize(unsigned int basketSize)
void SetFileManager(std::shared_ptr< G4VFileManager > fileManager)
void SetP1FileName(G4int id, const G4String &fileName)
G4bool WriteAscii(const G4String &fileName)
virtual void SetNtupleMerging(G4bool mergeNtuples, G4int nofReducedNtupleFiles=0)
G4bool ListP1(G4bool onlyIfActive=true) const
void SetP1Activation(G4bool activation)
virtual void SetBasketEntries(unsigned int basketEntries)
G4int GetFirstNtupleColumnId() const
void SetVerboseLevel(G4int verboseLevel)
G4bool SetH1(G4int id, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
void SetH2Activation(G4bool activation)
G4int CreateNtuple(const G4String &name, const G4String &title)
std::shared_ptr< G4VNtupleManager > fVNtupleManager
void SetNtupleManager(std::shared_ptr< G4VNtupleManager > ntupleManager)
G4bool SetFirstH2Id(G4int firstId)
G4bool DeleteH3(G4int id, G4bool keepSetting=false)
G4bool SetFirstP2Id(G4int firstId)
G4bool List(G4bool onlyIfActive=true) const
G4bool SetH2(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
G4String GetFileType() const
virtual G4bool ResetImpl()=0
std::shared_ptr< G4VFileManager > fVFileManager
virtual G4String GetDefaultFileTypeImpl() const
G4bool SetFileName(const G4String &fileName)
void SetCompressionLevel(G4int level)
G4int CreateH2(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
void SetNtupleActivation(G4bool activation)
G4int GetCompressionLevel() const
G4bool SetFirstH1Id(G4int firstId)
G4bool ScaleH1(G4int id, G4double factor)
G4String GetNtupleDirectoryName() const
void SetH2Manager(G4VTBaseHnManager< kDim2 > *h2Manager)
G4bool SetFirstNtupleId(G4int firstId)
G4bool SetFirstHistoId(G4int firstId)
G4bool SetFirstProfileId(G4int firstId)
G4bool SetNtupleDirectoryName(const G4String &dirName)
G4bool ScaleP2(G4int id, G4double factor)
virtual G4bool CloseFileImpl(G4bool reset)=0
G4bool ScaleH2(G4int id, G4double factor)
void SetDefaultFileType(const G4String &value)
G4bool Merge(tools::histo::hmpi *hmpi)
void SetP2Ascii(G4int id, G4bool ascii)
void SetH2Plotting(G4int id, G4bool plotting)
G4bool ListH3(G4bool onlyIfActive=true) const
G4int GetNofNtuples(G4bool onlyIfExist=false) const
void SetNtupleFileManager(std::shared_ptr< G4VNtupleFileManager > ntupleFileManager)
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
G4String GetExtension(const G4String &fileName, const G4String &defaultExtension="")
constexpr G4int kVL1
constexpr G4int kVL3
constexpr G4int kVL4
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)
G4bool IsWorkerThread()
G4int G4GetThreadId()
void G4SetThreadId(G4int aNewValue)