Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file biasing/B02/src/B02ImportanceDetecto << 27 /// \brief Implementation of the B02Importance << 28 // << 29 // 26 // >> 27 // $Id: B02ImportanceDetectorConstruction.cc,v 1.11 2007-06-22 13:38:55 ahoward Exp $ >> 28 // GEANT4 tag $Name: geant4-09-04-patch-01 $ 30 // 29 // 31 30 >> 31 #include "globals.hh" >> 32 #include <sstream> >> 33 32 #include "B02ImportanceDetectorConstruction.hh 34 #include "B02ImportanceDetectorConstruction.hh" 33 35 34 #include "G4LogicalVolume.hh" << 35 #include "G4Material.hh" 36 #include "G4Material.hh" 36 #include "G4PVPlacement.hh" << 37 #include "G4PhysicalConstants.hh" << 38 #include "G4SystemOfUnits.hh" << 39 #include "G4ThreeVector.hh" << 40 #include "G4Tubs.hh" 37 #include "G4Tubs.hh" 41 #include "globals.hh" << 38 #include "G4LogicalVolume.hh" 42 << 39 #include "G4ThreeVector.hh" 43 #include <sstream> << 40 #include "G4PVPlacement.hh" 44 41 45 // For Primitive Scorers 42 // For Primitive Scorers >> 43 #include "G4SDManager.hh" 46 #include "G4MultiFunctionalDetector.hh" 44 #include "G4MultiFunctionalDetector.hh" >> 45 #include "G4SDParticleFilter.hh" 47 #include "G4PSNofCollision.hh" 46 #include "G4PSNofCollision.hh" 48 #include "G4PSPopulation.hh" 47 #include "G4PSPopulation.hh" 49 #include "G4PSTrackCounter.hh" 48 #include "G4PSTrackCounter.hh" 50 #include "G4PSTrackLength.hh" 49 #include "G4PSTrackLength.hh" 51 #include "G4SDManager.hh" << 52 #include "G4SDParticleFilter.hh" << 53 << 54 // for importance biasing << 55 #include "G4IStore.hh" << 56 50 57 // for weight window technique << 58 #include "G4WeightWindowStore.hh" << 59 51 60 //....oooOO0OOooo........oooOO0OOooo........oo << 61 52 62 B02ImportanceDetectorConstruction::B02Importan << 53 B02ImportanceDetectorConstruction::B02ImportanceDetectorConstruction(G4String worldName) 63 : G4VUserParallelWorld(worldName), fLogicalV << 54 :G4VUserParallelWorld(worldName),fLogicalVolumeVector() 64 { 55 { 65 // Construct(); 56 // Construct(); 66 } 57 } 67 58 68 //....oooOO0OOooo........oooOO0OOooo........oo << 69 << 70 B02ImportanceDetectorConstruction::~B02Importa 59 B02ImportanceDetectorConstruction::~B02ImportanceDetectorConstruction() 71 { 60 { 72 fLogicalVolumeVector.clear(); 61 fLogicalVolumeVector.clear(); 73 } 62 } 74 63 75 //....oooOO0OOooo........oooOO0OOooo........oo << 76 << 77 void B02ImportanceDetectorConstruction::Constr 64 void B02ImportanceDetectorConstruction::Construct() 78 { << 65 { 79 G4cout << " constructing parallel world " << 66 G4cout << " constructing parallel world " << G4endl; 80 67 81 G4Material* dummyMat = 0; << 68 //GetWorld methods create a clone of the mass world to the parallel world (!) 82 << 69 // via the transportation manager 83 // GetWorld methods create a clone of the ma << 70 ghostWorld = GetWorld(); 84 // via the transportation manager << 71 G4LogicalVolume* worldLogical = ghostWorld->GetLogicalVolume(); 85 fGhostWorld = GetWorld(); << 86 G4cout << " B02ImportanceDetectorConstructio << 87 << G4endl; << 88 G4LogicalVolume* worldLogical = fGhostWorld- << 89 fLogicalVolumeVector.push_back(worldLogical) 72 fLogicalVolumeVector.push_back(worldLogical); 90 73 >> 74 G4String name("none"); >> 75 G4double density(universe_mean_density), temperature(0), pressure(0); >> 76 >> 77 name = "Galactic"; >> 78 density = universe_mean_density; //from PhysicalConstants.h >> 79 pressure = 3.e-18*pascal; >> 80 temperature = 2.73*kelvin; >> 81 G4cout << density << " " << kStateGas << G4endl; >> 82 G4Material *Galactic = >> 83 new G4Material(name, 1., 1.01*g/mole, density, >> 84 kStateGas,temperature,pressure); >> 85 >> 86 91 // fPVolumeStore.AddPVolume(G4GeometryCell( 87 // fPVolumeStore.AddPVolume(G4GeometryCell(*pWorldVolume, 0)); 92 fPVolumeStore.AddPVolume(G4GeometryCell(*fGh << 88 fPVolumeStore.AddPVolume(G4GeometryCell(*ghostWorld, 0)); 93 89 94 // creating 18 slobs of 10 cm thicknes << 95 90 96 G4double innerRadiusShield = 0 * cm; << 97 G4double outerRadiusShield = 100 * cm; << 98 G4double heightShield = 5 * cm; << 99 G4double startAngleShield = 0 * deg; << 100 G4double spanningAngleShield = 360 * deg; << 101 91 102 G4Tubs* aShield = new G4Tubs("aShield", inne << 103 startAngleShiel << 104 92 >> 93 // creating 18 slobs of 10 cm thicknes >> 94 >> 95 G4double innerRadiusShield = 0*cm; >> 96 G4double outerRadiusShield = 100*cm; >> 97 G4double hightShield = 5*cm; >> 98 G4double startAngleShield = 0*deg; >> 99 G4double spanningAngleShield = 360*deg; >> 100 >> 101 G4Tubs *aShield = new G4Tubs("aShield", >> 102 innerRadiusShield, >> 103 outerRadiusShield, >> 104 hightShield, >> 105 startAngleShield, >> 106 spanningAngleShield); >> 107 105 // logical parallel cells 108 // logical parallel cells 106 109 107 G4LogicalVolume* aShield_log_imp = new G4Log << 110 G4LogicalVolume *aShield_log = 108 fLogicalVolumeVector.push_back(aShield_log_i << 111 new G4LogicalVolume(aShield, Galactic, "aShield_log"); >> 112 fLogicalVolumeVector.push_back(aShield_log); 109 113 110 // physical parallel cells 114 // physical parallel cells 111 G4String name = "none"; << 115 112 G4int i = 1; 116 G4int i = 1; 113 G4double startz = -85 * cm; << 117 G4double startz = -85*cm; 114 // for (i=1; i<=18; ++i) { 118 // for (i=1; i<=18; ++i) { 115 for (i = 1; i <= 18; i++) { << 119 for (i=1; i<=18; i++) { >> 120 116 name = GetCellName(i); 121 name = GetCellName(i); 117 << 122 118 G4double pos_x = 0 * cm; << 123 G4double pos_x = 0*cm; 119 G4double pos_y = 0 * cm; << 124 G4double pos_y = 0*cm; 120 G4double pos_z = startz + (i - 1) * (2 * h << 125 G4double pos_z = startz + (i-1) * (2*hightShield); 121 G4VPhysicalVolume* pvol = new G4PVPlacemen << 126 G4VPhysicalVolume *pvol = 122 << 127 new G4PVPlacement(0, 123 // 0); << 128 G4ThreeVector(pos_x, pos_y, pos_z), >> 129 aShield_log, >> 130 name, >> 131 worldLogical, >> 132 false, >> 133 i); >> 134 // 0); 124 G4GeometryCell cell(*pvol, i); 135 G4GeometryCell cell(*pvol, i); 125 // G4GeometryCell cell(*pvol, 0); 136 // G4GeometryCell cell(*pvol, 0); 126 fPVolumeStore.AddPVolume(cell); 137 fPVolumeStore.AddPVolume(cell); 127 } 138 } 128 139 129 // filling the rest of the world volumr behi 140 // filling the rest of the world volumr behind the concrete with 130 // another slob which should get the same im << 141 // another slob which should get the same importance value as the 131 // last slob 142 // last slob 132 innerRadiusShield = 0 * cm; << 143 innerRadiusShield = 0*cm; 133 // outerRadiusShield = 110*cm; exceeds worl 144 // outerRadiusShield = 110*cm; exceeds world volume!!!! 134 outerRadiusShield = 100 * cm; << 145 outerRadiusShield = 101*cm; 135 // heightShield = 10*cm; << 146 // hightShield = 10*cm; 136 heightShield = 5 * cm; << 147 hightShield = 5*cm; 137 startAngleShield = 0 * deg; << 148 startAngleShield = 0*deg; 138 spanningAngleShield = 360 * deg; << 149 spanningAngleShield = 360*deg; 139 << 150 140 G4Tubs* aRest = new G4Tubs("Rest", innerRadi << 151 G4Tubs *aRest = new G4Tubs("Rest", 141 startAngleShield, << 152 innerRadiusShield, 142 << 153 outerRadiusShield, 143 G4LogicalVolume* aRest_log = new G4LogicalVo << 154 hightShield, >> 155 startAngleShield, >> 156 spanningAngleShield); >> 157 >> 158 G4LogicalVolume *aRest_log = >> 159 new G4LogicalVolume(aRest, Galactic, "aRest_log"); 144 160 145 fLogicalVolumeVector.push_back(aRest_log); 161 fLogicalVolumeVector.push_back(aRest_log); 146 162 147 name = GetCellName(19); 163 name = GetCellName(19); 148 << 164 149 G4double pos_x = 0 * cm; << 165 G4double pos_x = 0*cm; 150 G4double pos_y = 0 * cm; << 166 G4double pos_y = 0*cm; 151 // G4double pos_z = 100*cm; 167 // G4double pos_z = 100*cm; 152 G4double pos_z = 95 * cm; << 168 G4double pos_z = 95*cm; 153 G4VPhysicalVolume* pvol = new G4PVPlacement( << 169 G4VPhysicalVolume *pvol = 154 << 170 new G4PVPlacement(0, 155 // 0); << 171 G4ThreeVector(pos_x, pos_y, pos_z), >> 172 aRest_log, >> 173 name, >> 174 worldLogical, >> 175 false, >> 176 19); >> 177 // 0); 156 G4GeometryCell cell(*pvol, 19); 178 G4GeometryCell cell(*pvol, 19); 157 // G4GeometryCell cell(*pvol, 0); 179 // G4GeometryCell cell(*pvol, 0); 158 fPVolumeStore.AddPVolume(cell); 180 fPVolumeStore.AddPVolume(cell); 159 181 160 SetSensitive(); 182 SetSensitive(); 161 } << 162 183 163 //....oooOO0OOooo........oooOO0OOooo........oo << 184 } 164 185 165 const G4VPhysicalVolume& << 186 const G4VPhysicalVolume &B02ImportanceDetectorConstruction:: 166 B02ImportanceDetectorConstruction::GetPhysical << 187 GetPhysicalVolumeByName(const G4String& name) const { 167 { << 168 return *fPVolumeStore.GetPVolume(name); 188 return *fPVolumeStore.GetPVolume(name); 169 } 189 } 170 190 171 //....oooOO0OOooo........oooOO0OOooo........oo << 172 191 173 G4String B02ImportanceDetectorConstruction::Li << 192 G4String B02ImportanceDetectorConstruction::ListPhysNamesAsG4String(){ 174 { << 175 G4String names(fPVolumeStore.GetPNames()); 193 G4String names(fPVolumeStore.GetPNames()); 176 return names; 194 return names; 177 } 195 } 178 196 179 //....oooOO0OOooo........oooOO0OOooo........oo << 180 197 181 G4String B02ImportanceDetectorConstruction::Ge << 198 G4String B02ImportanceDetectorConstruction::GetCellName(G4int i) { 182 { << 183 std::ostringstream os; 199 std::ostringstream os; 184 os << "cell_"; 200 os << "cell_"; 185 if (i < 10) { << 201 if (i<10) { 186 os << "0"; 202 os << "0"; 187 } 203 } 188 os << i; 204 os << i; 189 G4String name = os.str(); 205 G4String name = os.str(); 190 return name; 206 return name; 191 } 207 } 192 208 193 //....oooOO0OOooo........oooOO0OOooo........oo << 209 G4GeometryCell B02ImportanceDetectorConstruction::GetGeometryCell(G4int i){ 194 << 195 G4GeometryCell B02ImportanceDetectorConstructi << 196 { << 197 G4String name(GetCellName(i)); 210 G4String name(GetCellName(i)); 198 const G4VPhysicalVolume* p = 0; << 211 const G4VPhysicalVolume *p=0; 199 p = fPVolumeStore.GetPVolume(name); 212 p = fPVolumeStore.GetPVolume(name); 200 if (p) { 213 if (p) { 201 return G4GeometryCell(*p, 0); << 214 return G4GeometryCell(*p,0); 202 } 215 } 203 else { 216 else { 204 G4cout << "B02ImportanceDetectorConstructi << 217 G4cout << "B02ImportanceDetectorConstruction::GetGeometryCell: couldn't get G4GeometryCell" << G4endl; 205 << " couldn't get G4GeometryCell" < << 218 return G4GeometryCell(*ghostWorld,-2); 206 return G4GeometryCell(*fGhostWorld, -2); << 207 } 219 } 208 } 220 } 209 221 210 //....oooOO0OOooo........oooOO0OOooo........oo << 211 222 212 G4VPhysicalVolume& B02ImportanceDetectorConstr << 223 G4VPhysicalVolume &B02ImportanceDetectorConstruction::GetWorldVolumeAddress() const{ 213 { << 224 return *ghostWorld; 214 return *fGhostWorld; << 215 } 225 } 216 226 217 //....oooOO0OOooo........oooOO0OOooo........oo << 227 G4VPhysicalVolume *B02ImportanceDetectorConstruction::GetWorldVolume() { 218 << 228 return ghostWorld; 219 G4VPhysicalVolume* B02ImportanceDetectorConstr << 220 { << 221 return fGhostWorld; << 222 } 229 } 223 230 224 //....oooOO0OOooo........oooOO0OOooo........oo << 225 231 226 void B02ImportanceDetectorConstruction::SetSen << 232 void B02ImportanceDetectorConstruction::SetSensitive(){ 227 { << 233 228 // ---------------------------------------- 234 // ------------------------------------------------- 229 // The collection names of defined Primiti 235 // The collection names of defined Primitives are 230 // 0 ConcreteSD/Collisions 236 // 0 ConcreteSD/Collisions 231 // 1 ConcreteSD/CollWeight 237 // 1 ConcreteSD/CollWeight 232 // 2 ConcreteSD/Population 238 // 2 ConcreteSD/Population 233 // 3 ConcreteSD/TrackEnter 239 // 3 ConcreteSD/TrackEnter 234 // 4 ConcreteSD/SL 240 // 4 ConcreteSD/SL 235 // 5 ConcreteSD/SLW 241 // 5 ConcreteSD/SLW 236 // 6 ConcreteSD/SLWE 242 // 6 ConcreteSD/SLWE 237 // 7 ConcreteSD/SLW_V 243 // 7 ConcreteSD/SLW_V 238 // 8 ConcreteSD/SLWE_V 244 // 8 ConcreteSD/SLWE_V 239 // ---------------------------------------- 245 // ------------------------------------------------- 240 246 241 // moved to ConstructSD() for MT compliance << 242 } << 243 247 244 //....oooOO0OOooo........oooOO0OOooo........oo << 248 //================================================ 245 void B02ImportanceDetectorConstruction::Constr << 249 // Sensitive detectors : MultiFunctionalDetector 246 { << 250 //================================================ >> 251 // >> 252 // Sensitive Detector Manager. >> 253 247 G4SDManager* SDman = G4SDManager::GetSDMpoin 254 G4SDManager* SDman = G4SDManager::GetSDMpointer(); 248 // 255 // 249 // Sensitive Detector Name 256 // Sensitive Detector Name 250 G4String concreteSDname = "ConcreteSD"; 257 G4String concreteSDname = "ConcreteSD"; 251 258 252 //------------------------ 259 //------------------------ 253 // MultiFunctionalDetector 260 // MultiFunctionalDetector 254 //------------------------ 261 //------------------------ 255 // 262 // 256 // Define MultiFunctionalDetector with name. 263 // Define MultiFunctionalDetector with name. 257 G4MultiFunctionalDetector* MFDet = new G4Mul 264 G4MultiFunctionalDetector* MFDet = new G4MultiFunctionalDetector(concreteSDname); 258 SDman->AddNewDetector(MFDet); // Register S << 265 SDman->AddNewDetector( MFDet ); // Register SD to SDManager >> 266 259 267 260 G4String fltName, particleName; << 268 G4String fltName,particleName; 261 G4SDParticleFilter* neutronFilter = << 269 G4SDParticleFilter* neutronFilter = 262 new G4SDParticleFilter(fltName = "neutronF << 270 new G4SDParticleFilter(fltName="neutronFilter", particleName="neutron"); 263 271 264 MFDet->SetFilter(neutronFilter); 272 MFDet->SetFilter(neutronFilter); 265 273 266 for (std::vector<G4LogicalVolume*>::iterator << 274 267 it != fLogicalVolumeVector.end(); it++) << 275 for (std::vector<G4LogicalVolume *>::iterator it = fLogicalVolumeVector.begin(); 268 { << 276 it != fLogicalVolumeVector.end(); it++){ 269 // (*it)->SetSensitiveDetector(MFDet) << 277 (*it)->SetSensitiveDetector(MFDet); 270 SetSensitiveDetector((*it)->GetName(), MFD << 271 } 278 } 272 279 273 G4String psName; 280 G4String psName; 274 G4PSNofCollision* scorer0 = new G4PSNofColli << 281 G4PSNofCollision* scorer0 = new G4PSNofCollision(psName="Collisions"); 275 MFDet->RegisterPrimitive(scorer0); 282 MFDet->RegisterPrimitive(scorer0); 276 283 277 G4PSNofCollision* scorer1 = new G4PSNofColli << 284 >> 285 G4PSNofCollision* scorer1 = new G4PSNofCollision(psName="CollWeight"); 278 scorer1->Weighted(true); 286 scorer1->Weighted(true); 279 MFDet->RegisterPrimitive(scorer1); 287 MFDet->RegisterPrimitive(scorer1); 280 288 281 G4PSPopulation* scorer2 = new G4PSPopulation << 289 >> 290 G4PSPopulation* scorer2 = new G4PSPopulation(psName="Population"); 282 MFDet->RegisterPrimitive(scorer2); 291 MFDet->RegisterPrimitive(scorer2); 283 292 284 G4PSTrackCounter* scorer3 = new G4PSTrackCou << 293 G4PSTrackCounter* scorer3 = new G4PSTrackCounter(psName="TrackEnter",fCurrent_In); 285 MFDet->RegisterPrimitive(scorer3); 294 MFDet->RegisterPrimitive(scorer3); 286 295 287 G4PSTrackLength* scorer4 = new G4PSTrackLeng << 296 G4PSTrackLength* scorer4 = new G4PSTrackLength(psName="SL"); 288 MFDet->RegisterPrimitive(scorer4); 297 MFDet->RegisterPrimitive(scorer4); 289 298 290 G4PSTrackLength* scorer5 = new G4PSTrackLeng << 299 G4PSTrackLength* scorer5 = new G4PSTrackLength(psName="SLW"); 291 scorer5->Weighted(true); 300 scorer5->Weighted(true); 292 MFDet->RegisterPrimitive(scorer5); 301 MFDet->RegisterPrimitive(scorer5); 293 302 294 G4PSTrackLength* scorer6 = new G4PSTrackLeng << 303 G4PSTrackLength* scorer6 = new G4PSTrackLength(psName="SLWE"); 295 scorer6->Weighted(true); 304 scorer6->Weighted(true); 296 scorer6->MultiplyKineticEnergy(true); 305 scorer6->MultiplyKineticEnergy(true); 297 MFDet->RegisterPrimitive(scorer6); 306 MFDet->RegisterPrimitive(scorer6); 298 307 299 G4PSTrackLength* scorer7 = new G4PSTrackLeng << 308 G4PSTrackLength* scorer7 = new G4PSTrackLength(psName="SLW_V"); 300 scorer7->Weighted(true); 309 scorer7->Weighted(true); 301 scorer7->DivideByVelocity(true); 310 scorer7->DivideByVelocity(true); 302 MFDet->RegisterPrimitive(scorer7); 311 MFDet->RegisterPrimitive(scorer7); 303 312 304 G4PSTrackLength* scorer8 = new G4PSTrackLeng << 313 G4PSTrackLength* scorer8 = new G4PSTrackLength(psName="SLWE_V"); 305 scorer8->Weighted(true); 314 scorer8->Weighted(true); 306 scorer8->MultiplyKineticEnergy(true); 315 scorer8->MultiplyKineticEnergy(true); 307 scorer8->DivideByVelocity(true); 316 scorer8->DivideByVelocity(true); 308 MFDet->RegisterPrimitive(scorer8); 317 MFDet->RegisterPrimitive(scorer8); 309 } << 310 << 311 //....oooOO0OOooo........oooOO0OOooo........oo << 312 G4VIStore* B02ImportanceDetectorConstruction:: << 313 { << 314 G4cout << " B02ImportanceDetectorConstructio << 315 if (!fPVolumeStore.Size()) { << 316 G4Exception("B02ImportanceDetectorConstruc << 317 RunMustBeAborted, "no physical << 318 } << 319 << 320 // creating and filling the importance store << 321 << 322 // G4IStore *istore = new G4IStore(*fWorldV << 323 << 324 G4IStore* istore = G4IStore::GetInstance(Get << 325 << 326 G4GeometryCell gWorldVolumeCell(GetWorldVolu << 327 << 328 G4double imp = 1; << 329 << 330 istore->AddImportanceGeometryCell(1, gWorldV << 331 << 332 // set importance values and create scorers << 333 G4int cell(1); << 334 for (cell = 1; cell <= 18; cell++) { << 335 G4GeometryCell gCell = GetGeometryCell(cel << 336 G4cout << " adding cell: " << cell << " re << 337 << " name: " << gCell.GetPhysicalVo << 338 imp = std::pow(2.0, cell - 1); << 339 << 340 G4cout << "Going to assign importance: " < << 341 << ", to volume: " << gCell.GetPhys << 342 // x aIstore.AddImportanceGeometryCell( << 343 istore->AddImportanceGeometryCell(imp, gCe << 344 } << 345 << 346 // creating the geometry cell and add both t << 347 // G4GeometryCell gCell = GetGeometryCell(1 << 348 << 349 // create importance geometry cell pair for << 350 // with the same importance as the last conc << 351 G4GeometryCell gCell = GetGeometryCell(19); << 352 // G4double imp = std::pow(2.0,18); << 353 imp = std::pow(2.0, 17); << 354 istore->AddImportanceGeometryCell(imp, gCell << 355 << 356 return istore; << 357 } << 358 << 359 //....oooOO0OOooo........oooOO0OOooo........oo << 360 << 361 G4VWeightWindowStore* B02ImportanceDetectorCon << 362 { << 363 G4cout << " B02ImportanceDetectorConstructio << 364 if (!fPVolumeStore.Size()) { << 365 G4Exception("B02ImportanceDetectorConstruc << 366 RunMustBeAborted, "no physical << 367 } << 368 << 369 // creating and filling the importance store << 370 << 371 // G4IStore *istore = new G4IStore(*fWorldV << 372 << 373 G4WeightWindowStore* wwstore = G4WeightWindo << 374 << 375 // create one energy region covering the ene << 376 // << 377 std::set<G4double, std::less<G4double>> enBo << 378 enBounds.insert(1 * GeV); << 379 wwstore->SetGeneralUpperEnergyBounds(enBound << 380 << 381 G4int n = 0; << 382 G4double lowerWeight = 1; << 383 std::vector<G4double> lowerWeights; << 384 << 385 lowerWeights.push_back(1); << 386 G4GeometryCell gWorldCell(GetWorldVolumeAddr << 387 wwstore->AddLowerWeights(gWorldCell, lowerWe << 388 << 389 G4int cell(1); << 390 for (cell = 1; cell <= 18; cell++) { << 391 G4GeometryCell gCell = GetGeometryCell(cel << 392 G4cout << " adding cell: " << cell << " re << 393 << " name: " << gCell.GetPhysicalVo << 394 << 395 lowerWeight = 1. / std::pow(2., n++); << 396 G4cout << "Going to assign lower weight: " << 397 << ", to volume: " << gCell.GetPhys << 398 lowerWeights.clear(); << 399 lowerWeights.push_back(lowerWeight); << 400 wwstore->AddLowerWeights(gCell, lowerWeigh << 401 } << 402 << 403 // the remaining part pf the geometry (rest) << 404 // lower weight bound as the last conrete c << 405 // << 406 << 407 // create importance geometry cell pair for << 408 // with the same importance as the last conc << 409 G4GeometryCell gCell = GetGeometryCell(19); << 410 wwstore->AddLowerWeights(gCell, lowerWeights << 411 318 412 return wwstore; << 413 } 319 } 414 320