Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:08:51

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file HistoManager.hh
0027 /// \brief Definition of the HistoManager class
0028 
0029 //---------------------------------------------------------------------------
0030 //
0031 // ClassName:   HistoManager
0032 //
0033 // Description: Singleton class to hold parameters and build histograms.
0034 //              User cannot access to the constructor.
0035 //              The pointer of the only existing object can be got via
0036 //              HistoManager::GetPointer() static method.
0037 //              The first invokation of this static method makes
0038 //              the singleton object.
0039 //
0040 // Author:      V.Ivanchenko 27/09/00
0041 //
0042 // Modified:
0043 //
0044 //----------------------------------------------------------------------------
0045 //
0046 
0047 #ifndef HistoManager_h
0048 #define HistoManager_h 1
0049 
0050 #include "G4AnalysisManager.hh"
0051 #include "G4Material.hh"
0052 #include "globals.hh"
0053 
0054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0055 
0056 class Histo;
0057 class G4ParticleDefinition;
0058 class HistoManagerMessenger;
0059 
0060 class HistoManager
0061 {
0062   public:
0063     HistoManager();
0064 
0065     ~HistoManager();
0066 
0067     void BeginOfRun();
0068     void EndOfRun();
0069 
0070     void SetVerbose(G4int val);
0071 
0072     inline void SetParticleName(const G4String&);
0073     inline void SetElementName(const G4String&);
0074 
0075     inline void SetNumberOfBinsE(G4int val);
0076     inline void SetNumberOfBinsP(G4int val);
0077 
0078     inline void SetMinKinEnergy(G4double val);
0079     inline void SetMaxKinEnergy(G4double val);
0080 
0081     inline void SetMinMomentum(G4double val);
0082     inline void SetMaxMomentum(G4double val);
0083 
0084     inline void SetHistoName(G4String& val);
0085 
0086     inline void SetTargetMaterial(const G4Material* p);
0087 
0088   private:
0089     HistoManagerMessenger* fMessenger;
0090     G4AnalysisManager* fAnalysisManager;
0091 
0092     const G4ParticleDefinition* fNeutron;
0093     const G4Material* fTargetMaterial;
0094 
0095     G4String fParticleName;
0096     G4String fElementName;
0097 
0098     G4double fMinKinEnergy;
0099     G4double fMaxKinEnergy;
0100     G4double fMinMomentum;
0101     G4double fMaxMomentum;
0102 
0103     G4int fVerbose;
0104     G4int fBinsE;
0105     G4int fBinsP;
0106 
0107     G4String fHistoName;
0108 };
0109 
0110 inline void HistoManager::SetParticleName(const G4String& name)
0111 {
0112   fParticleName = name;
0113 }
0114 
0115 inline void HistoManager::SetElementName(const G4String& name)
0116 {
0117   fElementName = name;
0118 }
0119 
0120 inline void HistoManager::SetNumberOfBinsE(G4int val)
0121 {
0122   if (val > 0) {
0123     fBinsE = val;
0124   }
0125 }
0126 
0127 inline void HistoManager::SetNumberOfBinsP(G4int val)
0128 {
0129   if (val > 0) {
0130     fBinsP = val;
0131   }
0132 }
0133 
0134 inline void HistoManager::SetMinKinEnergy(G4double val)
0135 {
0136   if (val > 0 && val < fMaxKinEnergy) {
0137     fMinKinEnergy = val;
0138   }
0139 }
0140 
0141 inline void HistoManager::SetMaxKinEnergy(G4double val)
0142 {
0143   if (val > fMinKinEnergy) {
0144     fMaxKinEnergy = val;
0145   }
0146 }
0147 
0148 inline void HistoManager::SetMinMomentum(G4double val)
0149 {
0150   if (val > 0 && val < fMaxMomentum) {
0151     fMinMomentum = val;
0152   }
0153 }
0154 
0155 inline void HistoManager::SetMaxMomentum(G4double val)
0156 {
0157   if (val > fMinMomentum) {
0158     fMaxMomentum = val;
0159   }
0160 }
0161 
0162 inline void HistoManager::SetHistoName(G4String& val)
0163 {
0164   fHistoName = val;
0165 }
0166 
0167 inline void HistoManager::SetTargetMaterial(const G4Material* p)
0168 {
0169   fTargetMaterial = p;
0170 }
0171 
0172 #endif