Geometry detector assembly example.
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);
en->ExpandIntoListTreesRecursively();
en->Save("assembly.root", "Assembly");
}
R__EXTERN TEveManager * gEve
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TSystem * gSystem
A wrapper over a TGeoNode, possibly displaced with a global trasformation stored in TEveElement.
void AddGlobalElement(TEveElement *element, TEveElement *parent=nullptr)
Add a global element, i.e.
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Class describing rotation + translation.
The manager class for any TGeo geometry.
TGeoNode * GetTopNode() const
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.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
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.