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 // 00027 // $Id$ 00028 // 00029 // ---------------------------------------------------------------------- 00030 // Class G4IStore 00031 // 00032 // Class description: 00033 // 00034 // An implementation of a "importance store" with the interface 00035 // G4VIStore. See description in G4VIStore. 00036 // This implementation uses G4GeometryCellImportance as the container 00037 // to store the "cells" together with the importance values. 00038 // Giving a cell the importance 0 is allowed as 00039 // a flagging that no biasing should happen between this 00040 // cell and it's neighbors 00041 // If a cell is not known by the importance store no biasing 00042 // should be applied between this cell and it's nighbors. 00043 00044 // Author: Michael Dressel (Michael.Dressel@cern.ch) 00045 // ---------------------------------------------------------------------- 00046 #ifndef G4IStore_hh 00047 #define G4IStore_hh G4IStore_hh 00048 00049 #include "G4VIStore.hh" 00050 #include "G4GeometryCellImportance.hh" 00051 00052 class G4IStore : public G4VIStore 00053 { 00054 00055 public: // with description 00056 00057 explicit G4IStore(const G4VPhysicalVolume &worldvolume); 00058 // initialise the importance store for the given geometry 00059 00060 virtual ~G4IStore(); 00061 // destruct 00062 00063 virtual G4double GetImportance(const G4GeometryCell &gCell) const; 00064 // derive a importance value of a "cell" addresed by a G4GeometryCell 00065 // from the store. 00066 00067 virtual G4bool IsKnown(const G4GeometryCell &gCell) const; 00068 // returns true if the gCell is in the store, else false 00069 00070 00071 virtual const G4VPhysicalVolume &GetWorldVolume() const; 00072 // return a reference to the wolrd volume of the 00073 // "importance" geometry 00074 00075 void AddImportanceGeometryCell(G4double importance, 00076 const G4GeometryCell &gCell); 00077 void AddImportanceGeometryCell(G4double importance, 00078 const G4VPhysicalVolume &, 00079 G4int aRepNum = 0); 00080 // Add a "cell" together with a importance value to the store. 00081 00082 void ChangeImportance(G4double importance, 00083 const G4GeometryCell &gCell); 00084 void ChangeImportance(G4double importance, 00085 const G4VPhysicalVolume &, 00086 G4int aRepNum = 0); 00087 // Change a importance value of a "cell". 00088 00089 G4double GetImportance(const G4VPhysicalVolume &, 00090 G4int aRepNum = 0) const ; 00091 00092 private: 00093 00094 G4bool IsInWorld(const G4VPhysicalVolume &) const; 00095 void SetInternalIterator(const G4GeometryCell &gCell) const; 00096 void Error(const G4String &m) const; 00097 00098 private: 00099 00100 const G4VPhysicalVolume &fWorldVolume; 00101 G4GeometryCellImportance fGeometryCelli; 00102 00103 mutable G4GeometryCellImportance::const_iterator fCurrentIterator; 00104 }; 00105 00106 #endif