Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/analysis/management/src/G4VAnalysisManager.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /analysis/management/src/G4VAnalysisManager.cc (Version 11.3.0) and /analysis/management/src/G4VAnalysisManager.cc (Version 11.2.2)


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