ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorConstruction.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DetectorConstruction.cc
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 //
29 
30 #include "G4Box.hh"
31 #include "G4LogicalVolume.hh"
32 #include "G4Material.hh"
33 #include "G4PVPlacement.hh"
34 #include "G4SystemOfUnits.hh"
35 #include "G4Tubs.hh"
36 #include "G4VisAttributes.hh"
37 #include "DetectorConstruction.hh"
38 #include "Materials.hh"
39 
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 {
43 }
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 {
48 }
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52 {
53  // material definition
54  Materials* materialConstruction = new Materials;
55  materialConstruction-> Construct();
56 
57  G4Material* mate;
58  G4VisAttributes* va;
59 
60  // world volume
61  const G4double DXYZ_AREA = 32.*cm;
62  G4Box* areaSolid = new G4Box("AREA", DXYZ_AREA/2., DXYZ_AREA/2.,
63  DXYZ_AREA/2.);
64 
65  G4Material* vacuum = G4Material::GetMaterial("Vacuum");
66  G4LogicalVolume* areaLV = new G4LogicalVolume(areaSolid, vacuum, "AREA_LV");
67  G4PVPlacement* area = new G4PVPlacement(0, G4ThreeVector(), "AREA_PV",
68  areaLV, 0, false, 0);
69  // vis. attributes
70  va = new G4VisAttributes(G4Color(1.,1.,1.));
71  va-> SetVisibility(false);
72  areaLV-> SetVisAttributes(va);
73 
74  // detectors
75  // voxel
76  const G4double dvoxel = 10.*mm;
77  const G4double dl = 10.*cm;
78 
79  G4Box* svoxel = new G4Box("voxel", dvoxel, dl, dvoxel);
80  mate = G4Material::GetMaterial("Vacuum");
81  G4LogicalVolume* lvoxel = new G4LogicalVolume(svoxel, mate, "voxel");
82  va = new G4VisAttributes(G4Color(0.,0.8,0.8));
83  va-> SetVisibility(false);
84  lvoxel-> SetVisAttributes(va);
85 
86  G4int ix, iz;
87  G4int index = 0;
88  for ( iz = 0; iz < 5; iz++ ) {
89  for ( ix = -7; ix <= 7; ix++ ) {
90  G4double x0 = (2.*ix) * cm;
91  G4double z0 = (-13.+2.*iz) * cm;
92  new G4PVPlacement(0, G4ThreeVector(x0, 0., z0),
93  lvoxel, "voxel", areaLV, false, index);
94  index++;
95  }
96  }
97 
98  // tube
99  G4Tubs* stube = new G4Tubs("tube", 0.*mm, 19./2.*mm, dl, 0., 360.*deg);
100  mate = G4Material::GetMaterial("Al");
101  G4LogicalVolume* ltube = new G4LogicalVolume(stube, mate, "tube");
102  va = new G4VisAttributes(G4Color(0.,0.8,0.8));
103  ltube-> SetVisAttributes(va);
104 
105  G4RotationMatrix* rmtube = new G4RotationMatrix;
106  rmtube-> rotateX(-90.*deg);
107  new G4PVPlacement(rmtube, G4ThreeVector(),
108  ltube, "tube", lvoxel, false, 0);
109 
110  // cal
111  const G4double dxycal = 25.*mm;
112  const G4double dzcal = 3.*cm;
113 
114  G4Box* scal = new G4Box("cal", dxycal, dxycal, dzcal);
115  mate = G4Material::GetMaterial("CsI");
116  G4LogicalVolume* lcal = new G4LogicalVolume(scal, mate, "cal");
117  va = new G4VisAttributes(G4Color(0.5,0.5,0.));
118  lcal-> SetVisAttributes(va);
119 
120  index = 0;
121  for ( ix = -2; ix <= 2; ix++ ) {
122  G4double x0 = (5.*ix)*cm;
123  new G4PVPlacement(0, G4ThreeVector(x0, 0., 2.*cm),
124  lcal, "cal", areaLV, false, index);
125  index++;
126  }
127 
128  return area;
129 }
130 
131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
133 {
134 }