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 11.1)


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