Geometry detector assembly example.
Modified to save the assembly as shape-extract.
void assembly()
{
auto geom =
new TGeoManager(
"Assemblies",
"Geometry using assemblies");
auto Vacuum =
new TGeoMedium(
"Vacuum", 1, matVacuum);
auto top = geom->MakeBox("TOP", Vacuum, 1000., 1000., 100.);
geom->SetTopVolume(top);
Double_t ytooth = 0.5 * yplate / ntooth;
auto plate = geom->MakeBox("PLATE", Al, xplate, yplate, 1);
plate->SetLineColor(
kBlue);
auto tooth = geom->MakeBox("TOOTH", Al, xtooth, ytooth, 1);
tooth->SetLineColor(
kBlue);
tplate->AddNode(plate, 1);
for (i = 0; i < ntooth; i++) {
xt = xplate + xtooth;
yt = -yplate + (4 * i + 1) * ytooth;
xt = -xplate - xtooth;
yt = -yplate + (4 * i + 3) * ytooth;
}
rot1->RotateX(90);
for (i = 0; i < 6; i++) {
}
for (i = 0; i < ncells; i++) {
Double_t ycell = (2 * i + 1) * (dshift + 10);
}
for (i = 0; i < nrows; i++) {
Double_t xrow = 0.5 * (2 * i + 1) * dxrow;
if ((i % 2) == 0)
yrow = -yrow;
}
geom->CloseGeometry();
en->SetVisLevel(4);
en->GetNode()->GetVolume()->SetVisibility(
kFALSE);
gEve->AddGlobalElement(en);
en->ExpandIntoListTreesRecursively();
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.
The manager class for any TGeo geometry.
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.