Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
geoTopNode.C
Go to the documentation of this file.
1
4
5
6namespace REX = ROOT::Experimental;
7
10 // gGeoManager->GetVolume("TRAK")->InvisibleAll();
24}
25
26TGeoNode *getNodeFromPath(TGeoNode *top, std::string path)
27{
28 TGeoNode *node = top;
29 std::istringstream f(path);
30 std::string s;
31 while (getline(f, s, '/'))
32 node = node->GetVolume()->FindNode(s.c_str());
33
34 return node;
35}
36
38{
39 auto eveMng = REX::REveManager::Create();
40 // eveMng->AllowMultipleRemoteConnections(false, false);
41
43
44 TGeoManager::Import("https://root.cern/files/cms.root");
45 TGeoNode *top = gGeoManager->GetTopVolume()->FindNode("CMSE_1");
47
48 // tracker barrel
49 {
50 // Init RGeomDescription object
51 auto data = new REX::REveGeoTopNodeData("TRACK GeoNode-Data ");
52 data->SetTNode(getNodeFromPath(top, "TRAK_1/SVTX_1"));
53 data->RefDescription().SetVisLevel(2);
54 eveMng->GetWorld()->AddElement(data); // data can be added to any scene
55
56 // 3D GL representation
57 auto geoViz = new REX::REveGeoTopNodeViz("CaloTopNode");
58 geoViz->SetGeoData(data);
59 geoViz->SetPickable(true);
60 data->AddNiece(geoViz);
62 }
63
64 // muon barrel
65 {
66 // Init RGeomDescription object
67 auto data = new REX::REveGeoTopNodeData("MUON GeoNode-Data");
68 data->SetTNode(getNodeFromPath(top, "MUON_1/MB_1"));
69 data->RefDescription().SetVisLevel(2);
71
72 // 3D GL representation
73 auto geoViz = new REX::REveGeoTopNodeViz("MUON TopNode");
74 geoViz->SetGeoData(data);
75 geoViz->SetPickable(true);
76 data->AddNiece(geoViz);
78 }
79 eveMng->Show();
80}
#define f(i)
Definition RSha256.hxx:104
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
R__EXTERN TGeoManager * gGeoManager
virtual void AddElement(REveElement *el)
Add el to the list of children.
REveScene * GetEventScene() const
void Show(const RWebDisplayArgs &args="")
Show eve manager in specified browser.
static Bool_t SetCacheFileDir(std::string_view cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
Sets the directory where to locally stage/cache remote files.
Definition TFile.cxx:4623
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
static function Import a geometry from a gdml or ROOT file
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
void DefaultColors()
Set default volume colors according to A of material.
TGeoVolume * GetTopVolume() const
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition TGeoNode.h:39
TGeoVolume * GetVolume() const
Definition TGeoNode.h:99
void SetTransparency(Char_t transparency=0)
Definition TGeoVolume.h:376
void SetLineColor(Color_t lcolor) override
Set the line color.
TGeoNode * FindNode(const char *name) const
search a daughter inside the list of nodes
ROOT::Experimental::REveManager * eveMng
TGeoNode * getNodeFromPath(TGeoNode *top, std::string path)
Definition geoTopNode.C:26
void setDetColors()
Definition geoTopNode.C:8
void geoTopNode()
Definition geoTopNode.C:37