[816] | 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: G4CellScorerStore.hh,v 1.3 2006/06/29 18:08:21 gunter Exp $ |
---|
[1337] | 28 | // GEANT4 tag $Name: geant4-09-04-beta-01 $ |
---|
[816] | 29 | // |
---|
| 30 | // ---------------------------------------------------------------------- |
---|
| 31 | // Class G4CellScorerStore |
---|
| 32 | // |
---|
| 33 | // Class description: |
---|
| 34 | // |
---|
| 35 | // This class stores pointers to G4CellScorer. Objects of G4CellScorer for |
---|
| 36 | // each cell may be created the first time a cell is hit: therefore |
---|
| 37 | // SetAutoScorerCreate() has to be called before the run starts. |
---|
| 38 | // Alternative the store may be filled with pointers to G4CellScorer |
---|
| 39 | // before the run. In this case only the cells for which a G4CellScorer |
---|
| 40 | // exists are scored. |
---|
| 41 | // |
---|
| 42 | |
---|
| 43 | // Author: Michael Dressel (Michael.Dressel@cern.ch) |
---|
| 44 | // ---------------------------------------------------------------------- |
---|
| 45 | |
---|
| 46 | #ifndef G4CellScorerStore_hh |
---|
| 47 | #define G4CellScorerStore_hh G4CellScorerStore_hh |
---|
| 48 | |
---|
| 49 | #include <map> |
---|
| 50 | #include "G4GeometryCell.hh" |
---|
| 51 | |
---|
| 52 | #include "globals.hh" |
---|
| 53 | #include "G4VCellScorerStore.hh" |
---|
| 54 | #include "G4GeometryCellComp.hh" |
---|
| 55 | |
---|
| 56 | class G4CellScorer; |
---|
| 57 | |
---|
| 58 | typedef std::map<G4GeometryCell, G4CellScorer *, G4GeometryCellComp> G4MapGeometryCellCellScorer; |
---|
| 59 | |
---|
| 60 | class G4CellScorerStore : public G4VCellScorerStore { |
---|
| 61 | public: // with description |
---|
| 62 | |
---|
| 63 | G4CellScorerStore(); |
---|
| 64 | |
---|
| 65 | virtual ~G4CellScorerStore(); |
---|
| 66 | |
---|
| 67 | virtual G4VCellScorer *GetCellScore(const G4GeometryCell &gCell); |
---|
| 68 | // return the current cell scorer |
---|
| 69 | |
---|
| 70 | void SetAutoScorerCreate(); |
---|
| 71 | // if this function is called cell scorers will be created |
---|
| 72 | // automatically for a cell the first time a track hits the cell |
---|
| 73 | |
---|
| 74 | G4CellScorer *AddCellScorer(const G4GeometryCell &gCell); |
---|
| 75 | // add a G4CellScorer for the given cell, needed if |
---|
| 76 | // SetAutoScorerCreate is not called. This way the user |
---|
| 77 | // may specify to score only for the given cells. |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | G4CellScorer *AddCellScorer(G4VPhysicalVolume &vol, G4int repnum = 0); |
---|
| 81 | // same functionallity as above only that the cell is specified |
---|
| 82 | // by the physical volume and a replica number |
---|
| 83 | |
---|
| 84 | |
---|
| 85 | const G4MapGeometryCellCellScorer &GetMapGeometryCellCellScorer() const ; |
---|
| 86 | // return the map of GeometryCell to the G4CellScorer |
---|
| 87 | |
---|
| 88 | void DeleteAllScorers(); |
---|
| 89 | |
---|
| 90 | private: |
---|
| 91 | G4MapGeometryCellCellScorer fMapGeometryCellCellScorer; |
---|
| 92 | G4bool fAutoCreate; |
---|
| 93 | }; |
---|
| 94 | |
---|
| 95 | #endif |
---|