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 G4CellScorerStore 00031 // 00032 // Class description: 00033 // 00034 // This class stores pointers to G4CellScorer. Objects of G4CellScorer for 00035 // each cell may be created the first time a cell is hit: therefore 00036 // SetAutoScorerCreate() has to be called before the run starts. 00037 // Alternative the store may be filled with pointers to G4CellScorer 00038 // before the run. In this case only the cells for which a G4CellScorer 00039 // exists are scored. 00040 // 00041 00042 // Author: Michael Dressel (Michael.Dressel@cern.ch) 00043 // ---------------------------------------------------------------------- 00044 00045 #ifndef G4CellScorerStore_hh 00046 #define G4CellScorerStore_hh G4CellScorerStore_hh 00047 00048 #include <map> 00049 #include "G4GeometryCell.hh" 00050 00051 #include "globals.hh" 00052 #include "G4VCellScorerStore.hh" 00053 #include "G4GeometryCellComp.hh" 00054 00055 class G4CellScorer; 00056 00057 typedef std::map<G4GeometryCell, G4CellScorer *, G4GeometryCellComp> G4MapGeometryCellCellScorer; 00058 00059 class G4CellScorerStore : public G4VCellScorerStore { 00060 public: // with description 00061 00062 G4CellScorerStore(); 00063 00064 virtual ~G4CellScorerStore(); 00065 00066 virtual G4VCellScorer *GetCellScore(const G4GeometryCell &gCell); 00067 // return the current cell scorer 00068 00069 void SetAutoScorerCreate(); 00070 // if this function is called cell scorers will be created 00071 // automatically for a cell the first time a track hits the cell 00072 00073 G4CellScorer *AddCellScorer(const G4GeometryCell &gCell); 00074 // add a G4CellScorer for the given cell, needed if 00075 // SetAutoScorerCreate is not called. This way the user 00076 // may specify to score only for the given cells. 00077 00078 00079 G4CellScorer *AddCellScorer(G4VPhysicalVolume &vol, G4int repnum = 0); 00080 // same functionallity as above only that the cell is specified 00081 // by the physical volume and a replica number 00082 00083 00084 const G4MapGeometryCellCellScorer &GetMapGeometryCellCellScorer() const ; 00085 // return the map of GeometryCell to the G4CellScorer 00086 00087 void DeleteAllScorers(); 00088 00089 private: 00090 G4MapGeometryCellCellScorer fMapGeometryCellCellScorer; 00091 G4bool fAutoCreate; 00092 }; 00093 00094 #endif