G4LossTableBuilder.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id$
00027 //
00028 //
00029 // -------------------------------------------------------------------
00030 //
00031 // GEANT4 Class header file
00032 //
00033 //
00034 // File name:     G4LossTableBuilder
00035 //
00036 // Author:        Vladimir Ivanchenko on base of Laszlo Urban code
00037 // 
00038 // Creation date: 03.01.2002
00039 //
00040 // Modifications: 
00041 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko)
00042 // 17-07-08 Added splineFlag (V.Ivanchenko)
00043 //
00044 // Class Description: 
00045 //
00046 // Provide building of dE/dx, range, and inverse range tables.
00047 
00048 // -------------------------------------------------------------------
00049 //
00050 
00051 #ifndef G4LossTableBuilder_h
00052 #define G4LossTableBuilder_h 1
00053 
00054 #include <vector>
00055 #include "globals.hh"
00056 #include "G4PhysicsTable.hh"
00057 
00058 class G4VEmModel;
00059 class G4ParticleDefinition;
00060 
00061 class G4LossTableBuilder
00062 {
00063 
00064 public:
00065 
00066   G4LossTableBuilder();
00067 
00068   virtual ~G4LossTableBuilder();
00069 
00070   // build sum of all energy loss processes
00071   void BuildDEDXTable(G4PhysicsTable* dedxTable, 
00072                       const std::vector<G4PhysicsTable*>&);
00073 
00074   // build range
00075   void BuildRangeTable(const G4PhysicsTable* dedxTable, 
00076                        G4PhysicsTable* rangeTable,
00077                        G4bool isIonisation = false);
00078 
00079   // build inverse range
00080   void BuildInverseRangeTable(const G4PhysicsTable* rangeTable,
00081                               G4PhysicsTable* invRangeTable,
00082                               G4bool isIonisation = false);
00083 
00084   // build a table requested by any model class
00085   G4PhysicsTable* BuildTableForModel(G4PhysicsTable* table, 
00086                                      G4VEmModel* model,
00087                                      const G4ParticleDefinition*,
00088                                      G4double emin, G4double emax, 
00089                                      G4bool spline);
00090 
00091   // initialise base materials
00092   void InitialiseBaseMaterials(G4PhysicsTable* table);
00093 
00094 
00095   // access methods
00096   inline const std::vector<G4int>* GetCoupleIndexes();
00097 
00098   inline const std::vector<G4double>* GetDensityFactors();
00099 
00100   inline G4bool GetFlag(size_t idx) const;
00101 
00102   inline void SetSplineFlag(G4bool flag);
00103 
00104   inline void SetInitialisationFlag(G4bool flag);
00105  
00106 private:
00107 
00108   void InitialiseCouples();
00109 
00110   G4LossTableBuilder & operator=(const  G4LossTableBuilder &right);
00111   G4LossTableBuilder(const  G4LossTableBuilder&);
00112 
00113   G4bool splineFlag;
00114   G4bool isInitialized;
00115 
00116   std::vector<G4double>* theDensityFactor;
00117   std::vector<G4int>*    theDensityIdx;
00118   std::vector<G4bool>*   theFlag;
00119 
00120 };
00121 
00122 inline const std::vector<G4int>* 
00123 G4LossTableBuilder::GetCoupleIndexes()
00124 {
00125   if(theDensityIdx->size() == 0) { InitialiseCouples(); }
00126   return theDensityIdx;
00127 }
00128 
00129 inline const std::vector<G4double>* 
00130 G4LossTableBuilder::GetDensityFactors()
00131 {
00132   if(theDensityIdx->size() == 0) { InitialiseCouples(); }
00133   return theDensityFactor;
00134 }
00135 
00136 inline G4bool G4LossTableBuilder::GetFlag(size_t idx) const
00137 {
00138   return (*theFlag)[idx];
00139 }
00140 
00141 inline void G4LossTableBuilder::SetSplineFlag(G4bool flag)
00142 {
00143   splineFlag = flag;
00144 }
00145 
00146 inline void G4LossTableBuilder::SetInitialisationFlag(G4bool flag)
00147 {
00148   isInitialized = flag;
00149 }
00150 
00151 //....oooOO0OOooo.......oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00152 
00153 #endif

Generated on Mon May 27 17:48:49 2013 for Geant4 by  doxygen 1.4.7