[807] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // $Id: TiaraConcreteShieldB.cc,v 1.4 2006/06/29 15:44:45 gunter Exp $ |
---|
| 27 | // GEANT4 tag $Name: $ |
---|
| 28 | // |
---|
| 29 | |
---|
| 30 | #include "TiaraConcreteShieldB.hh" |
---|
| 31 | #include "TiaraDimensions.hh" |
---|
| 32 | #include "TiaraMaterials.hh" |
---|
| 33 | #include "G4Box.hh" |
---|
| 34 | #include "G4LogicalVolume.hh" |
---|
| 35 | #include "G4ThreeVector.hh" |
---|
| 36 | #include "G4VisAttributes.hh" |
---|
| 37 | #include "G4Colour.hh" |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | TiaraConcreteShieldB:: |
---|
| 41 | TiaraConcreteShieldB(TiaraMaterials &mfac, |
---|
| 42 | const TiaraDimensions &tiaraDimensions){ |
---|
| 43 | G4double halfHight((tiaraDimensions.distTargetEndB - |
---|
| 44 | tiaraDimensions.distTargetEndA) / 2); |
---|
| 45 | G4double radialHalf(0.5 * (tiaraDimensions.worldHalfWidth - |
---|
| 46 | tiaraDimensions.widthExperiment/2)); |
---|
| 47 | G4double lateralHalf(0.5 * (tiaraDimensions.widthExperiment/2 + |
---|
| 48 | tiaraDimensions.worldHalfWidth)); |
---|
| 49 | G4double radialShift(tiaraDimensions.widthExperiment/2 + radialHalf); |
---|
| 50 | G4double lateralShift(tiaraDimensions.worldHalfWidth - lateralHalf); |
---|
| 51 | |
---|
| 52 | G4Box *concretBbox = new G4Box("concretBbox", |
---|
| 53 | lateralHalf, |
---|
| 54 | radialHalf, |
---|
| 55 | halfHight); |
---|
| 56 | |
---|
| 57 | G4LogicalVolume *logConcreteBbox = |
---|
| 58 | new G4LogicalVolume(concretBbox, |
---|
| 59 | mfac.GetMaterial("concrete"), |
---|
| 60 | "ConcreteBbox"); |
---|
| 61 | |
---|
| 62 | G4VisAttributes* pConcreteAVis = new |
---|
| 63 | G4VisAttributes(G4Colour(0.5, 0.5, 0.5)); |
---|
| 64 | // pConcreteAVis->SetForceSolid(true); |
---|
| 65 | logConcreteBbox->SetVisAttributes(pConcreteAVis); |
---|
| 66 | |
---|
| 67 | TiaraPart tiaraPart; |
---|
| 68 | tiaraPart.rot = 0; |
---|
| 69 | tiaraPart.logVol = logConcreteBbox; |
---|
| 70 | tiaraPart.pos.setZ(tiaraDimensions.targetPosZ + |
---|
| 71 | tiaraDimensions.distTargetEndA + halfHight); |
---|
| 72 | |
---|
| 73 | // upper shield |
---|
| 74 | tiaraPart.pos.setX(lateralShift); |
---|
| 75 | tiaraPart.pos.setY(radialShift); |
---|
| 76 | fTiaraParts.push_back(tiaraPart); |
---|
| 77 | |
---|
| 78 | // lower shield |
---|
| 79 | tiaraPart.pos.setX(-1*lateralShift); |
---|
| 80 | tiaraPart.pos.setY(-1*radialShift); |
---|
| 81 | fTiaraParts.push_back(tiaraPart); |
---|
| 82 | |
---|
| 83 | // right shield |
---|
| 84 | tiaraPart.rot = new G4RotationMatrix(); |
---|
| 85 | tiaraPart.rot->set(G4ThreeVector(0, 0, 1), 90 * deg); |
---|
| 86 | tiaraPart.pos.setX(-1* radialShift); |
---|
| 87 | tiaraPart.pos.setY(lateralShift); |
---|
| 88 | fTiaraParts.push_back(tiaraPart); |
---|
| 89 | |
---|
| 90 | // left shield |
---|
| 91 | // tiaraPart.rot->set(G4ThreeVector(0, 0, 1), -90); |
---|
| 92 | tiaraPart.pos.setX(radialShift); |
---|
| 93 | tiaraPart.pos.setY(-1*lateralShift); |
---|
| 94 | fTiaraParts.push_back(tiaraPart); |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | } |
---|
| 98 | |
---|
| 99 | TiaraConcreteShieldB::~TiaraConcreteShieldB(){ |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | TiaraParts TiaraConcreteShieldB::GetParts(){ |
---|
| 103 | return fTiaraParts; |
---|
| 104 | } |
---|