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