Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-30 07:50:12

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 #ifndef HistoManager_h
0030 #define HistoManager_h 1
0031 
0032 //---------------------------------------------------------------------------
0033 //
0034 // ClassName:   HistoManager
0035 //
0036 // Description: Singleton class to hold Emc parameters and build histograms.
0037 //              User cannot access to the constructor.
0038 //              The pointer of the only existing object can be got via
0039 //              HistoManager::GetPointer() static method.
0040 //              The first invokation of this static method makes
0041 //              the singleton object.
0042 //
0043 // Author:      V.Ivanchenko 27/09/00
0044 //
0045 //----------------------------------------------------------------------------
0046 //
0047 
0048 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0049 
0050 #include "G4DataVector.hh"
0051 #include "G4DynamicParticle.hh"
0052 #include "G4Track.hh"
0053 #include "G4VPhysicalVolume.hh"
0054 #include "globals.hh"
0055 
0056 #include <vector>
0057 
0058 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0059 
0060 class Histo;
0061 
0062 class HistoManager
0063 {
0064   public:
0065     // With description
0066 
0067     static HistoManager* GetPointer();
0068 
0069   private:
0070     HistoManager();
0071 
0072   public:  // Without description
0073     ~HistoManager();
0074 
0075     void BookHisto();
0076 
0077     void BeginOfRun();
0078     void EndOfRun(G4int runID);
0079 
0080     void BeginOfEvent();
0081     void EndOfEvent();
0082 
0083     void ScoreNewTrack(const G4Track* aTrack);
0084     void AddEnergy(G4double edep, G4int idx, G4int copyNo);
0085 
0086     void AddDeltaElectron(const G4DynamicParticle*);
0087     void AddPhoton(const G4DynamicParticle*);
0088 
0089     inline void ResetTrackLength() { fTrackLength = 0.0, fTrackAbs = true; };
0090     inline void AddPositron(const G4DynamicParticle*) { ++fPosit; };
0091     inline void SetVerbose(G4int val) { fVerbose = val; };
0092     inline G4int GetVerbose() const { return fVerbose; };
0093     inline void SetHistoNumber(G4int val) { fNHisto = val; };
0094 
0095     inline void SetFirstEventToDebug(G4int val) { fEvt1 = val; };
0096     inline G4int FirstEventToDebug() const { return fEvt1; };
0097     inline void SetLastEventToDebug(G4int val) { fEvt2 = val; };
0098     inline G4int LastEventToDebug() const { return fEvt2; };
0099 
0100     inline void SetMaxEnergy(G4double val) { fMaxEnergy = val; };
0101     inline G4double GetMaxEnergy() const { return fMaxEnergy; };
0102     inline void AddStep() { fStep += 1.0; };
0103 
0104     // Acceptance parameters
0105     inline void SetBeamEnergy(G4double val) { fBeamEnergy = val; };
0106 
0107     void SetEdepAndRMS(G4int, const G4ThreeVector&);
0108 
0109   private:
0110     // MEMBERS
0111     static HistoManager* fManager;
0112 
0113     const G4ParticleDefinition* fGamma;
0114     const G4ParticleDefinition* fElectron;
0115     const G4ParticleDefinition* fPositron;
0116 
0117     Histo* fHisto;
0118 
0119     G4int fNHisto;
0120     G4int fVerbose;
0121     G4int fEvt1;
0122     G4int fEvt2;
0123 
0124     G4double fBeamEnergy;
0125     G4double fMaxEnergy;
0126     G4double fMaxEnergyAbs;
0127 
0128     G4double fTrackLength;
0129     G4double fStep;
0130     G4bool fTrackAbs;  // Track is in absorber
0131     G4int fEvt;
0132     G4int fElec;
0133     G4int fPosit;
0134     G4int fGam;
0135     G4int fLowe;
0136     G4int fBinsE, fBinsEA, fBinsED;
0137 
0138     G4double fEabs1, fEabs2, fEabs3, fEabs4;
0139     G4double fE[25];
0140     G4DataVector fEvertex;
0141     G4DataVector fNvertex;
0142     G4DataVector fBrem;
0143     G4DataVector fPhot;
0144     G4DataVector fComp;
0145     G4DataVector fConv;
0146 
0147     G4double fEdeptrue[3];
0148     G4double fRmstrue[3];
0149     G4double fLimittrue[3];
0150     G4double fEdep[6];
0151     G4double fErms[6];
0152     G4double fEdeptr[6];
0153     G4double fErmstr[6];
0154     G4int fStat[6];
0155     G4int fNmax;
0156 };
0157 
0158 #endif