Tests importing/exporting optical surfaces from GDML.
Optical surfaces, skin surfaces and border surfaces are imported in object arrays stored by TGeoManager class. Optical surfaces do not store property arrays but point to GDML matrices describing such properties. One can get the data for such property like:
const char *
property =
surf=>GetPropertyRef(
"REFLECTIVITY");
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t property
This is a wrapper class to G4OpticalSurface.
Skin surfaces and border surfaces can be retrieved from the TGeoManager object by using:
Alternatively accessors by name can also be used: GetSkinSurface(name)/GetBorderSurface(name)
#include <cassert>
{
TIter next(
geom->GetListOfOpticalSurfaces());
}
}
{
printf(
"=== List of GDML matrices:\n");
geom->GetListOfGDMLMatrices()->Print();
printf(
"=== List of optical surfaces:\n");
geom->GetListOfOpticalSurfaces()->Print();
printf(
"=== List of skin surfaces:\n");
geom->GetListOfSkinSurfaces()->Print();
printf(
"=== List of border surfaces:\n");
geom->GetListOfBorderSurfaces()->Print();
printf(
"=== Exporting as .gdml, then importing back\n");
geom->Export(
"tmp.gdml");
printf(
"=== Exporting as .root, then importing back\n");
geom->Export(
"tmp.root");
return 0;
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The manager class for any TGeo geometry.
static void SetExportPrecision(UInt_t prec)
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
static function Import a geometry from a gdml or ROOT file
static void SetVerboseLevel(Int_t vl)
Return current verbosity level (static function).
static uint64_t sum(uint64_t i)
- Author
- Andrei Gheata
Definition in file testoptical.C.