00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 /// \file hadronic/Hadr00/include/HistoManager.hh 00027 /// \brief Definition of the HistoManager class 00028 // 00029 // $Id$ 00030 // 00031 //--------------------------------------------------------------------------- 00032 // 00033 // ClassName: HistoManager 00034 // 00035 // Description: Singleton class to hold parameters and build histograms. 00036 // User cannot access to the constructor. 00037 // The pointer of the only existing object can be got via 00038 // HistoManager::GetPointer() static method. 00039 // The first invokation of this static method makes 00040 // the singleton object. 00041 // 00042 // Author: V.Ivanchenko 27/09/00 00043 // 00044 // Modified: 00045 // 00046 //---------------------------------------------------------------------------- 00047 // 00048 00049 #ifndef HistoManager_h 00050 #define HistoManager_h 1 00051 00052 #include "globals.hh" 00053 #include "G4Material.hh" 00054 00055 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00056 00057 class Histo; 00058 class G4ParticleDefinition; 00059 00060 class HistoManager 00061 { 00062 public: 00063 00064 static HistoManager* GetPointer(); 00065 00066 private: 00067 00068 HistoManager(); 00069 00070 public: 00071 00072 ~HistoManager(); 00073 00074 void BeginOfRun(); 00075 void EndOfRun(); 00076 00077 void SetVerbose(G4int val); 00078 00079 inline void SetParticleName(const G4String&); 00080 inline void SetElementName(const G4String&); 00081 00082 inline void SetNumberOfBinsE(G4int val); 00083 inline void SetNumberOfBinsP(G4int val); 00084 00085 inline void SetMinKinEnergy(G4double val); 00086 inline void SetMaxKinEnergy(G4double val); 00087 00088 inline void SetMinMomentum(G4double val); 00089 inline void SetMaxMomentum(G4double val); 00090 00091 inline G4int GetVerbose() const; 00092 00093 private: 00094 00095 static HistoManager* fManager; 00096 00097 Histo* fHisto; 00098 00099 const G4ParticleDefinition* fNeutron; 00100 00101 G4String fParticleName; 00102 G4String fElementName; 00103 00104 G4double fMinKinEnergy; 00105 G4double fMaxKinEnergy; 00106 G4double fMinMomentum; 00107 G4double fMaxMomentum; 00108 00109 G4int fVerbose; 00110 G4int fBinsE; 00111 G4int fBinsP; 00112 00113 G4bool fIsInitialised; 00114 }; 00115 00116 inline void HistoManager::SetParticleName(const G4String& name) 00117 { 00118 fParticleName = name; 00119 } 00120 00121 inline void HistoManager::SetElementName(const G4String& name) 00122 { 00123 fElementName = name; 00124 } 00125 00126 inline void HistoManager::SetNumberOfBinsE(G4int val) 00127 { 00128 if(val>0) { fBinsE = val; } 00129 } 00130 00131 inline void HistoManager::SetNumberOfBinsP(G4int val) 00132 { 00133 if(val>0) { fBinsP = val; } 00134 } 00135 00136 inline void HistoManager::SetMinKinEnergy(G4double val) 00137 { 00138 if(val>0 && val<fMaxKinEnergy) { fMinKinEnergy = val; } 00139 } 00140 00141 inline void HistoManager::SetMaxKinEnergy(G4double val) 00142 { 00143 if(val>fMinKinEnergy) { fMaxKinEnergy = val; } 00144 } 00145 00146 inline void HistoManager::SetMinMomentum(G4double val) 00147 { 00148 if(val>0 && val<fMaxMomentum) { fMinMomentum = val; } 00149 } 00150 00151 inline void HistoManager::SetMaxMomentum(G4double val) 00152 { 00153 if(val>fMinMomentum) { fMaxMomentum = val; } 00154 } 00155 00156 inline G4int HistoManager::GetVerbose() const 00157 { 00158 return fVerbose; 00159 } 00160 00161 #endif