Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // Author: Mathieu Fontaine 26 // Author: Mathieu Fontaine Rachid Mazini 27 // fontaine@lps.umontreal 27 // fontaine@lps.umontreal.ca Rachid.Mazini@cern.ch 28 // Language: C++ 28 // Language: C++ 29 // Tested on: g++ 29 // Tested on: g++ 30 // Prerequisites: None 30 // Prerequisites: None 31 // Purpose: Header file for FCALFr 31 // Purpose: Header file for FCALFrontVolume.cc, which defines 32 // the volumes in the te 32 // the volumes in the testbeam front. 33 // Developped: 10-March-2000 M.F. 33 // Developped: 10-March-2000 M.F. 34 // 34 // 35 //-------------------------------------------- 35 //---------------------------------------------------------------------------- 36 36 37 37 38 #include "FCALTestbeamSetup.hh" 38 #include "FCALTestbeamSetup.hh" 39 #include "FCALTestbeamSetupSD.hh" 39 #include "FCALTestbeamSetupSD.hh" 40 40 41 #include "FCALMaterialConsultant.hh" 41 #include "FCALMaterialConsultant.hh" 42 #include "FCALCryostatVolumes.hh" 42 #include "FCALCryostatVolumes.hh" 43 43 44 #include "FCALTestbeamSetupSD.hh" 44 #include "FCALTestbeamSetupSD.hh" 45 45 46 #include "G4PhysicalConstants.hh" 46 #include "G4PhysicalConstants.hh" 47 #include "G4SystemOfUnits.hh" 47 #include "G4SystemOfUnits.hh" 48 #include "G4Box.hh" 48 #include "G4Box.hh" 49 #include "G4Tubs.hh" 49 #include "G4Tubs.hh" 50 #include "G4SubtractionSolid.hh" 50 #include "G4SubtractionSolid.hh" 51 #include "G4Material.hh" 51 #include "G4Material.hh" 52 #include "G4LogicalVolume.hh" 52 #include "G4LogicalVolume.hh" 53 #include "G4VPhysicalVolume.hh" 53 #include "G4VPhysicalVolume.hh" 54 #include "G4PVPlacement.hh" 54 #include "G4PVPlacement.hh" 55 #include "G4ThreeVector.hh" 55 #include "G4ThreeVector.hh" 56 #include "G4RotationMatrix.hh" 56 #include "G4RotationMatrix.hh" 57 57 58 #include "G4SDManager.hh" 58 #include "G4SDManager.hh" 59 #include "G4RunManager.hh" 59 #include "G4RunManager.hh" 60 60 61 #include "G4VisAttributes.hh" 61 #include "G4VisAttributes.hh" 62 #include "G4Colour.hh" 62 #include "G4Colour.hh" 63 63 64 #include "G4ios.hh" 64 #include "G4ios.hh" 65 #include "G4Threading.hh" 65 #include "G4Threading.hh" 66 66 67 FCALTestbeamSetup::FCALTestbeamSetup() { 67 FCALTestbeamSetup::FCALTestbeamSetup() { 68 #include "FCALTestbeamSetupParameters.input" 68 #include "FCALTestbeamSetupParameters.input" 69 } 69 } 70 70 71 FCALTestbeamSetup::~FCALTestbeamSetup() {} 71 FCALTestbeamSetup::~FCALTestbeamSetup() {} 72 72 73 G4VPhysicalVolume * FCALTestbeamSetup::Constru 73 G4VPhysicalVolume * FCALTestbeamSetup::Construct() 74 { 74 { 75 G4int i=0; 75 G4int i=0; 76 76 77 //----------------------------- 77 //----------------------------- 78 // construction of materials 78 // construction of materials 79 //----------------------------- 79 //----------------------------- 80 G4cout << "Constructing materials..."; 80 G4cout << "Constructing materials..."; 81 FCALMaterialConsultant* 81 FCALMaterialConsultant* 82 FCALMaterials = FCALMaterialConsultant::Ge 82 FCALMaterials = FCALMaterialConsultant::GetInstance(); 83 G4cout << "... done" << G4endl; 83 G4cout << "... done" << G4endl; 84 84 85 //------------------- 85 //------------------- 86 // Experimental Hall 86 // Experimental Hall 87 //------------------- 87 //------------------- 88 G4Box * SolidMother = new G4Box("Mother",Mot 88 G4Box * SolidMother = new G4Box("Mother",MotherSizeX,MotherSizeY,MotherSizeZ); 89 G4LogicalVolume * LogicalMother = 89 G4LogicalVolume * LogicalMother = 90 new G4LogicalVolume(SolidMother,FCALMateri 90 new G4LogicalVolume(SolidMother,FCALMaterials->Material("Air"),"Mother"); 91 G4VPhysicalVolume * PhysicalMother = 91 G4VPhysicalVolume * PhysicalMother = 92 new G4PVPlacement(0, G4ThreeVector(),"Moth 92 new G4PVPlacement(0, G4ThreeVector(),"Mother", LogicalMother, NULL, 0,0); 93 93 94 LogicalMother->SetVisAttributes(G4VisAttribu 94 LogicalMother->SetVisAttributes(G4VisAttributes::GetInvisible()); 95 95 96 96 97 //------------------------------- 97 //------------------------------- 98 // Scintillators S1, S2 and S3 98 // Scintillators S1, S2 and S3 99 //------------------------------- 99 //------------------------------- 100 G4Box * SolidScintS1andS3 = 100 G4Box * SolidScintS1andS3 = 101 new G4Box("ScintS1andS3Solid",ScintS1andS3 101 new G4Box("ScintS1andS3Solid",ScintS1andS3SizeX, ScintS1andS3SizeY, ScintS1andS3SizeZ); 102 G4Box * SolidScintS2 = 102 G4Box * SolidScintS2 = 103 new G4Box("ScintS2Solid", ScintS2SizeX, Sc 103 new G4Box("ScintS2Solid", ScintS2SizeX, ScintS2SizeY, ScintS2SizeZ); 104 104 105 G4LogicalVolume * LogicalScintS1andS3 = 105 G4LogicalVolume * LogicalScintS1andS3 = 106 new G4LogicalVolume(SolidScintS1andS3,FCAL 106 new G4LogicalVolume(SolidScintS1andS3,FCALMaterials->Material("Polystyrene"), 107 "ScintS1andS3Logical"); 107 "ScintS1andS3Logical"); 108 G4LogicalVolume * LogicalScintS2 = 108 G4LogicalVolume * LogicalScintS2 = 109 new G4LogicalVolume(SolidScintS2, FCALMate 109 new G4LogicalVolume(SolidScintS2, FCALMaterials->Material("Polystyrene"), 110 "ScintS2Logical"); 110 "ScintS2Logical"); 111 111 112 // G4VPhysicalVolume * PhysicalScintS1 = 112 // G4VPhysicalVolume * PhysicalScintS1 = 113 new G4PVPlacement(0, G4ThreeVector(ScintS1 113 new G4PVPlacement(0, G4ThreeVector(ScintS1_S3PosX, ScintS1_S3PosY, ScintS1PosZ), 114 "ScintS1Physical",LogicalScintS1an 114 "ScintS1Physical",LogicalScintS1andS3,PhysicalMother,0,0); 115 // G4VPhysicalVolume * PhysicalScintS3 = 115 // G4VPhysicalVolume * PhysicalScintS3 = 116 new G4PVPlacement(0, G4ThreeVector(ScintS1 116 new G4PVPlacement(0, G4ThreeVector(ScintS1_S3PosX, ScintS1_S3PosY, ScintS3PosZ), 117 "ScintS3Physical",LogicalScintS1an 117 "ScintS3Physical",LogicalScintS1andS3,PhysicalMother,0,0); 118 // G4VPhysicalVolume * PhysicalScintS2 = 118 // G4VPhysicalVolume * PhysicalScintS2 = 119 new G4PVPlacement(0, G4ThreeVector(ScintS1 119 new G4PVPlacement(0, G4ThreeVector(ScintS1_S3PosX, ScintS1_S3PosY, ScintS2PosZ), 120 "ScintS2Physical", LogicalScintS2, P 120 "ScintS2Physical", LogicalScintS2, PhysicalMother,0,0); 121 121 122 G4VisAttributes * ColorOfScintillator = new 122 G4VisAttributes * ColorOfScintillator = new G4VisAttributes(G4Colour(0.,0.8,0.)); 123 LogicalScintS1andS3->SetVisAttributes(ColorO 123 LogicalScintS1andS3->SetVisAttributes(ColorOfScintillator); 124 LogicalScintS2->SetVisAttributes(ColorOfScin 124 LogicalScintS2->SetVisAttributes(ColorOfScintillator); 125 125 126 126 127 //------------------- 127 //------------------- 128 // MWPC's 128 // MWPC's 129 //------------------- 129 //------------------- 130 G4Box* SolidMWPC = new G4Box("MWPCSolid",MWP 130 G4Box* SolidMWPC = new G4Box("MWPCSolid",MWPCSizeX,MWPCSizeY,MWPCSizeZ); 131 G4LogicalVolume * LogicalMWPC = 131 G4LogicalVolume * LogicalMWPC = 132 new G4LogicalVolume(SolidMWPC,FCALMaterial 132 new G4LogicalVolume(SolidMWPC,FCALMaterials->Material("MWPCArCO2"),"MWPCLogical"); 133 for(i=0; i<5; i++) 133 for(i=0; i<5; i++) 134 { 134 { 135 // G4VPhysicalVolume * PhysicalMWPC = 135 // G4VPhysicalVolume * PhysicalMWPC = 136 new G4PVPlacement(0,G4ThreeVector(MWPCPosX,M 136 new G4PVPlacement(0,G4ThreeVector(MWPCPosX,MWPCPosY,MWPCPosZ[i]), 137 "MWPCPhysical", LogicalMWPC, PhysicalM 137 "MWPCPhysical", LogicalMWPC, PhysicalMother,0,i+1); 138 } 138 } 139 G4VisAttributes * ColorOfMWPC = new G4VisAtt 139 G4VisAttributes * ColorOfMWPC = new G4VisAttributes(G4Colour(0.,0.,0.5)); 140 LogicalMWPC->SetVisAttributes(ColorOfMWPC); 140 LogicalMWPC->SetVisAttributes(ColorOfMWPC); 141 141 142 //--------------------------------------- 142 //--------------------------------------- 143 // Hole Counter (scintillator + Pb + Al 143 // Hole Counter (scintillator + Pb + Al 144 //--------------------------------------- 144 //--------------------------------------- 145 // Scintillator Counter 145 // Scintillator Counter 146 G4Box * SolidHoleCntrScint = 146 G4Box * SolidHoleCntrScint = 147 new G4Box("ScintSolid", HoleCntrSizeX, Hol 147 new G4Box("ScintSolid", HoleCntrSizeX, HoleCntrSizeY, HoleCntrScintSizeZ); 148 G4LogicalVolume * LogicalHoleCntrScint = 148 G4LogicalVolume * LogicalHoleCntrScint = 149 new G4LogicalVolume(SolidHoleCntrScint, FC 149 new G4LogicalVolume(SolidHoleCntrScint, FCALMaterials->Material("Polystyrene"), 150 "HoleCntrScintLogical"); 150 "HoleCntrScintLogical"); 151 // Hole in scintillator Counter 151 // Hole in scintillator Counter 152 G4Tubs * SolidHole = 152 G4Tubs * SolidHole = 153 new G4Tubs("HoleSolid", ScintHoleRmin, Sci 153 new G4Tubs("HoleSolid", ScintHoleRmin, ScintHoleRmax, ScintHoleLenght, 154 HoleStartPhi, HoleDPhi); 154 HoleStartPhi, HoleDPhi); 155 G4LogicalVolume * LogicalHole = 155 G4LogicalVolume * LogicalHole = 156 new G4LogicalVolume(SolidHole, FCALMateria 156 new G4LogicalVolume(SolidHole, FCALMaterials->Material("Air"), "HoleLogical"); 157 // G4VPhysicalVolume * PhysicalHoleScint = 157 // G4VPhysicalVolume * PhysicalHoleScint = 158 new G4PVPlacement(0, G4ThreeVector(HolePos 158 new G4PVPlacement(0, G4ThreeVector(HolePosX, HolePosY, HolePosZ), LogicalHole, 159 "HolePhysicalScint", LogicalHoleCntr 159 "HolePhysicalScint", LogicalHoleCntrScint, 0, 0); 160 // Scintillator Hole counter placement 160 // Scintillator Hole counter placement 161 // G4VPhysicalVolume * PhysicalHoleCntrScint 161 // G4VPhysicalVolume * PhysicalHoleCntrScint = 162 new G4PVPlacement(0, 162 new G4PVPlacement(0, 163 G4ThreeVector(HoleCntrScintPosX, H 163 G4ThreeVector(HoleCntrScintPosX, HoleCntrScintPosY, HoleCntrScintPosZ), 164 "HoleCntrScintPhysical", LogicalHo 164 "HoleCntrScintPhysical", LogicalHoleCntrScint, PhysicalMother, 0, 0); 165 165 166 // Absorber Lead 166 // Absorber Lead 167 G4Box * SolidHoleCntrAbsrb = 167 G4Box * SolidHoleCntrAbsrb = 168 new G4Box("AbsrbSolid", HoleCntrSizeX, Hol 168 new G4Box("AbsrbSolid", HoleCntrSizeX, HoleCntrSizeY, HoleCntrAbsrbSizeZ); 169 G4LogicalVolume * LogicalHoleCntrPb = 169 G4LogicalVolume * LogicalHoleCntrPb = 170 new G4LogicalVolume(SolidHoleCntrAbsrb, FC 170 new G4LogicalVolume(SolidHoleCntrAbsrb, FCALMaterials->Material("Lead"), 171 "HoleCntrPbLoghical"); 171 "HoleCntrPbLoghical"); 172 172 173 //hole in ABsorber, both Lead and Al. 173 //hole in ABsorber, both Lead and Al. 174 G4Tubs * SolidHoleAbs = 174 G4Tubs * SolidHoleAbs = 175 new G4Tubs("HoleSolidAbs", AbsrbHoleRmin, 175 new G4Tubs("HoleSolidAbs", AbsrbHoleRmin, AbsrbHoleRmax, AbsrbHoleLenght, 176 HoleStartPhi, HoleDPhi); 176 HoleStartPhi, HoleDPhi); 177 G4LogicalVolume * LogicalHoleAbs = 177 G4LogicalVolume * LogicalHoleAbs = 178 new G4LogicalVolume(SolidHoleAbs, FCALMate 178 new G4LogicalVolume(SolidHoleAbs, FCALMaterials->Material("Air"),"HoleAbsLogical"); 179 // G4VPhysicalVolume * PhysicalHolePb = 179 // G4VPhysicalVolume * PhysicalHolePb = 180 new G4PVPlacement(0, G4ThreeVector(HolePos 180 new G4PVPlacement(0, G4ThreeVector(HolePosX, HolePosY, HolePosZ), LogicalHoleAbs, 181 "HolePbPhysical", LogicalHoleCntrPb, 181 "HolePbPhysical", LogicalHoleCntrPb, 0, 0); 182 182 183 // Lead Placement 183 // Lead Placement 184 // G4VPhysicalVolume * PhysicalHoleCntrPb = 184 // G4VPhysicalVolume * PhysicalHoleCntrPb = 185 new G4PVPlacement(0, G4ThreeVector(HoleCnt 185 new G4PVPlacement(0, G4ThreeVector(HoleCntrPbPosX, HoleCntrPbPosY, HoleCntrPbPosZ), 186 "HoleCntrPbPhysical", LogicalHoleCnt 186 "HoleCntrPbPhysical", LogicalHoleCntrPb, PhysicalMother, 0, 0); 187 187 188 // Absorber Al. 188 // Absorber Al. 189 G4LogicalVolume * LogicalHoleCntrAl = 189 G4LogicalVolume * LogicalHoleCntrAl = 190 new G4LogicalVolume(SolidHoleCntrAbsrb, F 190 new G4LogicalVolume(SolidHoleCntrAbsrb, FCALMaterials->Material("Aluminium"), 191 "HoleCntrAlLogical"); 191 "HoleCntrAlLogical"); 192 // G4VPhysicalVolume * PhysicalHoleAl = 192 // G4VPhysicalVolume * PhysicalHoleAl = 193 new G4PVPlacement(0, G4ThreeVector(HolePos 193 new G4PVPlacement(0, G4ThreeVector(HolePosX, HolePosY, HolePosZ), LogicalHoleAbs, 194 "HoleAlPhysical", LogicalHoleCntrAl, 194 "HoleAlPhysical", LogicalHoleCntrAl, 0, 0); 195 // G4VPhysicalVolume * PhysicalHoleCntrAl = 195 // G4VPhysicalVolume * PhysicalHoleCntrAl = 196 new G4PVPlacement(0, G4ThreeVector(HoleCnt 196 new G4PVPlacement(0, G4ThreeVector(HoleCntrAlPosX, HoleCntrAlPosY, HoleCntrAlPosZ), 197 "HoleCntrAlPhysical", LogicalHoleCnt 197 "HoleCntrAlPhysical", LogicalHoleCntrAl, PhysicalMother, 0, 0); 198 198 199 LogicalHoleCntrScint->SetVisAttributes(Colo 199 LogicalHoleCntrScint->SetVisAttributes(ColorOfScintillator); 200 200 201 G4VisAttributes * ColorOfLead = new G4VisAt 201 G4VisAttributes * ColorOfLead = new G4VisAttributes(G4Colour(0.5,0.5,0.8)); 202 G4VisAttributes * ColorOfAlu = new G4VisAtt 202 G4VisAttributes * ColorOfAlu = new G4VisAttributes(G4Colour(0.5,0.5,0.3)); 203 LogicalHoleCntrPb->SetVisAttributes(ColorOf 203 LogicalHoleCntrPb->SetVisAttributes(ColorOfLead); 204 LogicalHoleCntrAl->SetVisAttributes(ColorOf 204 LogicalHoleCntrAl->SetVisAttributes(ColorOfAlu); 205 205 206 G4VisAttributes * ColorOfAir = new G4VisAtt 206 G4VisAttributes * ColorOfAir = new G4VisAttributes(G4Colour(1.,1.,1.)); 207 LogicalHole->SetVisAttributes(ColorOfAir); 207 LogicalHole->SetVisAttributes(ColorOfAir); 208 LogicalHoleAbs->SetVisAttributes(ColorOfAir 208 LogicalHoleAbs->SetVisAttributes(ColorOfAir); 209 209 210 210 211 //------------------- 211 //------------------- 212 // Lead Wall 212 // Lead Wall 213 //------------------- 213 //------------------- 214 G4Box * SolidLeadWall = 214 G4Box * SolidLeadWall = 215 new G4Box("LeadWallSolid", LeadWallSizeX, 215 new G4Box("LeadWallSolid", LeadWallSizeX, LeadWallSizeY, LeadWallSizeZ); 216 G4LogicalVolume * LogicalLeadWall = 216 G4LogicalVolume * LogicalLeadWall = 217 new G4LogicalVolume(SolidLeadWall, FCALMa 217 new G4LogicalVolume(SolidLeadWall, FCALMaterials->Material("Lead"), 218 "LeadWallLogical"); 218 "LeadWallLogical"); 219 219 220 G4Box * SolidSlitPb = new G4Box("SlitPb", L 220 G4Box * SolidSlitPb = new G4Box("SlitPb", LeadWallSlitSizeX, LeadWallSlitSizeY, 221 LeadWallSlitSizeZ); 221 LeadWallSlitSizeZ); 222 G4LogicalVolume * LogicalSlitPb = 222 G4LogicalVolume * LogicalSlitPb = 223 new G4LogicalVolume(SolidSlitPb, FCALMate 223 new G4LogicalVolume(SolidSlitPb, FCALMaterials->Material("Air"), "SlitPbLogical"); 224 // G4VPhysicalVolume * PhysicalSlitPb = 224 // G4VPhysicalVolume * PhysicalSlitPb = 225 new G4PVPlacement(0, G4ThreeVector(), Log 225 new G4PVPlacement(0, G4ThreeVector(), LogicalSlitPb, "SlitPbPhysical", LogicalLeadWall, 0, 0); 226 226 227 // G4VPhysicalVolume * PhysicalLeadWall = 227 // G4VPhysicalVolume * PhysicalLeadWall = 228 new G4PVPlacement(0, G4ThreeVector(LeadWa 228 new G4PVPlacement(0, G4ThreeVector(LeadWallPosX,LeadWallPosY,LeadWallPosZ), 229 "LeadWallPhysical", LogicalLeadWall 229 "LeadWallPhysical", LogicalLeadWall, PhysicalMother, 0, 0); 230 230 231 LogicalLeadWall->SetVisAttributes(ColorOfLe 231 LogicalLeadWall->SetVisAttributes(ColorOfLead); 232 LogicalSlitPb->SetVisAttributes(ColorOfAir) 232 LogicalSlitPb->SetVisAttributes(ColorOfAir); 233 233 234 234 235 //------------------- 235 //------------------- 236 // Iron Wall 236 // Iron Wall 237 //------------------- 237 //------------------- 238 G4Box * SolidIronWall = 238 G4Box * SolidIronWall = 239 new G4Box("IronWallSolid", IronWallSizeX, 239 new G4Box("IronWallSolid", IronWallSizeX, IronWallSizeY, IronWallSizeZ); 240 G4LogicalVolume * LogicalIronWall = 240 G4LogicalVolume * LogicalIronWall = 241 new G4LogicalVolume(SolidIronWall, FCALMa 241 new G4LogicalVolume(SolidIronWall, FCALMaterials->Material("Iron"), 242 "IronWallLogical"); 242 "IronWallLogical"); 243 243 244 G4Box * SolidSlitFe = new G4Box("SlitFe", I 244 G4Box * SolidSlitFe = new G4Box("SlitFe", IronWallSlitSizeX, IronWallSlitSizeY, 245 IronWallSlitSizeZ); 245 IronWallSlitSizeZ); 246 G4LogicalVolume * LogicalSlitFe = 246 G4LogicalVolume * LogicalSlitFe = 247 new G4LogicalVolume(SolidSlitFe, FCALMate 247 new G4LogicalVolume(SolidSlitFe, FCALMaterials->Material("Air"), "SlitFeLogical"); 248 // G4VPhysicalVolume * PhysicalSlitFe = 248 // G4VPhysicalVolume * PhysicalSlitFe = 249 new G4PVPlacement(0, G4ThreeVector(), Log 249 new G4PVPlacement(0, G4ThreeVector(), LogicalSlitFe, "SlitFePhysical", LogicalIronWall, 0, 0); 250 250 251 // G4VPhysicalVolume * PhysicalIronWall = 251 // G4VPhysicalVolume * PhysicalIronWall = 252 new G4PVPlacement(0, G4ThreeVector(IronWa 252 new G4PVPlacement(0, G4ThreeVector(IronWallPosX,IronWallPosY,IronWallPosZ), 253 "IronWallPhysical", LogicalIronWall 253 "IronWallPhysical", LogicalIronWall, PhysicalMother, 0, 0); 254 254 255 G4VisAttributes * ColorOfIron = new G4VisAt 255 G4VisAttributes * ColorOfIron = new G4VisAttributes(G4Colour(0.2,0.2,0.2)); 256 LogicalIronWall->SetVisAttributes(ColorOfIr 256 LogicalIronWall->SetVisAttributes(ColorOfIron); 257 LogicalSlitFe->SetVisAttributes(ColorOfAir) 257 LogicalSlitFe->SetVisAttributes(ColorOfAir); 258 258 259 //---------------- 259 //---------------- 260 // Tail Catcher 260 // Tail Catcher 261 //---------------- 261 //---------------- 262 G4Box * SolidBigScint = 262 G4Box * SolidBigScint = 263 new G4Box("BigSolidScint",BigScintSizeX, 263 new G4Box("BigSolidScint",BigScintSizeX, BigScintSizeY, ScintSizeZ); 264 G4LogicalVolume * LogicalBigScint = 264 G4LogicalVolume * LogicalBigScint = 265 new G4LogicalVolume(SolidBigScint, FCALM 265 new G4LogicalVolume(SolidBigScint, FCALMaterials->Material("Polystyrene"), 266 "BigScintLogical"); 266 "BigScintLogical"); 267 267 268 G4Box * SolidSmallScint = 268 G4Box * SolidSmallScint = 269 new G4Box("SmallSolidScint",SmallScintSiz 269 new G4Box("SmallSolidScint",SmallScintSizeX, SmallScintSizeY, ScintSizeZ); 270 G4LogicalVolume * LogicalSmallScint = 270 G4LogicalVolume * LogicalSmallScint = 271 new G4LogicalVolume(SolidSmallScint, FCA 271 new G4LogicalVolume(SolidSmallScint, FCALMaterials->Material("Polystyrene"), 272 "SmallScintLogical"); 272 "SmallScintLogical"); 273 273 274 for( i=0; i<(NBigScint+NSmallScint); i++) 274 for( i=0; i<(NBigScint+NSmallScint); i++) 275 { 275 { 276 if(i<NBigScint) 276 if(i<NBigScint) 277 { // G4VPhysicalVolume * PhysicalBigScint = 277 { // G4VPhysicalVolume * PhysicalBigScint = 278 new G4PVPlacement(0, G4ThreeVector(Scin 278 new G4PVPlacement(0, G4ThreeVector(ScintPosX, ScintPosY, ScintPosZ[i]), 279 "BigScintPhysical", LogicalBigSci 279 "BigScintPhysical", LogicalBigScint, PhysicalMother, 280 0, i+1); 280 0, i+1); 281 } 281 } 282 else 282 else 283 { // G4VPhysicalVolume * PhysicalSmallScint 283 { // G4VPhysicalVolume * PhysicalSmallScint = 284 new G4PVPlacement(0, G4ThreeVector(Scin 284 new G4PVPlacement(0, G4ThreeVector(ScintPosX, ScintPosY, ScintPosZ[i]), 285 "SmallScintPhysical", LogicalSmal 285 "SmallScintPhysical", LogicalSmallScint, PhysicalMother, 286 0, i+1); 286 0, i+1); 287 } 287 } 288 } 288 } 289 LogicalBigScint->SetVisAttributes(ColorOfSc 289 LogicalBigScint->SetVisAttributes(ColorOfScintillator); 290 LogicalSmallScint->SetVisAttributes(ColorOf 290 LogicalSmallScint->SetVisAttributes(ColorOfScintillator); 291 291 292 292 293 G4Box * SolidBigIron = 293 G4Box * SolidBigIron = 294 new G4Box("BigSolidIron",BigIronSizeX, Bi 294 new G4Box("BigSolidIron",BigIronSizeX, BigIronSizeY, IronSizeZ); 295 G4LogicalVolume * LogicalBigIron = 295 G4LogicalVolume * LogicalBigIron = 296 new G4LogicalVolume(SolidBigIron, FCALMa 296 new G4LogicalVolume(SolidBigIron, FCALMaterials->Material("Polystyrene"), 297 "BigIronLogical"); 297 "BigIronLogical"); 298 298 299 G4Box * SolidSmallIron = 299 G4Box * SolidSmallIron = 300 new G4Box("SmallSolidIron",SmallIronSizeX 300 new G4Box("SmallSolidIron",SmallIronSizeX, SmallIronSizeY, IronSizeZ); 301 G4LogicalVolume * LogicalSmallIron = 301 G4LogicalVolume * LogicalSmallIron = 302 new G4LogicalVolume(SolidSmallIron, FCAL 302 new G4LogicalVolume(SolidSmallIron, FCALMaterials->Material("Iron"), 303 "SmallIronLogical"); 303 "SmallIronLogical"); 304 304 305 for( i=0; i<(NBigIron+NSmallIron); i++) 305 for( i=0; i<(NBigIron+NSmallIron); i++) 306 { 306 { 307 if(i<NBigIron) 307 if(i<NBigIron) 308 { // G4VPhysicalVolume * PhysicalBigIron = 308 { // G4VPhysicalVolume * PhysicalBigIron = 309 new G4PVPlacement(0, G4ThreeVector(Iron 309 new G4PVPlacement(0, G4ThreeVector(IronPosX, IronPosY, IronPosZ[i]), 310 "BigIronPhysical", LogicalBigIron 310 "BigIronPhysical", LogicalBigIron, PhysicalMother, 311 0, i+1); 311 0, i+1); 312 } 312 } 313 else 313 else 314 { // G4VPhysicalVolume * PhysicalSmallIron 314 { // G4VPhysicalVolume * PhysicalSmallIron = 315 new G4PVPlacement(0, G4ThreeVector(Iron 315 new G4PVPlacement(0, G4ThreeVector(IronPosX, IronPosY, IronPosZ[i]), 316 "SmallIronPhysical", LogicalSmall 316 "SmallIronPhysical", LogicalSmallIron, PhysicalMother, 317 0, i+1); 317 0, i+1); 318 } 318 } 319 } 319 } 320 LogicalBigIron->SetVisAttributes(ColorOfIro 320 LogicalBigIron->SetVisAttributes(ColorOfIron); 321 LogicalSmallIron->SetVisAttributes(ColorOfI 321 LogicalSmallIron->SetVisAttributes(ColorOfIron); 322 322 323 //------------------------- 323 //------------------------- 324 // Concrete Walls A and B 324 // Concrete Walls A and B 325 //------------------------- 325 //------------------------- 326 G4Box * SolidConcWall = 326 G4Box * SolidConcWall = 327 new G4Box("ConcWallSolid", ConcWallSizeX, 327 new G4Box("ConcWallSolid", ConcWallSizeX, ConcWallSizeY, ConcWallSizeZ); 328 G4LogicalVolume * LogicalConcWallA = 328 G4LogicalVolume * LogicalConcWallA = 329 new G4LogicalVolume(SolidConcWall, FCALMa 329 new G4LogicalVolume(SolidConcWall, FCALMaterials->Material("ShieldingConcrete"), 330 "ConcWallALogical"); 330 "ConcWallALogical"); 331 G4VPhysicalVolume * PhysicalConcWallA = 331 G4VPhysicalVolume * PhysicalConcWallA = 332 new G4PVPlacement(0, G4ThreeVector(ConcWa 332 new G4PVPlacement(0, G4ThreeVector(ConcWallPosX, ConcWallPosY, ConcWallAPosZ), 333 "ConcWallAPhysical", LogicalConcWal 333 "ConcWallAPhysical", LogicalConcWallA, PhysicalMother, 0, 0); 334 334 335 G4LogicalVolume * LogicalConcWallB = 335 G4LogicalVolume * LogicalConcWallB = 336 new G4LogicalVolume(SolidConcWall, FCALMa 336 new G4LogicalVolume(SolidConcWall, FCALMaterials->Material("ShieldingConcrete"), 337 "ConcWallBLogical"); 337 "ConcWallBLogical"); 338 // G4VPhysicalVolume * PhysicalConcWallB = 338 // G4VPhysicalVolume * PhysicalConcWallB = 339 new G4PVPlacement(0, G4ThreeVector(ConcWa 339 new G4PVPlacement(0, G4ThreeVector(ConcWallPosX, ConcWallPosY, ConcWallBPosZ), 340 "ConcWallBPhysical", LogicalConcWal 340 "ConcWallBPhysical", LogicalConcWallB, PhysicalMother, 0, 0); 341 341 342 G4Box * SolidConcWallIns = 342 G4Box * SolidConcWallIns = 343 new G4Box("ConcWallInsSolid", ConcWallIns 343 new G4Box("ConcWallInsSolid", ConcWallInsSizeX,ConcWallInsSizeY,ConcWallInsSizeZ); 344 G4LogicalVolume * LogicalConcWallIns = 344 G4LogicalVolume * LogicalConcWallIns = 345 new G4LogicalVolume(SolidConcWallIns, FC 345 new G4LogicalVolume(SolidConcWallIns, FCALMaterials->Material("Iron"), 346 "LogicalConcWallIns"); 346 "LogicalConcWallIns"); 347 // G4VPhysicalVolume * PhysicalConcWallIns 347 // G4VPhysicalVolume * PhysicalConcWallIns = 348 new G4PVPlacement(0, G4ThreeVector(), "C 348 new G4PVPlacement(0, G4ThreeVector(), "ConcWallInsPhysical", LogicalConcWallIns, PhysicalConcWallA, 0, 0); 349 349 350 G4VisAttributes * ColorOfConcrete = new G4V 350 G4VisAttributes * ColorOfConcrete = new G4VisAttributes(G4Colour(0.,0.,0.)); 351 LogicalConcWallA->SetVisAttributes(ColorOfC 351 LogicalConcWallA->SetVisAttributes(ColorOfConcrete); 352 LogicalConcWallB->SetVisAttributes(ColorOfC 352 LogicalConcWallB->SetVisAttributes(ColorOfConcrete); 353 LogicalConcWallIns->SetVisAttributes(ColorO 353 LogicalConcWallIns->SetVisAttributes(ColorOfIron); 354 354 355 //------------------ 355 //------------------ 356 // Muon Counter 356 // Muon Counter 357 //------------------- 357 //------------------- 358 G4Box * SolidMuContr = 358 G4Box * SolidMuContr = 359 new G4Box("MuContrSolid", MuCntrSIzeX, Mu 359 new G4Box("MuContrSolid", MuCntrSIzeX, MuCntrSIzeY, MuCntrSIzeZ); 360 G4LogicalVolume * LogicalMuContr = 360 G4LogicalVolume * LogicalMuContr = 361 new G4LogicalVolume(SolidMuContr, FCALMat 361 new G4LogicalVolume(SolidMuContr, FCALMaterials->Material("Polystyrene"), 362 "MuContrLogical"); 362 "MuContrLogical"); 363 // G4VPhysicalVolume * PhysicalMuContr = 363 // G4VPhysicalVolume * PhysicalMuContr = 364 new G4PVPlacement(0, G4ThreeVector(MuCntr 364 new G4PVPlacement(0, G4ThreeVector(MuCntrPosX, MuCntrPosY, MuCntrPosZ), 365 "MuContrPhyiscal", LogicalMuContr, 365 "MuContrPhyiscal", LogicalMuContr, PhysicalMother, 0, 0); 366 366 367 LogicalMuContr->SetVisAttributes(ColorOfSci 367 LogicalMuContr->SetVisAttributes(ColorOfScintillator); 368 368 369 //----------------- 369 //----------------- 370 // cryostat 370 // cryostat 371 //----------------- 371 //----------------- 372 372 373 373 374 G4RotationMatrix* CryostatRotationMatrix = 374 G4RotationMatrix* CryostatRotationMatrix = 375 new G4RotationMatrix(); 375 new G4RotationMatrix(); 376 376 377 // new G4RotationMatrix(1.,0.,0.,0.,0.,-1 377 // new G4RotationMatrix(1.,0.,0.,0.,0.,-1.,0.,1.,0.); 378 378 379 // Theta(...) 90.0000 180.0000 90.000 379 // Theta(...) 90.0000 180.0000 90.0000 380 // Phi(...) 0.0000 0.0000 90.000 380 // Phi(...) 0.0000 0.0000 90.0000 381 // 381 // 382 // Matrix(...) | 1.0000 0.0000 0.0000 | 382 // Matrix(...) | 1.0000 0.0000 0.0000 | 383 // | 0.0000 0.0000 -1.0000 | 383 // | 0.0000 0.0000 -1.0000 | 384 // | 0.0000 1.0000 0.0000 | 384 // | 0.0000 1.0000 0.0000 | 385 // 385 // 386 // How to input? 386 // How to input? 387 387 388 CryostatRotationMatrix->rotateX(90*deg); 388 CryostatRotationMatrix->rotateX(90*deg); 389 389 390 FCALCryostatVolumes * CryostatVolumes = new 390 FCALCryostatVolumes * CryostatVolumes = new FCALCryostatVolumes(); 391 391 392 G4LogicalVolume * theCryostatVolumes = Cryos 392 G4LogicalVolume * theCryostatVolumes = CryostatVolumes->Construct(); 393 393 394 // G4VPhysicalVolume * PhysiCryostatVolumes 394 // G4VPhysicalVolume * PhysiCryostatVolumes = 395 new G4PVPlacement(CryostatRotationMatrix, 395 new G4PVPlacement(CryostatRotationMatrix, 396 G4ThreeVector(CryostatPosX,CryostatP 396 G4ThreeVector(CryostatPosX,CryostatPosY,CryostatPosZ),"CryostatVolumes" 397 , theCryostatVolumes, PhysicalMother 397 , theCryostatVolumes, PhysicalMother, 0,0); 398 398 399 399 400 return PhysicalMother; 400 return PhysicalMother; 401 401 402 } 402 } 403 403 404 void FCALTestbeamSetup::ConstructSDandField() 404 void FCALTestbeamSetup::ConstructSDandField() 405 { 405 { 406 //----------------------- 406 //----------------------- 407 // Senstive detectors 407 // Senstive detectors 408 //----------------------- 408 //----------------------- 409 G4SDManager* SDman = G4SDManager::GetSDMpo 409 G4SDManager* SDman = G4SDManager::GetSDMpointer(); 410 const G4String detName = "FCALTB/TBSetupSD 410 const G4String detName = "FCALTB/TBSetupSD"; 411 FCALTestbeamSetupSD* FCALTBSetupSD = stati 411 FCALTestbeamSetupSD* FCALTBSetupSD = static_cast<FCALTestbeamSetupSD*>(SDman->FindSensitiveDetector(detName)); 412 if(!FCALTBSetupSD) 412 if(!FCALTBSetupSD) 413 { 413 { 414 FCALTBSetupSD = new FCALTestbeamSetupS 414 FCALTBSetupSD = new FCALTestbeamSetupSD(detName); 415 SDman->AddNewDetector(FCALTBSetupSD); 415 SDman->AddNewDetector(FCALTBSetupSD); 416 } 416 } 417 SetSensitiveDetector("ScintS1andS3Logical" 417 SetSensitiveDetector("ScintS1andS3Logical",FCALTBSetupSD); 418 SetSensitiveDetector("ScintS2Logical",FCAL 418 SetSensitiveDetector("ScintS2Logical",FCALTBSetupSD); 419 SetSensitiveDetector("MWPCLogical",FCALTBS 419 SetSensitiveDetector("MWPCLogical",FCALTBSetupSD); 420 SetSensitiveDetector("HoleCntrScintLogical 420 SetSensitiveDetector("HoleCntrScintLogical",FCALTBSetupSD); 421 SetSensitiveDetector("HoleCntrPbLoghical", 421 SetSensitiveDetector("HoleCntrPbLoghical",FCALTBSetupSD); 422 SetSensitiveDetector("HoleCntrAlLogical",F 422 SetSensitiveDetector("HoleCntrAlLogical",FCALTBSetupSD); 423 423 424 SetSensitiveDetector("LeadWallLogical",FCA 424 SetSensitiveDetector("LeadWallLogical",FCALTBSetupSD); 425 SetSensitiveDetector("IronWallLogical",FCA 425 SetSensitiveDetector("IronWallLogical",FCALTBSetupSD); 426 SetSensitiveDetector("BigScintLogical",FCA 426 SetSensitiveDetector("BigScintLogical",FCALTBSetupSD); 427 SetSensitiveDetector("SmallScintLogical",F 427 SetSensitiveDetector("SmallScintLogical",FCALTBSetupSD); 428 428 429 SetSensitiveDetector("BigIronLogical",FCAL 429 SetSensitiveDetector("BigIronLogical",FCALTBSetupSD); 430 SetSensitiveDetector("SmallIronLogical",FC 430 SetSensitiveDetector("SmallIronLogical",FCALTBSetupSD); 431 SetSensitiveDetector("ConcWallALogical",FC 431 SetSensitiveDetector("ConcWallALogical",FCALTBSetupSD); 432 SetSensitiveDetector("ConcWallBLogical",FC 432 SetSensitiveDetector("ConcWallBLogical",FCALTBSetupSD); 433 SetSensitiveDetector("LogicalConcWallIns", 433 SetSensitiveDetector("LogicalConcWallIns",FCALTBSetupSD); 434 SetSensitiveDetector("MuContrLogical",FCAL 434 SetSensitiveDetector("MuContrLogical",FCALTBSetupSD); 435 } 435 } 436 436 437 437