3 #include <phparameter/PHParameters.h>
12 #include <Geant4/G4Box.hh>
13 #include <Geant4/G4SubtractionSolid.hh>
14 #include <Geant4/G4Colour.hh>
15 #include <Geant4/G4LogicalVolume.hh>
16 #include <Geant4/G4Material.hh>
17 #include <Geant4/G4PVPlacement.hh>
18 #include <Geant4/G4SystemOfUnits.hh>
19 #include <Geant4/G4UserLimits.hh>
20 #include <Geant4/G4VisAttributes.hh>
37 if (volume == block_physi)
46 G4LogicalVolume *mother,
47 G4UserLimits *g4userlimits,
49 const std::string& name,
50 G4Material *mat_inner,
54 G4ThreeVector d_inner,
55 G4Material *mat_outer,
62 G4VSolid *all_solid =
new G4Box((name+
"_all").c_str(),
67 G4VSolid *inner_solid =
new G4Box((name+
"_inner").c_str(),
72 G4VSolid * outer_solid =
new G4SubtractionSolid((name+
"_outer").c_str(),
79 G4VisAttributes *vis_outer =
new G4VisAttributes();
81 vis_outer->SetVisibility(
true);
82 vis_outer->SetForceSolid(
true);
84 G4LogicalVolume *outer_logic =
new G4LogicalVolume(outer_solid,
86 (name+
"_outer").c_str(),
87 nullptr,
nullptr, g4userlimits);
89 outer_logic->SetVisAttributes(vis_outer);
95 (name+
"_outer").c_str(),
96 mother, 0,
false, overlapcheck);
98 G4VisAttributes *vis_inner =
new G4VisAttributes();
100 vis_inner->SetVisibility(
false);
101 vis_inner->SetForceSolid(
false);
103 G4LogicalVolume *inner_logic =
new G4LogicalVolume(inner_solid,
105 (name+
"_inner").c_str(),
106 nullptr,
nullptr, g4userlimits);
108 inner_logic->SetVisAttributes(vis_inner);
114 (name+
"_inner").c_str(),
115 mother, 0,
false, overlapcheck);
120 bool PlaceHollowdBox(
121 G4LogicalVolume *mother,
122 G4UserLimits *g4userlimits,
124 const std::string& name,
125 G4Material *mat_inner,
129 G4ThreeVector d_inner,
130 G4Material *mat_outer,
134 G4ThreeVector d_outer
137 G4VSolid *all_solid =
new G4Box((name+
"_all").c_str(),
142 G4VSolid *inner_solid =
new G4Box((name+
"_inner").c_str(),
147 G4VSolid * outer_solid =
new G4SubtractionSolid((name+
"_outer").c_str(),
154 G4VisAttributes *vis_outer =
new G4VisAttributes();
156 vis_outer->SetVisibility(
true);
157 vis_outer->SetForceSolid(
true);
159 G4LogicalVolume *outer_logic =
new G4LogicalVolume(outer_solid,
161 (name+
"_outer").c_str(),
162 nullptr,
nullptr, g4userlimits);
164 outer_logic->SetVisAttributes(vis_outer);
170 (name+
"_outer").c_str(),
171 mother, 0,
false, overlapcheck);
179 double inch = 2.54*cm;
183 double x1 = 3.08*inch;
184 double y1 = 1.37*inch;
185 double x2 = 5.00*inch;
186 double y2 = 3.81*inch;
187 double x3 = 18.00*inch;
188 double y3 = 16.78*inch;
190 double dy3 = (4.28-8.688)/2*inch;
194 G4VSolid *block_solid =
new G4Box(G4String(
GetName().c_str()),
200 G4UserLimits *g4userlimits =
nullptr;
201 if (isfinite(steplimits))
203 g4userlimits =
new G4UserLimits(steplimits);
206 G4LogicalVolume *block_logic =
new G4LogicalVolume(block_solid,
207 G4Material::GetMaterial(
"G4_Galactic"),
209 nullptr,
nullptr,g4userlimits);
211 G4VisAttributes* matVis =
new G4VisAttributes();
213 matVis->SetVisibility(
false);
214 matVis->SetForceSolid(
false);
215 block_logic->SetVisAttributes(matVis);
217 G4RotationMatrix *rotm =
new G4RotationMatrix();
219 block_physi =
new G4PVPlacement(
221 G4ThreeVector(0.,dy3,dz3),
232 x2, y2, z, G4ThreeVector(0.,-dy3,0.),
233 G4Material::GetMaterial(
"G4_Fe"),
234 x3, y3, z, G4ThreeVector(0.,0,0.)
242 G4Material::GetMaterial(
"G4_Galactic"),
243 x1, y1, z, G4ThreeVector(0.,-dy3,0.),
244 G4Material::GetMaterial(
"G4_Cu"),
245 x2, y2, z, G4ThreeVector(0.,-dy3,0.)
bool IsInBlock(G4VPhysicalVolume *) const
PHG4CollimatorDetector(PHCompositeNode *Node, PHParameters *parameters, const std::string &dnam="BLOCK", const int lyr=0)
constructor
virtual void Construct(G4LogicalVolume *world)
construct
base class for phenix detector creation
virtual std::string GetName() const
static void SetColour(G4VisAttributes *att, const std::string &mat)
double get_double_param(const std::string &name) const