Geant4 11.4.0
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 (ivana@ipno.in2p3.fr)
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 if (fVNtupleManager != nullptr) {
252 fVNtupleManager->SetFirstId(fNtupleBookingManager->GetFirstId());
253 fVNtupleManager->SetFirstNtupleColumnId(fNtupleBookingManager->GetFirstNtupleColumnId());
254 }
255}
256
257//_____________________________________________________________________________
259 std::shared_ptr<G4VNtupleFileManager> ntupleFileManager)
260{
261 fVNtupleFileManager = std::move(ntupleFileManager);
262}
263
264//_____________________________________________________________________________
265void G4VAnalysisManager::SetFileManager(std::shared_ptr<G4VFileManager> fileManager)
266{
267 fVFileManager = fileManager;
268
269 if ( fH1HnManager != nullptr ) fH1HnManager->SetFileManager(fileManager);
270 if ( fH2HnManager != nullptr ) fH2HnManager->SetFileManager(fileManager);
271 if ( fH3HnManager != nullptr ) fH3HnManager->SetFileManager(fileManager);
272 if ( fP1HnManager != nullptr ) fP1HnManager->SetFileManager(fileManager);
273 if ( fP2HnManager != nullptr ) fP2HnManager->SetFileManager(std::move(fileManager));
274}
275
276//_____________________________________________________________________________
278{
279 // Do not write on workers
280 if ( ! fState.GetIsMaster() ) return true;
281
282 auto result = true;
283
284 // Replace or add file extension .ascii
285 G4String name(fileName);
286 if (name.find('.') != std::string::npos) {
287 name.erase(name.find('.'), name.length());
288 }
289 name.append(".ascii");
290
291 Message(kVL3, "write ASCII", "file", name);
292
293 std::ofstream output(name, std::ios::out);
294 if ( ! output ) {
295 Warn("Cannot open file. File name is not defined.",
296 fkClass, "WriteAscii");
297 return false;
298 }
299 output.setf( std::ios::scientific, std::ios::floatfield );
300
301 result &= fVH1Manager->WriteOnAscii(output);
302 result &= fVH2Manager->WriteOnAscii(output);
303 result &= fVH3Manager->WriteOnAscii(output);
304 result &= fVP1Manager->WriteOnAscii(output);
305 result &= fVP2Manager->WriteOnAscii(output);
306
307 Message(kVL1, "write ASCII", "file", name, result);
308
309 return result;
310}
311
312//_____________________________________________________________________________
313std::shared_ptr<G4VFileManager>
315{
316 // Check if file type corresponds the manager output type
317 G4String extension = GetExtension(fileName);
318 if ((extension.size() != 0u) && extension != GetFileType()) {
319 Warn(
320 "The file extension differs from " + GetFileType() + " output type.\n" +
321 GetFileType() + " output type will be used.",
322 fkClass, "GetFileManager");
323 }
324
325 return fVFileManager;
326}
327
328//
329// public methods
330//
331
332//_____________________________________________________________________________
334{
335 // Protection against opening file twice
336 // (Seems to happen when opening file via UI command after the first run)
337 if (IsOpenFile()) {
338 // G4cout << "Skipping OpenFile. File is already open" << G4endl;
339 return true;
340 }
341
342 if ( fileName != "" ) {
343 return OpenFileImpl(fileName);
344 }
345 if (fVFileManager->GetFileName() == "") {
346 Warn("Cannot open file. File name is not defined.", fkClass, "OpenFile");
347 return false;
348 }
349 return OpenFileImpl(fVFileManager->GetFileName());
350}
351
352//_____________________________________________________________________________
354{
355 auto result = true;
356
357 result &= WriteImpl();
358 if ( IsPlotting() ) {
359 result &= PlotImpl();
360 }
361
362 // Increment cycle number
363 fState.IncrementCycle();
364
365 return result;
366}
367
368//_____________________________________________________________________________
370{
371 auto result = CloseFileImpl(reset);
372
373 // Notify about new cycle
374 fState.ResetCycle();
375 if (fVNtupleManager != nullptr) {
376 fVNtupleManager->SetNewCycle(false);
377 }
378
379 return result;
380}
381
382//_____________________________________________________________________________
384{
385 // Notify about new cycle
386 // (as reset causes deleting ntuples)
387 if (fVNtupleManager != nullptr) {
388 fVNtupleManager->SetNewCycle(true);
389 }
390
391 return ResetImpl();
392}
393
394//_____________________________________________________________________________
396{
397 Message(kVL4, "clear", "all data");
398
399 // clear hntools objects
400 ClearImpl();
401
402 // clear remaining data
403 fNtupleBookingManager->ClearData();
404 if ( fVNtupleManager != nullptr ) fVNtupleManager->Clear();
405 if ( fVFileManager != nullptr ) fVFileManager->Clear();
406
407 Message(kVL1, "clear", "all data");
408}
409
410//_____________________________________________________________________________
411G4bool G4VAnalysisManager::Merge(tools::histo::hmpi* hmpi)
412{
413 return MergeImpl(hmpi);
414}
415
416//_____________________________________________________________________________
418{
419 return PlotImpl();
420}
421
422//_____________________________________________________________________________
427
428//_____________________________________________________________________________
433
434//_____________________________________________________________________________
439
440//_____________________________________________________________________________
442{
443 return fVFileManager->SetFileName(fileName);
444}
445
446//_____________________________________________________________________________
448{
449 return fVFileManager->SetHistoDirectoryName(dirName);
450}
451
452//_____________________________________________________________________________
454{
455 return fVFileManager->SetNtupleDirectoryName(dirName);
456}
457
458//_____________________________________________________________________________
460{
461 fVFileManager->SetCompressionLevel(level);
462}
463
464//_____________________________________________________________________________
466{
467 return fVFileManager->GetFileName();
468}
469
470//_____________________________________________________________________________
472{
473 return fVFileManager->GetHistoDirectoryName();
474}
475
476//_____________________________________________________________________________
478{
479 return fVFileManager->GetNtupleDirectoryName();
480}
481
482//_____________________________________________________________________________
484{
485 return fVFileManager->GetCompressionLevel();
486}
487
488//_____________________________________________________________________________
490 G4int nbins, G4double xmin, G4double xmax,
491 const G4String& unitName, const G4String& fcnName,
492 const G4String& binSchemeName)
493{
494 std::array<G4HnDimension, kDim1> bins = {
495 G4HnDimension(nbins, xmin, xmax)};
496 std::array<G4HnDimensionInformation, kDim1> info = {
497 G4HnDimensionInformation(unitName, fcnName, binSchemeName) };
498
499 return fVH1Manager->Create(name, title, bins, info);
500}
501
502//_____________________________________________________________________________
504 const std::vector<G4double>& edges,
505 const G4String& unitName, const G4String& fcnName)
506{
507 std::array<G4HnDimension, kDim1> bins = {
508 G4HnDimension(edges)};
509 std::array<G4HnDimensionInformation, kDim1> info = {
510 G4HnDimensionInformation(unitName, fcnName, "user")};
511
512 return fVH1Manager->Create(name, title, bins, info);
513}
514
515//_____________________________________________________________________________
517 G4int nxbins, G4double xmin, G4double xmax,
518 G4int nybins, G4double ymin, G4double ymax,
519 const G4String& xunitName, const G4String& yunitName,
520 const G4String& xfcnName, const G4String& yfcnName,
521 const G4String& xbinSchemeName,
522 const G4String& ybinSchemeName)
523
524{
525 std::array<G4HnDimension, kDim2> bins = {
526 G4HnDimension(nxbins, xmin, xmax),
527 G4HnDimension(nybins, ymin, ymax) };
528 std::array<G4HnDimensionInformation, kDim2> info = {
529 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
530 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName)};
531
532 return fVH2Manager->Create(name, title, bins, info);
533}
534
535//_____________________________________________________________________________
537 const std::vector<G4double>& xedges,
538 const std::vector<G4double>& yedges,
539 const G4String& xunitName, const G4String& yunitName,
540 const G4String& xfcnName, const G4String& yfcnName)
541
542{
543 std::array<G4HnDimension, kDim2> bins = {
544 G4HnDimension(xedges), G4HnDimension(yedges)};
545 std::array<G4HnDimensionInformation, kDim2> info = {
546 G4HnDimensionInformation(xunitName, xfcnName, "user"),
547 G4HnDimensionInformation(yunitName, yfcnName, "user")};
548
549 return fVH2Manager->Create(name, title, bins, info);
550}
551
552//_____________________________________________________________________________
554 G4int nxbins, G4double xmin, G4double xmax,
555 G4int nybins, G4double ymin, G4double ymax,
556 G4int nzbins, G4double zmin, G4double zmax,
557 const G4String& xunitName, const G4String& yunitName,
558 const G4String& zunitName,
559 const G4String& xfcnName, const G4String& yfcnName,
560 const G4String& zfcnName,
561 const G4String& xbinSchemeName,
562 const G4String& ybinSchemeName,
563 const G4String& zbinSchemeName)
564
565{
566 std::array<G4HnDimension, kDim3> bins = {
567 G4HnDimension(nxbins, xmin, xmax),
568 G4HnDimension(nybins, ymin, ymax),
569 G4HnDimension(nzbins, zmin, zmax)};
570 std::array<G4HnDimensionInformation, kDim3> info = {
571 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
572 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName),
573 G4HnDimensionInformation(zunitName, zfcnName, zbinSchemeName)};
574
575 return fVH3Manager->Create(name, title, bins, info);
576}
577
578//_____________________________________________________________________________
580 const std::vector<G4double>& xedges,
581 const std::vector<G4double>& yedges,
582 const std::vector<G4double>& zedges,
583 const G4String& xunitName, const G4String& yunitName,
584 const G4String& zunitName,
585 const G4String& xfcnName, const G4String& yfcnName,
586 const G4String& zfcnName)
587
588{
589 std::array<G4HnDimension, kDim3> bins = {
590 G4HnDimension(xedges), G4HnDimension(yedges), G4HnDimension(zedges) };
591 std::array<G4HnDimensionInformation, kDim3> info = {
592 G4HnDimensionInformation(xunitName, xfcnName, "user"),
593 G4HnDimensionInformation(yunitName, yfcnName, "user"),
594 G4HnDimensionInformation(zunitName, zfcnName, "user")};
595
596 return fVH3Manager->Create(name, title, bins, info);
597}
598
599//_____________________________________________________________________________
601 G4int nbins, G4double xmin, G4double xmax,
602 const G4String& unitName, const G4String& fcnName,
603 const G4String& binSchemeName)
604{
605 std::array<G4HnDimension, kDim1> bins = {
606 G4HnDimension(nbins, xmin, xmax)};
607 std::array<G4HnDimensionInformation, kDim1> info = {
608 G4HnDimensionInformation(unitName, fcnName, binSchemeName) };
609
610 return fVH1Manager->Set(id, bins, info);
611}
612
613//_____________________________________________________________________________
615 const std::vector<G4double>& edges,
616 const G4String& unitName, const G4String& fcnName)
617{
618 std::array<G4HnDimension, kDim1> bins = {
619 G4HnDimension(edges)};
620 std::array<G4HnDimensionInformation, kDim1> info = {
621 G4HnDimensionInformation(unitName, fcnName, "user")};
622
623 return fVH1Manager->Set(id, bins, info);
624}
625
626//_____________________________________________________________________________
628 G4int nxbins, G4double xmin, G4double xmax,
629 G4int nybins, G4double ymin, G4double ymax,
630 const G4String& xunitName, const G4String& yunitName,
631 const G4String& xfcnName, const G4String& yfcnName,
632 const G4String& xbinSchemeName,
633 const G4String& ybinSchemeName)
634{
635 std::array<G4HnDimension, kDim2> bins = {
636 G4HnDimension(nxbins, xmin, xmax),
637 G4HnDimension(nybins, ymin, ymax) };
638 std::array<G4HnDimensionInformation, kDim2> info = {
639 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
640 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName)};
641
642 return fVH2Manager->Set(id, bins, info);
643}
644
645//_____________________________________________________________________________
647 const std::vector<G4double>& xedges,
648 const std::vector<G4double>& yedges,
649 const G4String& xunitName, const G4String& yunitName,
650 const G4String& xfcnName, const G4String& yfcnName)
651{
652 std::array<G4HnDimension, kDim2> bins = {
653 G4HnDimension(xedges), G4HnDimension(yedges)};
654 std::array<G4HnDimensionInformation, kDim2> info = {
655 G4HnDimensionInformation(xunitName, xfcnName, "user"),
656 G4HnDimensionInformation(yunitName, yfcnName, "user")};
657
658 return fVH2Manager->Set(id, bins, info);
659}
660
661//_____________________________________________________________________________
663 G4int nxbins, G4double xmin, G4double xmax,
664 G4int nybins, G4double ymin, G4double ymax,
665 G4int nzbins, G4double zmin, G4double zmax,
666 const G4String& xunitName, const G4String& yunitName,
667 const G4String& zunitName,
668 const G4String& xfcnName, const G4String& yfcnName,
669 const G4String& zfcnName,
670 const G4String& xbinSchemeName,
671 const G4String& ybinSchemeName,
672 const G4String& zbinSchemeName)
673{
674 std::array<G4HnDimension, kDim3> bins = {
675 G4HnDimension(nxbins, xmin, xmax),
676 G4HnDimension(nybins, ymin, ymax),
677 G4HnDimension(nzbins, zmin, zmax)};
678 std::array<G4HnDimensionInformation, kDim3> info = {
679 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
680 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName),
681 G4HnDimensionInformation(zunitName, zfcnName, zbinSchemeName)};
682
683 return fVH3Manager->Set(id, bins, info);
684}
685
686//_____________________________________________________________________________
688 const std::vector<G4double>& xedges,
689 const std::vector<G4double>& yedges,
690 const std::vector<G4double>& zedges,
691 const G4String& xunitName, const G4String& yunitName,
692 const G4String& zunitName,
693 const G4String& xfcnName, const G4String& yfcnName,
694 const G4String& zfcnName)
695{
696 std::array<G4HnDimension, kDim3> bins = {
697 G4HnDimension(xedges), G4HnDimension(yedges), G4HnDimension(zedges) };
698 std::array<G4HnDimensionInformation, kDim3> info = {
699 G4HnDimensionInformation(xunitName, xfcnName, "user"),
700 G4HnDimensionInformation(yunitName, yfcnName, "user"),
701 G4HnDimensionInformation(zunitName, zfcnName, "user")};
702
703 return fVH3Manager->Set(id, bins, info);
704}
705
706//_____________________________________________________________________________
708{
709 return fVH1Manager->Scale(id, factor);
710}
711
712//_____________________________________________________________________________
714{
715 return fVH2Manager->Scale(id, factor);
716}
717
718//_____________________________________________________________________________
720{
721 return fVH3Manager->Scale(id, factor);
722}
723
724//_____________________________________________________________________________
726 G4int nbins, G4double xmin, G4double xmax,
727 G4double ymin, G4double ymax,
728 const G4String& xunitName, const G4String& yunitName,
729 const G4String& xfcnName, const G4String& yfcnName,
730 const G4String& xbinSchemeName)
731{
732 std::array<G4HnDimension, kDim2> bins = {
733 G4HnDimension(nbins, xmin, xmax),
734 G4HnDimension(0, ymin, ymax) };
735 std::array<G4HnDimensionInformation, kDim2> info = {
736 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
737 G4HnDimensionInformation(yunitName, yfcnName)};
738
739 return fVP1Manager->Create(name, title, bins, info);
740}
741
742//_____________________________________________________________________________
744 const std::vector<G4double>& edges,
745 G4double ymin, G4double ymax,
746 const G4String& xunitName, const G4String& yunitName,
747 const G4String& xfcnName, const G4String& yfcnName)
748{
749 std::array<G4HnDimension, kDim2> bins = {
750 G4HnDimension(edges), G4HnDimension(0, ymin, ymax)};
751 std::array<G4HnDimensionInformation, kDim2> info = {
752 G4HnDimensionInformation(xunitName, xfcnName),
753 G4HnDimensionInformation(yunitName, yfcnName)};
754
755 return fVP1Manager->Create(name, title, bins, info);
756}
757
758//_____________________________________________________________________________
760 G4int nxbins, G4double xmin, G4double xmax,
761 G4int nybins, G4double ymin, G4double ymax,
762 G4double zmin, G4double zmax,
763 const G4String& xunitName, const G4String& yunitName,
764 const G4String& zunitName,
765 const G4String& xfcnName, const G4String& yfcnName,
766 const G4String& zfcnName,
767 const G4String& xbinSchemeName,
768 const G4String& ybinSchemeName)
769{
770 std::array<G4HnDimension, kDim3> bins = {
771 G4HnDimension(nxbins, xmin, xmax),
772 G4HnDimension(nybins, ymin, ymax),
773 G4HnDimension(0, zmin, zmax)};
774 std::array<G4HnDimensionInformation, kDim3> info = {
775 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
776 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName),
777 G4HnDimensionInformation(zunitName, zfcnName)};
778
779 return fVP2Manager->Create(name, title, bins, info);
780}
781
782//_____________________________________________________________________________
784 const std::vector<G4double>& xedges,
785 const std::vector<G4double>& yedges,
786 G4double zmin, G4double zmax,
787 const G4String& xunitName, const G4String& yunitName,
788 const G4String& zunitName,
789 const G4String& xfcnName, const G4String& yfcnName,
790 const G4String& zfcnName)
791{
792 std::array<G4HnDimension, kDim3> bins = {
793 G4HnDimension(xedges), G4HnDimension(yedges), G4HnDimension(0, zmin, zmax)};
794 std::array<G4HnDimensionInformation, kDim3> info = {
795 G4HnDimensionInformation(xunitName, xfcnName),
796 G4HnDimensionInformation(yunitName, yfcnName),
797 G4HnDimensionInformation(zunitName, zfcnName)};
798
799 return fVP2Manager->Create(name, title, bins, info);
800}
801
802//_____________________________________________________________________________
804 G4int nbins, G4double xmin, G4double xmax,
805 G4double ymin, G4double ymax,
806 const G4String& xunitName, const G4String& yunitName,
807 const G4String& xfcnName, const G4String& yfcnName,
808 const G4String& xbinSchemeName)
809{
810 std::array<G4HnDimension, kDim2> bins = {
811 G4HnDimension(nbins, xmin, xmax),
812 G4HnDimension(0, ymin, ymax) };
813 std::array<G4HnDimensionInformation, kDim2> info = {
814 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
815 G4HnDimensionInformation(yunitName, yfcnName)};
816
817 return fVP1Manager->Set(id, bins, info);
818}
819
820//_____________________________________________________________________________
822 const std::vector<G4double>& edges,
823 G4double ymin, G4double ymax,
824 const G4String& xunitName, const G4String& yunitName,
825 const G4String& xfcnName, const G4String& yfcnName)
826{
827 std::array<G4HnDimension, kDim2> bins = {
828 G4HnDimension(edges), G4HnDimension(0, ymin, ymax)};
829 std::array<G4HnDimensionInformation, kDim2> info = {
830 G4HnDimensionInformation(xunitName, xfcnName),
831 G4HnDimensionInformation(yunitName, yfcnName)};
832
833 return fVP1Manager->Set(id, bins, info);
834}
835
836//_____________________________________________________________________________
838 G4int nxbins, G4double xmin, G4double xmax,
839 G4int nybins, G4double ymin, G4double ymax,
840 G4double zmin, G4double zmax,
841 const G4String& xunitName, const G4String& yunitName,
842 const G4String& zunitName,
843 const G4String& xfcnName, const G4String& yfcnName,
844 const G4String& zfcnName,
845 const G4String& xbinSchemeName,
846 const G4String& ybinSchemeName)
847{
848 std::array<G4HnDimension, kDim3> bins = {
849 G4HnDimension(nxbins, xmin, xmax),
850 G4HnDimension(nybins, ymin, ymax),
851 G4HnDimension(0, zmin, zmax)};
852 std::array<G4HnDimensionInformation, kDim3> info = {
853 G4HnDimensionInformation(xunitName, xfcnName, xbinSchemeName),
854 G4HnDimensionInformation(yunitName, yfcnName, ybinSchemeName),
855 G4HnDimensionInformation(zunitName, zfcnName)};
856
857 return fVP2Manager->Set(id, bins, info);
858}
859
860//_____________________________________________________________________________
862 const std::vector<G4double>& xedges,
863 const std::vector<G4double>& yedges,
864 G4double zmin, G4double zmax,
865 const G4String& xunitName,
866 const G4String& yunitName,
867 const G4String& zunitName,
868 const G4String& xfcnName,
869 const G4String& yfcnName,
870 const G4String& zfcnName)
871{
872 std::array<G4HnDimension, kDim3> bins = {
873 G4HnDimension(xedges), G4HnDimension(yedges), G4HnDimension(0, zmin, zmax)};
874 std::array<G4HnDimensionInformation, kDim3> info = {
875 G4HnDimensionInformation(xunitName, xfcnName),
876 G4HnDimensionInformation(yunitName, yfcnName),
877 G4HnDimensionInformation(zunitName, zfcnName)};
878
879 return fVP2Manager->Set(id, bins, info);
880}
881
882//_____________________________________________________________________________
884{
885 return fVP1Manager->Scale(id, factor);
886}
887
888//_____________________________________________________________________________
890{
891 return fVP2Manager->Scale(id, factor);
892}
893
894//_____________________________________________________________________________
896 const G4String& title)
897{
898 return fNtupleBookingManager->CreateNtuple(name, title);
899}
900
901//_____________________________________________________________________________
903{
904 return fNtupleBookingManager->CreateNtupleIColumn(name, nullptr);
905}
906
907//_____________________________________________________________________________
909{
910 return fNtupleBookingManager->CreateNtupleFColumn(name, nullptr);
911}
912
913//_____________________________________________________________________________
915{
916 return fNtupleBookingManager->CreateNtupleDColumn(name, nullptr);
917}
918
919//_____________________________________________________________________________
921{
922 return fNtupleBookingManager->CreateNtupleSColumn(name, nullptr);
923}
924
925//_____________________________________________________________________________
927 std::vector<int>& vector)
928{
929 return fNtupleBookingManager->CreateNtupleIColumn(name, &vector);
930}
931
932//_____________________________________________________________________________
934 std::vector<float>& vector)
935{
936 return fNtupleBookingManager->CreateNtupleFColumn(name, &vector);
937}
938
939//_____________________________________________________________________________
941 std::vector<double>& vector)
942{
943 return fNtupleBookingManager->CreateNtupleDColumn(name, &vector);
944}
945
946//_____________________________________________________________________________
948 std::vector<std::string>& vector)
949{
950 return fNtupleBookingManager->CreateNtupleSColumn(name, &vector);
951}
952
953//_____________________________________________________________________________
955{
956 auto ntupleBooking = fNtupleBookingManager->FinishNtuple();
957
958 if ( fVNtupleManager ) {
959 fVNtupleManager->CreateNtuple(ntupleBooking);
960 }
961}
962
963//_____________________________________________________________________________
965 G4int /*nofReducedNtupleFiles*/)
966{
967// The function is overridden in the managers which supports ntuple merging
968// Here we give just a warning that the feature is not available.
969
970 NtupleMergingWarning(fkClass, "SetNtupleMerging", GetType());
971}
972
973//_____________________________________________________________________________
975 G4bool /*rowMode*/)
976{
977// The function is overridden in the managers which supports ntuple merging
978// Here we give just a warning that the feature is not available.
979
980 NtupleMergingWarning(fkClass, "SetNtupleRowWise", GetType());
981}
982
983//_____________________________________________________________________________
984void G4VAnalysisManager::SetBasketSize(unsigned int /*basketSize*/)
985{
986// The function is overridden in the managers which supports ntuple merging
987// Here we give just a warning that the feature is not available.
988
989 NtupleMergingWarning(fkClass, "SetBasketSize", GetType());
990}
991
992//_____________________________________________________________________________
993void G4VAnalysisManager::SetBasketEntries(unsigned int /*basketEntries*/)
994{
995// The function is overridden in the managers which supports ntuple merging
996// Here we give just a warning that the feature is not available.
997
998 NtupleMergingWarning(fkClass, "SetBasketEntries", GetType());
999}
1000
1001//_____________________________________________________________________________
1003 const G4String& name)
1004{
1005 return fNtupleBookingManager->CreateNtupleIColumn(ntupleId, name, nullptr);
1006}
1007
1008//_____________________________________________________________________________
1010 const G4String& name)
1011{
1012 return fNtupleBookingManager->CreateNtupleFColumn(ntupleId, name, nullptr);
1013}
1014
1015
1016//_____________________________________________________________________________
1018 const G4String& name)
1019{
1020 return fNtupleBookingManager->CreateNtupleDColumn(ntupleId, name, nullptr);
1021}
1022
1023//_____________________________________________________________________________
1025 const G4String& name)
1026{
1027 return fNtupleBookingManager->CreateNtupleSColumn(ntupleId, name, nullptr);
1028}
1029
1030//_____________________________________________________________________________
1032 const G4String& name,
1033 std::vector<int>& vector)
1034{
1035 return fNtupleBookingManager->CreateNtupleIColumn(ntupleId, name, &vector);
1036}
1037
1038//_____________________________________________________________________________
1040 const G4String& name,
1041 std::vector<float>& vector)
1042{
1043 return fNtupleBookingManager->CreateNtupleFColumn(ntupleId, name, &vector);
1044}
1045
1046//_____________________________________________________________________________
1048 const G4String& name,
1049 std::vector<double>& vector)
1050{
1051 return fNtupleBookingManager->CreateNtupleDColumn(ntupleId, name, &vector);
1052}
1053
1054//_____________________________________________________________________________
1056 const G4String& name,
1057 std::vector<std::string>& vector)
1058{
1059 return fNtupleBookingManager->CreateNtupleSColumn(ntupleId, name, &vector);
1060}
1061
1062//_____________________________________________________________________________
1064{
1065 auto ntupleBooking = fNtupleBookingManager->FinishNtuple(ntupleId);
1066
1067 if ( fVNtupleManager ) {
1068 fVNtupleManager->CreateNtuple(ntupleBooking);
1069 }
1070}
1071
1072//_____________________________________________________________________________
1074{
1075 auto result = true;
1076
1077 result &= SetFirstH1Id(firstId);
1078 result &= SetFirstH2Id(firstId);
1079 result &= SetFirstH3Id(firstId);
1080
1081 return result;
1082}
1083
1084//_____________________________________________________________________________
1086{
1087 return fH1HnManager->SetFirstId(firstId);
1088}
1089
1090//_____________________________________________________________________________
1092{
1093 return fH2HnManager->SetFirstId(firstId);
1094}
1095
1096//_____________________________________________________________________________
1098{
1099 return fH3HnManager->SetFirstId(firstId);
1100}
1101
1102//_____________________________________________________________________________
1104{
1105 auto result = true;
1106
1107 result &= SetFirstP1Id(firstId);
1108 result &= SetFirstP2Id(firstId);
1109
1110 return result;
1111}
1112
1113//_____________________________________________________________________________
1115{
1116 return fP1HnManager->SetFirstId(firstId);
1117}
1118
1119//_____________________________________________________________________________
1121{
1122 return fP2HnManager->SetFirstId(firstId);
1123}
1124
1125//_____________________________________________________________________________
1127{
1128 auto result = true;
1129
1130 result &= fNtupleBookingManager->SetFirstId(firstId);
1131 if ( fVNtupleManager ) {
1132 result &= fVNtupleManager->SetFirstId(firstId);
1133 }
1134
1135 return result;
1136}
1137
1138//_____________________________________________________________________________
1140{
1141 auto result = true;
1142
1143 result &= fNtupleBookingManager->SetFirstNtupleColumnId(firstId);
1144 if ( fVNtupleManager ) {
1145 result &= fVNtupleManager->SetFirstNtupleColumnId(firstId);
1146 }
1147
1148 return result;
1149}
1150
1151// Fill methods in .icc
1152
1153//_____________________________________________________________________________
1155{
1156 fState.SetIsActivation(activation);
1157}
1158
1159// GetActivation() in .icc
1160
1161//_____________________________________________________________________________
1163{
1164// Return true if activation option is selected and any of managers has
1165// an activated object.
1166
1167 return fState.GetIsActivation() &&
1168 ( fH1HnManager->IsActive() ||
1169 fH2HnManager->IsActive() ||
1170 fH3HnManager->IsActive() ||
1171 fP1HnManager->IsActive() ||
1172 fP2HnManager->IsActive() );
1173}
1174
1175//_____________________________________________________________________________
1177{
1178// Return true any of managers has an object with activated ASCII option.
1179
1180 return ( fH1HnManager->IsAscii() ||
1181 fH2HnManager->IsAscii() ||
1182 fH3HnManager->IsAscii() ||
1183 fP1HnManager->IsAscii() ||
1184 fP2HnManager->IsAscii() );
1185}
1186
1187//_____________________________________________________________________________
1189{
1190// Return true any of managers has an object with activated plotting option.
1191
1192 return ( fH1HnManager->IsPlotting() ||
1193 fH2HnManager->IsPlotting() ||
1194 fH3HnManager->IsPlotting() ||
1195 fP1HnManager->IsPlotting() ||
1196 fP2HnManager->IsPlotting() );
1197}
1198
1199//_____________________________________________________________________________
1201{
1202// Return first H1 id
1203
1204 return fH1HnManager->GetFirstId();
1205}
1206
1207//_____________________________________________________________________________
1209{
1210// Return first H2 id
1211
1212 return fH2HnManager->GetFirstId();
1213}
1214
1215//_____________________________________________________________________________
1217{
1218// Return first H3 id
1219
1220 return fH3HnManager->GetFirstId();
1221}
1222
1223//_____________________________________________________________________________
1225{
1226// Return first P1 id
1227
1228 return fP1HnManager->GetFirstId();
1229}
1230
1231//_____________________________________________________________________________
1233{
1234// Return first P2 id
1235
1236 return fP2HnManager->GetFirstId();
1237}
1238
1239//_____________________________________________________________________________
1241{
1242// Return first Ntuple id
1243
1244 return fNtupleBookingManager->GetFirstId();
1245}
1246
1247//_____________________________________________________________________________
1249{
1250// Return first Ntuple column id
1251
1252 return fNtupleBookingManager->GetFirstNtupleColumnId();
1253}
1254
1255//_____________________________________________________________________________
1257{
1258 return fVH1Manager->GetNofHns(onlyIfExist);
1259}
1260
1261//_____________________________________________________________________________
1263{
1264 return fVH2Manager->GetNofHns(onlyIfExist);
1265}
1266
1267//_____________________________________________________________________________
1269{
1270 return fVH3Manager->GetNofHns(onlyIfExist);
1271}
1272
1273//_____________________________________________________________________________
1275{
1276 return fVP1Manager->GetNofHns(onlyIfExist);
1277}
1278
1279//_____________________________________________________________________________
1281{
1282 return fVP2Manager->GetNofHns(onlyIfExist);
1283}
1284
1285//_____________________________________________________________________________
1287{
1288 return fNtupleBookingManager->GetNofNtuples(onlyIfExist);
1289}
1290
1291// GetH1Id(), GetH2Id in .icc
1292
1293//_____________________________________________________________________________
1295{
1296 return fVH1Manager->List(G4cout, onlyIfActive);
1297}
1298
1299//_____________________________________________________________________________
1301{
1302 return fVH2Manager->List(G4cout, onlyIfActive);
1303}
1304
1305//_____________________________________________________________________________
1307{
1308 return fVH3Manager->List(G4cout, onlyIfActive);
1309}
1310
1311//_____________________________________________________________________________
1313{
1314 return fVP1Manager->List(G4cout, onlyIfActive);
1315}
1316
1317//_____________________________________________________________________________
1319{
1320 return fVP2Manager->List(G4cout, onlyIfActive);
1321}
1322
1323//_____________________________________________________________________________
1325{
1326 return fNtupleBookingManager->List(G4cout, onlyIfActive);
1327}
1328
1329//_____________________________________________________________________________
1331{
1332 auto result = true;
1333 result &= ListH1(onlyIfActive);
1334 result &= ListH2(onlyIfActive);
1335 result &= ListH3(onlyIfActive);
1336 result &= ListP1(onlyIfActive);
1337 result &= ListP2(onlyIfActive);
1338 result &= ListNtuple(onlyIfActive);
1339
1340 return result;
1341}
1342
1343//_____________________________________________________________________________
1345{
1346// Set activation to a given H1 object
1347
1348 fH1HnManager->SetActivation(id, activation);
1349}
1350
1351//_____________________________________________________________________________
1353{
1354// Set activation to all H1 objects
1355
1356 fH1HnManager->SetActivation(activation);
1357}
1358
1359//_____________________________________________________________________________
1361{
1362 fH1HnManager->SetAscii(id, ascii);
1363}
1364
1365//_____________________________________________________________________________
1367{
1368 fH1HnManager->SetPlotting(id, plotting);
1369}
1370
1371//_____________________________________________________________________________
1373{
1374 fH1HnManager->SetFileName(id, fileName);
1375}
1376
1377//_____________________________________________________________________________
1379{
1380// Set activation to a given H2 object
1381
1382 fH2HnManager->SetActivation(id, activation);
1383}
1384
1385//_____________________________________________________________________________
1387{
1388// Set activation to all H2 objects
1389
1390 fH2HnManager->SetActivation(activation);
1391}
1392
1393//_____________________________________________________________________________
1395{
1396 fH2HnManager->SetAscii(id, ascii);
1397}
1398
1399//_____________________________________________________________________________
1401{
1402 fH2HnManager->SetPlotting(id, plotting);
1403}
1404
1405//_____________________________________________________________________________
1407{
1408 fH2HnManager->SetFileName(id, fileName);
1409}
1410
1411//_____________________________________________________________________________
1413{
1414// Set activation to a given H3 object
1415
1416 fH3HnManager->SetActivation(id, activation);
1417}
1418
1419//_____________________________________________________________________________
1421{
1422// Set activation to all H3 objects
1423
1424 fH3HnManager->SetActivation(activation);
1425}
1426
1427//_____________________________________________________________________________
1429{
1430 fH3HnManager->SetAscii(id, ascii);
1431}
1432
1433//_____________________________________________________________________________
1435{
1436 fH3HnManager->SetPlotting(id, plotting);
1437}
1438
1439//_____________________________________________________________________________
1441{
1442 fH3HnManager->SetFileName(id, fileName);
1443}
1444
1445//_____________________________________________________________________________
1447{
1448// Set activation to a given P1 object
1449
1450 fP1HnManager->SetActivation(id, activation);
1451}
1452
1453//_____________________________________________________________________________
1455{
1456// Set activation to all P1 objects
1457
1458 fP1HnManager->SetActivation(activation);
1459}
1460
1461//_____________________________________________________________________________
1463{
1464 fP1HnManager->SetAscii(id, ascii);
1465}
1466
1467//_____________________________________________________________________________
1469{
1470 fP1HnManager->SetPlotting(id, plotting);
1471}
1472
1473//_____________________________________________________________________________
1475{
1476 fP1HnManager->SetFileName(id, fileName);
1477}
1478
1479//_____________________________________________________________________________
1481{
1482// Set activation to a given P2 object
1483
1484 fP2HnManager->SetActivation(id, activation);
1485}
1486
1487//_____________________________________________________________________________
1489{
1490// Set activation to all P2 objects
1491
1492 fP2HnManager->SetActivation(activation);
1493}
1494
1495//_____________________________________________________________________________
1497{
1498 fP2HnManager->SetAscii(id, ascii);
1499}
1500
1501//_____________________________________________________________________________
1503{
1504 fP2HnManager->SetPlotting(id, plotting);
1505}
1506
1507//_____________________________________________________________________________
1509{
1510 fP2HnManager->SetFileName(id, fileName);
1511}
1512
1513//_____________________________________________________________________________
1515{
1516// Set activation to a given ntuple object
1517
1518 fNtupleBookingManager->SetActivation(id, activation);
1519}
1520
1521//_____________________________________________________________________________
1523{
1524// Set activation to all ntuple objects
1525
1526 fNtupleBookingManager->SetActivation(activation);
1527}
1528
1529//_____________________________________________________________________________
1531{
1532// Set activation to a given P2 object
1533
1534 fNtupleBookingManager->SetFileName(id, fileName);
1535}
1536
1537//_____________________________________________________________________________
1539{
1540// Set activation to all P2 objects
1541
1542 fNtupleBookingManager->SetFileName(fileName);
1543}
1544
1545//_____________________________________________________________________________
1547{
1548 return fVH1Manager->Delete(id, keepSetting);
1549}
1550
1551//_____________________________________________________________________________
1553{
1554 return fVH2Manager->Delete(id, keepSetting);
1555}
1556
1557//_____________________________________________________________________________
1559{
1560 return fVH3Manager->Delete(id, keepSetting);
1561}
1562
1563//_____________________________________________________________________________
1565{
1566 return fVP1Manager->Delete(id, keepSetting);
1567}
1568
1569//_____________________________________________________________________________
1571{
1572 return fVP2Manager->Delete(id, keepSetting);
1573}
1574
1575//_____________________________________________________________________________
1577{
1578 auto result = fNtupleBookingManager->Delete(id, keepSetting);
1579
1580 if (fVNtupleManager != nullptr) {
1581 result &= fVNtupleManager->Delete(id);
1582 }
1583
1584 return result;
1585}
1586
1587// Access methods in .icc
1588
1589//_____________________________________________________________________________
1591{
1592 fState.SetVerboseLevel(verboseLevel);
1593}
1594
1595// GetVerboseLevel() in .icc
1596
G4TemplateAutoLock< G4Mutex > G4AutoLock
#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)