Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4WeightWindowStore Class Reference

#include <G4WeightWindowStore.hh>

Inheritance diagram for G4WeightWindowStore:
Collaboration diagram for G4WeightWindowStore:

Public Member Functions

virtual G4double GetLowerWeight (const G4GeometryCell &gCell, G4double partEnergy) const
 
virtual G4bool IsKnown (const G4GeometryCell &gCell) const
 
void Clear ()
 
void SetWorldVolume ()
 
void SetParallelWorldVolume (G4String paraName)
 
virtual const G4VPhysicalVolumeGetWorldVolume () const
 
virtual const G4VPhysicalVolumeGetParallelWorldVolumePointer () const
 
void AddLowerWeights (const G4GeometryCell &gCell, const std::vector< G4double > &lowerWeights)
 
void AddUpperEboundLowerWeightPairs (const G4GeometryCell &gCell, const G4UpperEnergyToLowerWeightMap &enWeMap)
 
void SetGeneralUpperEnergyBounds (const std::set< G4double, std::less< G4double > > &enBounds)
 
- Public Member Functions inherited from G4VWeightWindowStore
 G4VWeightWindowStore ()
 
virtual ~G4VWeightWindowStore ()
 

Static Public Member Functions

static G4WeightWindowStoreGetInstance ()
 
static G4WeightWindowStoreGetInstance (const G4String &ParallelWorldName)
 

Protected Member Functions

 G4WeightWindowStore ()
 
 G4WeightWindowStore (const G4String &ParallelWorldName)
 
 ~G4WeightWindowStore ()
 

Detailed Description

Definition at line 58 of file G4WeightWindowStore.hh.

Constructor & Destructor Documentation

G4WeightWindowStore::G4WeightWindowStore ( )
explicitprotected

Definition at line 49 of file G4WeightWindowStore.cc.

49  :
50 fWorldVolume(G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume()),
51  fGeneralUpperEnergyBounds(),
52  fCellToUpEnBoundLoWePairsMap(),
53  fCurrentIterator(fCellToUpEnBoundLoWePairsMap.end())
54 {}
virtual const G4VPhysicalVolume & GetWorldVolume() const
static G4TransportationManager * GetTransportationManager()

Here is the caller graph for this function:

G4WeightWindowStore::G4WeightWindowStore ( const G4String ParallelWorldName)
explicitprotected

Definition at line 57 of file G4WeightWindowStore.cc.

57  :
58 fWorldVolume(G4TransportationManager::GetTransportationManager()->GetParallelWorld(ParallelWorldName)),
59  fGeneralUpperEnergyBounds(),
60  fCellToUpEnBoundLoWePairsMap(),
61  fCurrentIterator(fCellToUpEnBoundLoWePairsMap.end())
62 {}
static G4TransportationManager * GetTransportationManager()
G4WeightWindowStore::~G4WeightWindowStore ( )
protected

Definition at line 64 of file G4WeightWindowStore.cc.

65 {}

Member Function Documentation

void G4WeightWindowStore::AddLowerWeights ( const G4GeometryCell gCell,
const std::vector< G4double > &  lowerWeights 
)

Definition at line 161 of file G4WeightWindowStore.cc.

163 {
164  if (fGeneralUpperEnergyBounds.empty()) {
165  Error("AddLowerWeights() - No general upper energy limits set!");
166  }
167  if (IsKnown(gCell)) {
168  Error("AddLowerWeights() - Cell already in the store.");
169  }
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()
175  << ")!";
176  Error(err_mess.str());
177  }
179  G4int i = 0;
180  for (std::set<G4double, std::less<G4double> >::iterator it =
181  fGeneralUpperEnergyBounds.begin();
182  it != fGeneralUpperEnergyBounds.end();
183  it++) {
184  map[*it] = lowerWeights[i];
185  i++;
186  }
187  fCellToUpEnBoundLoWePairsMap[gCell] = map;
188 }
int G4int
Definition: G4Types.hh:78
virtual G4bool IsKnown(const G4GeometryCell &gCell) const
std::map< G4double, G4double, std::less< G4double > > G4UpperEnergyToLowerWeightMap
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void G4WeightWindowStore::AddUpperEboundLowerWeightPairs ( const G4GeometryCell gCell,
const G4UpperEnergyToLowerWeightMap enWeMap 
)

Definition at line 192 of file G4WeightWindowStore.cc.

194 {
195  if (IsKnown(gCell)) {
196  Error("AddUpperEboundLowerWeightPairs() - Cell already in the store.");
197  }
198  if (IsKnown(gCell)) {
199  Error("AddUpperEboundLowerWeightPairs() - Cell already in the store.");
200  }
201  fCellToUpEnBoundLoWePairsMap[gCell] = enWeMap;
202 
203 }
virtual G4bool IsKnown(const G4GeometryCell &gCell) const

Here is the call graph for this function:

void G4WeightWindowStore::Clear ( )

Definition at line 128 of file G4WeightWindowStore.cc.

129 {
130  fCellToUpEnBoundLoWePairsMap.clear();
131 }
G4WeightWindowStore * G4WeightWindowStore::GetInstance ( void  )
static

Definition at line 229 of file G4WeightWindowStore.cc.

230 {
231  if (!fInstance)
232  {
233  fInstance = new G4WeightWindowStore();
234  }
235  return fInstance;
236 }

Here is the call graph for this function:

Here is the caller graph for this function:

G4WeightWindowStore * G4WeightWindowStore::GetInstance ( const G4String ParallelWorldName)
static

Definition at line 243 of file G4WeightWindowStore.cc.

244 {
245  if (!fInstance)
246  {
247  G4cout << "G4IStore:: Creating new Parallel IStore " << ParallelWorldName << G4endl;
248  fInstance = new G4WeightWindowStore(ParallelWorldName);
249  }
250  return fInstance;
251 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

G4double G4WeightWindowStore::GetLowerWeight ( const G4GeometryCell gCell,
G4double  partEnergy 
) const
virtual

Implements G4VWeightWindowStore.

Definition at line 68 of file G4WeightWindowStore.cc.

70 {
71  SetInternalIterator(gCell);
72  G4GeometryCellWeight::const_iterator gCellIterator = fCurrentIterator;
73  if (gCellIterator == fCellToUpEnBoundLoWePairsMap.end()) {
74  Error("GetLowerWitgh() - Cell does not exist!");
75  return 0.;
76  }
77  G4UpperEnergyToLowerWeightMap upEnLoWeiPairs =
78  fCurrentIterator->second;
79  G4double lowerWeight = -1;
80  G4bool found = false;
81  for (G4UpperEnergyToLowerWeightMap::iterator it =
82  upEnLoWeiPairs.begin(); it != upEnLoWeiPairs.end(); it++) {
83  if (partEnergy < it->first) {
84  lowerWeight = it->second;
85  found = true;
86  break;
87  }
88  }
89  if (!found) {
90  std::ostringstream err_mess;
91  err_mess << "GetLowerWitgh() - Couldn't find lower weight bound." << G4endl
92  << "Energy: " << partEnergy << ".";
93  Error(err_mess.str());
94  }
95  return lowerWeight;
96 
97 
98 }
bool G4bool
Definition: G4Types.hh:79
std::map< G4double, G4double, std::less< G4double > > G4UpperEnergyToLowerWeightMap
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const G4VPhysicalVolume * G4WeightWindowStore::GetParallelWorldVolumePointer ( ) const
virtual

Definition at line 153 of file G4WeightWindowStore.cc.

154 {
155  return fWorldVolume;
156 }
const G4VPhysicalVolume & G4WeightWindowStore::GetWorldVolume ( ) const
virtual

Implements G4VWeightWindowStore.

Definition at line 148 of file G4WeightWindowStore.cc.

149 {
150  return *fWorldVolume;
151 }
G4bool G4WeightWindowStore::IsKnown ( const G4GeometryCell gCell) const
virtual

Implements G4VWeightWindowStore.

Definition at line 117 of file G4WeightWindowStore.cc.

118 {
119  G4bool inWorldKnown(IsInWorld(gCell.GetPhysicalVolume()));
120 
121  if ( inWorldKnown ) {
122  SetInternalIterator(gCell);
123  inWorldKnown = (fCurrentIterator!=fCellToUpEnBoundLoWePairsMap.end());
124  }
125  return inWorldKnown;
126 }
bool G4bool
Definition: G4Types.hh:79
const G4VPhysicalVolume & GetPhysicalVolume() const

Here is the call graph for this function:

Here is the caller graph for this function:

void G4WeightWindowStore::SetGeneralUpperEnergyBounds ( const std::set< G4double, std::less< G4double > > &  enBounds)

Definition at line 207 of file G4WeightWindowStore.cc.

209 {
210  if (!fGeneralUpperEnergyBounds.empty()) {
211  Error("SetGeneralUpperEnergyBounds() - Energy bounds already set.");
212  }
213  fGeneralUpperEnergyBounds = enBounds;
214 }

Here is the caller graph for this function:

void G4WeightWindowStore::SetParallelWorldVolume ( G4String  paraName)

Definition at line 141 of file G4WeightWindowStore.cc.

142 {
144  // fGeometryCelli = new G4GeometryCellImportance;
145 }
static G4TransportationManager * GetTransportationManager()
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)

Here is the call graph for this function:

void G4WeightWindowStore::SetWorldVolume ( )

Definition at line 133 of file G4WeightWindowStore.cc.

134 {
135  G4cout << " G4IStore:: SetWorldVolume " << G4endl;
137  G4cout << " World volume is: " << fWorldVolume->GetName() << G4endl;
138  // fGeometryCelli = new G4GeometryCellImportance;
139 }
G4Navigator * GetNavigatorForTracking() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
#define G4endl
Definition: G4ios.hh:61
G4VPhysicalVolume * GetWorldVolume() const

Here is the call graph for this function:


The documentation for this class was generated from the following files: