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