20 auto geom =
new TGeoManager(
"Assemblies",
"Geometry using assemblies");
26 auto Vacuum =
new TGeoMedium(
"Vacuum", 1, matVacuum);
27 auto Al =
new TGeoMedium(
"Aluminium", 2, matAl);
30 auto top = geom->MakeBox(
"TOP", Vacuum, 1000., 1000., 100.);
31 geom->SetTopVolume(top);
40 Double_t ytooth = 0.5 * yplate / ntooth;
41 Double_t dshift = 2. * xplate + xtooth;
44 auto plate = geom->MakeBox(
"PLATE", Al, xplate, yplate, 1);
45 plate->SetLineColor(
kBlue);
46 auto tooth = geom->MakeBox(
"TOOTH", Al, xtooth, ytooth, 1);
47 tooth->SetLineColor(
kBlue);
48 tplate->AddNode(plate, 1);
49 for (i = 0; i < ntooth; i++) {
51 yt = -yplate + (4 * i + 1) * ytooth;
53 xt = -xplate - xtooth;
54 yt = -yplate + (4 * i + 3) * ytooth;
64 for (i = 0; i < 6; i++) {
79 for (i = 0; i < ncells; i++) {
80 Double_t ycell = (2 * i + 1) * (dshift + 10);
88 for (i = 0; i < nrows; i++) {
89 Double_t xrow = 0.5 * (2 * i + 1) * dxrow;
98 geom->CloseGeometry();
105 en->GetNode()->GetVolume()->SetVisibility(
kFALSE);
107 gEve->AddGlobalElement(en);
111 en->ExpandIntoListTreesRecursively();
112 en->Save(
"assembly.root",
"Assembly");
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
externTGeoManager * gGeoManager
A wrapper over a TGeoNode, possibly displaced with a global trasformation stored in TEveElement.
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
Class describing rotation + translation.
Base class describing materials.
Media are used to store properties related to tracking and which are useful only when using geometry ...
Class describing rotations.
void RotateZ(Double_t angle) override
Rotate about Z axis of the master frame with angle expressed in degrees.
Class describing translations.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.