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.0)


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