Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:05

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