27#include <TGeoElement.h>
28#include <TGeoManager.h>
29#include <TGeoMaterial.h>
32#include <TVirtualMC.h>
36#include "Ex03DetectorConstruction.h"
53 fAbsorberThickness(0.),
55 fDefaultMaterial(
"Galactic"),
56 fAbsorberMaterial(
"Lead"),
57 fGapMaterial(
"liquidArgon")
62 fAbsorberThickness = 1.;
67 ComputeCalorParameters();
106 new TGeoManager(
"E03_geometry",
"E03 VMC example geometry");
119 new TGeoMaterial(
"Aluminium", a = 26.98, z = 13., density = 2.700);
121 new TGeoMaterial(
"liquidArgon", a = 39.95, z = 18., density = 1.390);
123 new TGeoMaterial(
"Lead", a = 207.19, z = 82., density = 11.35);
131 TGeoElement* elH =
new TGeoElement(
"Hydrogen",
"H", z = 1, a = 1.01);
132 TGeoElement* elC =
new TGeoElement(
"Carbon",
"C", z = 6., a = 12.01);
133 TGeoElement* elN =
new TGeoElement(
"Nitrogen",
"N", z = 7., a = 14.01);
134 TGeoElement* elO =
new TGeoElement(
"Oxygen",
"O", z = 8., a = 16.00);
135 TGeoElement* elSi =
new TGeoElement(
"Silicon",
"Si", z = 14., a = 28.09);
149 TGeoMixture* matH2O =
new TGeoMixture(
"Water", 2, density = 1.000);
150 matH2O->AddElement(elH, 2);
151 matH2O->AddElement(elO, 1);
156 TGeoMixture* matSci =
new TGeoMixture(
"Scintillator", 2, density = 1.032);
157 matSci->AddElement(elC, 9);
158 matSci->AddElement(elH, 10);
160 TGeoMixture* matMyl =
new TGeoMixture(
"Mylar", 3, density = 1.397);
161 matMyl->AddElement(elC, 10);
162 matMyl->AddElement(elH, 8);
163 matMyl->AddElement(elO, 4);
165 TGeoMixture* matSiO2 =
new TGeoMixture(
"quartz", 2, density = 2.200);
166 matSiO2->AddElement(elSi, 1);
167 matSiO2->AddElement(elO, 2);
173 TGeoMixture* matAir =
new TGeoMixture(
"Air", 2, density = 1.29e-03);
174 matAir->AddElement(elN, 0.7);
175 matAir->AddElement(elO, 0.3);
182 TGeoMixture* matAerog =
new TGeoMixture(
"Aerogel", 3, density = 0.200);
183 matAerog->AddElement(matSiO2, 0.625);
184 matAerog->AddElement(matH2O, 0.374);
185 matAerog->AddElement(elC, 0.001);
191 TGeoMixture* matCO2 =
new TGeoMixture(
"CarbonicGas", 2, density = 1.842e-03);
192 matCO2->AddElement(elC, 1);
193 matCO2->AddElement(elO, 2);
195 Double_t atmosphere = 6.32421e+08;
196 Double_t pressure = 50. * atmosphere;
197 Double_t temperature = 325.;
198 matCO2->SetPressure(pressure);
199 matCO2->SetTemperature(temperature);
200 matCO2->SetState(TGeoMaterial::kMatStateGas);
202 TGeoMixture* matSteam =
new TGeoMixture(
"WaterSteam", 1, density = 0.3e-03);
203 matSteam->AddElement(matH2O, 1.0);
205 pressure = 2. * atmosphere;
207 matSteam->SetPressure(pressure);
208 matSteam->SetTemperature(temperature);
209 matSteam->SetState(TGeoMaterial::kMatStateGas);
215 new TGeoMaterial(
"Galactic", a = 1.e-16, z = 1.e-16, density = 1.e-16);
217 TGeoMixture* matBeam =
new TGeoMixture(
"Beam", 1, density = 1.e-5);
218 matBeam->AddElement(matAir, 1.0);
220 pressure = 2. * atmosphere;
221 temperature = STP_temperature;
222 matBeam->SetPressure(pressure);
223 matBeam->SetTemperature(temperature);
224 matBeam->SetState(TGeoMaterial::kMatStateGas);
240 for (Int_t i = 8; i < 20; ++i) param[i] = 0.;
243 TList* materials = gGeoManager->GetListOfMaterials();
244 TIter next(materials);
245 while (
TObject* obj = next()) {
246 TGeoMaterial* material = (TGeoMaterial*)obj;
247 new TGeoMedium(material->GetName(), ++mediumId, material, param);
262 Int_t defaultMediumId =
264 Int_t absorberMediumId =
266 Int_t gapMediumId = gGeoManager->GetMedium(
fGapMaterial.Data())->GetId();
277 gGeoManager->Volume(
"WRLD",
"BOX", defaultMediumId, world, 3);
278 gGeoManager->SetTopVolume(top);
289 gGeoManager->Volume(
"CALO",
"BOX", defaultMediumId, calo, 3);
294 gGeoManager->Node(
"CALO", 1,
"WRLD", posX, posY, posZ, 0, kTRUE, ubuf);
298 Double_t start = -calo[0];
300 gGeoManager->Division(
"CELL",
"CALO", 1,
fNbOfLayers, start, width);
309 gGeoManager->Volume(
"LAYE",
"BOX", defaultMediumId, layer, 3);
314 gGeoManager->Node(
"LAYE", 1,
"CELL", posX, posY, posZ, 0, kTRUE, ubuf);
327 gGeoManager->Volume(
"ABSO",
"BOX", absorberMediumId, abso, 3);
332 gGeoManager->Node(
"ABSO", 1,
"LAYE", posX, posY, posZ, 0, kTRUE, ubuf);
345 gGeoManager->Volume(
"GAPX",
"BOX", gapMediumId, gap, 3);
350 gGeoManager->Node(
"GAPX", 1,
"LAYE", posX, posY, posZ, 0, kTRUE, ubuf);
365 gGeoManager->CloseGeometry();
368 gMC->SetRootGeometry();
379 std::set<TString> createdMaterials;
386 std::vector<MaterialCuts> materialCutsVector = {
387 MaterialCuts(
"Aluminium", 10.e-06, 10.e-06, 597.e-06, 597.e-06),
388 MaterialCuts(
"liquidArgon", 10.e-06, 10.e-06, 342.9e-06, 342.9e-06),
389 MaterialCuts(
"Lead", 100.5e-06, 100.5e-06, 1.378e-03, 1.378e-03),
390 MaterialCuts(
"Water", 10.e-06, 10.e-06, 347.2e-06, 347.2e-06),
391 MaterialCuts(
"Scintillator", 10.e-06, 10.e-06, 355.8e-06, 355.8e-06),
392 MaterialCuts(
"Mylar", 10.e-06, 10.e-06, 417.5e-06, 417.5e-06),
393 MaterialCuts(
"quartz", 10.e-06, 10.e-06, 534.1e-06, 534.1e-06),
394 MaterialCuts(
"Air", 10.e-06, 10.e-06, 10.e-06, 10.e-06),
395 MaterialCuts(
"Aerogel", 10.e-06, 10.e-06, 119.0e-06, 119.0e-06),
396 MaterialCuts(
"CarbonicGas", 10.e-09, 10.e-06, 10.e-06, 10.e-06),
397 MaterialCuts(
"WaterSteam", 10.e-06, 10.e-06, 10.e-06, 10.e-06),
398 MaterialCuts(
"Galactic", 10.e-06, 10.e-06, 10.e-06, 10.e-06),
399 MaterialCuts(
"Beam", 10.e-06, 10.e-06, 10.e-06, 10.e-06)
403 for (
auto materialCuts : materialCutsVector) {
405 if (createdMaterials.find(materialCuts.fName) == createdMaterials.end())
408 Int_t mediumId = gMC->MediumId(materialCuts.fName);
417 Double_t cut = 100.e-06;
418 gMC->Gstpar(mediumId,
"CUTGAM", cut);
419 gMC->Gstpar(mediumId,
"BCUTE", cut);
420 gMC->Gstpar(mediumId,
"CUTELE", cut);
421 gMC->Gstpar(mediumId,
"DCUTE", cut);
435 Int_t mediumId = gMC->MediumId(
"Lead");
437 gMC->Gstpar(mediumId,
"COMP", 0);
438 gMC->Gstpar(mediumId,
"PAIR", 0);
439 gMC->Gstpar(mediumId,
"PHOT", 0);
448 cout <<
"\n------------------------------------------------------------"
449 <<
"\n---> The calorimeter is " <<
fNbOfLayers <<
" layers of: [ "
452 <<
"\n------------------------------------------------------------\n";
The detector construction (via TGeo )
virtual ~Ex03DetectorConstruction()
Double_t fWorldSizeYZ
The world size y,z component.
Int_t fNbOfLayers
The number of calorimeter layers.
Ex03DetectorConstruction()
void SetNbOfLayers(Int_t value)
Double_t fGapThickness
The gap thickness.
TString fDefaultMaterial
The default material name.
void SetGapThickness(Double_t value)
void PrintCalorParameters()
void SetAbsorberThickness(Double_t value)
TString fAbsorberMaterial
The absorber material name.
Double_t fLayerThickness
The calorimeter layer thickness.
TString fGapMaterial
The gap material name.
Double_t fAbsorberThickness
The absorber thickness.
void SetAbsorberMaterial(const TString &materialName)
void SetDefaultMaterial(const TString &materialName)
Double_t fCalorThickness
The calorimeter thickness.
void ConstructMaterials()
void ComputeCalorParameters()
void SetCalorSizeYZ(Double_t value)
Double_t fWorldSizeX
The world size x component.
void SetGapMaterial(const TString &materialName)
Double_t fCalorSizeYZ
The calorimeter size y,z component.