1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // $Id: G4IStore.hh,v 1.10 2006/06/29 18:16:04 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: HEAD $ |
---|
29 | // |
---|
30 | // ---------------------------------------------------------------------- |
---|
31 | // Class G4IStore |
---|
32 | // |
---|
33 | // Class description: |
---|
34 | // |
---|
35 | // An implementation of a "importance store" with the interface |
---|
36 | // G4VIStore. See description in G4VIStore. |
---|
37 | // This implementation uses G4GeometryCellImportance as the container |
---|
38 | // to store the "cells" together with the importance values. |
---|
39 | // Giving a cell the importance 0 is allowed as |
---|
40 | // a flagging that no biasing should happen between this |
---|
41 | // cell and it's neighbors |
---|
42 | // If a cell is not known by the importance store no biasing |
---|
43 | // should be applied between this cell and it's nighbors. |
---|
44 | |
---|
45 | // Author: Michael Dressel (Michael.Dressel@cern.ch) |
---|
46 | // ---------------------------------------------------------------------- |
---|
47 | #ifndef G4IStore_hh |
---|
48 | #define G4IStore_hh G4IStore_hh |
---|
49 | |
---|
50 | #include "G4VIStore.hh" |
---|
51 | #include "G4GeometryCellImportance.hh" |
---|
52 | |
---|
53 | class G4IStore : public G4VIStore |
---|
54 | { |
---|
55 | |
---|
56 | public: // with description |
---|
57 | |
---|
58 | explicit G4IStore(const G4VPhysicalVolume &worldvolume); |
---|
59 | // initialise the importance store for the given geometry |
---|
60 | |
---|
61 | virtual ~G4IStore(); |
---|
62 | // destruct |
---|
63 | |
---|
64 | virtual G4double GetImportance(const G4GeometryCell &gCell) const; |
---|
65 | // derive a importance value of a "cell" addresed by a G4GeometryCell |
---|
66 | // from the store. |
---|
67 | |
---|
68 | virtual G4bool IsKnown(const G4GeometryCell &gCell) const; |
---|
69 | // returns true if the gCell is in the store, else false |
---|
70 | |
---|
71 | |
---|
72 | virtual const G4VPhysicalVolume &GetWorldVolume() const; |
---|
73 | // return a reference to the wolrd volume of the |
---|
74 | // "importance" geometry |
---|
75 | |
---|
76 | void AddImportanceGeometryCell(G4double importance, |
---|
77 | const G4GeometryCell &gCell); |
---|
78 | void AddImportanceGeometryCell(G4double importance, |
---|
79 | const G4VPhysicalVolume &, |
---|
80 | G4int aRepNum = 0); |
---|
81 | // Add a "cell" together with a importance value to the store. |
---|
82 | |
---|
83 | void ChangeImportance(G4double importance, |
---|
84 | const G4GeometryCell &gCell); |
---|
85 | void ChangeImportance(G4double importance, |
---|
86 | const G4VPhysicalVolume &, |
---|
87 | G4int aRepNum = 0); |
---|
88 | // Change a importance value of a "cell". |
---|
89 | |
---|
90 | G4double GetImportance(const G4VPhysicalVolume &, |
---|
91 | G4int aRepNum = 0) const ; |
---|
92 | |
---|
93 | private: |
---|
94 | |
---|
95 | G4bool IsInWorld(const G4VPhysicalVolume &) const; |
---|
96 | void SetInternalIterator(const G4GeometryCell &gCell) const; |
---|
97 | void Error(const G4String &m) const; |
---|
98 | |
---|
99 | private: |
---|
100 | |
---|
101 | const G4VPhysicalVolume &fWorldVolume; |
---|
102 | G4GeometryCellImportance fGeometryCelli; |
---|
103 | |
---|
104 | mutable G4GeometryCellImportance::const_iterator fCurrentIterator; |
---|
105 | }; |
---|
106 | |
---|
107 | #endif |
---|