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