QwGeant4
QweakSimPionWall.cc
Go to the documentation of this file.
1 
2 //=============================================================================
3 //
4 // File QweakSimPionWall.cc
5 // Revision 1.0
6 // Date 07/05/2012
7 // Author James Dowd
8 //
9 //=============================================================================
10 
11 // Pion Wall z=?
12 
13 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
14 
15 #include "QweakSimPionWall.hh"
16 
17 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
19 {
20  PionWall_Logical = NULL;
21  PionWall_Physical = NULL;
22  PionWall_Solid = NULL;
23  PionWall_Material = NULL;
24  PionWall_VisAtt = NULL;
25 
26  PionWall_Length_X = 22*4*inch; // 22 bricks wide (8" x 4" x 2")
27  PionWall_Length_Y = 10*inch; // 8" tall brick + another on its side
28  PionWall_Length_Z = 4*inch; // 4" thick (2 bricks)
29 
30  MD7_CenterYPosition = -335.17*cm;
31  MD7_CenterZPosition = 577.88*cm;
32 
33  Offset_X = 0.0*cm;
34  Offset_Y = 0.0*cm;
35  Offset_Z = 0.0*cm;
36 
38  PionWall_CenterYPosition = MD7_CenterYPosition + 1*inch; // MD7 center Y position + 1"
39  PionWall_CenterZPosition = MD7_CenterZPosition // MD 7 center Z position
40  - 6.5*cm // Center of Pb brick in front of PMT
41  - 1*inch // 1/2 Pb brick thickness
42  - 0.5*PionWall_Length_Z // 1/2 pion wall thickness
43  - 0.5*cm; // extra space so the pion wall doesn't overlap MD volume
44 
45  // This position places the PionWall 0.5 cm upstream of the Pb PMT shielding of MD7
46  // in Z and flush in Y. (Flush along bottom of Pb PMT shielding)
47 
48 
50 
51  // get access to material definition
53 }
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59 void QweakSimPionWall::ConstructPionWall(G4VPhysicalVolume* MotherVolume)
60 {
61 //-----------------------------------------------------------------------------
62 //! Creates the Pion Wall
63 /*
64  \param G4VPhysicalVolume* - The physical volume in which the pion wall will be placed
65 */
66 //-----------------------------------------------------------------------------
67 
68  // assign material
70 
71  G4ThreeVector positionPionWall;
72 
73 
74  // Construct pion wall volume
75  PionWall_Solid = new G4Box("PionWall_Sol",
77 
78  //***************************************************************************
79  // Define pion wall logical and physical volumes
80 
81  PionWall_Logical = new G4LogicalVolume(PionWall_Solid,
83  "PionWall_Log",
84  0,0,0);
85 
86  positionPionWall = G4ThreeVector(PionWall_CenterXPosition + Offset_X,
89 
90  PionWall_Physical = new G4PVPlacement(0,
91  positionPionWall,
92  "PionWall",
94  MotherVolume,
95  false,
96  0,
97  pSurfChk);
98  //***************************************************************************
99 
100  // Formating
101  G4Color blue (0.,0.,1.);
102 
103  PionWall_VisAtt = new G4VisAttributes(blue);
104  PionWall_VisAtt->SetVisibility(true);
105  PionWall_Logical->SetVisAttributes(PionWall_VisAtt);
106 
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110 void QweakSimPionWall::SetPionWallMaterial(G4String materialName)
111 {
112  // Sets pion wall material
113  G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
114  if (pttoMaterial)
115  PionWall_Logical->SetMaterial(pttoMaterial);
116 }
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120 {
121  // Sets X position of the pion wall
123  PionWall_Physical->SetTranslation(G4ThreeVector(PionWall_CenterXPosition + Offset_X,
126 }
127 
128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
130 {
131  // Sets Y position of the pion wall
133  PionWall_Physical->SetTranslation(G4ThreeVector(PionWall_CenterXPosition + Offset_X,
136 }
137 
138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
140 {
141  // Sets Z position of the pion wall
143  PionWall_Physical->SetTranslation(G4ThreeVector(PionWall_CenterXPosition + Offset_X,
146 }
147 
148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
150 {
151  // Sets X position offset of the pion wall
152  Offset_X = xOff;
153  PionWall_Physical->SetTranslation(G4ThreeVector(PionWall_CenterXPosition + Offset_X,
156 }
157 
158 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
160 {
161  // Sets Y position offset of the pion wall
162  Offset_Y = yOff;
163  PionWall_Physical->SetTranslation(G4ThreeVector(PionWall_CenterXPosition + Offset_X,
166 }
167 
168 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
170 {
171  // Sets Z position offset of the pion wall
172  Offset_Z = zOff;
173  PionWall_Physical->SetTranslation(G4ThreeVector(PionWall_CenterXPosition + Offset_X,
176 }
177 
178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
180 {
181  // Sets thickness in X of the Pion Wall
182  if (dim > 0.0){
183  //G4double oldDim = PionWall_Length_X;
184  PionWall_Length_X = dim;
185  PionWall_Solid->SetXHalfLength(0.5*PionWall_Length_X);
186  //SetPionWall_CenterPositionInZ(PionWall_CenterZPosition + 0.5*oldDim - 0.5*dim);
187  }
188  else
189  G4cout << "Pion Wall: Invalid thickness value" << G4endl;
190 }
191 
192 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
194 {
195  // Sets thickness in Y of the Pion Wall
196  if (dim > 0.0){
197  G4double oldDim = PionWall_Length_Y;
198  PionWall_Length_Y = dim;
199  PionWall_Solid->SetYHalfLength(0.5*PionWall_Length_Y);
201  }
202  else
203  G4cout << "Pion Wall: Invalid thickness value" << G4endl;
204 }
205 
206 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
208 {
209  // Sets thickness in Z of the Pion Wall and moves the Pion Wall to be flush with Pb MD7 PMT shielding blocks
210  if (dim > 0.0){
211  G4double oldDim = PionWall_Length_Z;
212  PionWall_Length_Z = dim;
213  PionWall_Solid->SetZHalfLength(0.5*PionWall_Length_Z);
215  }
216  else
217  G4cout << "Pion Wall: Invalid thickness value" << G4endl;
218 }
219 
220 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
221 
222 void QweakSimPionWall::SetPionWall_Material(G4String materialName)
223 {
224  G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
225  PionWall_Logical->SetMaterial(pttoMaterial);
226 }
227 
228 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
229 
231 {
232  // Enables the Pion Wall
233  PionWall_VisAtt->SetVisibility(true);
235  PionWall_Physical->SetTranslation(G4ThreeVector(PionWall_CenterXPosition + Offset_X,
238 
239 
240 }
241 
242 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
243 
245 {
246  // Disables the Pion Wall by changing the material to air,
247  // moving the wall 5m into the floor and hiding it.
248  PionWall_VisAtt->SetVisibility(true);
249  SetPionWall_Material("Air");
250  PionWall_Physical->SetTranslation(G4ThreeVector(PionWall_CenterXPosition,
252  PionWall_CenterZPosition + 400*cm));
253 
254 }
255 
256 
257 
258 
259 
QweakSimPionWallMessenger * PionWall_Messenger
QweakSimPionWall()
Constructor.
~QweakSimPionWall()
Destructor.
static QweakSimMaterial * GetInstance()
G4Material * PionWall_Material
void SetPionWallMaterial(G4String)
void SetPionWall_CenterPositionInY(G4double yPos)
G4double MD7_CenterZPosition
static const G4bool pSurfChk
G4VisAttributes * PionWall_VisAtt
G4VPhysicalVolume * PionWall_Physical
G4double PionWall_Length_X
void SetPionWall_LengthInX(G4double dim)
G4double MD7_CenterYPosition
void ConstructPionWall(G4VPhysicalVolume *)
static const G4double inch
QweakSimMaterial * pMaterial
void SetPionWall_LengthInZ(G4double dim)
void SetPionWall_Position_Offset_X(G4double xOff)
void SetPionWall_CenterPositionInZ(G4double zPos)
G4Material * GetMaterial(G4String material)
G4double PionWall_CenterZPosition
G4double PionWall_Length_Z
void SetPionWall_Position_Offset_Y(G4double yOff)
G4double PionWall_CenterXPosition
void SetPionWall_Position_Offset_Z(G4double zOff)
G4LogicalVolume * PionWall_Logical
void SetPionWall_Material(G4String)
G4double PionWall_CenterYPosition
void SetPionWall_LengthInY(G4double dim)
G4double PionWall_Length_Y
void SetPionWall_CenterPositionInX(G4double xPos)