54 fGeneralUpperEnergyBounds(),
55 fCellToUpEnBoundLoWePairsMap(),
56 fCurrentIterator(fCellToUpEnBoundLoWePairsMap.end())
62 fGeneralUpperEnergyBounds(),
63 fCellToUpEnBoundLoWePairsMap(),
64 fCurrentIterator(fCellToUpEnBoundLoWePairsMap.end())
74 SetInternalIterator(gCell);
75 G4GeometryCellWeight::const_iterator gCellIterator = fCurrentIterator;
76 if (gCellIterator == fCellToUpEnBoundLoWePairsMap.end()) {
77 Error(
"GetLowerWitgh() - Cell does not exist!");
81 fCurrentIterator->second;
84 for (G4UpperEnergyToLowerWeightMap::iterator it =
85 upEnLoWeiPairs.begin(); it != upEnLoWeiPairs.end(); it++) {
86 if (partEnergy < it->
first) {
87 lowerWeight = it->second;
93 std::ostringstream err_mess;
94 err_mess <<
"GetLowerWitgh() - Couldn't find lower weight bound." <<
G4endl
95 <<
"Energy: " << partEnergy <<
".";
96 Error(err_mess.str());
103 void G4WeightWindowStore::
106 fCurrentIterator = fCellToUpEnBoundLoWePairsMap.find(gCell);
109 G4bool G4WeightWindowStore::
113 if (!(aVolume == *fWorldVolume)) {
124 if ( inWorldKnown ) {
125 SetInternalIterator(gCell);
126 inWorldKnown = (fCurrentIterator!=fCellToUpEnBoundLoWePairsMap.end());
133 fCellToUpEnBoundLoWePairsMap.clear();
153 return *fWorldVolume;
165 const std::vector<G4double> &lowerWeights)
167 if (fGeneralUpperEnergyBounds.empty()) {
168 Error(
"AddLowerWeights() - No general upper energy limits set!");
171 Error(
"AddLowerWeights() - Cell already in the store.");
173 if (lowerWeights.size() != fGeneralUpperEnergyBounds.size()) {
174 std::ostringstream err_mess;
175 err_mess <<
"AddLowerWeights() - Mismatch between "
176 <<
"number of lower weights (" << lowerWeights.size()
177 <<
") and energy bounds (" << fGeneralUpperEnergyBounds.size()
179 Error(err_mess.str());
183 for (std::set<
G4double, std::less<G4double> >::iterator it =
184 fGeneralUpperEnergyBounds.begin();
185 it != fGeneralUpperEnergyBounds.end();
187 map[*it] = lowerWeights[i];
190 fCellToUpEnBoundLoWePairsMap[gCell] = map;
199 Error(
"AddUpperEboundLowerWeightPairs() - Cell already in the store.");
202 Error(
"AddUpperEboundLowerWeightPairs() - Cell already in the store.");
204 fCellToUpEnBoundLoWePairsMap[gCell] = enWeMap;
211 std::less<G4double> > &enBounds)
213 if (!fGeneralUpperEnergyBounds.empty()) {
214 Error(
"SetGeneralUpperEnergyBounds() - Energy bounds already set.");
216 fGeneralUpperEnergyBounds = enBounds;
220 void G4WeightWindowStore::Error(
const G4String &msg)
const
250 G4cout <<
"G4IStore:: Creating new Parallel IStore " << ParallelWorldName <<
G4endl;
virtual ~G4WeightWindowStore()
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