Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-16 08:29:45

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 03/03/2011
0041 //
0042 // Modified:
0043 //
0044 //----------------------------------------------------------------------------
0045 //
0046 
0047 #ifndef HistoManager_h
0048 #define HistoManager_h 1
0049 
0050 #include "G4Material.hh"
0051 #include "globals.hh"
0052 
0053 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0054 
0055 class Histo;
0056 class G4Track;
0057 class G4Step;
0058 class G4ParticleDefinition;
0059 class G4VModularPhysicsList;
0060 class G4VPhysicsConstructor;
0061 
0062 class HistoManager
0063 {
0064   public:
0065     static HistoManager* GetPointer();
0066 
0067     ~HistoManager();
0068 
0069     void BookHisto();
0070 
0071     void BeginOfRun();
0072     void EndOfRun();
0073     void BeginOfEvent();
0074     void EndOfEvent();
0075     void Fill(G4int id, G4double x, G4double w);
0076 
0077     void ScoreNewTrack(const G4Track*);
0078     void AddTargetStep(const G4Step*);
0079 
0080     void SetVerbose(G4int val);
0081     void SetIonPhysics(const G4String&);
0082 
0083     inline void SetTargetMaterial(const G4Material* mat) { fMaterial = mat; };
0084     inline void SetTargetLength(G4double val) { fLength = val; };
0085     inline void SetNumberOfSlices(G4int val) { fNSlices = val; };
0086     inline void SetNumberOfBinsE(G4int val) { fNBinsE = val; };
0087 
0088     inline G4double Length() const { return fLength; };
0089     inline G4int NumberOfSlices() const { return fNSlices; };
0090 
0091     inline G4int GetVerbose() const { return fVerbose; };
0092 
0093     inline void SetDefaultBeamPositionFlag(G4bool f) { fBeamFlag = f; };
0094     inline G4bool DefaultBeamPosition() const { return fBeamFlag; };
0095 
0096     inline void SetMaxEnergyDeposit(G4double val) { fEdepMax = val; };
0097 
0098     inline void SetPhysicsList(G4VModularPhysicsList* p) { fPhysList = p; };
0099 
0100   private:
0101     HistoManager();
0102 
0103     void Initialise();
0104 
0105     static HistoManager* fManager;
0106 
0107     G4VModularPhysicsList* fPhysList;
0108     G4VPhysicsConstructor* fIonPhysics;
0109     const G4ParticleDefinition* fPrimaryDef;
0110     const G4ParticleDefinition* fNeutron;
0111     const G4Material* fMaterial;
0112 
0113     G4double fEdepMax;
0114     G4double fEdepEvt;
0115     G4double fEdepSum;
0116     G4double fEdepSum2;
0117     G4double fLength;
0118     G4double fAbsZ0;
0119     G4double fPrimaryKineticEnergy;
0120 
0121     G4int fVerbose;
0122     G4int fNBinsE;
0123     G4int fNSlices;
0124 
0125     G4int fNevt;
0126     G4int fNelec;
0127     G4int fNposit;
0128     G4int fNgam;
0129     G4int fNcpions;
0130     G4int fNpi0;
0131     G4int fNkaons;
0132     G4int fNmuons;
0133     G4int fNions;
0134     G4int fNdeut;
0135     G4int fNalpha;
0136     G4int fNneutron;
0137     G4int fNproton;
0138     G4int fNaproton;
0139     G4int fNstep;
0140     G4int fNHisto;
0141 
0142     G4bool fBeamFlag;
0143 
0144     Histo* fHisto;
0145 };
0146 
0147 #endif