Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
geoTopNode.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_eve_7
3///
4/// \macro_code
5///
8
9namespace REX = ROOT::Experimental;
10
12{
14 // gGeoManager->GetVolume("TRAK")->InvisibleAll();
28}
29
30TGeoNode *getNodeFromPath(TGeoNode *top, std::string path)
31{
32 TGeoNode *node = top;
33 std::istringstream f(path);
34 std::string s;
35 while (getline(f, s, '/'))
36 node = node->GetVolume()->FindNode(s.c_str());
37
38 return node;
39}
40
42{
43 auto eveMng = REX::REveManager::Create();
44 // eveMng->AllowMultipleRemoteConnections(false, false);
45
47
48 TGeoManager::Import("https://root.cern/files/cms.root");
49 TGeoNode *top = gGeoManager->GetTopVolume()->FindNode("CMSE_1");
51
52 // tracker barrel
53 {
54 // Init RGeomDescription object
55 auto data = new REX::REveGeoTopNodeData("TRACK GeoNode-Data ");
56 data->SetTNode(getNodeFromPath(top, "TRAK_1/SVTX_1"));
57 data->RefDescription().SetVisLevel(2);
58 eveMng->GetWorld()->AddElement(data); // data can be added to any scene
59
60 // 3D GL representation
61 auto geoViz = new REX::REveGeoTopNodeViz("CaloTopNode");
62 geoViz->SetGeoData(data);
63 geoViz->SetPickable(true);
64 data->AddNiece(geoViz);
66 }
67
68 // muon barrel
69 {
70 // Init RGeomDescription object
71 auto data = new REX::REveGeoTopNodeData("MUON GeoNode-Data");
72 data->SetTNode(getNodeFromPath(top, "MUON_1/MB_1"));
73 data->RefDescription().SetVisLevel(2);
75
76 // 3D GL representation
77 auto geoViz = new REX::REveGeoTopNodeViz("MUON TopNode");
78 geoViz->SetGeoData(data);
79 geoViz->SetPickable(true);
80 data->AddNiece(geoViz);
82 }
83 eveMng->Show();
84}
#define f(i)
Definition RSha256.hxx:104
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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:4674
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:30
void setDetColors()
Definition geoTopNode.C:11
void geoTopNode()
Definition geoTopNode.C:41