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: TiaraIronShieldB.cc,v 1.4 2006/06/29 15:45:09 gunter Exp $ |
---|
27 | // GEANT4 tag $Name: $ |
---|
28 | // |
---|
29 | |
---|
30 | #include "TiaraIronShieldB.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 | #include "G4Tubs.hh" |
---|
39 | #include "G4PVPlacement.hh" |
---|
40 | |
---|
41 | /* |
---|
42 | TiaraIronShieldB:: |
---|
43 | TiaraIronShieldB(TiaraMaterials &mfac, |
---|
44 | const TiaraDimensions &tiaraDimensions){ |
---|
45 | G4double halfHight((tiaraDimensions.distTargetExperiment - |
---|
46 | tiaraDimensions.distTargetEndA) / 2); |
---|
47 | G4double radialHalf(0.5 * (tiaraDimensions.widthExperiment/2 - |
---|
48 | tiaraDimensions.pipeRadius)); |
---|
49 | G4double lateralHalf(0.5 * (tiaraDimensions.pipeRadius + |
---|
50 | tiaraDimensions.widthExperiment/2)); |
---|
51 | G4double radialShift(tiaraDimensions.pipeRadius + radialHalf); |
---|
52 | G4double lateralShift(tiaraDimensions.widthExperiment/2 - lateralHalf); |
---|
53 | |
---|
54 | G4Box *ironBbox = new G4Box("ironBbox", |
---|
55 | lateralHalf, |
---|
56 | radialHalf, |
---|
57 | halfHight); |
---|
58 | |
---|
59 | G4LogicalVolume *logIronBbox = |
---|
60 | new G4LogicalVolume(ironBbox, |
---|
61 | mfac.GetMaterial("iron"), |
---|
62 | "IronBbox"); |
---|
63 | |
---|
64 | G4VisAttributes* pIronAVis = new |
---|
65 | G4VisAttributes(G4Colour(0.1, 0.1, 1.0)); |
---|
66 | // pIronAVis->SetForceSolid(true); |
---|
67 | logIronBbox->SetVisAttributes(pIronAVis); |
---|
68 | |
---|
69 | TiaraPart tiaraPart; |
---|
70 | tiaraPart.rot = 0; |
---|
71 | tiaraPart.logVol = logIronBbox; |
---|
72 | tiaraPart.pos.setZ(tiaraDimensions.targetPosZ + |
---|
73 | tiaraDimensions.distTargetEndA + halfHight); |
---|
74 | |
---|
75 | // upper shield |
---|
76 | tiaraPart.pos.setX(lateralShift); |
---|
77 | tiaraPart.pos.setY(radialShift); |
---|
78 | fTiaraParts.push_back(tiaraPart); |
---|
79 | |
---|
80 | // lower shield |
---|
81 | tiaraPart.pos.setX(-1*lateralShift); |
---|
82 | tiaraPart.pos.setY(-1*radialShift); |
---|
83 | fTiaraParts.push_back(tiaraPart); |
---|
84 | |
---|
85 | // right shield |
---|
86 | tiaraPart.rot = new G4RotationMatrix(); |
---|
87 | tiaraPart.rot->set(G4ThreeVector(0, 0, 1), 90 * deg); |
---|
88 | tiaraPart.pos.setX(-1* radialShift); |
---|
89 | tiaraPart.pos.setY(lateralShift); |
---|
90 | fTiaraParts.push_back(tiaraPart); |
---|
91 | |
---|
92 | // left shield |
---|
93 | // tiaraPart.rot->set(G4ThreeVector(0, 0, 1), -90); |
---|
94 | tiaraPart.pos.setX(radialShift); |
---|
95 | tiaraPart.pos.setY(-1*lateralShift); |
---|
96 | fTiaraParts.push_back(tiaraPart); |
---|
97 | |
---|
98 | |
---|
99 | } |
---|
100 | */ |
---|
101 | |
---|
102 | TiaraIronShieldB:: |
---|
103 | TiaraIronShieldB(TiaraMaterials &mfac, |
---|
104 | const TiaraDimensions &tiaraDimensions){ |
---|
105 | G4double halfHight((tiaraDimensions.distTargetExperiment - |
---|
106 | tiaraDimensions.distTargetEndA) / 2); |
---|
107 | G4double halfWidth(tiaraDimensions.widthExperiment/2); |
---|
108 | |
---|
109 | G4Box *ironBbox = new G4Box("ironBbox", |
---|
110 | halfWidth, |
---|
111 | halfWidth, |
---|
112 | halfHight); |
---|
113 | |
---|
114 | G4LogicalVolume *logIronBbox = |
---|
115 | new G4LogicalVolume(ironBbox, |
---|
116 | mfac.GetMaterial("iron"), |
---|
117 | "IronBbox"); |
---|
118 | |
---|
119 | G4VisAttributes* pIronAVis = new |
---|
120 | G4VisAttributes(G4Colour(0.1, 0.1, 1.0)); |
---|
121 | // pIronAVis->SetForceSolid(true); |
---|
122 | logIronBbox->SetVisAttributes(pIronAVis); |
---|
123 | |
---|
124 | G4Tubs *tub = new G4Tubs("holeIronB", |
---|
125 | 0, |
---|
126 | tiaraDimensions.pipeRadius, |
---|
127 | halfHight, |
---|
128 | 0, |
---|
129 | 360 * deg); |
---|
130 | |
---|
131 | G4LogicalVolume *logHole = new G4LogicalVolume(tub, |
---|
132 | mfac.GetMaterial("air"), |
---|
133 | "logHoleIronB"); |
---|
134 | |
---|
135 | new G4PVPlacement(0, |
---|
136 | G4ThreeVector(0, 0, 0), |
---|
137 | logHole, |
---|
138 | "holeIronB", |
---|
139 | logIronBbox, |
---|
140 | false, |
---|
141 | 0); |
---|
142 | |
---|
143 | TiaraPart tiaraPart; |
---|
144 | tiaraPart.rot = 0; |
---|
145 | tiaraPart.logVol = logIronBbox; |
---|
146 | tiaraPart.pos.setZ(tiaraDimensions.targetPosZ + |
---|
147 | tiaraDimensions.distTargetEndA + halfHight); |
---|
148 | tiaraPart.pos.setX(0); |
---|
149 | tiaraPart.pos.setY(0); |
---|
150 | fTiaraParts.push_back(tiaraPart); |
---|
151 | |
---|
152 | } |
---|
153 | |
---|
154 | TiaraIronShieldB::~TiaraIronShieldB(){ |
---|
155 | } |
---|
156 | |
---|
157 | TiaraParts TiaraIronShieldB::GetParts(){ |
---|
158 | return fTiaraParts; |
---|
159 | } |
---|