51 fGeneralUpperEnergyBounds(),
52 fCellToUpEnBoundLoWePairsMap(),
53 fCurrentIterator(fCellToUpEnBoundLoWePairsMap.end())
59 fGeneralUpperEnergyBounds(),
60 fCellToUpEnBoundLoWePairsMap(),
61 fCurrentIterator(fCellToUpEnBoundLoWePairsMap.end())
71 SetInternalIterator(gCell);
72 G4GeometryCellWeight::const_iterator gCellIterator = fCurrentIterator;
73 if (gCellIterator == fCellToUpEnBoundLoWePairsMap.end()) {
74 Error(
"GetLowerWitgh() - Cell does not exist!");
78 fCurrentIterator->second;
81 for (G4UpperEnergyToLowerWeightMap::iterator it =
82 upEnLoWeiPairs.begin(); it != upEnLoWeiPairs.end(); it++) {
83 if (partEnergy < it->
first) {
84 lowerWeight = it->second;
90 std::ostringstream err_mess;
91 err_mess <<
"GetLowerWitgh() - Couldn't find lower weight bound." <<
G4endl
92 <<
"Energy: " << partEnergy <<
".";
93 Error(err_mess.str());
100 void G4WeightWindowStore::
103 fCurrentIterator = fCellToUpEnBoundLoWePairsMap.find(gCell);
106 G4bool G4WeightWindowStore::
110 if (!(aVolume == *fWorldVolume)) {
121 if ( inWorldKnown ) {
122 SetInternalIterator(gCell);
123 inWorldKnown = (fCurrentIterator!=fCellToUpEnBoundLoWePairsMap.end());
130 fCellToUpEnBoundLoWePairsMap.clear();
150 return *fWorldVolume;
162 const std::vector<G4double> &lowerWeights)
164 if (fGeneralUpperEnergyBounds.empty()) {
165 Error(
"AddLowerWeights() - No general upper energy limits set!");
168 Error(
"AddLowerWeights() - Cell already in the store.");
170 if (lowerWeights.size() != fGeneralUpperEnergyBounds.size()) {
171 std::ostringstream err_mess;
172 err_mess <<
"AddLowerWeights() - Mismatch between "
173 <<
"number of lower weights (" << lowerWeights.size()
174 <<
") and energy bounds (" << fGeneralUpperEnergyBounds.size()
176 Error(err_mess.str());
180 for (std::set<
G4double, std::less<G4double> >::iterator it =
181 fGeneralUpperEnergyBounds.begin();
182 it != fGeneralUpperEnergyBounds.end();
184 map[*it] = lowerWeights[i];
187 fCellToUpEnBoundLoWePairsMap[gCell] = map;
196 Error(
"AddUpperEboundLowerWeightPairs() - Cell already in the store.");
199 Error(
"AddUpperEboundLowerWeightPairs() - Cell already in the store.");
201 fCellToUpEnBoundLoWePairsMap[gCell] = enWeMap;
208 std::less<G4double> > &enBounds)
210 if (!fGeneralUpperEnergyBounds.empty()) {
211 Error(
"SetGeneralUpperEnergyBounds() - Energy bounds already set.");
213 fGeneralUpperEnergyBounds = enBounds;
217 void G4WeightWindowStore::Error(
const G4String &msg)
const
247 G4cout <<
"G4IStore:: Creating new Parallel IStore " << ParallelWorldName <<
G4endl;
G4bool IsAncestor(const G4VPhysicalVolume *p) const
void AddLowerWeights(const G4GeometryCell &gCell, const std::vector< G4double > &lowerWeights)
G4Navigator * GetNavigatorForTracking() const
virtual const G4VPhysicalVolume * GetParallelWorldVolumePointer() const
G4GLOB_DLL std::ostream G4cout
virtual G4bool IsKnown(const G4GeometryCell &gCell) const
const G4String & GetName() const
void AddUpperEboundLowerWeightPairs(const G4GeometryCell &gCell, const G4UpperEnergyToLowerWeightMap &enWeMap)
void SetParallelWorldVolume(G4String paraName)
virtual const G4VPhysicalVolume & GetWorldVolume() const
static G4WeightWindowStore * GetInstance()
std::map< G4double, G4double, std::less< G4double > > G4UpperEnergyToLowerWeightMap
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4TransportationManager * GetTransportationManager()
const G4VPhysicalVolume & GetPhysicalVolume() const
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)
G4LogicalVolume * GetLogicalVolume() const
virtual G4double GetLowerWeight(const G4GeometryCell &gCell, G4double partEnergy) const
void SetGeneralUpperEnergyBounds(const std::set< G4double, std::less< G4double > > &enBounds)
G4VPhysicalVolume * GetWorldVolume() const