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
10{
11 gGeoManager->DefaultColors();
12 // gGeoManager->GetVolume("TRAK")->InvisibleAll();
13 gGeoManager->GetVolume("HVP2")->SetTransparency(20);
14 gGeoManager->GetVolume("HVEQ")->SetTransparency(20);
15 gGeoManager->GetVolume("YE4")->SetTransparency(10);
16 gGeoManager->GetVolume("YE3")->SetTransparency(20);
17 gGeoManager->GetVolume("RB2")->SetTransparency(99);
18 gGeoManager->GetVolume("RB3")->SetTransparency(99);
19 gGeoManager->GetVolume("COCF")->SetTransparency(99);
20 gGeoManager->GetVolume("HEC1")->SetLineColor(7);
21 gGeoManager->GetVolume("EAP1")->SetLineColor(7);
22 gGeoManager->GetVolume("EAP2")->SetLineColor(7);
23 gGeoManager->GetVolume("EAP3")->SetLineColor(7);
24 gGeoManager->GetVolume("EAP4")->SetLineColor(7);
25 gGeoManager->GetVolume("HTC1")->SetLineColor(2);
26}
27
28TGeoNode *getNodeFromPath(TGeoNode *top, std::string path)
29{
30 TGeoNode *node = top;
31 std::istringstream f(path);
32 std::string s;
33 while (getline(f, s, '/'))
34 node = node->GetVolume()->FindNode(s.c_str());
35
36 return node;
37}
38
40{
41 using namespace ROOT::Experimental;
43 eveMng->AllowMultipleRemoteConnections(false, false);
44
46
47 // tracker barrel
48 auto data = new REveGeoTopNodeData("https://root.cern/files/cms.root");
50 data->InitPath("/CMSE_1/TRAK_1/SVTX_1");
51 data->RefDescription().SetVisLevel(2);
52 eveMng->GetWorld()->AddElement(data);
53
54 // 3D GL representation
55 auto geoViz = new REveGeoTopNodeViz();
56 geoViz->SetGeoData(data);
57 data->AddNiece(geoViz);
58 eveMng->GetEventScene()->AddElement(geoViz);
59 geoViz->SetPickable(true);
60 eveMng->Show();
61}
#define f(i)
Definition RSha256.hxx:104
externTGeoManager * gGeoManager
static REveManager * Create()
If global REveManager* REX::gEve is not set initialize it.
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:4328
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:100
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:28
void setDetColors()
Definition geoTopNode.C:9
void geoTopNode()
Definition geoTopNode.C:39
Namespace for ROOT features in testing.
Definition TROOT.h:100