G4WeightWindowStore.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 //
00027 // $Id$
00028 //
00029 // ----------------------------------------------------------------------
00030 // Class G4WeightWindowStore
00031 //
00032 // Class description:
00033 //
00034 // Implementation of a weight window store according to the
00035 // G4VWeightWindowStore interface.
00036 // See G4VWeightWindowStore.
00037 
00038 // Author: Michael Dressel (Michael.Dressel@cern.ch)
00039 // ----------------------------------------------------------------------
00040 #ifndef G4WeightWindowStore_hh
00041 #define G4WeightWindowStore_hh G4WeightWindowStore_hh 
00042 
00043 #include "G4VWeightWindowStore.hh"
00044 #include "G4GeometryCellWeight.hh"
00045 #include <set>
00046 #include <vector>
00047 
00048 class G4WeightWindowStore: public G4VWeightWindowStore
00049 {
00050 
00051 public:  // with description
00052 
00053   explicit G4WeightWindowStore(const G4VPhysicalVolume &worldvolume);
00054     // initialise the weight window store for the given geometry
00055 
00056   ~G4WeightWindowStore();
00057     // destructor
00058 
00059   G4double GetLowerWeight(const G4GeometryCell &gCell, 
00060                                         G4double partEnergy) const;
00061     // derive a lower weight bound value of a "cell" addresed by a 
00062     // G4GeometryCell and the coresponding energy from the store.
00063 
00064   G4bool IsKnown(const G4GeometryCell &gCell) const;
00065     // returns true if the gCell is in the store, else false 
00066 
00067 
00068   const G4VPhysicalVolume &GetWorldVolume() const;
00069     // return a reference to the wolrd volume of the 
00070     // geometry
00071 
00072   void AddLowerWeights(const G4GeometryCell &gCell,
00073                        const std::vector<G4double> &lowerWeights);
00074     // add lower weights. Only if general upper energy bounds have 
00075     // been set
00076  
00077   void AddUpperEboundLowerWeightPairs(const G4GeometryCell &gCell,
00078                                       const G4UpperEnergyToLowerWeightMap&
00079                                       enWeMap);
00080     // set upper energy - lower weight pairs for a cell
00081 
00082   void SetGeneralUpperEnergyBounds(const std::set<G4double, std::less<G4double> > &enBounds);
00083   
00084 private:
00085 
00086   G4bool IsInWorld(const G4VPhysicalVolume &) const;
00087   void Error(const G4String &m) const;
00088   void SetInternalIterator(const G4GeometryCell &gCell) const;
00089   
00090 private:
00091 
00092   const G4VPhysicalVolume &fWorldVolume;  
00093   std::set<G4double, std::less<G4double> > fGeneralUpperEnergyBounds;
00094   G4GeometryCellWeight fCellToUpEnBoundLoWePairsMap;
00095   mutable G4GeometryCellWeight::const_iterator fCurrentIterator;
00096   
00097 };
00098 
00099 #endif

Generated on Mon May 27 17:50:25 2013 for Geant4 by  doxygen 1.4.7