1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
3
* MAUS is free software: you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License as published by
5
* the Free Software Foundation, either version 3 of the License, or
6
* (at your option) any later version.
8
* MAUS is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with MAUS. If not, see <http://www.gnu.org/licenses/>.
22
#include "CLHEP/Vector/Rotation.h"
25
#include "Geant4/G4NistManager.hh"
26
#include "Geant4/G4Material.hh"
27
#include "Geant4/G4Tubs.hh"
28
#include "Geant4/G4Box.hh"
29
#include "Geant4/G4Trap.hh"
30
#include "Geant4/G4LogicalVolume.hh"
31
#include "Geant4/G4PVPlacement.hh"
32
#include "Geant4/G4PVParameterised.hh"
33
#include "Geant4/G4UserLimits.hh"
34
#include "Geant4/G4VisAttributes.hh"
35
#include "Geant4/G4Colour.hh"
36
#include "Geant4/G4ios.hh"
37
#include "Geant4/G4ThreeVector.hh"
38
#include "Geant4/G4RotationMatrix.hh"
39
#include "Geant4/globals.hh"
40
#include "Geant4/G4SDManager.hh"
42
#include "DetModel/EMR/EMRBar.hh"
43
#include "DetModel/EMR/EMRSD.hh"
44
#include "DetModel/EMR/BarParameterisation.hh"
46
EMRBar::EMRBar(MiceModule* mod,
48
G4VPhysicalVolume *mlv) {
51
// --------- Material definition ---------
52
G4NistManager* nistMan = G4NistManager::Instance();
53
nistMan->SetVerbose(2);
54
// nistMan->ListMaterials("all";)
56
G4Material* Air = nistMan->FindOrBuildMaterial("G4_Galactic");
57
G4Material* Polystyrene = nistMan->FindOrBuildMaterial("G4_POLYSTYRENE");
59
G4String symbol; // a=mass of a mole;
60
G4double a, z, density; // z=mean number of protons;
61
G4int ncomponents, natoms;
63
G4Element* H = new G4Element("Hydrogen", symbol="H", z = 1., a = 1.01*g/mole);
64
G4Element* C = new G4Element("Carbon" , symbol="C", z = 6., a = 12.01*g/mole);
65
G4Element* O = new G4Element("Oxygen" , symbol="O", z = 8., a = 15.9994*g/mole);
67
G4Material* Glue = new G4Material("EpoxyGlue", density = 1.36*g/cm3, ncomponents = 3);
68
Glue->AddElement(C, natoms = 261);
69
Glue->AddElement(H, natoms = 304);
70
Glue->AddElement(O, natoms = 40);
72
G4Material* Acr = new G4Material("Acrylic", density = 1.18*g/cm3, ncomponents = 3);
73
Acr->AddElement(C, natoms = 5);
74
Acr->AddElement(O, natoms = 2);
75
Acr->AddElement(H, natoms = 8);
77
// Print all the materials defined.
79
// G4cout << G4endl << "The materials defined are : " << G4endl << G4endl;
80
// G4cout << *(G4Material::GetMaterialTable()) << G4endl;
82
// --------- Sizes of the principal geometrical components (solids) ---------
84
G4double fNbOfBars = mod->propertyDouble("NbOfBars");
85
// std::cerr << "NUMBER OF BARS " << fNbOfBars << std::endl;
86
G4double fBarWidth = mod->propertyDouble("BarWidth");
87
G4double fBarHeight = mod->propertyDouble("BarHeight");
88
G4double fBarLength = mod->propertyDouble("BarLength");
89
G4double fHoleRad = mod->propertyDouble("HoleRad");
90
G4double fFiberCladdingExtRadius = mod->propertyDouble("FiberCladdingExtRadius");
92
G4double fFiberCoreRadius = 0.95*fFiberCladdingExtRadius;
93
G4Material* BarMater = Polystyrene;
94
G4Material* HoleMater = Glue;
95
G4Material* FiberCladdingExtMater = Acr;
96
G4Material* FiberCoreMater = Polystyrene;
97
G4double fCalorimeterLength = 1.2*fBarLength;
98
// G4double fWorldLength = 1.2*fCalorimeterLength;
99
// ----------------------------------------------------------------------------
101
// ------------------------------
103
// ------------------------------
104
G4double HalfCaloLength = 0.5*fCalorimeterLength;
106
solidCalorimeter = new G4Box("calorimeter",
111
logicCalorimeter = new G4LogicalVolume(solidCalorimeter, Air, "Calorimeter", 0, 0, 0);
112
physiCalorimeter = new G4PVPlacement(0, // no rotation
114
logicCalorimeter, // its logical volume
115
"Calorimeter", // its name
116
mlv->GetLogicalVolume(), // its mother volume
117
false, // no boolean operations
120
// ----------------------------------------------------------------------------
122
G4double pDz = 0.5*fBarHeight; // Half-length along the z-axis
124
G4double pTheta = 0.0; // Polar angle of the line joining
125
// the centres of the faces at -/+pDz
127
G4double pPhi = 0.0; // Azimuthal angle of the line joing the centre of the face at
128
// -pDz to the centre of the face at +pDz
130
G4double pDy1 = 0.5*fBarWidth; // Half-length along y of the face at -pDz
132
G4double pDx1 = 0.5*fBarLength; // Half-length along x of the side at
133
// y=-pDy1 of the face at -pDz
135
G4double pDx2 = 0.5*fBarLength; // Half-length along x of the side at
136
// y=+pDy1 of the face at -pDz
138
G4double pAlp1 = 0.0; // Angle with respect to the y axis from the centre of the side
139
// at y=-pDy1 to the centre at y=+pDy1 of the face at -pDz
141
G4double pDy2 = 0.01*cm; // Half-length along y of the face at +pDz
143
G4double pDx3 = pDx1; // Half-length along x of the side at y=-pDy2 of the face at +pDz
145
G4double pDx4 = pDx1; // Half-length along x of the side at y=+pDy2 of the face at +pDz
147
G4double pAlp2 = pAlp1; // Angle with respect to the y axis from the centre of the side
148
// at y=-pDy2 to the centre at y=+pDy2 of the face at +pDz
150
solidBar = new G4Trap("bar", pDz, pTheta, pPhi, pDy1, pDx1,
151
pDx2, pAlp1, pDy2, pDx3, pDx4, pAlp2);
153
logicBar = new G4LogicalVolume(solidBar, BarMater, "Bar", 0, 0, 0);
155
barParam = new BarParameterisation(fBarWidth,
160
// dummy value : kZAxis -- modified by parameterised volume
161
physiBar = new G4PVParameterised("Bar", // their name
162
logicBar, // their logical volume
163
logicCalorimeter, // Mother logical volume
164
kZAxis, // Are placed along this axis
165
fNbOfBars, // Number of bars
166
barParam); // The parametrisation
168
fAddWLSFiber = mod->propertyBool("AddWLSFiber");
171
// ------------------------------
173
// ------------------------------
174
G4RotationMatrix roty = G4RotationMatrix();
175
roty.rotateY(90*deg);
176
G4ThreeVector positionH = G4ThreeVector(0., 0., 0.05*mm);
177
G4Transform3D transformH = G4Transform3D(roty, positionH);
179
solidHole = new G4Tubs("Hole", 0.*mm, fHoleRad/2, fBarLength/2, 0.*deg, 360.*deg);
180
logicHole = new G4LogicalVolume(solidHole, HoleMater, "Hole", 0, 0, 0);
181
physiHole = new G4PVPlacement(transformH, // at (x,y,z)
182
logicHole, // its logical volume
184
logicBar, // its mother volume
185
false, // no boolean operations
188
// ------------------------------
190
// ------------------------------
191
solidFiberCladding = new G4Tubs("FiberCladding",
193
fFiberCladdingExtRadius/2,
198
logicFiberCladding = new G4LogicalVolume(solidFiberCladding,
199
FiberCladdingExtMater,
204
new G4PVPlacement(0, // no rotation
205
G4ThreeVector((fHoleRad-fFiberCladdingExtRadius)/2, 0., 0.),
206
logicFiberCladding, // its logical volume
207
"FiberCladding", // its name
208
logicHole, // its mother volume
209
false, // no boolean operations
212
// ------------------------------
214
// ------------------------------
215
solidFiberCore = new G4Tubs("FiberCladding",
222
logicFiberCore = new G4LogicalVolume(solidFiberCore,
227
physiFiberCore = new G4PVPlacement(0, // no rotation
229
logicFiberCore, // its logical volume
230
"FiberCore", // its name
231
logicFiberCladding, // its mother volume
232
false, // no boolean operations
234
// ------------------------------
235
}// if (fAddWLSFiber)