45 fWorldVolume(worldvolume),
46 fGeneralUpperEnergyBounds(),
47 fCellToUpEnBoundLoWePairsMap(),
48 fCurrentIterator(fCellToUpEnBoundLoWePairsMap.end())
58 SetInternalIterator(gCell);
59 G4GeometryCellWeight::const_iterator gCellIterator = fCurrentIterator;
60 if (gCellIterator == fCellToUpEnBoundLoWePairsMap.end()) {
61 Error(
"GetLowerWitgh() - Cell does not exist!");
65 fCurrentIterator->second;
68 for (G4UpperEnergyToLowerWeightMap::iterator it =
69 upEnLoWeiPairs.begin(); it != upEnLoWeiPairs.end(); it++) {
70 if (partEnergy < it->first) {
71 lowerWeight = it->second;
77 std::ostringstream err_mess;
78 err_mess <<
"GetLowerWitgh() - Couldn't find lower weight bound." <<
G4endl
79 <<
"Energy: " << partEnergy <<
".";
80 Error(err_mess.str());
87 void G4WeightWindowStore::
90 fCurrentIterator = fCellToUpEnBoundLoWePairsMap.find(gCell);
93 G4bool G4WeightWindowStore::
97 if (!(aVolume == fWorldVolume)) {
108 if ( inWorldKnown ) {
109 SetInternalIterator(gCell);
110 inWorldKnown = (fCurrentIterator!=fCellToUpEnBoundLoWePairsMap.end());
124 const std::vector<G4double> &lowerWeights)
126 if (fGeneralUpperEnergyBounds.empty()) {
127 Error(
"AddLowerWeights() - No general upper energy limits set!");
130 Error(
"AddLowerWeights() - Cell already in the store.");
132 if (lowerWeights.size() != fGeneralUpperEnergyBounds.size()) {
133 std::ostringstream err_mess;
134 err_mess <<
"AddLowerWeights() - Mismatch between "
135 <<
"number of lower weights (" << lowerWeights.size()
136 <<
") and energy bounds (" << fGeneralUpperEnergyBounds.size()
138 Error(err_mess.str());
142 for (std::set<
G4double, std::less<G4double> >::iterator it =
143 fGeneralUpperEnergyBounds.begin();
144 it != fGeneralUpperEnergyBounds.end();
146 map[*it] = lowerWeights[i];
149 fCellToUpEnBoundLoWePairsMap[gCell] = map;
158 Error(
"AddUpperEboundLowerWeightPairs() - Cell already in the store.");
161 Error(
"AddUpperEboundLowerWeightPairs() - Cell already in the store.");
163 fCellToUpEnBoundLoWePairsMap[gCell] = enWeMap;
170 std::less<G4double> > &enBounds)
172 if (!fGeneralUpperEnergyBounds.empty()) {
173 Error(
"SetGeneralUpperEnergyBounds() - Energy bounds already set.");
175 fGeneralUpperEnergyBounds = enBounds;
179 void G4WeightWindowStore::Error(
const G4String &msg)
const