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, 20/07/2015 (ivan 27 // Author: Ivana Hrivnacova, 20/07/2015 (ivana@ipno.in2p3.fr) 28 28 29 #include "G4ToolsAnalysisReader.hh" 29 #include "G4ToolsAnalysisReader.hh" >> 30 #include "G4H1ToolsManager.hh" >> 31 #include "G4H2ToolsManager.hh" >> 32 #include "G4H3ToolsManager.hh" >> 33 #include "G4P1ToolsManager.hh" >> 34 #include "G4P2ToolsManager.hh" >> 35 #include "G4MPIToolsManager.hh" 30 36 31 //____________________________________________ 37 //_____________________________________________________________________________ 32 G4ToolsAnalysisReader::G4ToolsAnalysisReader(c << 38 G4ToolsAnalysisReader::G4ToolsAnalysisReader(const G4String& type, G4bool isMaster) 33 : G4VAnalysisReader(type) << 39 : G4VAnalysisReader(type, isMaster), >> 40 fH1Manager(nullptr), >> 41 fH2Manager(nullptr), >> 42 fH3Manager(nullptr), >> 43 fP1Manager(nullptr), >> 44 fP2Manager(nullptr) 34 { 45 { 35 // Create managers 46 // Create managers 36 fH1Manager = new G4THnToolsManager<kDim1, to << 47 fH1Manager = new G4H1ToolsManager(fState); 37 fH2Manager = new G4THnToolsManager<kDim2, to << 48 fH2Manager = new G4H2ToolsManager(fState); 38 fH3Manager = new G4THnToolsManager<kDim3, to << 49 fH3Manager = new G4H3ToolsManager(fState); 39 fP1Manager = new G4THnToolsManager<kDim2, to << 50 fP1Manager = new G4P1ToolsManager(fState); 40 fP2Manager = new G4THnToolsManager<kDim3, to << 51 fP2Manager = new G4P2ToolsManager(fState); 41 // The managers will be deleted by the b 52 // The managers will be deleted by the base class 42 << 53 43 // Set managers to base class which takes th 54 // Set managers to base class which takes then their ownership 44 SetH1Manager(fH1Manager); 55 SetH1Manager(fH1Manager); 45 SetH2Manager(fH2Manager); 56 SetH2Manager(fH2Manager); 46 SetH3Manager(fH3Manager); 57 SetH3Manager(fH3Manager); 47 SetP1Manager(fP1Manager); 58 SetP1Manager(fP1Manager); 48 SetP2Manager(fP2Manager); 59 SetP2Manager(fP2Manager); 49 } 60 } 50 61 >> 62 //_____________________________________________________________________________ >> 63 G4ToolsAnalysisReader::~G4ToolsAnalysisReader() >> 64 {} >> 65 51 // 66 // 52 // protected methods 67 // protected methods 53 // 68 // 54 69 55 //____________________________________________ 70 //_____________________________________________________________________________ 56 G4int G4ToolsAnalysisReader::ReadH1Impl(const << 57 const G << 58 const G << 59 G4bool << 60 { << 61 return ReadTImpl<tools::histo::h1d>( << 62 h1Name, fileName, dirName, isUserFi << 63 } << 64 << 65 //____________________________________________ << 66 G4int G4ToolsAnalysisReader::ReadH2Impl(const << 67 const G << 68 const G << 69 G4bool << 70 { << 71 return ReadTImpl<tools::histo::h2d>( << 72 h2Name, fileName, dirName, isUserFi << 73 } << 74 << 75 //____________________________________________ << 76 G4int G4ToolsAnalysisReader::ReadH3Impl(const << 77 const G << 78 const G << 79 G4bool << 80 { << 81 return ReadTImpl<tools::histo::h3d>( << 82 h3Name, fileName, dirName, isUserFi << 83 } << 84 << 85 //____________________________________________ << 86 G4int G4ToolsAnalysisReader::ReadP1Impl(const << 87 const G << 88 const G << 89 G4bool << 90 { << 91 return ReadTImpl<tools::histo::p1d>( << 92 p1Name, fileName, dirName, isUserFi << 93 } << 94 << 95 //____________________________________________ << 96 G4int G4ToolsAnalysisReader::ReadP2Impl(const << 97 const G << 98 const G << 99 G4bool << 100 { << 101 return ReadTImpl<tools::histo::p2d>( << 102 p2Name, fileName, dirName, isUserFi << 103 } << 104 << 105 //____________________________________________ << 106 G4bool G4ToolsAnalysisReader::Reset() 71 G4bool G4ToolsAnalysisReader::Reset() 107 { 72 { 108 // Reset histograms and profiles 73 // Reset histograms and profiles 109 74 110 auto result = true; << 75 auto finalResult = true; 111 << 76 112 result &= fH1Manager->Reset(); << 77 auto result = fH1Manager->Reset(); 113 result &= fH2Manager->Reset(); << 78 finalResult = finalResult && result; 114 result &= fH3Manager->Reset(); << 79 115 result &= fP1Manager->Reset(); << 80 result = fH2Manager->Reset(); 116 result &= fP2Manager->Reset(); << 81 finalResult = finalResult && result; 117 << 82 118 return result; << 83 result = fH3Manager->Reset(); 119 } << 84 finalResult = finalResult && result; >> 85 >> 86 result = fP1Manager->Reset(); >> 87 finalResult = finalResult && result; >> 88 >> 89 result = fP2Manager->Reset(); >> 90 finalResult = finalResult && result; >> 91 >> 92 return finalResult; >> 93 } 120 94