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