26#include <TGeoManager.h>
27#include <TGeoMatrix.h>
28#include <TGeoVolume.h>
29#include <TVirtualMC.h>
31#include "Ex03DetectorConstructionOld.h"
48 fAbsorberThickness(0.),
50 fDefaultMaterial(
"Galactic"),
51 fAbsorberMaterial(
"Lead"),
52 fGapMaterial(
"liquidArgon")
57 fAbsorberThickness = 1.;
62 ComputeCalorParameters();
101 Double_t fieldm = 10.;
102 Double_t epsil = .001;
103 Double_t stemax = -0.01;
104 Double_t tmaxfd = -20.;
105 Double_t deemax = -.3;
106 Double_t stmin = -.8;
131 gMC->Material(imat, name.Data(), a, z, density, radl, absl, ubuf, 0);
133 gMC->Medium(mediumId, name.Data(), imat, 0, ifield, fieldm, tmaxfd, stemax,
134 deemax, epsil, stmin, ubuf, 0);
136 name =
"liquidArgon";
142 gMC->Material(imat, name.Data(), a, z, density, radl, absl, ubuf, 0);
143 gMC->Medium(mediumId, name.Data(), imat, 0, ifield, fieldm, tmaxfd, stemax,
144 deemax, epsil, stmin, ubuf, 0);
152 gMC->Material(imat, name.Data(), a, z, density, radl, absl, ubuf, 0);
153 gMC->Medium(mediumId, name.Data(), imat, 0, ifield, fieldm, tmaxfd, stemax,
154 deemax, epsil, stmin, ubuf, 0);
161 Double_t aw2[2] = { 1.01, 16.00 };
162 Double_t zw2[2] = { 1.0, 8.0 };
163 Double_t ww2[2] = { 2., 1. };
165 gMC->Mixture(imat, name.Data(), aw2, zw2, density, -2, ww2);
166 gMC->Medium(mediumId, name.Data(), imat, 0, ifield, fieldm, tmaxfd, stemax,
167 deemax, epsil, stmin, ubuf, 0);
169 name =
"Scintillator";
170 Double_t as2[2] = { 1.01, 12.01 };
171 Double_t zs2[2] = { 1.0, 6.0 };
172 Double_t ws2[2] = { 10., 9. };
174 gMC->Mixture(imat, name.Data(), as2, zs2, density, -2, ws2);
175 gMC->Medium(mediumId, name.Data(), imat, 0, ifield, fieldm, tmaxfd, stemax,
176 deemax, epsil, stmin, ubuf, 0);
179 Double_t am2[3] = { 12.01, 1.01, 16.00 };
180 Double_t zm2[3] = { 6.0, 1.0, 8.0 };
181 Double_t wm2[3] = { 10., 8., 4. };
183 gMC->Mixture(imat, name.Data(), am2, zm2, density, -3, wm2);
184 gMC->Medium(mediumId, name.Data(), imat, 0, ifield, fieldm, tmaxfd, stemax,
185 deemax, epsil, stmin, ubuf, 0);
188 Double_t aq2[2] = { 28.09, 16.00 };
189 Double_t zq2[2] = { 14.0, 8.0 };
190 Double_t wq2[2] = { 1., 2. };
192 gMC->Mixture(imat, name.Data(), aq2, zq2, density, -2, wq2);
193 gMC->Medium(mediumId, name.Data(), imat, 0, ifield, fieldm, tmaxfd, stemax,
194 deemax, epsil, stmin, ubuf, 0);
201 Double_t aa2[2] = { 14.01, 16.00 };
202 Double_t za2[2] = { 7.0, 8.0 };
203 Double_t wa2[2] = { 0.7, 0.3 };
205 gMC->Mixture(imat, name.Data(), aa2, za2, density, 2, wa2);
206 gMC->Medium(mediumId, name.Data(), imat, 0, ifield, fieldm, tmaxfd, stemax,
207 deemax, epsil, stmin, ubuf, 0);
253 gMC->Material(imat, name.Data(), a, z, density, radl, absl, ubuf, 0);
254 gMC->Medium(mediumId, name.Data(), imat, 0, ifield, fieldm, tmaxfd, stemax,
255 deemax, epsil, stmin, ubuf, 0);
276 gMC->Gsvolu(
"WRLD",
"BOX", gMC->MediumId(
fDefaultMaterial.Data()), world, 3);
287 gMC->Gsvolu(
"CALO",
"BOX", gMC->MediumId(
fDefaultMaterial.Data()), calo, 3);
292 gMC->Gspos(
"CALO", 1,
"WRLD", posX, posY, posZ, 0,
"ONLY");
311 gMC->Gspos(
"LAYE", 1,
"CELL", posX, posY, posZ, 0,
"ONLY");
332 gMC->Gspos(
"ABSO", 1,
"LAYE", posX + abso[0], posY, posZ, 0,
"ONLY");
333 auto volume = gGeoManager ? gGeoManager->GetVolume(
"ABSO") :
nullptr;
334 auto mother = gGeoManager ? gGeoManager->GetVolume(
"LAYE") :
nullptr;
335 if (!volume || !mother || gGeoManager->IsClosed()) {
336 Fatal(
"ConstructGeometry",
337 "Reflected VMC geometry requires geomVMC+RootToGeant4");
340 auto reflection =
new TGeoHMatrix();
341 reflection->ReflectX(kTRUE);
342 reflection->SetDx(posX - abso[0]);
343 mother->AddNode(volume, 2, reflection);
346 gMC->Gspos(
"ABSO", 1,
"LAYE", posX, posY, posZ, 0,
"ONLY");
360 gMC->Gsvolu(
"GAPX",
"BOX", gMC->MediumId(
fGapMaterial.Data()), gap, 3);
367 gMC->Gspos(
"GAPX", 1,
"LAYE", posX + gap[0], posY, posZ, 0,
"ONLY");
368 auto volume = gGeoManager ? gGeoManager->GetVolume(
"GAPX") :
nullptr;
369 auto mother = gGeoManager ? gGeoManager->GetVolume(
"LAYE") :
nullptr;
370 if (!volume || !mother || gGeoManager->IsClosed()) {
371 Fatal(
"ConstructGeometry",
372 "Reflected VMC geometry requires geomVMC+RootToGeant4");
375 auto reflection =
new TGeoHMatrix();
376 reflection->ReflectX(kTRUE);
377 reflection->SetDx(posX - gap[0]);
378 mother->AddNode(volume, 2, reflection);
381 gMC->Gspos(
"GAPX", 1,
"LAYE", posX, posY, posZ, 0,
"ONLY");
404 cout <<
"\n------------------------------------------------------------"
405 <<
"\n---> The calorimeter is " <<
fNbOfLayers <<
" layers of: [ "
408 <<
"\n------------------------------------------------------------\n";
422 const TString& materialName)
432 const TString& materialName)
The old detector construction (via VMC functions).
void PrintCalorParameters()
Int_t fNbOfLayers
The number of calorimeter layers.
virtual ~Ex03DetectorConstructionOld()
void SetGapThickness(Double_t value)
TString fGapMaterial
The gap material name.
void ConstructMaterials()
Double_t fWorldSizeYZ
The world size y,z component.
void SetAbsorberThickness(Double_t value)
Double_t fCalorSizeYZ
The calorimeter size y,z component.
void SetCalorSizeYZ(Double_t value)
TString fDefaultMaterial
The default material name.
Ex03DetectorConstructionOld()
void SetNbOfLayers(Int_t value)
void SetGapMaterial(const TString &materialName)
TString fAbsorberMaterial
The absorber material name.
void ComputeCalorParameters()
void SetAbsorberMaterial(const TString &materialName)
Double_t fWorldSizeX
The world size x component.
Double_t fAbsorberThickness
The absorber thickness.
Double_t fCalorThickness
The calorimeter thickness.
void SetDefaultMaterial(const TString &materialName)
Double_t fLayerThickness
The calorimeter layer thickness.
Double_t fGapThickness
The gap thickness.