Geant4-11
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"
32#include "G4HnManager.hh"
33#include "G4VH1Manager.hh"
34#include "G4VH2Manager.hh"
35#include "G4VH3Manager.hh"
36#include "G4VP1Manager.hh"
37#include "G4VP2Manager.hh"
38#include "G4VNtupleManager.hh"
39#include "G4VFileManager.hh"
41#include "G4Threading.hh"
42
43using namespace G4Analysis;
44
45namespace {
46
47//_____________________________________________________________________________
48void NtupleMergingWarning(std::string_view className,
49 std::string_view functionName,
50 const G4String& outputType)
51{
53 "Ntuple merging is not available with " + outputType + " output.\n" +
54 "Setting is ignored.", className, functionName);
55}
56
57}
58
59//
60// protected methods
61//
62
63//_____________________________________________________________________________
65 : fState(type, ! G4Threading::IsWorkerThread())
66{
67 fMessenger = std::make_unique<G4AnalysisMessenger>(this);
68 fNtupleBookingManager = std::make_shared<G4NtupleBookingManager>(fState);
69}
70
71//_____________________________________________________________________________
73
74//_____________________________________________________________________________
76{
77 fVH1Manager.reset(h1Manager);
78 fH1HnManager = h1Manager->GetHnManager();
79 fMessenger->SetH1HnManager(*fH1HnManager);
80 if (fVFileManager != nullptr ) fH1HnManager->SetFileManager(fVFileManager);
81}
82
83//_____________________________________________________________________________
85{
86 fVH2Manager.reset(h2Manager);
87 fH2HnManager = h2Manager->GetHnManager();
88 fMessenger->SetH2HnManager(*fH2HnManager);
89 if (fVFileManager != nullptr ) fH2HnManager->SetFileManager(fVFileManager);
90}
91
92//_____________________________________________________________________________
94{
95 fVH3Manager.reset(h3Manager);
96 fH3HnManager = h3Manager->GetHnManager();
97 fMessenger->SetH3HnManager(*fH3HnManager);
98 if (fVFileManager != nullptr ) fH3HnManager->SetFileManager(fVFileManager);
99}
100
101//_____________________________________________________________________________
103{
104 fVP1Manager.reset(p1Manager);
105 fP1HnManager = p1Manager->GetHnManager();
106 fMessenger->SetP1HnManager(*fP1HnManager);
107 if (fVFileManager != nullptr ) fP1HnManager->SetFileManager(fVFileManager);
108}
109
110//_____________________________________________________________________________
112{
113 fVP2Manager.reset(p2Manager);
114 fP2HnManager = p2Manager->GetHnManager();
115 fMessenger->SetP2HnManager(*fP2HnManager);
116 if (fVFileManager != nullptr ) fP2HnManager->SetFileManager(fVFileManager);
117}
118
119//_____________________________________________________________________________
120void G4VAnalysisManager::SetNtupleManager(std::shared_ptr<G4VNtupleManager> ntupleManager)
121{
122 fVNtupleManager = std::move(ntupleManager);
123 fVNtupleManager->SetFirstId(fNtupleBookingManager->GetFirstId());
124 fVNtupleManager->SetFirstNtupleColumnId(fNtupleBookingManager->GetFirstNtupleColumnId());
125}
126
127//_____________________________________________________________________________
128void G4VAnalysisManager::SetFileManager(std::shared_ptr<G4VFileManager> fileManager)
129{
130 fVFileManager = fileManager;
131
132 if ( fH1HnManager != nullptr ) fH1HnManager->SetFileManager(fileManager);
133 if ( fH2HnManager != nullptr ) fH2HnManager->SetFileManager(fileManager);
134 if ( fH3HnManager != nullptr ) fH3HnManager->SetFileManager(fileManager);
135 if ( fP1HnManager != nullptr ) fP1HnManager->SetFileManager(fileManager);
136 if ( fP2HnManager != nullptr ) fP2HnManager->SetFileManager(std::move(fileManager));
137}
138
139//_____________________________________________________________________________
140void G4VAnalysisManager::SetPlotManager(std::shared_ptr<G4PlotManager> plotManager)
141{
142 fPlotManager = std::move(plotManager);
143}
144
145//_____________________________________________________________________________
147{
148 // Do not write on workers
149 if ( ! fState.GetIsMaster() ) return true;
150
151 auto result = true;
152
153 // Replace or add file extension .ascii
154 G4String name(fileName);
155 if ( name.find(".") != std::string::npos ) {
156 name.erase(name.find("."), name.length());
157 }
158 name.append(".ascii");
159
160 Message(kVL3, "write ASCII", "file", name);
161
162 std::ofstream output(name, std::ios::out);
163 if ( ! output ) {
164 Warn("Cannot open file. File name is not defined.",
165 fkClass, "WriteAscii");
166 return false;
167 }
168 output.setf( std::ios::scientific, std::ios::floatfield );
169
170 result &= fVH1Manager->WriteOnAscii(output);
171 result &= fVH2Manager->WriteOnAscii(output);
172 result &= fVH3Manager->WriteOnAscii(output);
173 result &= fVP1Manager->WriteOnAscii(output);
174 result &= fVP2Manager->WriteOnAscii(output);
175
176 Message(kVL1, "write ASCII", "file", name, result);
177
178 return result;
179}
180
181//_____________________________________________________________________________
182std::shared_ptr<G4VFileManager>
184{
185 // Check if file type corresponds the manager output type
186 G4String extension = GetExtension(fileName);
187 if ( extension.size() && extension != GetFileType() ) {
188 Warn(
189 "The file extension differs from " + GetFileType() + " output type.\n" +
190 GetFileType() + " output type will be used.",
191 fkClass, "GetFileManager");
192 }
193
194 return fVFileManager;
195}
196
197//
198// public methods
199//
200
201//_____________________________________________________________________________
203{
204 if ( fileName != "" ) {
205 return OpenFileImpl(fileName);
206 }
207 else {
208 if ( fVFileManager->GetFileName() == "" ) {
209 Warn("Cannot open file. File name is not defined.", fkClass, "OpenFile");
210 return false;
211 }
212 return OpenFileImpl(fVFileManager->GetFileName());
213 }
214}
215
216//_____________________________________________________________________________
218{
219 auto result = true;
220
221 result &= WriteImpl();
222 if ( IsPlotting() ) {
223 result &= PlotImpl();
224 }
225
226 return result;
227}
228
229//_____________________________________________________________________________
231{
232 return CloseFileImpl(reset);
233}
234
235//_____________________________________________________________________________
237{
238 return ResetImpl();
239}
240
241//_____________________________________________________________________________
243{
244 Message(kVL4, "clear", "all data");
245
246 // clear hntools objects
247 ClearImpl();
248
249 // clear remaining data
250 fNtupleBookingManager->ClearData();
251 if ( fVNtupleManager != nullptr ) fVNtupleManager->Clear();
252 if ( fVFileManager != nullptr ) fVFileManager->Clear();
253
254 Message(kVL1, "clear", "all data");
255}
256
257//_____________________________________________________________________________
258G4bool G4VAnalysisManager::Merge(tools::histo::hmpi* hmpi)
259{
260 return MergeImpl(hmpi);
261}
262
263//_____________________________________________________________________________
265{
266 return PlotImpl();
267}
268
269//_____________________________________________________________________________
271{
272 return IsOpenFileImpl();
273}
274
275//_____________________________________________________________________________
277{
278 return fVFileManager->SetFileName(fileName);
279}
280
281//_____________________________________________________________________________
283{
284 return fVFileManager->SetHistoDirectoryName(dirName);
285}
286
287//_____________________________________________________________________________
289{
290 return fVFileManager->SetNtupleDirectoryName(dirName);
291}
292
293//_____________________________________________________________________________
295{
297}
298
299//_____________________________________________________________________________
301{
302 return fVFileManager->GetFileName();
303}
304
305//_____________________________________________________________________________
307{
308 return fVFileManager->GetHistoDirectoryName();
309}
310
311//_____________________________________________________________________________
313{
314 return fVFileManager->GetNtupleDirectoryName();
315}
316
317//_____________________________________________________________________________
319{
321}
322
323//_____________________________________________________________________________
325 G4int nbins, G4double xmin, G4double xmax,
326 const G4String& unitName, const G4String& fcnName,
327 const G4String& binSchemeName)
328{
329 if ( ! CheckName(name, "H1") ) return kInvalidId;
330 if ( ! CheckNbins(nbins) ) return kInvalidId;
331 if ( ! CheckMinMax(xmin, xmax, fcnName, binSchemeName) ) return kInvalidId;
332
333 return fVH1Manager->CreateH1(name, title, nbins, xmin, xmax,
334 unitName, fcnName, binSchemeName);
335}
336
337//_____________________________________________________________________________
339 const std::vector<G4double>& edges,
340 const G4String& unitName, const G4String& fcnName)
341{
342 if ( ! CheckName(name, "H1") ) return kInvalidId;
343 if ( ! CheckEdges(edges) ) return kInvalidId;
344
345 return fVH1Manager->CreateH1(name, title, edges, unitName, fcnName);
346}
347
348//_____________________________________________________________________________
350 G4int nxbins, G4double xmin, G4double xmax,
351 G4int nybins, G4double ymin, G4double ymax,
352 const G4String& xunitName, const G4String& yunitName,
353 const G4String& xfcnName, const G4String& yfcnName,
354 const G4String& xbinSchemeName,
355 const G4String& ybinSchemeName)
356
357{
358 if ( ! CheckName(name, "H2") ) return kInvalidId;
359
360 if ( ! CheckNbins(nxbins) ) return kInvalidId;
361 if ( ! CheckMinMax(xmin, xmax, xfcnName, xbinSchemeName) ) return kInvalidId;
362
363 if ( ! CheckNbins(nybins) ) return kInvalidId;
364 if ( ! CheckMinMax(ymin, ymax, yfcnName, ybinSchemeName) ) return kInvalidId;
365
366 return fVH2Manager->CreateH2(name, title,
367 nxbins, xmin, xmax, nybins, ymin, ymax,
368 xunitName, yunitName, xfcnName, yfcnName,
369 xbinSchemeName, ybinSchemeName);
370}
371
372//_____________________________________________________________________________
374 const std::vector<G4double>& xedges,
375 const std::vector<G4double>& yedges,
376 const G4String& xunitName, const G4String& yunitName,
377 const G4String& xfcnName, const G4String& yfcnName)
378
379{
380 if ( ! CheckName(name, "H2") ) return kInvalidId;
381
382 if ( ! CheckEdges(xedges) ) return kInvalidId;
383 if ( ! CheckEdges(yedges) ) return kInvalidId;
384
385 return fVH2Manager->CreateH2(name, title,
386 xedges, yedges,
387 xunitName, yunitName, xfcnName, yfcnName);
388}
389
390//_____________________________________________________________________________
392 G4int nxbins, G4double xmin, G4double xmax,
393 G4int nybins, G4double ymin, G4double ymax,
394 G4int nzbins, G4double zmin, G4double zmax,
395 const G4String& xunitName, const G4String& yunitName,
396 const G4String& zunitName,
397 const G4String& xfcnName, const G4String& yfcnName,
398 const G4String& zfcnName,
399 const G4String& xbinSchemeName,
400 const G4String& ybinSchemeName,
401 const G4String& zbinSchemeName)
402
403{
404 if ( ! CheckName(name, "H3") ) return kInvalidId;
405
406 if ( ! CheckNbins(nxbins) ) return kInvalidId;
407 if ( ! CheckMinMax(xmin, xmax, xfcnName, xbinSchemeName) ) return kInvalidId;
408
409 if ( ! CheckNbins(nybins) ) return kInvalidId;
410 if ( ! CheckMinMax(ymin, ymax, yfcnName, ybinSchemeName) ) return kInvalidId;
411
412 if ( ! CheckNbins(nzbins) ) return kInvalidId;
413 if ( ! CheckMinMax(zmin, zmax, zfcnName, zbinSchemeName) ) return kInvalidId;
414
415 return fVH3Manager->CreateH3(name, title,
416 nxbins, xmin, xmax, nybins, ymin, ymax,
417 nzbins, zmin, zmax,
418 xunitName, yunitName, zunitName,
419 xfcnName, yfcnName, zfcnName,
420 xbinSchemeName, ybinSchemeName, zbinSchemeName);
421}
422
423//_____________________________________________________________________________
425 const std::vector<G4double>& xedges,
426 const std::vector<G4double>& yedges,
427 const std::vector<G4double>& zedges,
428 const G4String& xunitName, const G4String& yunitName,
429 const G4String& zunitName,
430 const G4String& xfcnName, const G4String& yfcnName,
431 const G4String& zfcnName)
432
433{
434 if ( ! CheckName(name, "H3") ) return kInvalidId;
435
436 if ( ! CheckEdges(xedges) ) return kInvalidId;
437 if ( ! CheckEdges(yedges) ) return kInvalidId;
438 if ( ! CheckEdges(zedges) ) return kInvalidId;
439
440 return fVH3Manager->CreateH3(name, title,
441 xedges, yedges, zedges,
442 xunitName, yunitName, zunitName,
443 xfcnName, yfcnName, zfcnName);
444}
445
446//_____________________________________________________________________________
448 G4int nbins, G4double xmin, G4double xmax,
449 const G4String& unitName, const G4String& fcnName,
450 const G4String& binSchemeName)
451{
452 if ( ! CheckNbins(nbins) ) return kInvalidId;
453 if ( ! CheckMinMax(xmin, xmax, fcnName, binSchemeName) ) return kInvalidId;
454
455 return fVH1Manager->SetH1(id, nbins, xmin, xmax, unitName, fcnName, binSchemeName);
456}
457
458//_____________________________________________________________________________
460 const std::vector<G4double>& edges,
461 const G4String& unitName, const G4String& fcnName)
462{
463 if ( ! CheckEdges(edges) ) return kInvalidId;
464
465 return fVH1Manager->SetH1(id, edges, unitName, fcnName);
466}
467
468//_____________________________________________________________________________
470 G4int nxbins, G4double xmin, G4double xmax,
471 G4int nybins, G4double ymin, G4double ymax,
472 const G4String& xunitName, const G4String& yunitName,
473 const G4String& xfcnName, const G4String& yfcnName,
474 const G4String& xbinSchemeName,
475 const G4String& ybinSchemeName)
476{
477 if ( ! CheckNbins(nxbins) ) return kInvalidId;
478 if ( ! CheckMinMax(xmin, xmax, xfcnName, xbinSchemeName) ) return kInvalidId;
479
480 if ( ! CheckNbins(nybins) ) return kInvalidId;
481 if ( ! CheckMinMax(ymin, ymax, yfcnName, ybinSchemeName) ) return kInvalidId;
482
483 return fVH2Manager->SetH2(id, nxbins, xmin, xmax, nybins, ymin, ymax,
484 xunitName, yunitName, xfcnName, yfcnName,
485 xbinSchemeName, ybinSchemeName);
486}
487
488//_____________________________________________________________________________
490 const std::vector<G4double>& xedges,
491 const std::vector<G4double>& yedges,
492 const G4String& xunitName, const G4String& yunitName,
493 const G4String& xfcnName, const G4String& yfcnName)
494{
495 if ( ! CheckEdges(xedges) ) return kInvalidId;
496 if ( ! CheckEdges(yedges) ) return kInvalidId;
497
498 return fVH2Manager->SetH2(id, xedges, yedges,
499 xunitName, yunitName, xfcnName, yfcnName);
500}
501
502//_____________________________________________________________________________
504 G4int nxbins, G4double xmin, G4double xmax,
505 G4int nybins, G4double ymin, G4double ymax,
506 G4int nzbins, G4double zmin, G4double zmax,
507 const G4String& xunitName, const G4String& yunitName,
508 const G4String& zunitName,
509 const G4String& xfcnName, const G4String& yfcnName,
510 const G4String& zfcnName,
511 const G4String& xbinSchemeName,
512 const G4String& ybinSchemeName,
513 const G4String& zbinSchemeName)
514{
515 if ( ! CheckNbins(nxbins) ) return kInvalidId;
516 if ( ! CheckMinMax(xmin, xmax, xfcnName, xbinSchemeName) ) return kInvalidId;
517
518 if ( ! CheckNbins(nybins) ) return kInvalidId;
519 if ( ! CheckMinMax(ymin, ymax, yfcnName, ybinSchemeName) ) return kInvalidId;
520
521 if ( ! CheckNbins(nzbins) ) return kInvalidId;
522 if ( ! CheckMinMax(zmin, zmax, zfcnName, zbinSchemeName) ) return kInvalidId;
523
524 return fVH3Manager->SetH3(id,
525 nxbins, xmin, xmax, nybins, ymin, ymax,
526 nzbins, zmin, zmax,
527 xunitName, yunitName, zunitName,
528 xfcnName, yfcnName, zfcnName,
529 xbinSchemeName, ybinSchemeName, zbinSchemeName);
530}
531
532//_____________________________________________________________________________
534 const std::vector<G4double>& xedges,
535 const std::vector<G4double>& yedges,
536 const std::vector<G4double>& zedges,
537 const G4String& xunitName, const G4String& yunitName,
538 const G4String& zunitName,
539 const G4String& xfcnName, const G4String& yfcnName,
540 const G4String& zfcnName)
541{
542 if ( ! CheckEdges(xedges) ) return kInvalidId;
543 if ( ! CheckEdges(yedges) ) return kInvalidId;
544 if ( ! CheckEdges(zedges) ) return kInvalidId;
545
546 return fVH3Manager->SetH3(id, xedges, yedges, zedges,
547 xunitName, yunitName, zunitName,
548 xfcnName, yfcnName, zfcnName);
549}
550
551//_____________________________________________________________________________
553{
554 return fVH1Manager->ScaleH1(id, factor);
555}
556
557//_____________________________________________________________________________
559{
560 return fVH2Manager->ScaleH2(id, factor);
561}
562
563//_____________________________________________________________________________
565{
566 return fVH3Manager->ScaleH3(id, factor);
567}
568
569//_____________________________________________________________________________
571 G4int nbins, G4double xmin, G4double xmax,
572 G4double ymin, G4double ymax,
573 const G4String& xunitName, const G4String& yunitName,
574 const G4String& xfcnName, const G4String& yfcnName,
575 const G4String& xbinSchemeName)
576{
577 if ( ! CheckName(name, "P1") ) return kInvalidId;
578 if ( ! CheckNbins(nbins) ) return kInvalidId;
579 if ( ! CheckMinMax(xmin, xmax, xfcnName, xbinSchemeName) ) return kInvalidId;
580 if ( ymin != 0. || ymax != 0. ) {
581 // Do not check default values
582 if ( ! CheckMinMax(ymin, ymax) ) return kInvalidId;
583 }
584
585 return fVP1Manager->CreateP1(name, title, nbins, xmin, xmax, ymin, ymax,
586 xunitName, yunitName, xfcnName, yfcnName,
587 xbinSchemeName);
588}
589
590//_____________________________________________________________________________
592 const std::vector<G4double>& edges,
593 G4double ymin, G4double ymax,
594 const G4String& xunitName, const G4String& yunitName,
595 const G4String& xfcnName, const G4String& yfcnName)
596{
597 if ( ! CheckName(name, "P1") ) return kInvalidId;
598 if ( ! CheckEdges(edges) ) return kInvalidId;
599 if ( ymin != 0. || ymax != 0. ) {
600 // Do not check default values
601 if ( ! CheckMinMax(ymin, ymax) ) return kInvalidId;
602 }
603
604 return fVP1Manager->CreateP1(name, title, edges, ymin, ymax,
605 xunitName, yunitName, xfcnName, yfcnName);
606}
607
608//_____________________________________________________________________________
610 G4int nxbins, G4double xmin, G4double xmax,
611 G4int nybins, G4double ymin, G4double ymax,
612 G4double zmin, G4double zmax,
613 const G4String& xunitName, const G4String& yunitName,
614 const G4String& zunitName,
615 const G4String& xfcnName, const G4String& yfcnName,
616 const G4String& zfcnName,
617 const G4String& xbinSchemeName,
618 const G4String& ybinSchemeName)
619{
620 if ( ! CheckName(name, "P2") ) return kInvalidId;
621 if ( ! CheckNbins(nxbins) ) return kInvalidId;
622 if ( ! CheckMinMax(xmin, xmax, xfcnName, xbinSchemeName) ) return kInvalidId;
623 if ( ! CheckMinMax(ymin, ymax, yfcnName, xbinSchemeName) ) return kInvalidId;
624 if ( zmin != 0. || zmax != 0. ) {
625 // Do not check default values
626 if ( ! CheckMinMax(zmin, zmax) ) return kInvalidId;
627 }
628
629 return fVP2Manager->CreateP2(name, title,
630 nxbins, xmin, xmax, nybins, ymin, ymax,
631 zmin, zmax,
632 xunitName, yunitName, zunitName,
633 xfcnName, yfcnName, zfcnName,
634 xbinSchemeName, ybinSchemeName);
635}
636
637//_____________________________________________________________________________
639 const std::vector<G4double>& xedges,
640 const std::vector<G4double>& yedges,
641 G4double zmin, G4double zmax,
642 const G4String& xunitName, const G4String& yunitName,
643 const G4String& zunitName,
644 const G4String& xfcnName, const G4String& yfcnName,
645 const G4String& zfcnName)
646{
647 if ( ! CheckName(name, "P2") ) return kInvalidId;
648 if ( ! CheckEdges(xedges) ) return kInvalidId;
649 if ( ! CheckEdges(yedges) ) return kInvalidId;
650 if ( zmin != 0. || zmax != 0. ) {
651 // Do not check default values
652 if ( ! CheckMinMax(zmin, zmax) ) return kInvalidId;
653 }
654
655 return fVP2Manager->CreateP2(name, title, xedges, yedges, zmin, zmax,
656 xunitName, yunitName, zunitName,
657 xfcnName, yfcnName, zfcnName);
658}
659
660//_____________________________________________________________________________
662 G4int nbins, G4double xmin, G4double xmax,
663 G4double ymin, G4double ymax,
664 const G4String& xunitName, const G4String& yunitName,
665 const G4String& xfcnName, const G4String& yfcnName,
666 const G4String& xbinSchemeName)
667{
668 if ( ! CheckNbins(nbins) ) return kInvalidId;
669 if ( ! CheckMinMax(xmin, xmax, xfcnName, xbinSchemeName) ) return kInvalidId;
670 if ( ymin != 0. || ymax != 0. ) {
671 // Do not check default values
672 if ( ! CheckMinMax(ymin, ymax) ) return kInvalidId;
673 }
674
675 return fVP1Manager->SetP1(id, nbins, xmin, xmax, ymin, ymax,
676 xunitName, yunitName, xfcnName, yfcnName,
677 xbinSchemeName);
678}
679
680//_____________________________________________________________________________
682 const std::vector<G4double>& edges,
683 G4double ymin, G4double ymax,
684 const G4String& xunitName, const G4String& yunitName,
685 const G4String& xfcnName, const G4String& yfcnName)
686{
687 if ( ! CheckEdges(edges) ) return kInvalidId;
688 if ( ymin != 0. || ymax != 0. ) {
689 // Do not check default values
690 if ( ! CheckMinMax(ymin, ymax) ) return kInvalidId;
691 }
692
693 return fVP1Manager->SetP1(id, edges, ymin, ymax,
694 xunitName, yunitName, xfcnName, yfcnName);
695}
696
697//_____________________________________________________________________________
699 G4int nxbins, G4double xmin, G4double xmax,
700 G4int nybins, G4double ymin, G4double ymax,
701 G4double zmin, G4double zmax,
702 const G4String& xunitName, const G4String& yunitName,
703 const G4String& zunitName,
704 const G4String& xfcnName, const G4String& yfcnName,
705 const G4String& zfcnName,
706 const G4String& xbinSchemeName,
707 const G4String& ybinSchemeName)
708{
709 if ( ! CheckNbins(nxbins) ) return kInvalidId;
710 if ( ! CheckNbins(nybins) ) return kInvalidId;
711 if ( ! CheckMinMax(xmin, xmax, xfcnName, xbinSchemeName) ) return kInvalidId;
712 if ( ! CheckMinMax(ymin, ymax, yfcnName, ybinSchemeName) ) return kInvalidId;
713 if ( zmin != 0. || zmax != 0. ) {
714 // Do not check default values
715 if ( ! CheckMinMax(zmin, zmax) ) return kInvalidId;
716 }
717
718 return fVP2Manager->SetP2(id, nxbins, xmin, xmax, nybins, ymin, ymax,
719 zmin, zmax,
720 xunitName, yunitName, zunitName,
721 xfcnName, yfcnName, zfcnName,
722 xbinSchemeName, ybinSchemeName);
723}
724
725//_____________________________________________________________________________
727 const std::vector<G4double>& xedges,
728 const std::vector<G4double>& yedges,
729 G4double zmin, G4double zmax,
730 const G4String& xunitName,
731 const G4String& yunitName,
732 const G4String& zunitName,
733 const G4String& xfcnName,
734 const G4String& yfcnName,
735 const G4String& zfcnName)
736{
737 if ( ! CheckEdges(xedges) ) return kInvalidId;
738 if ( ! CheckEdges(yedges) ) return kInvalidId;
739 if ( zmin != 0. || zmax != 0. ) {
740 // Do not check default values
741 if ( ! CheckMinMax(zmin, zmax) ) return kInvalidId;
742 }
743
744 return fVP2Manager->SetP2(id, xedges, yedges, zmin, zmax,
745 xunitName, yunitName, zunitName,
746 xfcnName, yfcnName, zfcnName);
747}
748
749//_____________________________________________________________________________
751{
752 return fVP1Manager->ScaleP1(id, factor);
753}
754
755//_____________________________________________________________________________
757{
758 return fVP2Manager->ScaleP2(id, factor);
759}
760
761//_____________________________________________________________________________
763 const G4String& title)
764{
765 if ( ! CheckName(name, "Ntuple") ) return kInvalidId;
766
767 return fNtupleBookingManager->CreateNtuple(name, title);
768}
769
770//_____________________________________________________________________________
772{
773 if ( ! CheckName(name, "NtupleIColumn") ) return kInvalidId;
774
775 return fNtupleBookingManager->CreateNtupleIColumn(name, nullptr);
776}
777
778//_____________________________________________________________________________
780{
781 if ( ! CheckName(name, "NtupleFColumn") ) return kInvalidId;
782
783 return fNtupleBookingManager->CreateNtupleFColumn(name, nullptr);
784}
785
786//_____________________________________________________________________________
788{
789 if ( ! CheckName(name, "NtupleDColumn") ) return kInvalidId;
790
791 return fNtupleBookingManager->CreateNtupleDColumn(name, nullptr);
792}
793
794//_____________________________________________________________________________
796{
797 if ( ! CheckName(name, "NtupleSColumn") ) return kInvalidId;
798
799 return fNtupleBookingManager->CreateNtupleSColumn(name, nullptr);
800}
801
802//_____________________________________________________________________________
804 std::vector<int>& vector)
805{
806 if ( ! CheckName(name, "NtupleIColumn") ) return kInvalidId;
807
808 return fNtupleBookingManager->CreateNtupleIColumn(name, &vector);
809}
810
811//_____________________________________________________________________________
813 std::vector<float>& vector)
814{
815 if ( ! CheckName(name, "NtupleFColumn") ) return kInvalidId;
816
817 return fNtupleBookingManager->CreateNtupleFColumn(name, &vector);
818}
819
820//_____________________________________________________________________________
822 std::vector<double>& vector)
823{
824 if ( ! CheckName(name, "NtupleDColumn") ) return kInvalidId;
825
826 return fNtupleBookingManager->CreateNtupleDColumn(name, &vector);
827}
828
829//_____________________________________________________________________________
831 std::vector<std::string>& vector)
832{
833 if ( ! CheckName(name, "NtupleDColumn") ) return kInvalidId;
834
835 return fNtupleBookingManager->CreateNtupleSColumn(name, &vector);
836}
837
838//_____________________________________________________________________________
840{
841 auto ntupleBooking = fNtupleBookingManager->FinishNtuple();
842
843 if ( fVNtupleManager ) {
844 fVNtupleManager->CreateNtuple(ntupleBooking);
845 }
846}
847
848//_____________________________________________________________________________
850 G4int /*nofReducedNtupleFiles*/)
851{
852// The function is overridden in the managers which supports ntuple merging
853// Here we give just a warning that the feature is not available.
854
855 NtupleMergingWarning(fkClass, "SetNtupleMerging", GetType());
856}
857
858//_____________________________________________________________________________
860 G4bool /*rowMode*/)
861{
862// The function is overridden in the managers which supports ntuple merging
863// Here we give just a warning that the feature is not available.
864
865 NtupleMergingWarning(fkClass, "SetNtupleRowWise", GetType());
866}
867
868//_____________________________________________________________________________
869void G4VAnalysisManager::SetBasketSize(unsigned int /*basketSize*/)
870{
871// The function is overridden in the managers which supports ntuple merging
872// Here we give just a warning that the feature is not available.
873
874 NtupleMergingWarning(fkClass, "SetBasketSize", GetType());
875}
876
877//_____________________________________________________________________________
878void G4VAnalysisManager::SetBasketEntries(unsigned int /*basketEntries*/)
879{
880// The function is overridden in the managers which supports ntuple merging
881// Here we give just a warning that the feature is not available.
882
883 NtupleMergingWarning(fkClass, "SetBasketEntries", GetType());
884}
885
886//_____________________________________________________________________________
888 const G4String& name)
889{
890 if ( ! CheckName(name, "NtupleIColumn") ) return kInvalidId;
891
892 return fNtupleBookingManager->CreateNtupleIColumn(ntupleId, name, nullptr);
893}
894
895//_____________________________________________________________________________
897 const G4String& name)
898{
899 if ( ! CheckName(name, "NtupleFColumn") ) return kInvalidId;
900
901 return fNtupleBookingManager->CreateNtupleFColumn(ntupleId, name, nullptr);
902}
903
904
905//_____________________________________________________________________________
907 const G4String& name)
908{
909 if ( ! CheckName(name, "NtupleDColumn") ) return kInvalidId;
910
911 return fNtupleBookingManager->CreateNtupleDColumn(ntupleId, name, nullptr);
912}
913
914//_____________________________________________________________________________
916 const G4String& name)
917{
918 if ( ! CheckName(name, "NtupleSColumn") ) return kInvalidId;
919
920 return fNtupleBookingManager->CreateNtupleSColumn(ntupleId, name, nullptr);
921}
922
923//_____________________________________________________________________________
925 const G4String& name,
926 std::vector<int>& vector)
927{
928 if ( ! CheckName(name, "NtupleIColumn") ) return kInvalidId;
929
930 return fNtupleBookingManager->CreateNtupleIColumn(ntupleId, name, &vector);
931}
932
933//_____________________________________________________________________________
935 const G4String& name,
936 std::vector<float>& vector)
937{
938 if ( ! CheckName(name, "NtupleFColumn") ) return kInvalidId;
939
940 return fNtupleBookingManager->CreateNtupleFColumn(ntupleId, name, &vector);
941}
942
943//_____________________________________________________________________________
945 const G4String& name,
946 std::vector<double>& vector)
947{
948 if ( ! CheckName(name, "NtupleDColumn") ) return kInvalidId;
949
950 return fNtupleBookingManager->CreateNtupleDColumn(ntupleId, name, &vector);
951}
952
953//_____________________________________________________________________________
955 const G4String& name,
956 std::vector<std::string>& vector)
957{
958 if ( ! CheckName(name, "NtupleDColumn") ) return kInvalidId;
959
960 return fNtupleBookingManager->CreateNtupleSColumn(ntupleId, name, &vector);
961}
962
963//_____________________________________________________________________________
965{
966 auto ntupleBooking = fNtupleBookingManager->FinishNtuple(ntupleId);
967
968 if ( fVNtupleManager ) {
969 fVNtupleManager->CreateNtuple(ntupleBooking);
970 }
971}
972
973//_____________________________________________________________________________
975{
976 auto result = true;
977
978 result &= SetFirstH1Id(firstId);
979 result &= SetFirstH2Id(firstId);
980 result &= SetFirstH3Id(firstId);
981
982 return result;
983}
984
985//_____________________________________________________________________________
987{
988 return fH1HnManager->SetFirstId(firstId);
989}
990
991//_____________________________________________________________________________
993{
994 return fH2HnManager->SetFirstId(firstId);
995}
996
997//_____________________________________________________________________________
999{
1000 return fH3HnManager->SetFirstId(firstId);
1001}
1002
1003//_____________________________________________________________________________
1005{
1006 auto result = true;
1007
1008 result &= SetFirstP1Id(firstId);
1009 result &= SetFirstP2Id(firstId);
1010
1011 return result;
1012}
1013
1014//_____________________________________________________________________________
1016{
1017 return fP1HnManager->SetFirstId(firstId);
1018}
1019
1020//_____________________________________________________________________________
1022{
1023 return fP2HnManager->SetFirstId(firstId);
1024}
1025
1026//_____________________________________________________________________________
1028{
1029 auto result = true;
1030
1031 result &= fNtupleBookingManager->SetFirstId(firstId);
1032 if ( fVNtupleManager ) {
1033 result &= fVNtupleManager->SetFirstId(firstId);
1034 }
1035
1036 return result;
1037}
1038
1039//_____________________________________________________________________________
1041{
1042 auto result = true;
1043
1044 result &= fNtupleBookingManager->SetFirstNtupleColumnId(firstId);
1045 if ( fVNtupleManager ) {
1046 result &= fVNtupleManager->SetFirstNtupleColumnId(firstId);
1047 }
1048
1049 return result;
1050}
1051
1052// Fill methods in .icc
1053
1054//_____________________________________________________________________________
1056{
1057 fState.SetIsActivation(activation);
1058}
1059
1060// GetActivation() in .icc
1061
1062//_____________________________________________________________________________
1064{
1065// Return true if activation option is selected and any of managers has
1066// an activated object.
1067
1068 return fState.GetIsActivation() &&
1069 ( fH1HnManager->IsActive() ||
1070 fH2HnManager->IsActive() ||
1071 fH3HnManager->IsActive() ||
1072 fP1HnManager->IsActive() ||
1073 fP2HnManager->IsActive() );
1074}
1075
1076//_____________________________________________________________________________
1078{
1079// Return true any of managers has an object with activated ASCII option.
1080
1081 return ( fH1HnManager->IsAscii() ||
1082 fH2HnManager->IsAscii() ||
1083 fH3HnManager->IsAscii() ||
1084 fP1HnManager->IsAscii() ||
1085 fP2HnManager->IsAscii() );
1086}
1087
1088//_____________________________________________________________________________
1090{
1091// Return true any of managers has an object with activated plotting option.
1092
1093 return ( fH1HnManager->IsPlotting() ||
1094 fH2HnManager->IsPlotting() ||
1095 fH3HnManager->IsPlotting() ||
1096 fP1HnManager->IsPlotting() ||
1097 fP2HnManager->IsPlotting() );
1098}
1099
1100//_____________________________________________________________________________
1102{
1103// Return first H1 id
1104
1105 return fH1HnManager->GetFirstId();
1106}
1107
1108//_____________________________________________________________________________
1110{
1111// Return first H2 id
1112
1113 return fH2HnManager->GetFirstId();
1114}
1115
1116//_____________________________________________________________________________
1118{
1119// Return first H3 id
1120
1121 return fH3HnManager->GetFirstId();
1122}
1123
1124//_____________________________________________________________________________
1126{
1127// Return first P1 id
1128
1129 return fP1HnManager->GetFirstId();
1130}
1131
1132//_____________________________________________________________________________
1134{
1135// Return first P2 id
1136
1137 return fP2HnManager->GetFirstId();
1138}
1139
1140//_____________________________________________________________________________
1142{
1143// Return first Ntuple id
1144
1145 return fNtupleBookingManager->GetFirstId();
1146}
1147
1148//_____________________________________________________________________________
1150{
1151// Return first Ntuple column id
1152
1153 return fNtupleBookingManager->GetFirstNtupleColumnId();
1154}
1155
1156//_____________________________________________________________________________
1158{
1159 return fH1HnManager->GetNofHns();
1160}
1161
1162//_____________________________________________________________________________
1164{
1165 return fH2HnManager->GetNofHns();
1166}
1167
1168//_____________________________________________________________________________
1170{
1171 return fH3HnManager->GetNofHns();
1172}
1173
1174//_____________________________________________________________________________
1176{
1177 return fP1HnManager->GetNofHns();
1178}
1179
1180//_____________________________________________________________________________
1182{
1183 return fP2HnManager->GetNofHns();
1184}
1185
1186//_____________________________________________________________________________
1188{
1189 return fVNtupleManager->GetNofNtuples();
1190}
1191
1192// GetH1Id(), GetH2Id in .icc
1193
1194//_____________________________________________________________________________
1196{
1197// Set activation to a given H1 object
1198
1199 fH1HnManager->SetActivation(id, activation);
1200}
1201
1202//_____________________________________________________________________________
1204{
1205// Set activation to all H1 objects
1206
1207 fH1HnManager->SetActivation(activation);
1208}
1209
1210//_____________________________________________________________________________
1212{
1213 fH1HnManager->SetAscii(id, ascii);
1214}
1215
1216//_____________________________________________________________________________
1218{
1219 fH1HnManager->SetPlotting(id, plotting);
1220}
1221
1222//_____________________________________________________________________________
1224{
1225 fH1HnManager->SetFileName(id, fileName);
1226}
1227
1228//_____________________________________________________________________________
1230{
1231// Set activation to a given H2 object
1232
1233 fH2HnManager->SetActivation(id, activation);
1234}
1235
1236//_____________________________________________________________________________
1238{
1239// Set activation to all H2 objects
1240
1241 fH2HnManager->SetActivation(activation);
1242}
1243
1244//_____________________________________________________________________________
1246{
1247 fH2HnManager->SetAscii(id, ascii);
1248}
1249
1250//_____________________________________________________________________________
1252{
1253 fH2HnManager->SetPlotting(id, plotting);
1254}
1255
1256//_____________________________________________________________________________
1258{
1259 fH2HnManager->SetFileName(id, fileName);
1260}
1261
1262//_____________________________________________________________________________
1264{
1265// Set activation to a given H3 object
1266
1267 fH3HnManager->SetActivation(id, activation);
1268}
1269
1270//_____________________________________________________________________________
1272{
1273// Set activation to all H3 objects
1274
1275 fH3HnManager->SetActivation(activation);
1276}
1277
1278//_____________________________________________________________________________
1280{
1281 fH3HnManager->SetAscii(id, ascii);
1282}
1283
1284//_____________________________________________________________________________
1286{
1287 fH3HnManager->SetPlotting(id, plotting);
1288}
1289
1290//_____________________________________________________________________________
1292{
1293 fH3HnManager->SetFileName(id, fileName);
1294}
1295
1296//_____________________________________________________________________________
1298{
1299// Set activation to a given P1 object
1300
1301 fP1HnManager->SetActivation(id, activation);
1302}
1303
1304//_____________________________________________________________________________
1306{
1307// Set activation to all P1 objects
1308
1309 fP1HnManager->SetActivation(activation);
1310}
1311
1312//_____________________________________________________________________________
1314{
1315 fP1HnManager->SetAscii(id, ascii);
1316}
1317
1318//_____________________________________________________________________________
1320{
1321 fP1HnManager->SetPlotting(id, plotting);
1322}
1323
1324//_____________________________________________________________________________
1326{
1327 fP1HnManager->SetFileName(id, fileName);
1328}
1329
1330//_____________________________________________________________________________
1332{
1333// Set activation to a given P2 object
1334
1335 fP2HnManager->SetActivation(id, activation);
1336}
1337
1338//_____________________________________________________________________________
1340{
1341// Set activation to all P2 objects
1342
1343 fP2HnManager->SetActivation(activation);
1344}
1345
1346//_____________________________________________________________________________
1348{
1349 fP2HnManager->SetAscii(id, ascii);
1350}
1351
1352//_____________________________________________________________________________
1354{
1355 fP2HnManager->SetPlotting(id, plotting);
1356}
1357
1358//_____________________________________________________________________________
1360{
1361 fP2HnManager->SetFileName(id, fileName);
1362}
1363
1364//_____________________________________________________________________________
1366{
1367// Set activation to a given ntuple object
1368
1369 fNtupleBookingManager->SetActivation(id, activation);
1370 if ( fVNtupleManager ) {
1371 fVNtupleManager->SetActivation(id, activation);
1372 }
1373}
1374
1375//_____________________________________________________________________________
1377{
1378// Set activation to all ntuple objects
1379
1380 fNtupleBookingManager->SetActivation(activation);
1381 if ( fVNtupleManager ) {
1382 fVNtupleManager->SetActivation(activation);
1383 }
1384}
1385
1386//_____________________________________________________________________________
1388{
1389// Set activation to a given P2 object
1390
1391 fNtupleBookingManager->SetFileName(id, fileName);
1392}
1393
1394//_____________________________________________________________________________
1396{
1397// Set activation to all P2 objects
1398
1399 fNtupleBookingManager->SetFileName(fileName);
1400}
1401
1402// Access methods in .icc
1403
1404//_____________________________________________________________________________
1406{
1407 fState.SetVerboseLevel(verboseLevel);
1408}
1409
1410// GetVerboseLevel() in .icc
1411
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
static char className[]
Definition: G4Win32.cc:36
void SetCompressionLevel(G4int level)
void SetVerboseLevel(G4int verboseLevel)
void SetIsActivation(G4bool isActivation)
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
std::shared_ptr< G4PlotManager > fPlotManager
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 SetH2FileName(G4int id, const G4String &fileName)
G4VAnalysisManager()=delete
void SetH1Activation(G4bool activation)
virtual std::shared_ptr< G4VFileManager > GetFileManager(const G4String &fileName)
virtual ~G4VAnalysisManager()
static constexpr std::string_view fkClass
std::shared_ptr< G4HnManager > fP1HnManager
void SetH1Plotting(G4int id, G4bool plotting)
void SetH3Ascii(G4int id, G4bool ascii)
void SetH1Manager(G4VH1Manager *h1Manager)
std::unique_ptr< G4VP1Manager > fVP1Manager
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")
void SetH2Manager(G4VH2Manager *h2Manager)
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)
std::unique_ptr< G4AnalysisMessenger > fMessenger
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)
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< G4HnManager > fP2HnManager
virtual G4bool OpenFileImpl(const G4String &fileName)=0
void SetActivation(G4bool activation)
G4bool SetFirstNtupleColumnId(G4int firstId)
G4String GetFileName() 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::unique_ptr< G4VH1Manager > fVH1Manager
std::shared_ptr< G4NtupleBookingManager > fNtupleBookingManager
G4bool ScaleP1(G4int id, G4double factor)
void SetPlotManager(std::shared_ptr< G4PlotManager > plotManager)
G4bool ScaleH3(G4int id, G4double factor)
void SetH2Ascii(G4int id, G4bool ascii)
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)
std::shared_ptr< G4HnManager > fH3HnManager
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)
std::shared_ptr< G4HnManager > fH1HnManager
std::unique_ptr< G4VH2Manager > fVH2Manager
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)
void SetP2Manager(G4VP2Manager *p2Manager)
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)
void SetP1Manager(G4VP1Manager *p1Manager)
void SetH3Manager(G4VH3Manager *h3Manager)
G4bool SetFirstP2Id(G4int firstId)
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::unique_ptr< G4VP2Manager > fVP2Manager
std::shared_ptr< G4VFileManager > fVFileManager
std::unique_ptr< G4VH3Manager > fVH3Manager
std::shared_ptr< G4HnManager > fH2HnManager
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)
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)
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
virtual std::shared_ptr< G4HnManager > GetHnManager()=0
G4String GetExtension(const G4String &fileName, const G4String &defaultExtension="")
G4bool CheckMinMax(G4double xmin, G4double xmax, const G4String &fcnName="none", const G4String &binSchemeName="linear")
constexpr G4int kVL1
G4bool CheckNbins(G4int nbins)
constexpr G4int kVL3
constexpr G4int kVL4
constexpr G4int kInvalidId
G4bool CheckEdges(const std::vector< G4double > &edges)
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)
G4bool CheckName(const G4String &name, const G4String &objectType)
const char * name(G4int ptype)
G4bool IsWorkerThread()
Definition: G4Threading.cc:123
void NtupleMergingWarning(std::string_view className, std::string_view functionName, const G4String &outputType)