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