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