5 #include <Geant4/G4Box.hh>
6 #include <Geant4/G4Color.hh>
7 #include <Geant4/G4LogicalVolume.hh>
8 #include <Geant4/G4Material.hh>
9 #include <Geant4/G4PVPlacement.hh>
10 #include <Geant4/G4RotationMatrix.hh>
11 #include <Geant4/G4String.hh>
12 #include <Geant4/G4SystemOfUnits.hh>
13 #include <Geant4/G4ThreeVector.hh>
14 #include <Geant4/G4Transform3D.hh>
15 #include <Geant4/G4VisAttributes.hh>
47 cout <<
"constructing DIRC" << endl;
48 double cb_DIRC_bars_DZ = 340 *
cm;
49 double cb_DIRC_bars_DY = 42. *
cm;
50 double cb_DIRC_bars_DX = 1.7 *
cm;
51 double dR = 83.65 *
cm;
52 double myL = 2 *
M_PI * dR;
53 int NUM = myL / cb_DIRC_bars_DY;
54 double cb_DIRC_bars_deltaphi = 2 *
M_PI / NUM;
55 string solidname =
"cb_DIRC_bars_Solid";
56 G4VSolid *
solid =
new G4Box(solidname, cb_DIRC_bars_DX / 2., cb_DIRC_bars_DY / 2., cb_DIRC_bars_DZ / 2.);
57 string logicname =
"cb_DIRC_bars_Logic";
58 G4LogicalVolume *logical =
new G4LogicalVolume(solid, G4Material::GetMaterial(
"Quartz"), logicname);
59 G4VisAttributes *vis =
new G4VisAttributes(G4Color(0., 1., 0., 1.0));
60 vis->SetForceSolid(
true);
61 logical->SetVisAttributes(vis);
62 for (
int ia = 0; ia < NUM; ia++)
64 double phi = (ia * (cb_DIRC_bars_deltaphi));
65 double x = -dR *
cos(phi);
66 double y = -dR * sin(phi);
68 rot.rotateZ(cb_DIRC_bars_deltaphi * ia);
69 string physname =
"cb_DIRC_bars_Phys_" +
to_string(ia);
70 G4VPhysicalVolume *phy =
new G4PVPlacement(G4Transform3D(rot, G4ThreeVector(x, y, 0)),
80 cout <<
"JLeic DIRC Detector:" << endl;
81 if (what ==
"ALL" || what ==
"VOLUME")
83 cout <<
"Version 0.1" << endl;