Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/underground_physics/src/DMXDetectorRoom.icc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/advanced/underground_physics/src/DMXDetectorRoom.icc (Version 11.3.0) and /examples/advanced/underground_physics/src/DMXDetectorRoom.icc (Version 8.0.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
 26 //                                                 23 //
 27   // Window - AIR + glass ********************     24   // Window - AIR + glass ************************************************
 28                                                    25 
 29   G4double glassThick = 3.0*mm;                    26   G4double glassThick = 3.0*mm;
 30   G4double sidepanelWidth = 43.*cm;                27   G4double sidepanelWidth = 43.*cm;
 31   G4double windowWidth = labWidth - 2.*sidepan     28   G4double windowWidth = labWidth - 2.*sidepanelWidth;
 32   G4double windowHeight = labHeight - 112.0*cm     29   G4double windowHeight = labHeight - 112.0*cm;
 33   G4double glassPosY = 0.5*(worldLength - glas     30   G4double glassPosY = 0.5*(worldLength - glassThick);
 34   G4double glassPosZ = 0.5*(labHeight - window     31   G4double glassPosZ = 0.5*(labHeight - windowHeight);
 35                                                    32 
 36   G4Box* glass_box = new G4Box                     33   G4Box* glass_box = new G4Box
 37   ("glass_box",0.5*windowWidth, 0.5*glassThick     34   ("glass_box",0.5*windowWidth, 0.5*glassThick, 0.5*windowHeight );
 38   glass_log = new G4LogicalVolume(glass_box, g     35   glass_log = new G4LogicalVolume(glass_box, glass_mat, "glass_log");
 39   glass_phys = new G4PVPlacement                   36   glass_phys = new G4PVPlacement
 40     (0, G4ThreeVector(0., glassPosY, glassPosZ     37     (0, G4ThreeVector(0., glassPosY, glassPosZ), "glass_phys", glass_log, 
 41      world_phys, false, 0);                        38      world_phys, false, 0);
 42                                                    39 
 43   G4VisAttributes* glass_vat= new G4VisAttribu     40   G4VisAttributes* glass_vat= new G4VisAttributes(blue);
 44   glass_vat->SetVisibility(true);                  41   glass_vat->SetVisibility(true);
 45   glass_vat->SetForceSolid(true);                  42   glass_vat->SetForceSolid(true);
 46   glass_log->SetVisAttributes(glass_vat);          43   glass_log->SetVisAttributes(glass_vat);
 47                                                    44 
 48   // hole in wall between glass and "lab": ***     45   // hole in wall between glass and "lab": ************************************
 49                                                    46 
 50   G4double holeThick = wallThick - glassThick;     47   G4double holeThick = wallThick - glassThick;
 51   G4double windowPosY = 0.5*(worldLength - hol     48   G4double windowPosY = 0.5*(worldLength - holeThick) - glassThick;
 52   G4double windowPosZ = glassPosZ;                 49   G4double windowPosZ = glassPosZ;
 53                                                    50 
 54   G4Box* window_box = new G4Box                    51   G4Box* window_box = new G4Box
 55   ("window_box",0.5*windowWidth, 0.5*holeThick     52   ("window_box",0.5*windowWidth, 0.5*holeThick, 0.5*windowHeight );
 56   window_log = new G4LogicalVolume(window_box,     53   window_log = new G4LogicalVolume(window_box, lab_mat, "window_log");
 57   window_phys = new G4PVPlacement                  54   window_phys = new G4PVPlacement
 58     (0, G4ThreeVector(0., windowPosY, windowPo     55     (0, G4ThreeVector(0., windowPosY, windowPosZ), "window_phys",
 59      window_log, world_phys, false, 0);            56      window_log, world_phys, false, 0);
 60                                                    57 
 61   G4VisAttributes* window_vat= new G4VisAttrib     58   G4VisAttributes* window_vat= new G4VisAttributes(yellow);
 62   //  window_log->SetVisAttributes(G4VisAttrib <<  59   //  window_log->SetVisAttributes(G4VisAttributes::Invisible);
 63   window_vat->SetVisibility(true);                 60   window_vat->SetVisibility(true);
 64   window_log->SetVisAttributes(window_vat);        61   window_log->SetVisAttributes(window_vat);
 65                                                    62 
 66                                                    63 
 67   // Side panels of Window - AIR + Al ********     64   // Side panels of Window - AIR + Al ****************************************
 68                                                    65 
 69   G4double panelThick = 5.0*mm;                    66   G4double panelThick = 5.0*mm;
 70 //  G4double sidepanelWidth = 43.*cm; // defin     67 //  G4double sidepanelWidth = 43.*cm; // defined earlier
 71   G4double sidepanelPosX = 0.5*(labWidth - sid     68   G4double sidepanelPosX = 0.5*(labWidth - sidepanelWidth);
 72   G4double sidepanelPosY = 0.5*(worldLength -      69   G4double sidepanelPosY = 0.5*(worldLength - panelThick);
 73   G4double sidepanelPosZ = glassPosZ;              70   G4double sidepanelPosZ = glassPosZ;
 74                                                    71 
 75   G4Box* sidepanel_box = new G4Box                 72   G4Box* sidepanel_box = new G4Box
 76   ("sidepanel_box",0.5*sidepanelWidth, 0.5*pan     73   ("sidepanel_box",0.5*sidepanelWidth, 0.5*panelThick, 0.5*windowHeight );
 77   sidepanel_log = new G4LogicalVolume              74   sidepanel_log = new G4LogicalVolume
 78                       (sidepanel_box, panel_ma     75                       (sidepanel_box, panel_mat, "sidepanel_log");
 79   sidepanel_phys = new G4PVPlacement               76   sidepanel_phys = new G4PVPlacement
 80     (0, G4ThreeVector(sidepanelPosX, sidepanel     77     (0, G4ThreeVector(sidepanelPosX, sidepanelPosY, sidepanelPosZ), 
 81         "sidepanel_phys", sidepanel_log, world     78         "sidepanel_phys", sidepanel_log, world_phys, false, 0);
 82                                                    79 
 83   sidepanel_phys = new G4PVPlacement               80   sidepanel_phys = new G4PVPlacement
 84     (0, G4ThreeVector(-sidepanelPosX, sidepane     81     (0, G4ThreeVector(-sidepanelPosX, sidepanelPosY, sidepanelPosZ), 
 85         "sidepanel_phys", sidepanel_log, world     82         "sidepanel_phys", sidepanel_log, world_phys, false, 1);
 86                                                    83 
 87   G4VisAttributes* panel_vat= new G4VisAttribu     84   G4VisAttributes* panel_vat= new G4VisAttributes(grey);
 88   panel_vat->SetVisibility(true);                  85   panel_vat->SetVisibility(true);
 89   panel_vat->SetForceSolid(true);                  86   panel_vat->SetForceSolid(true);
 90   sidepanel_log->SetVisAttributes(panel_vat);      87   sidepanel_log->SetVisAttributes(panel_vat);
 91                                                    88 
 92   // panel hole in wall between Al and "lab":      89   // panel hole in wall between Al and "lab": ******************************
 93                                                    90 
 94   G4double panelholePosX  = sidepanelPosX;         91   G4double panelholePosX  = sidepanelPosX;
 95   G4double panelholeThick = wallThick - panelT     92   G4double panelholeThick = wallThick - panelThick;
 96   G4double panelholePosY  = 0.5*(worldLength -     93   G4double panelholePosY  = 0.5*(worldLength - panelholeThick) - panelThick;
 97   G4double panelholePosZ  = sidepanelPosZ;         94   G4double panelholePosZ  = sidepanelPosZ;
 98                                                    95 
 99   G4Box* panelhole_box = new G4Box                 96   G4Box* panelhole_box = new G4Box
100   ("panelhole_box",0.5*sidepanelWidth, 0.5*pan     97   ("panelhole_box",0.5*sidepanelWidth, 0.5*panelholeThick, 0.5*windowHeight );
101   panelhole_log = new G4LogicalVolume              98   panelhole_log = new G4LogicalVolume
102                        (panelhole_box, lab_mat     99                        (panelhole_box, lab_mat, "panelhole_log");
103                                                   100 
104   panelhole_phys = new G4PVPlacement              101   panelhole_phys = new G4PVPlacement
105     (0, G4ThreeVector(panelholePosX, panelhole    102     (0, G4ThreeVector(panelholePosX, panelholePosY, panelholePosZ), 
106     "panelhole_phys", panelhole_log, world_phy    103     "panelhole_phys", panelhole_log, world_phys, false, 0);
107   panelhole_phys = new G4PVPlacement              104   panelhole_phys = new G4PVPlacement
108     (0, G4ThreeVector(-panelholePosX, panelhol    105     (0, G4ThreeVector(-panelholePosX, panelholePosY, panelholePosZ), 
109     "panelhole_phys", panelhole_log, world_phy    106     "panelhole_phys", panelhole_log, world_phys, false, 1);
110                                                   107 
111   panelhole_log->SetVisAttributes(window_vat);    108   panelhole_log->SetVisAttributes(window_vat);
112                                                   109 
113                                                   110 
114   // DOOR Window - AIR + glass ***************    111   // DOOR Window - AIR + glass ************************************************
115                                                   112 
116   G4double doorwindowWidth = 62.*cm;              113   G4double doorwindowWidth = 62.*cm;
117   G4double doorwindowHeight = 84.0*cm;            114   G4double doorwindowHeight = 84.0*cm;
118   G4double doorglassPosX = 0.5*(labWidth - doo    115   G4double doorglassPosX = 0.5*(labWidth - doorwindowWidth) - sidepanelWidth;
119   G4double doorglassPosY = 0.5*(worldLength -     116   G4double doorglassPosY = 0.5*(worldLength - panelThick);
120   G4double doorglassPosZ = glassPosZ - 0.5*(wi    117   G4double doorglassPosZ = glassPosZ - 0.5*(windowHeight+doorwindowHeight);
121                                                   118 
122   G4Box* doorglass_box = new G4Box                119   G4Box* doorglass_box = new G4Box
123   ("doorglass_box",0.5*doorwindowWidth, 0.5*pa    120   ("doorglass_box",0.5*doorwindowWidth, 0.5*panelThick, 0.5*doorwindowHeight );
124   doorglass_log = new G4LogicalVolume             121   doorglass_log = new G4LogicalVolume
125                       (doorglass_box, panel_ma    122                       (doorglass_box, panel_mat, "doorglass_log");
126   doorglass_phys = new G4PVPlacement              123   doorglass_phys = new G4PVPlacement
127     (0, G4ThreeVector(doorglassPosX, doorglass    124     (0, G4ThreeVector(doorglassPosX, doorglassPosY, doorglassPosZ), 
128         "doorglass_phys", doorglass_log, world    125         "doorglass_phys", doorglass_log, world_phys, false, 0);
129                                                   126 
130   doorglass_log->SetVisAttributes(panel_vat);     127   doorglass_log->SetVisAttributes(panel_vat);
131                                                   128 
132   // door hole in wall between glass and "lab"    129   // door hole in wall between glass and "lab": ******************************
133                                                   130 
134   G4double doorwindowPosX = doorglassPosX;        131   G4double doorwindowPosX = doorglassPosX;
135   G4double doorwindowPosY = 0.5*(worldLength -    132   G4double doorwindowPosY = 0.5*(worldLength - panelholeThick) - panelThick;
136   G4double doorwindowPosZ = doorglassPosZ;        133   G4double doorwindowPosZ = doorglassPosZ;
137                                                   134 
138   G4Box* doorwindow_box = new G4Box               135   G4Box* doorwindow_box = new G4Box
139   ("doorwindow_box",0.5*doorwindowWidth, 0.5*p    136   ("doorwindow_box",0.5*doorwindowWidth, 0.5*panelholeThick, 0.5*doorwindowHeight );
140   doorwindow_log = new G4LogicalVolume            137   doorwindow_log = new G4LogicalVolume
141                        (doorwindow_box, lab_ma    138                        (doorwindow_box, lab_mat, "doorwindow_log");
142   doorwindow_phys = new G4PVPlacement             139   doorwindow_phys = new G4PVPlacement
143     (0, G4ThreeVector(doorwindowPosX, doorwind    140     (0, G4ThreeVector(doorwindowPosX, doorwindowPosY, doorwindowPosZ), 
144     "doorwindow_phys", doorwindow_log, world_p    141     "doorwindow_phys", doorwindow_log, world_phys, false, 0);
145                                                   142 
146   doorwindow_log->SetVisAttributes(window_vat)    143   doorwindow_log->SetVisAttributes(window_vat);
147                                                   144 
148                                                   145 
149   // cupboards: ******************************    146   // cupboards: ***************************************************************
150                                                   147 
151   // cupboard 1:                                  148   // cupboard 1:
152   G4double cupboardDepth  = 38.0*cm; //X          149   G4double cupboardDepth  = 38.0*cm; //X
153   G4double cupboard1Width  = 91.0*cm; //Y         150   G4double cupboard1Width  = 91.0*cm; //Y
154   G4double cupboard2Width  = 153.0*cm; //Y        151   G4double cupboard2Width  = 153.0*cm; //Y
155   G4double cupboardHeight = 91.0*cm; //Z          152   G4double cupboardHeight = 91.0*cm; //Z
156   G4double woodThick      = 2.0*cm;               153   G4double woodThick      = 2.0*cm;
157   G4double insideDepth  = cupboardDepth - 2.*w    154   G4double insideDepth  = cupboardDepth - 2.*woodThick;
158   G4double inside1Width  = cupboard1Width - 2.    155   G4double inside1Width  = cupboard1Width - 2.*woodThick;
159   G4double inside2Width  = cupboard2Width - 2.    156   G4double inside2Width  = cupboard2Width - 2.*woodThick;
160   G4double insideHeight = cupboardHeight - 2.*    157   G4double insideHeight = cupboardHeight - 2.*woodThick;
161                                                   158 
162   //nb: cupboard orientation is sideways becau    159   //nb: cupboard orientation is sideways because they are lined along the wall
163   G4Box* cupboard_box = new G4Box                 160   G4Box* cupboard_box = new G4Box
164    ("cupboard_box", 0.5*cupboardDepth, 0.5*cup    161    ("cupboard_box", 0.5*cupboardDepth, 0.5*cupboard1Width, 0.5*cupboardHeight);
165   G4Box* inside_box = new G4Box                   162   G4Box* inside_box = new G4Box
166     ("inside_box", 0.5*insideDepth, 0.5*inside    163     ("inside_box", 0.5*insideDepth, 0.5*inside1Width, 0.5*insideHeight);
167   G4Box* shelf_box  = new G4Box                   164   G4Box* shelf_box  = new G4Box
168     ("shelf_box", 0.5*insideDepth, 0.5*inside1    165     ("shelf_box", 0.5*insideDepth, 0.5*inside1Width, 0.5*woodThick);
169   G4Box* cupdoor_box = new G4Box                  166   G4Box* cupdoor_box = new G4Box
170     ("cupdoor_box", 0.5*woodThick+1.0*nanomete    167     ("cupdoor_box", 0.5*woodThick+1.0*nanometer, 0.25*inside1Width, 0.5*insideHeight);
171 //    ("cupdoor_box", 0.5*woodThick, 0.25*insi    168 //    ("cupdoor_box", 0.5*woodThick, 0.25*inside1Width, 0.5*insideHeight);
172                                                   169 
173   G4RotationMatrix rotMatrixCupboard;             170   G4RotationMatrix rotMatrixCupboard;
174   rotMatrixCupboard.rotateY(0.0*deg);             171   rotMatrixCupboard.rotateY(0.0*deg);
175                                                   172   
176   G4SubtractionSolid* cupboard_frame = new G4S    173   G4SubtractionSolid* cupboard_frame = new G4SubtractionSolid
177     ("cupboard_frame", cupboard_box, inside_bo    174     ("cupboard_frame", cupboard_box, inside_box, G4Transform3D
178      (rotMatrixCupboard, G4ThreeVector(0.,0.,0    175      (rotMatrixCupboard, G4ThreeVector(0.,0.,0.)));
179   G4UnionSolid* cupboard_shelf1 = new G4UnionS    176   G4UnionSolid* cupboard_shelf1 = new G4UnionSolid
180     ("cupboard_shelf1", cupboard_frame, shelf_    177     ("cupboard_shelf1", cupboard_frame, shelf_box, G4Transform3D
181      (rotMatrixCupboard, G4ThreeVector(0.,0.,0    178      (rotMatrixCupboard, G4ThreeVector(0.,0.,0.30*(insideHeight))));
182   G4UnionSolid* cupboard_shelf2 = new G4UnionS    179   G4UnionSolid* cupboard_shelf2 = new G4UnionSolid
183     ("cupboard_shelf2", cupboard_shelf1, shelf    180     ("cupboard_shelf2", cupboard_shelf1, shelf_box, G4Transform3D
184      (rotMatrixCupboard, G4ThreeVector(0.,0.,-    181      (rotMatrixCupboard, G4ThreeVector(0.,0.,-0.05*(insideHeight))));
185   G4SubtractionSolid* cupboard_sol = new G4Sub    182   G4SubtractionSolid* cupboard_sol = new G4SubtractionSolid
186     ("cupboard_sol", cupboard_shelf2, cupdoor_    183     ("cupboard_sol", cupboard_shelf2, cupdoor_box, G4Transform3D
187      (rotMatrixCupboard, G4ThreeVector            184      (rotMatrixCupboard, G4ThreeVector
188       (-0.5*(insideDepth+woodThick),0.25*insid    185       (-0.5*(insideDepth+woodThick),0.25*inside1Width,0.)));
189                                                   186 
190   cupboard_log = new G4LogicalVolume              187   cupboard_log = new G4LogicalVolume
191     (cupboard_sol, cupboard_mat, "cupboard_log    188     (cupboard_sol, cupboard_mat, "cupboard_log");
192                                                   189 
193   G4double cupb_X = 0.5*(labWidth - cupboardDe    190   G4double cupb_X = 0.5*(labWidth - cupboardDepth);
194   //  G4double cupb_Y = 0.5*(labLength - cupbo    191   //  G4double cupb_Y = 0.5*(labLength - cupboard1Width) - 2.0*cm;
195   G4double cupb_Y = 0.5*labLength;                192   G4double cupb_Y = 0.5*labLength;
196   G4double cupb_Z = 0.5*(labHeight - cupboardH    193   G4double cupb_Z = 0.5*(labHeight - cupboardHeight) - 25.4*cm;
197                                                   194 
198   for (G4int i=0; i<5; i++)                       195   for (G4int i=0; i<5; i++)
199     {                                             196     {
200       cupb_Y -= cupboard1Width+2.0*cm;            197       cupb_Y -= cupboard1Width+2.0*cm;
201       cupboard_phys = new G4PVPlacement           198       cupboard_phys = new G4PVPlacement
202   (0, G4ThreeVector(cupb_X, cupb_Y, cupb_Z), "    199   (0, G4ThreeVector(cupb_X, cupb_Y, cupb_Z), "cupboard_phys", 
203    cupboard_log, lab_phys, false, i);             200    cupboard_log, lab_phys, false, i);
204     }                                             201     }
205                                                   202 
206   cupb_X  = -(0.5*(labWidth - cupboard1Width)     203   cupb_X  = -(0.5*(labWidth - cupboard1Width) - cupboardDepth - 2.0*cm);
207   G4double cupb_Y2 = -0.5*(labLength - cupboar    204   G4double cupb_Y2 = -0.5*(labLength - cupboardDepth);
208                                                   205 
209   G4RotationMatrix rotMatrixWallcupboard;         206   G4RotationMatrix rotMatrixWallcupboard;
210   rotMatrixWallcupboard.rotateZ(-90.0*deg);       207   rotMatrixWallcupboard.rotateZ(-90.0*deg);
211                                                   208 
212   cupboard_phys = new G4PVPlacement               209   cupboard_phys = new G4PVPlacement
213     (G4Transform3D                                210     (G4Transform3D
214      (rotMatrixWallcupboard,G4ThreeVector(cupb    211      (rotMatrixWallcupboard,G4ThreeVector(cupb_X, cupb_Y2, cupb_Z)), 
215       "cupboard_phys", cupboard_log, lab_phys,    212       "cupboard_phys", cupboard_log, lab_phys, false, 5);
216                                                   213 
217                                                   214 
218   G4VisAttributes* cupboard_vat= new G4VisAttr    215   G4VisAttributes* cupboard_vat= new G4VisAttributes(yellow);
219   cupboard_vat->SetVisibility(true);              216   cupboard_vat->SetVisibility(true);
220   cupboard_vat->SetForceSolid(true);              217   cupboard_vat->SetForceSolid(true);
221   cupboard_log->SetVisAttributes(cupboard_vat)    218   cupboard_log->SetVisAttributes(cupboard_vat);
222                                                   219 
223   // cupboard 2 (bigger/wider) ***************    220   // cupboard 2 (bigger/wider) ***********************************************
224                                                   221 
225   G4Box* cupboard2_box = new G4Box                222   G4Box* cupboard2_box = new G4Box
226   ("cupboard2_box", 0.5*cupboardDepth, 0.5*cup    223   ("cupboard2_box", 0.5*cupboardDepth, 0.5*cupboard2Width, 0.5*cupboardHeight);
227   G4Box* inside2_box = new G4Box                  224   G4Box* inside2_box = new G4Box
228     ("inside2_box", 0.5*insideDepth, 0.5*insid    225     ("inside2_box", 0.5*insideDepth, 0.5*inside2Width, 0.5*insideHeight);
229   G4Box* shelf2_box  = new G4Box                  226   G4Box* shelf2_box  = new G4Box
230     ("shelf2_box", 0.5*insideDepth, 0.5*inside    227     ("shelf2_box", 0.5*insideDepth, 0.5*inside2Width, 0.5*woodThick);
231   G4Box* cupdoor_box2 = new G4Box                 228   G4Box* cupdoor_box2 = new G4Box
232     ("cupdoor_box2", 0.5*woodThick+1.0*nanomet    229     ("cupdoor_box2", 0.5*woodThick+1.0*nanometer, 0.25*inside2Width, 0.5*insideHeight);
233 //    ("cupdoor_box2", 0.5*woodThick, 0.25*ins    230 //    ("cupdoor_box2", 0.5*woodThick, 0.25*inside2Width, 0.5*insideHeight);
234                                                   231 
235   G4SubtractionSolid* cupboard2_frame = new G4    232   G4SubtractionSolid* cupboard2_frame = new G4SubtractionSolid
236     ("cupboard2_frame", cupboard2_box, inside2    233     ("cupboard2_frame", cupboard2_box, inside2_box, G4Transform3D
237      (rotMatrixCupboard, G4ThreeVector(0.,0.,0    234      (rotMatrixCupboard, G4ThreeVector(0.,0.,0.)));
238   G4UnionSolid* cupboard2_shelf1 = new G4Union    235   G4UnionSolid* cupboard2_shelf1 = new G4UnionSolid
239     ("cupboard2_shelf1", cupboard2_frame, shel    236     ("cupboard2_shelf1", cupboard2_frame, shelf2_box, G4Transform3D
240      (rotMatrixCupboard, G4ThreeVector(0.,0.,0    237      (rotMatrixCupboard, G4ThreeVector(0.,0.,0.30*(insideHeight))));
241   G4UnionSolid* cupboard2_shelf2 = new G4Union    238   G4UnionSolid* cupboard2_shelf2 = new G4UnionSolid
242     ("cupboard2_shelf2", cupboard2_shelf1, she    239     ("cupboard2_shelf2", cupboard2_shelf1, shelf2_box, G4Transform3D
243      (rotMatrixCupboard, G4ThreeVector(0.,0.,0    240      (rotMatrixCupboard, G4ThreeVector(0.,0.,0.10*(insideHeight))));
244   G4SubtractionSolid* cupboard2_sol = new G4Su    241   G4SubtractionSolid* cupboard2_sol = new G4SubtractionSolid
245     ("cupboard2_sol", cupboard2_shelf2, cupdoo    242     ("cupboard2_sol", cupboard2_shelf2, cupdoor_box2, G4Transform3D
246      (rotMatrixCupboard, G4ThreeVector            243      (rotMatrixCupboard, G4ThreeVector
247       (-0.5*(insideDepth+woodThick),0.25*insid    244       (-0.5*(insideDepth+woodThick),0.25*inside2Width,0.)));
248                                                   245 
249   cupboard2_log = new G4LogicalVolume             246   cupboard2_log = new G4LogicalVolume
250     (cupboard2_sol, cupboard_mat, "cupboard2_l    247     (cupboard2_sol, cupboard_mat, "cupboard2_log");
251                                                   248 
252   cupb_X = 0.5*(labWidth - cupboardDepth);        249   cupb_X = 0.5*(labWidth - cupboardDepth);
253   //  cupb_Y = -(0.5*(labLength - cupboard2Wid    250   //  cupb_Y = -(0.5*(labLength - cupboard2Width) - 2.0*cm);
254   cupb_Y -= 0.5*cupboard1Width + 0.5*cupboard2    251   cupb_Y -= 0.5*cupboard1Width + 0.5*cupboard2Width 
255                                + 2.0*cm; //usi    252                                + 2.0*cm; //using last cupboard posn on right...
256   //  cupb_Z = 0.5*(labHeight - cupboardHeight    253   //  cupb_Z = 0.5*(labHeight - cupboardHeight) - 25.4*cm;
257                                                   254 
258   cupboard2_phys = new G4PVPlacement              255   cupboard2_phys = new G4PVPlacement
259     (0,G4ThreeVector(cupb_X, cupb_Y, cupb_Z),     256     (0,G4ThreeVector(cupb_X, cupb_Y, cupb_Z), 
260       "cupboard2_phys", cupboard2_log, lab_phy    257       "cupboard2_phys", cupboard2_log, lab_phys, false, 0);
261                                                   258 
262   cupb_X = -0.5*(labWidth - cupboardDepth);       259   cupb_X = -0.5*(labWidth - cupboardDepth);
263   cupb_Y = -(0.5*(labLength - cupboard2Width)     260   cupb_Y = -(0.5*(labLength - cupboard2Width) - cupboardDepth - 2.0*cm);
264                                                   261 
265   G4RotationMatrix rotMatrixWallcupboard2;        262   G4RotationMatrix rotMatrixWallcupboard2;
266   rotMatrixWallcupboard2.rotateZ(-180.0*deg);     263   rotMatrixWallcupboard2.rotateZ(-180.0*deg);
267                                                   264 
268   cupboard2_phys = new G4PVPlacement              265   cupboard2_phys = new G4PVPlacement
269     (G4Transform3D                                266     (G4Transform3D
270      (rotMatrixWallcupboard2,G4ThreeVector(cup    267      (rotMatrixWallcupboard2,G4ThreeVector(cupb_X, cupb_Y, cupb_Z)), 
271       "cupboard2_phys", cupboard2_log, lab_phy    268       "cupboard2_phys", cupboard2_log, lab_phys, false, 1);
272                                                   269 
273                                                   270 
274   cupboard2_log->SetVisAttributes(cupboard_vat    271   cupboard2_log->SetVisAttributes(cupboard_vat);
275                                                   272 
276                                                   273 
277   // NOW add the (wooden) DOOR:                   274   // NOW add the (wooden) DOOR:
278                                                   275 
279   G4double doorWidth = 1.67*m;  //X               276   G4double doorWidth = 1.67*m;  //X
280   G4double doorThick = 4.0*cm; //Y                277   G4double doorThick = 4.0*cm; //Y
281   G4double doorHeight = 2.09*m; //Z               278   G4double doorHeight = 2.09*m; //Z
282   G4double doorPosY = -0.5*(worldLength - door    279   G4double doorPosY = -0.5*(worldLength - doorThick);
283   G4double doorPosZ = -0.5*(worldHeight - door    280   G4double doorPosZ = -0.5*(worldHeight - doorHeight);
284                                                   281 
285   G4Box* door_box = new G4Box                     282   G4Box* door_box = new G4Box
286   ("door_box",0.5*doorWidth, 0.5*doorThick, 0.    283   ("door_box",0.5*doorWidth, 0.5*doorThick, 0.5*doorHeight );
287   door_log = new G4LogicalVolume(door_box, doo    284   door_log = new G4LogicalVolume(door_box, door_mat, "door_log");
288   door_phys = new G4PVPlacement                   285   door_phys = new G4PVPlacement
289     (0, G4ThreeVector(0., doorPosY, doorPosZ),    286     (0, G4ThreeVector(0., doorPosY, doorPosZ), "door_phys", door_log, 
290      world_phys, false, 0);                       287      world_phys, false, 0);
291                                                   288 
292   G4VisAttributes* door_vat= new G4VisAttribut    289   G4VisAttributes* door_vat= new G4VisAttributes(brown);
293   door_vat->SetVisibility(true);                  290   door_vat->SetVisibility(true);
294   door_vat->SetForceSolid(true);                  291   door_vat->SetForceSolid(true);
295   door_log->SetVisAttributes(door_vat);           292   door_log->SetVisAttributes(door_vat);
296                                                   293 
297                                                   294 
298   // hole in wall between door and "lab": ****    295   // hole in wall between door and "lab": ************************************
299                                                   296 
300   G4double doorholeThick = wallThick - doorThi    297   G4double doorholeThick = wallThick - doorThick;
301   G4double doorholePosY = -(0.5*(worldLength -    298   G4double doorholePosY = -(0.5*(worldLength - doorholeThick) - doorThick);
302   G4double doorholePosZ = doorPosZ;               299   G4double doorholePosZ = doorPosZ;
303                                                   300 
304   G4Box* doorhole_box = new G4Box                 301   G4Box* doorhole_box = new G4Box
305   ("doorhole_box",0.5*doorWidth, 0.5*doorholeT    302   ("doorhole_box",0.5*doorWidth, 0.5*doorholeThick, 0.5*doorHeight );
306   doorhole_log = new G4LogicalVolume(doorhole_    303   doorhole_log = new G4LogicalVolume(doorhole_box, lab_mat, "doorhole_log");
307   doorhole_phys = new G4PVPlacement               304   doorhole_phys = new G4PVPlacement
308     (0, G4ThreeVector(0., doorholePosY, doorho    305     (0, G4ThreeVector(0., doorholePosY, doorholePosZ), "doorhole_phys",
309      doorhole_log, world_phys, false, 0);         306      doorhole_log, world_phys, false, 0);
310                                                   307 
311   G4VisAttributes* doorhole_vat= new G4VisAttr    308   G4VisAttributes* doorhole_vat= new G4VisAttributes(cyan);
312   //  window_log->SetVisAttributes(G4VisAttrib << 309   //  window_log->SetVisAttributes(G4VisAttributes::Invisible);
313   doorhole_vat->SetVisibility(true);              310   doorhole_vat->SetVisibility(true);
314   doorhole_log->SetVisAttributes(doorhole_vat)    311   doorhole_log->SetVisAttributes(doorhole_vat);
315                                                   312 
316                                                   313 
317   // desks: **********************************    314   // desks: *****************************************************************
318   //now add Desks - wood, but have the opportu    315   //now add Desks - wood, but have the opportunity for three different woods -
319   // Cupboard, Door and then desks                316   // Cupboard, Door and then desks
320                                                   317 
321   // desk1 - no cupboard underneath - should b    318   // desk1 - no cupboard underneath - should be bigger subtraction?:
322                                                   319 
323   G4double desk1Depth  = 57.0*cm; //X             320   G4double desk1Depth  = 57.0*cm; //X
324   G4double desk1Width  = 160.0*cm; //Y            321   G4double desk1Width  = 160.0*cm; //Y
325   G4double desk1Height = 90.5*cm; //Z             322   G4double desk1Height = 90.5*cm; //Z
326   G4double deskThick      = 3.0*cm;               323   G4double deskThick      = 3.0*cm;
327   G4double desk1_insideDepth  = desk1Depth - 2    324   G4double desk1_insideDepth  = desk1Depth - 2.*deskThick;
328   G4double desk1_insideWidth  = desk1Width - 2    325   G4double desk1_insideWidth  = desk1Width - 2.*deskThick;
329   G4double desk1_insideHeight = desk1Height -     326   G4double desk1_insideHeight = desk1Height - 2.*deskThick;
330                                                   327 
331   //nb: desk orientation is sideways because t    328   //nb: desk orientation is sideways because they are lined along the wall
332   G4Box* desk1_box = new G4Box                    329   G4Box* desk1_box = new G4Box
333    ("desk1_box", 0.5*desk1Depth, 0.5*desk1Widt    330    ("desk1_box", 0.5*desk1Depth, 0.5*desk1Width, 0.5*desk1Height);
334   G4Box* desk1_inside_box = new G4Box             331   G4Box* desk1_inside_box = new G4Box
335     ("desk1_inside_box", 0.5*desk1_insideDepth    332     ("desk1_inside_box", 0.5*desk1_insideDepth, 0.5*desk1_insideWidth, 
336      0.5*desk1_insideHeight);                     333      0.5*desk1_insideHeight);
337   G4Box* desk1_door_box = new G4Box               334   G4Box* desk1_door_box = new G4Box
338     ("desk1_door_box", 0.5*deskThick+1.0*nanom    335     ("desk1_door_box", 0.5*deskThick+1.0*nanometer, 0.25*desk1_insideWidth, 
339      0.5*desk1_insideHeight);                     336      0.5*desk1_insideHeight);
340 //    ("desk1_door_box", 0.5*deskThick, 0.25*d    337 //    ("desk1_door_box", 0.5*deskThick, 0.25*desk1_insideWidth, 
341 //     0.5*desk1_insideHeight);                   338 //     0.5*desk1_insideHeight);
342                                                   339 
343   G4RotationMatrix rotMatrixDesk;                 340   G4RotationMatrix rotMatrixDesk;
344   rotMatrixDesk.rotateY(0.0*deg);                 341   rotMatrixDesk.rotateY(0.0*deg);
345                                                   342   
346   G4SubtractionSolid* desk1_frame = new G4Subt    343   G4SubtractionSolid* desk1_frame = new G4SubtractionSolid
347     ("desk1_frame", desk1_box, desk1_inside_bo    344     ("desk1_frame", desk1_box, desk1_inside_box, G4Transform3D
348      (rotMatrixCupboard, G4ThreeVector(0.,0.,0    345      (rotMatrixCupboard, G4ThreeVector(0.,0.,0.)));
349   G4SubtractionSolid* desk1_sol = new G4Subtra    346   G4SubtractionSolid* desk1_sol = new G4SubtractionSolid
350     ("desk1_sol", desk1_frame, desk1_door_box,    347     ("desk1_sol", desk1_frame, desk1_door_box, G4Transform3D
351      (rotMatrixCupboard, G4ThreeVector            348      (rotMatrixCupboard, G4ThreeVector
352       (-0.5*(desk1_insideDepth+deskThick),-0.2    349       (-0.5*(desk1_insideDepth+deskThick),-0.25*desk1_insideWidth,0.)));
353                                                   350 
354   desk1_log = new G4LogicalVolume(desk1_sol, d    351   desk1_log = new G4LogicalVolume(desk1_sol, desk_mat, "desk1_log");
355                                                   352 
356   G4double desk_X = 0.5*(labWidth - desk1Depth    353   G4double desk_X = 0.5*(labWidth - desk1Depth);
357   G4double desk_Y = -(0.5*(labLength - desk1Wi    354   G4double desk_Y = -(0.5*(labLength - desk1Width) - 30.0*cm);
358   G4double desk_Z = 0.5*(desk1Height - labHeig    355   G4double desk_Z = 0.5*(desk1Height - labHeight);
359                                                   356 
360   desk1_phys = new G4PVPlacement                  357   desk1_phys = new G4PVPlacement
361   (0, G4ThreeVector(desk_X, desk_Y, desk_Z), "    358   (0, G4ThreeVector(desk_X, desk_Y, desk_Z), "desk1_phys", 
362    desk1_log, lab_phys, false, 0);                359    desk1_log, lab_phys, false, 0);
363                                                   360 
364   G4VisAttributes* desk_vat= new G4VisAttribut    361   G4VisAttributes* desk_vat= new G4VisAttributes(brown);
365   desk_vat->SetVisibility(true);                  362   desk_vat->SetVisibility(true);
366   desk_vat->SetForceSolid(true);                  363   desk_vat->SetForceSolid(true);
367   desk1_log->SetVisAttributes(desk_vat);          364   desk1_log->SetVisAttributes(desk_vat);
368                                                   365 
369   // *****************                            366   // *****************
370   // desk2 (drawers):                             367   // desk2 (drawers):
371                                                   368 
372   G4double desk2Depth  = 57.0*cm; //X             369   G4double desk2Depth  = 57.0*cm; //X
373   G4double desk2Width = 156.0*cm; //Y             370   G4double desk2Width = 156.0*cm; //Y
374   G4double desk2Height = desk1Height; //Z         371   G4double desk2Height = desk1Height; //Z
375                                                   372 
376   G4double desk2_insideDepth  = desk2Depth - 2    373   G4double desk2_insideDepth  = desk2Depth - 2.*deskThick;
377   G4double desk2_insideWidth  = desk2Width - 2    374   G4double desk2_insideWidth  = desk2Width - 2.*deskThick;
378   G4double desk2_insideHeight = desk2Height -     375   G4double desk2_insideHeight = desk2Height - 2.*deskThick;
379                                                   376 
380   //nb: desk orientation is sideways because t    377   //nb: desk orientation is sideways because they are lined along the wall
381   G4Box* desk2_box = new G4Box                    378   G4Box* desk2_box = new G4Box
382    ("desk2_box", 0.5*desk2Depth, 0.5*desk2Widt    379    ("desk2_box", 0.5*desk2Depth, 0.5*desk2Width, 0.5*desk2Height);
383   G4Box* desk2_inside_box = new G4Box             380   G4Box* desk2_inside_box = new G4Box
384     ("desk2_inside_box", 0.5*desk2_insideDepth    381     ("desk2_inside_box", 0.5*desk2_insideDepth, 0.5*desk2_insideWidth, 
385      0.5*desk2_insideHeight);                     382      0.5*desk2_insideHeight);
386   G4Box* desk2_door_box = new G4Box               383   G4Box* desk2_door_box = new G4Box
387     ("desk2_door_box", 0.5*deskThick+1.0*nanom    384     ("desk2_door_box", 0.5*deskThick+1.0*nanometer, 0.2*desk2_insideWidth, 
388      0.5*desk2_insideHeight);                     385      0.5*desk2_insideHeight);
389 //    ("desk2_door_box", 0.5*deskThick, 0.2*de    386 //    ("desk2_door_box", 0.5*deskThick, 0.2*desk2_insideWidth, 
390 //     0.5*desk2_insideHeight);                   387 //     0.5*desk2_insideHeight);
391                                                   388 
392   G4SubtractionSolid* desk2_frame = new G4Subt    389   G4SubtractionSolid* desk2_frame = new G4SubtractionSolid
393     ("desk2_frame", desk2_box, desk2_inside_bo    390     ("desk2_frame", desk2_box, desk2_inside_box, G4Transform3D
394      (rotMatrixCupboard, G4ThreeVector(0.,0.,0    391      (rotMatrixCupboard, G4ThreeVector(0.,0.,0.)));
395   G4SubtractionSolid* desk2_sol = new G4Subtra    392   G4SubtractionSolid* desk2_sol = new G4SubtractionSolid
396     ("desk2_sol", desk2_frame, desk2_door_box,    393     ("desk2_sol", desk2_frame, desk2_door_box, G4Transform3D
397      (rotMatrixCupboard, G4ThreeVector            394      (rotMatrixCupboard, G4ThreeVector
398       (-0.5*(desk2_insideDepth+deskThick),-0.2    395       (-0.5*(desk2_insideDepth+deskThick),-0.25*desk2_insideWidth,0.)));
399                                                   396 
400   desk2_log = new G4LogicalVolume(desk2_sol, d    397   desk2_log = new G4LogicalVolume(desk2_sol, desk_mat, "desk2_log");
401                                                   398 
402   desk_X = 0.5*(labWidth - desk2Depth);           399   desk_X = 0.5*(labWidth - desk2Depth);
403   desk_Y += 0.5*(desk2Width + desk1Width) + 2.    400   desk_Y += 0.5*(desk2Width + desk1Width) + 2.0*cm;
404   desk_Z = 0.5*(desk2Height - labHeight);         401   desk_Z = 0.5*(desk2Height - labHeight);
405                                                   402 
406   desk2_phys = new G4PVPlacement                  403   desk2_phys = new G4PVPlacement
407   (0, G4ThreeVector(desk_X, desk_Y, desk_Z), "    404   (0, G4ThreeVector(desk_X, desk_Y, desk_Z), "desk2_phys", 
408    desk2_log, lab_phys, false, 0);                405    desk2_log, lab_phys, false, 0);
409                                                   406 
410   desk2_log->SetVisAttributes(desk_vat);          407   desk2_log->SetVisAttributes(desk_vat);
411                                                   408 
412   // *****************                            409   // *****************
413   // desk3 (cupboard underneath):                 410   // desk3 (cupboard underneath):
414                                                   411 
415   G4double desk3Depth  = 79.0*cm; //X             412   G4double desk3Depth  = 79.0*cm; //X
416   G4double desk3Width = 160.0*cm; //Y             413   G4double desk3Width = 160.0*cm; //Y
417   G4double desk3Height = desk1Height; //Z         414   G4double desk3Height = desk1Height; //Z
418                                                   415 
419   G4double desk3_insideDepth  = desk3Depth - 2    416   G4double desk3_insideDepth  = desk3Depth - 2.*deskThick;
420   G4double desk3_insideWidth  = desk3Width - 2    417   G4double desk3_insideWidth  = desk3Width - 2.*deskThick;
421   G4double desk3_insideHeight = desk3Height -     418   G4double desk3_insideHeight = desk3Height - 2.*deskThick;
422                                                   419 
423   //nb: desk orientation is sideways because t    420   //nb: desk orientation is sideways because they are lined along the wall
424   G4Box* desk3_box = new G4Box                    421   G4Box* desk3_box = new G4Box
425    ("desk3_box", 0.5*desk3Depth, 0.5*desk3Widt    422    ("desk3_box", 0.5*desk3Depth, 0.5*desk3Width, 0.5*desk3Height);
426   G4Box* desk3_inside_box = new G4Box             423   G4Box* desk3_inside_box = new G4Box
427     ("desk3_inside_box", 0.5*desk3_insideDepth    424     ("desk3_inside_box", 0.5*desk3_insideDepth, 0.5*desk3_insideWidth, 
428      0.5*desk3_insideHeight);                     425      0.5*desk3_insideHeight);
429   G4Box* desk3_door_box = new G4Box               426   G4Box* desk3_door_box = new G4Box
430     ("desk3_door_box", 0.5*deskThick+1.0*nanom    427     ("desk3_door_box", 0.5*deskThick+1.0*nanometer, 0.15*desk3_insideWidth, 0.5*desk1_insideHeight);
431 //    ("desk3_door_box", 0.5*deskThick, 0.15*d    428 //    ("desk3_door_box", 0.5*deskThick, 0.15*desk3_insideWidth, 
432 //     0.5*desk1_insideHeight);                   429 //     0.5*desk1_insideHeight);
433                                                   430 
434   G4SubtractionSolid* desk3_frame = new G4Subt    431   G4SubtractionSolid* desk3_frame = new G4SubtractionSolid
435     ("desk3_frame", desk3_box, desk3_inside_bo    432     ("desk3_frame", desk3_box, desk3_inside_box, G4Transform3D
436      (rotMatrixCupboard, G4ThreeVector(0.,0.,0    433      (rotMatrixCupboard, G4ThreeVector(0.,0.,0.)));
437   G4SubtractionSolid* desk3_sol = new G4Subtra    434   G4SubtractionSolid* desk3_sol = new G4SubtractionSolid
438     ("desk3_sol", desk3_frame, desk3_door_box,    435     ("desk3_sol", desk3_frame, desk3_door_box, G4Transform3D
439      (rotMatrixCupboard, G4ThreeVector            436      (rotMatrixCupboard, G4ThreeVector
440       (-0.5*(desk3_insideDepth+deskThick),-0.3    437       (-0.5*(desk3_insideDepth+deskThick),-0.35*desk3_insideWidth,0.)));
441                                                   438 
442   desk3_log = new G4LogicalVolume(desk3_sol, d    439   desk3_log = new G4LogicalVolume(desk3_sol, desk_mat, "desk3_log");
443                                                   440 
444   desk_X = 0.5*(labWidth - desk3Depth);           441   desk_X = 0.5*(labWidth - desk3Depth);
445   desk_Y += 0.5*(desk3Width + desk3Width) + 2.    442   desk_Y += 0.5*(desk3Width + desk3Width) + 2.0*cm;
446   desk_Z = 0.5*(desk3Height - labHeight);         443   desk_Z = 0.5*(desk3Height - labHeight);
447                                                   444 
448   desk3_phys = new G4PVPlacement                  445   desk3_phys = new G4PVPlacement
449   (0, G4ThreeVector(desk_X, desk_Y, desk_Z), "    446   (0, G4ThreeVector(desk_X, desk_Y, desk_Z), "desk3_phys", 
450    desk3_log, lab_phys, false, 0);                447    desk3_log, lab_phys, false, 0);
451                                                   448 
452   desk3_log->SetVisAttributes(desk_vat);          449   desk3_log->SetVisAttributes(desk_vat);
453                                                   450 
454                                                   451 
455   // *****************                            452   // *****************
456   // wooden radiator trunking - along LHS wall    453   // wooden radiator trunking - along LHS wall
457                                                   454 
458   G4double trunkDepth  = 20.0*cm; //X             455   G4double trunkDepth  = 20.0*cm; //X
459   G4double trunkWidth  = labLength; //Y           456   G4double trunkWidth  = labLength; //Y
460   G4double trunkHeight = desk1Height; //Z         457   G4double trunkHeight = desk1Height; //Z
461   G4double trunkThick  = 3.0*cm;                  458   G4double trunkThick  = 3.0*cm;
462                                                   459 
463   // not 2.*trunkThick since only 2 sides of b    460   // not 2.*trunkThick since only 2 sides of box - top and front
464   G4double trunk_insideDepth  = trunkDepth - t    461   G4double trunk_insideDepth  = trunkDepth - trunkThick;
465   G4double trunk_insideWidth  = trunkWidth;       462   G4double trunk_insideWidth  = trunkWidth;
466   G4double trunk_insideHeight = trunkHeight -     463   G4double trunk_insideHeight = trunkHeight - trunkThick;
467                                                   464 
468   G4Box* trunk_box = new G4Box                    465   G4Box* trunk_box = new G4Box
469    ("trunk_box", 0.5*trunkDepth, 0.5*trunkWidt    466    ("trunk_box", 0.5*trunkDepth, 0.5*trunkWidth, 0.5*trunkHeight);
470   G4Box* trunk_inside_box = new G4Box             467   G4Box* trunk_inside_box = new G4Box
471     ("trunk_inside_box", 0.5*trunk_insideDepth    468     ("trunk_inside_box", 0.5*trunk_insideDepth, 0.5*trunk_insideWidth, 
472      0.5*trunk_insideHeight);                     469      0.5*trunk_insideHeight);
473                                                   470 
474   trunk_log = new G4LogicalVolume(trunk_box, d    471   trunk_log = new G4LogicalVolume(trunk_box, desk_mat, "trunk_log");
475   trunk_inside_log = new G4LogicalVolume          472   trunk_inside_log = new G4LogicalVolume
476                     (trunk_inside_box, lab_mat    473                     (trunk_inside_box, lab_mat, "trunk_inside_log");
477                                                   474 
478   G4double trunk_X = -0.5*(labWidth - trunkDep    475   G4double trunk_X = -0.5*(labWidth - trunkDepth);
479   G4double trunk_Y = 0.0*m;                       476   G4double trunk_Y = 0.0*m;
480   G4double trunk_Z = -0.5*(labHeight - trunkHe    477   G4double trunk_Z = -0.5*(labHeight - trunkHeight);
481                                                   478   
482   trunk_phys = new G4PVPlacement                  479   trunk_phys = new G4PVPlacement
483   (0, G4ThreeVector(trunk_X, trunk_Y, trunk_Z)    480   (0, G4ThreeVector(trunk_X, trunk_Y, trunk_Z), "trunk_phys", 
484    trunk_log, lab_phys, false, 0);                481    trunk_log, lab_phys, false, 0);
485                                                   482 
486   G4double trunkinside_X = -0.5*(trunkDepth -     483   G4double trunkinside_X = -0.5*(trunkDepth - trunk_insideDepth);
487   G4double trunkinside_Y = 0.0*m;                 484   G4double trunkinside_Y = 0.0*m;
488   G4double trunkinside_Z = -0.5*(trunkHeight -    485   G4double trunkinside_Z = -0.5*(trunkHeight - trunk_insideHeight);
489                                                   486   
490   trunk_inside_phys = new G4PVPlacement           487   trunk_inside_phys = new G4PVPlacement
491   (0, G4ThreeVector(trunkinside_X, trunkinside    488   (0, G4ThreeVector(trunkinside_X, trunkinside_Y, trunkinside_Z), 
492       "trunk_inside_phys",trunk_inside_log, tr    489       "trunk_inside_phys",trunk_inside_log, trunk_phys, false, 0);
493                                                   490 
494   trunk_log->SetVisAttributes(desk_vat);          491   trunk_log->SetVisAttributes(desk_vat);
495   trunk_inside_log->SetVisAttributes(window_va    492   trunk_inside_log->SetVisAttributes(window_vat);
496                                                   493 
497   // *****************                            494   // *****************
498   // desk4,5,6 (actually 4 with multi-place id    495   // desk4,5,6 (actually 4 with multi-place idx) LHS with cupboards underneath:
499                                                   496 
500   G4double desk4Depth  = 79.0*cm; //X             497   G4double desk4Depth  = 79.0*cm; //X
501   G4double desk4Width  = 79.0*cm; //Y             498   G4double desk4Width  = 79.0*cm; //Y
502   G4double desk4Height = desk1Height; //Z         499   G4double desk4Height = desk1Height; //Z
503                                                   500 
504   G4double desk4_insideDepth  = desk4Depth - 2    501   G4double desk4_insideDepth  = desk4Depth - 2.*deskThick;
505   G4double desk4_insideWidth  = desk4Width - 2    502   G4double desk4_insideWidth  = desk4Width - 2.*deskThick;
506   G4double desk4_insideHeight = desk4Height -     503   G4double desk4_insideHeight = desk4Height - 2.*deskThick;
507                                                   504 
508   //nb: desk orientation is sideways because t    505   //nb: desk orientation is sideways because they are lined along the wall
509   G4Box* desk4_box = new G4Box                    506   G4Box* desk4_box = new G4Box
510    ("desk4_box", 0.5*desk4Depth, 0.5*desk4Widt    507    ("desk4_box", 0.5*desk4Depth, 0.5*desk4Width, 0.5*desk4Height);
511   G4Box* desk4_inside_box = new G4Box             508   G4Box* desk4_inside_box = new G4Box
512     ("desk4_inside_box", 0.5*desk4_insideDepth    509     ("desk4_inside_box", 0.5*desk4_insideDepth, 0.5*desk4_insideWidth, 
513      0.5*desk4_insideHeight);                     510      0.5*desk4_insideHeight);
514   G4Box* desk4_door_box = new G4Box               511   G4Box* desk4_door_box = new G4Box
515     ("desk4_door_box", 0.5*deskThick+1.0*nanom    512     ("desk4_door_box", 0.5*deskThick+1.0*nanometer, 0.45*desk4_insideWidth, 
516      0.5*desk4_insideHeight);                     513      0.5*desk4_insideHeight);
517 //    ("desk4_door_box", 0.5*deskThick, 0.45*d    514 //    ("desk4_door_box", 0.5*deskThick, 0.45*desk4_insideWidth, 
518 //     0.5*desk4_insideHeight);                   515 //     0.5*desk4_insideHeight);
519                                                   516 
520   G4SubtractionSolid* desk4_frame = new G4Subt    517   G4SubtractionSolid* desk4_frame = new G4SubtractionSolid
521     ("desk4_frame", desk4_box, desk4_inside_bo    518     ("desk4_frame", desk4_box, desk4_inside_box, G4Transform3D
522      (rotMatrixCupboard, G4ThreeVector(0.,0.,0    519      (rotMatrixCupboard, G4ThreeVector(0.,0.,0.)));
523   G4SubtractionSolid* desk4_sol = new G4Subtra    520   G4SubtractionSolid* desk4_sol = new G4SubtractionSolid
524     ("desk4_sol", desk4_frame, desk4_door_box,    521     ("desk4_sol", desk4_frame, desk4_door_box, G4Transform3D
525      (rotMatrixCupboard, G4ThreeVector            522      (rotMatrixCupboard, G4ThreeVector
526       (0.5*(desk4_insideDepth+deskThick),0.,0.    523       (0.5*(desk4_insideDepth+deskThick),0.,0.)));
527                                                   524 
528   desk4_log = new G4LogicalVolume(desk4_sol, d    525   desk4_log = new G4LogicalVolume(desk4_sol, desk_mat, "desk4_log");
529                                                   526 
530   desk_X = -0.5*(labWidth - desk4Depth) + trun    527   desk_X = -0.5*(labWidth - desk4Depth) + trunkDepth;
531   desk_Y = -(0.5*(labLength - desk4Width) - 5.    528   desk_Y = -(0.5*(labLength - desk4Width) - 5.0*cm);
532   desk_Z = 0.5*(desk4Height - labHeight);         529   desk_Z = 0.5*(desk4Height - labHeight);
533                                                   530   
534   G4double crateWidth  = 60.0*cm; //Y             531   G4double crateWidth  = 60.0*cm; //Y
535   G4double crate_Y = 0.;                          532   G4double crate_Y = 0.;
536                                                   533 
537   G4RotationMatrix rotMatrixDesk4;                534   G4RotationMatrix rotMatrixDesk4;
538   rotMatrixDesk4.rotateZ(0.0*deg);                535   rotMatrixDesk4.rotateZ(0.0*deg);
539                                                   536 
540   for (G4int j=0; j<3; j++)                       537   for (G4int j=0; j<3; j++)
541     {                                             538     {
542       if( j == 2)                                 539       if( j == 2) 
543         {                                         540         {
544     desk_Y += crateWidth;                         541     desk_Y += crateWidth;
545     crate_Y = desk_Y - 0.5*(desk4Width + crate    542     crate_Y = desk_Y - 0.5*(desk4Width + crateWidth);
546   }                                               543   }
547       desk4_phys = new G4PVPlacement              544       desk4_phys = new G4PVPlacement
548   (G4Transform3D(rotMatrixDesk4, G4ThreeVector    545   (G4Transform3D(rotMatrixDesk4, G4ThreeVector(desk_X, desk_Y, desk_Z)),
549    "desk4_phys", desk4_log, lab_phys, false, j    546    "desk4_phys", desk4_log, lab_phys, false, j);
550       desk_Y += desk4Width+2.0*cm;                547       desk_Y += desk4Width+2.0*cm;
551     }                                             548     }
552                                                   549 
553   desk4_log->SetVisAttributes(desk_vat);          550   desk4_log->SetVisAttributes(desk_vat);
554                                                   551 
555   // *****************                            552   // *****************
556   // aluminium crate rack:                        553   // aluminium crate rack:
557                                                   554 
558   G4double crateDepth  = 64.0*cm; //X             555   G4double crateDepth  = 64.0*cm; //X
559   //  G4double crateWidth  = 60.0*cm; //Y - mo    556   //  G4double crateWidth  = 60.0*cm; //Y - moved above...........
560   G4double crateHeight = 128.0*cm; //Z            557   G4double crateHeight = 128.0*cm; //Z
561   G4double crateThick  = 3.0*cm;                  558   G4double crateThick  = 3.0*cm;
562                                                   559 
563   G4double crate_insideDepth  = crateDepth - 2    560   G4double crate_insideDepth  = crateDepth - 2.*crateThick;
564   G4double crate_insideWidth  = crateWidth - 2    561   G4double crate_insideWidth  = crateWidth - 2.*crateThick;
565   G4double crate_insideHeight = crateHeight -     562   G4double crate_insideHeight = crateHeight - 2.*crateThick;
566                                                   563 
567   //nb: crate orientation is sideways because     564   //nb: crate orientation is sideways because they are lined along the wall
568   G4Box* crate_box = new G4Box                    565   G4Box* crate_box = new G4Box
569    ("crate_box", 0.5*crateDepth, 0.5*crateWidt    566    ("crate_box", 0.5*crateDepth, 0.5*crateWidth, 0.5*crateHeight);
570   G4Box* crate_inside_box = new G4Box             567   G4Box* crate_inside_box = new G4Box
571     ("crate_inside_box", 0.5*crate_insideDepth    568     ("crate_inside_box", 0.5*crate_insideDepth, 0.5*crate_insideWidth, 
572      0.5*crate_insideHeight);                     569      0.5*crate_insideHeight);
573   G4Box* crate_front_box = new G4Box              570   G4Box* crate_front_box = new G4Box
574     ("crate_front_box", 0.5*crateThick+1.0*nan    571     ("crate_front_box", 0.5*crateThick+1.0*nanometer, 0.5*crate_insideWidth, 
575      0.5*crate_insideHeight);                     572      0.5*crate_insideHeight);
576                                                   573 
577   G4SubtractionSolid* crate_frame = new G4Subt    574   G4SubtractionSolid* crate_frame = new G4SubtractionSolid
578     ("crate_frame", crate_box, crate_inside_bo    575     ("crate_frame", crate_box, crate_inside_box, G4Transform3D
579      (rotMatrixCupboard, G4ThreeVector(0.,0.,0    576      (rotMatrixCupboard, G4ThreeVector(0.,0.,0.)));
580   G4SubtractionSolid* crate_sol = new G4Subtra    577   G4SubtractionSolid* crate_sol = new G4SubtractionSolid
581     ("crate_sol", crate_frame, crate_front_box    578     ("crate_sol", crate_frame, crate_front_box, G4Transform3D
582      (rotMatrixCupboard, G4ThreeVector            579      (rotMatrixCupboard, G4ThreeVector
583       (0.5*(crate_insideDepth+crateThick),0.,0    580       (0.5*(crate_insideDepth+crateThick),0.,0.)));
584                                                   581 
585   crate_log = new G4LogicalVolume(crate_sol, c    582   crate_log = new G4LogicalVolume(crate_sol, crate_mat, "crate_log");
586                                                   583 
587   G4double crate_X = -0.5*(labWidth - crateDep    584   G4double crate_X = -0.5*(labWidth - crateDepth) + trunkDepth;
588   // crate_Y defined previously (by desk spaci    585   // crate_Y defined previously (by desk spacing.......)
589   G4double crate_Z = 0.5*(crateHeight - labHei    586   G4double crate_Z = 0.5*(crateHeight - labHeight);
590                                                   587   
591   crate_phys = new G4PVPlacement                  588   crate_phys = new G4PVPlacement
592   (0, G4ThreeVector(crate_X, crate_Y, crate_Z)    589   (0, G4ThreeVector(crate_X, crate_Y, crate_Z), "crate_phys", 
593    crate_log, lab_phys, false, 0);                590    crate_log, lab_phys, false, 0);
594                                                   591 
595   G4VisAttributes* crate_vat= new G4VisAttribu    592   G4VisAttributes* crate_vat= new G4VisAttributes(grey);
596   crate_vat->SetVisibility(true);                 593   crate_vat->SetVisibility(true);
597   crate_vat->SetForceSolid(true);                 594   crate_vat->SetForceSolid(true);
598   crate_log->SetVisAttributes(crate_vat);         595   crate_log->SetVisAttributes(crate_vat);
599                                                   596 
600 // clean room desks: *************************    597 // clean room desks: ****************************************************
601                                                   598 
602 // first oblong desk (type "3"):                  599 // first oblong desk (type "3"):
603   desk_X = -0.5*(labWidth - desk3Width) + 50.0    600   desk_X = -0.5*(labWidth - desk3Width) + 50.0*cm;
604   desk_Y = 0.5*(labLength - desk3Width - 30.0*    601   desk_Y = 0.5*(labLength - desk3Width - 30.0*cm);
605   desk_Z = 0.5*(desk4Height - labHeight);         602   desk_Z = 0.5*(desk4Height - labHeight);
606                                                   603   
607   G4RotationMatrix rotMatrixCleanDesk;            604   G4RotationMatrix rotMatrixCleanDesk;
608   rotMatrixCleanDesk.rotateZ(90.0*deg);           605   rotMatrixCleanDesk.rotateZ(90.0*deg);
609                                                   606 
610   desk3_phys = new G4PVPlacement                  607   desk3_phys = new G4PVPlacement
611     (G4Transform3D                                608     (G4Transform3D
612      (rotMatrixCleanDesk,G4ThreeVector(desk_X,    609      (rotMatrixCleanDesk,G4ThreeVector(desk_X, desk_Y, desk_Z)), 
613       "desk3_phys", desk3_log, lab_phys, false    610       "desk3_phys", desk3_log, lab_phys, false, 1);
614                                                   611 
615 // square desk (type "4"):                        612 // square desk (type "4"):
616                                                   613 
617   desk_X += 0.5*desk3Width + 0.5*desk4Width; /    614   desk_X += 0.5*desk3Width + 0.5*desk4Width; // rotated hence Width
618                                                   615 
619   rotMatrixCleanDesk.rotateZ(-180.0*deg);         616   rotMatrixCleanDesk.rotateZ(-180.0*deg);
620   desk4_phys = new G4PVPlacement                  617   desk4_phys = new G4PVPlacement
621     (G4Transform3D                                618     (G4Transform3D
622   (rotMatrixCleanDesk, G4ThreeVector(desk_X, d    619   (rotMatrixCleanDesk, G4ThreeVector(desk_X, desk_Y, desk_Z)), 
623    "desk4_phys", desk4_log, lab_phys, false, 3    620    "desk4_phys", desk4_log, lab_phys, false, 3);
624                                                   621 
625                                                   622 
626                                                   623