73 auto ghostLogicalVolume = GetWorld()->GetLogicalVolume();
77 G4int nbOfCrystals = 10;
84 G4double calo_xside = 31 * cm;
85 G4double calo_yside = 31 * cm;
86 G4double calo_zside = 24 * cm;
88 G4double crystalWidth = 3 * cm;
89 G4double crystalLength = 24 * cm;
91 calo_xside = (crystalWidth * nbOfCrystals) + 1 * cm;
92 calo_yside = (crystalWidth * nbOfCrystals) + 1 * cm;
93 calo_zside = crystalLength;
95 auto calo_box =
new G4Box(
"CMS calorimeter",
97 calo_yside / 2., calo_zside / 2.);
107 G4double zpos = 100.0 * cm;
108 new G4PVPlacement(
nullptr, G4ThreeVector(xpos, ypos, zpos), caloLog,
"calorimeter",
109 ghostLogicalVolume,
false, 1);
113 crystalWidth / 2, crystalWidth / 2, crystalLength / 2);
119 for (G4int i = 0; i < nbOfCrystals; i++) {
120 for (G4int j = 0; j < nbOfCrystals; j++) {
121 G4int n = i * 10 + j;
122 G4ThreeVector crystalPos((i * crystalWidth) - 135, (j * crystalWidth) - 135, 0);
130 G4cout <<
"There are " << nbOfCrystals <<
" crystals per row in the calorimeter, so in total "
131 << nbOfCrystals * nbOfCrystals <<
" crystals" << G4endl;
132 G4cout <<
"They have width of " << crystalWidth / cm <<
" cm and a length of "
133 << crystalLength / cm <<
" cm. " << G4endl;
137 caloLog->SetVisAttributes(caloVisAtt);