69{
70
71 G4cout << "Defining the materials" << G4endl;
72
74
75 G4Material* air = nistManager->FindOrBuildMaterial(
"G4_AIR");
76 G4Material* pbWO4 = nistManager->FindOrBuildMaterial(
"G4_PbWO4");
77
78
79
80
81 G4double experimentalHall_x = 1000. * cm;
82 G4double experimentalHall_y = 1000. * cm;
83 G4double experimentalHall_z = 1000. * cm;
84
86 experimentalHall_x,
87 experimentalHall_y,
88 experimentalHall_z);
89
90 auto experimentalHallLog =
new G4LogicalVolume(experimentalHall_box, air,
"expHallLog",
91 nullptr,
92 nullptr,
93 nullptr);
96 G4ThreeVector(),
97 "expHall", experimentalHallLog, nullptr, false, 0);
98
99
100
101
102
103
104 G4int nbOfCrystals = 10;
105
106
107
108
109
110
111 G4double calo_xside = 31 * cm;
112 G4double calo_yside = 31 * cm;
113 G4double calo_zside = 24 * cm;
114
115 G4double crystalWidth = 3 * cm;
116 G4double crystalLength = 24 * cm;
117
118 calo_xside = (crystalWidth * nbOfCrystals) + 1 * cm;
119 calo_yside = (crystalWidth * nbOfCrystals) + 1 * cm;
120 calo_zside = crystalLength;
121
122 auto calo_box =
new G4Box(
"CMS calorimeter",
123 calo_xside / 2.,
124 calo_yside / 2., calo_zside / 2.);
126 air,
127 "calo log",
128 nullptr,
129 nullptr,
130 nullptr);
131
132 G4double xpos = 0.0;
133 G4double ypos = 0.0;
134 G4double zpos = 100.0 * cm;
135 new G4PVPlacement(
nullptr, G4ThreeVector(xpos, ypos, zpos), caloLog,
"calorimeter",
136 experimentalHallLog, false, 1);
137
138
140 crystalWidth / 2, crystalWidth / 2, crystalLength / 2);
141
143 pbWO4,
144 "CrystalLog");
145
146 for (G4int i = 0; i < nbOfCrystals; i++) {
147 for (G4int j = 0; j < nbOfCrystals; j++) {
148 G4int n = i * 10 + j;
149 G4ThreeVector crystalPos((i * crystalWidth) - 135, (j * crystalWidth) - 135, 0);
151 crystalPos,
153 "crystal",
154 caloLog, false, i);
155 }
156 }
157 G4cout << "There are " << nbOfCrystals << " crystals per row in the calorimeter, so in total "
158 << nbOfCrystals * nbOfCrystals << " crystals" << G4endl;
159 G4cout << "They have width of " << crystalWidth / cm << " cm and a length of "
160 << crystalLength / cm << " cm. The Material is " << pbWO4 << G4endl;
161
162 experimentalHallLog->SetVisAttributes(G4VisAttributes::GetInvisible());
165 caloLog->SetVisAttributes(caloVisAtt);
167
168
169
170 return experimentalHallPhys;
171}
G4VPhysicalVolume * fCrystalPhys[100]
G4LogicalVolume * fCrystalLog