Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:38

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 // -------------------------------------------------------------------
0027 //
0028 // GEANT4 Class header file
0029 //
0030 //
0031 // File name:     G4LossTableBuilder
0032 //
0033 // Author:        Vladimir Ivanchenko on base of Laszlo Urban code
0034 // 
0035 // Creation date: 03.01.2002
0036 //
0037 // Modifications: 
0038 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko)
0039 // 17-07-08 Added splineFlag (V.Ivanchenko)
0040 //
0041 // Class Description: 
0042 //
0043 // Provide building of dE/dx, range, and inverse range tables.
0044 
0045 // -------------------------------------------------------------------
0046 //
0047 
0048 #ifndef G4LossTableBuilder_h
0049 #define G4LossTableBuilder_h 1
0050 
0051 #include <vector>
0052 #include "globals.hh"
0053 #include "G4PhysicsTable.hh"
0054 
0055 class G4VEmModel;
0056 class G4ParticleDefinition;
0057 class G4EmParameters;
0058 
0059 class G4LossTableBuilder
0060 {
0061 
0062 public:
0063 
0064   G4LossTableBuilder(G4bool master=true);
0065 
0066   ~G4LossTableBuilder();
0067 
0068   // build sum of all energy loss processes
0069   void BuildDEDXTable(G4PhysicsTable* dedxTable, 
0070               const std::vector<G4PhysicsTable*>&);
0071 
0072   // build range
0073   void BuildRangeTable(const G4PhysicsTable* dedxTable, 
0074                G4PhysicsTable* rangeTable);
0075 
0076   // build inverse range
0077   void BuildInverseRangeTable(const G4PhysicsTable* rangeTable,
0078                   G4PhysicsTable* invRangeTable);
0079 
0080   // build a table requested by any model class
0081   G4PhysicsTable* BuildTableForModel(G4PhysicsTable* table, 
0082                      G4VEmModel* model,
0083                      const G4ParticleDefinition*,
0084                      G4double emin, G4double emax, 
0085                      G4bool spline);
0086 
0087   // initialise base materials
0088   void InitialiseBaseMaterials(const G4PhysicsTable* table=nullptr);
0089 
0090   // access methods
0091   const std::vector<G4int>* GetCoupleIndexes() const;
0092 
0093   const std::vector<G4double>* GetDensityFactors() const;
0094 
0095   G4bool GetFlag(size_t idx);
0096 
0097   G4bool GetBaseMaterialFlag();
0098 
0099   inline void SetSplineFlag(G4bool flag);
0100 
0101   inline void SetInitialisationFlag(G4bool flag);
0102 
0103   inline void SetBaseMaterialActive(G4bool flag);
0104 
0105   G4LossTableBuilder & operator=(const G4LossTableBuilder &right) = delete;
0106   G4LossTableBuilder(const G4LossTableBuilder&) = delete;
0107  
0108 private:
0109 
0110   G4EmParameters* theParameters;
0111 
0112   G4bool splineFlag = true;
0113   G4bool isInitialized = false;
0114   G4bool baseMatFlag = false;
0115   G4bool isBaseMatActive = true;
0116   G4bool isInitializer = false;
0117 
0118   static std::vector<G4double>* theDensityFactor;
0119   static std::vector<G4int>*    theDensityIdx;
0120   static std::vector<G4bool>*   theFlag;
0121 };
0122 
0123 inline void G4LossTableBuilder::SetSplineFlag(G4bool flag)
0124 {
0125   splineFlag = flag;
0126 }
0127 
0128 inline void G4LossTableBuilder::SetInitialisationFlag(G4bool flag)
0129 {
0130   isInitialized = flag;
0131 }
0132 
0133 inline void G4LossTableBuilder::SetBaseMaterialActive(G4bool flag)
0134 {
0135   isBaseMatActive = flag;
0136   if(!flag) {
0137     baseMatFlag = false;
0138     isInitialized = false;
0139   } 
0140 }
0141 
0142 //....oooOO0OOooo.......oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0143 
0144 #endif