85 G4cout <<
"Defining the materials" << G4endl;
89 G4Material* air = nistManager->FindOrBuildMaterial(
"G4_AIR");
90 G4Material* pbWO4 = nistManager->FindOrBuildMaterial(
"G4_PbWO4");
95 G4double experimentalHall_x = 1000. * cm;
96 G4double experimentalHall_y = 1000. * cm;
97 G4double experimentalHall_z = 1000. * cm;
104 auto experimentalHallLog =
new G4LogicalVolume(experimentalHall_box, air,
"expHallLog",
111 "expHall", experimentalHallLog,
nullptr,
false, 0);
118 G4int nbOfCrystals = 10;
125 G4double calo_xside = 31 * cm;
126 G4double calo_yside = 31 * cm;
127 G4double calo_zside = 24 * cm;
129 G4double crystalWidth = 3 * cm;
130 G4double crystalLength = 24 * cm;
132 calo_xside = (crystalWidth * nbOfCrystals) + 1 * cm;
133 calo_yside = (crystalWidth * nbOfCrystals) + 1 * cm;
134 calo_zside = crystalLength;
136 auto calo_box =
new G4Box(
"CMS calorimeter",
138 calo_yside / 2., calo_zside / 2.);
148 G4double zpos = 100.0 * cm;
149 new G4PVPlacement(
nullptr, G4ThreeVector(xpos, ypos, zpos), caloLog,
"calorimeter",
150 experimentalHallLog,
false, 1);
154 crystalWidth / 2, crystalWidth / 2, crystalLength / 2);
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);
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;
176 experimentalHallLog->SetVisAttributes(G4VisAttributes::GetInvisible());
179 caloLog->SetVisAttributes(caloVisAtt);
185 fRegion->AddRootLogicalVolume(caloLog);
187 return experimentalHallPhys;