View | Details | Raw Unified | Return to problem 2113 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/local/src/geant4/geant4.10.05/examples/extended/optical/OpNovice2/include/ParallelWorld.hh (+33 lines)
Line 0 Link Here
1
#ifndef ParallelWorld_h
2
#define ParallelWorld_h 1
3
4
#include "G4VUserParallelWorld.hh"
5
#include "G4SystemOfUnits.hh"
6
#include "G4LogicalVolume.hh"
7
#include "G4VPhysicalVolume.hh"
8
#include "G4PVPlacement.hh"
9
#include "G4Box.hh"
10
#include "globals.hh"
11
12
class ParallelWorld : public G4VUserParallelWorld
13
{
14
  public:
15
    ParallelWorld(G4String parallelWorldName)
16
    : G4VUserParallelWorld(parallelWorldName) { };
17
    virtual ~ParallelWorld() { };
18
19
    virtual void Construct() {
20
       G4VPhysicalVolume* ParallelWorldPhys = GetWorld();
21
       G4LogicalVolume* ParallelWorldLog = ParallelWorldPhys->GetLogicalVolume();
22
       G4VSolid* box = new G4Box("boxsolid",10.0*m,10.0*m,10.0*m);
23
       G4LogicalVolume* boxlog
24
         = new G4LogicalVolume(box,0,"boxlogical",0,0,0);
25
       //G4VPhysicalVolume* boxphys =
26
       new G4PVPlacement(0,G4ThreeVector(),boxlog,"boxphysical",
27
                        ParallelWorldLog,false,0);
28
    };
29
    virtual void ConstructSD() { };
30
};
31
32
#endif
33
(-)/usr/local/src/geant4/geant4.10.05/examples/extended/optical/OpNovice2/OpNovice2.cc (+5 lines)
Lines 42-50 Link Here
42
42
43
#include "FTFP_BERT.hh"
43
#include "FTFP_BERT.hh"
44
#include "G4OpticalPhysics.hh"
44
#include "G4OpticalPhysics.hh"
45
#include "G4ParallelWorldPhysics.hh"
45
#include "G4EmStandardPhysics_option4.hh"
46
#include "G4EmStandardPhysics_option4.hh"
46
47
47
#include "DetectorConstruction.hh"
48
#include "DetectorConstruction.hh"
49
#include "ParallelWorld.hh"
48
50
49
#include "ActionInitialization.hh"
51
#include "ActionInitialization.hh"
50
52
Lines 70-82 Link Here
70
  G4RunManager * runManager = new G4RunManager;
72
  G4RunManager * runManager = new G4RunManager;
71
#endif
73
#endif
72
74
75
  G4String parallelWorldName = "ParallelWorld";
73
  DetectorConstruction* detector = new DetectorConstruction();
76
  DetectorConstruction* detector = new DetectorConstruction();
77
  detector->RegisterParallelWorld(new ParallelWorld(parallelWorldName));
74
  runManager->SetUserInitialization(detector);
78
  runManager->SetUserInitialization(detector);
75
79
76
  G4VModularPhysicsList* physicsList = new FTFP_BERT;
80
  G4VModularPhysicsList* physicsList = new FTFP_BERT;
77
  physicsList->ReplacePhysics(new G4EmStandardPhysics_option4());
81
  physicsList->ReplacePhysics(new G4EmStandardPhysics_option4());
78
  G4OpticalPhysics* opticalPhysics = new G4OpticalPhysics();
82
  G4OpticalPhysics* opticalPhysics = new G4OpticalPhysics();
79
83
84
  physicsList->RegisterPhysics(new G4ParallelWorldPhysics(parallelWorldName));
80
  physicsList->RegisterPhysics(opticalPhysics);
85
  physicsList->RegisterPhysics(opticalPhysics);
81
  runManager->SetUserInitialization(physicsList);
86
  runManager->SetUserInitialization(physicsList);
82
87

Return to problem 2113