Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
geom_cms.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_eve
3 /// Shows CMS geometry.
4 ///
5 /// \image html eve_geom_cms.png
6 /// \macro_code
7 ///
8 /// \author Matevz Tadel
9 
10 void geom_cms()
11 {
12  TEveManager::Create();
13 
14  TFile::SetCacheFileDir(".");
15  gGeoManager = gEve->GetGeometry("http://root.cern.ch/files/cms.root");
16  gGeoManager->DefaultColors();
17 
18  auto top = gGeoManager->GetTopVolume()->FindNode("CMSE_1")->GetVolume();
19 
20  TEveGeoTopNode* trk = new TEveGeoTopNode(gGeoManager, top->FindNode("TRAK_1"));
21  trk->SetVisLevel(6);
22  gEve->AddGlobalElement(trk);
23 
24  auto calo = new TEveGeoTopNode(gGeoManager, top->FindNode("CALO_1"));
25  calo->SetVisLevel(3);
26  gEve->AddGlobalElement(calo);
27 
28  auto muon = new TEveGeoTopNode(gGeoManager, top->FindNode("MUON_1"));
29  muon->SetVisLevel(4);
30  gEve->AddGlobalElement(muon);
31 
32  gEve->FullRedraw3D(kTRUE);
33 
34  // EClipType not exported to CINT (see TGLUtil.h):
35  // 0 - no clip, 1 - clip plane, 2 - clip box
36  auto v = gEve->GetDefaultGLViewer();
37  v->GetClipSet()->SetClipType(TGLClip::EType(1));
38  v->ColorSet().Background().SetColor(kMagenta+4);
39  v->SetGuideState(TGLUtil::kAxesEdge, kTRUE, kFALSE, 0);
40  v->RefreshPadEditor(v);
41 
42  v->CurrentCamera().RotateRad(-1.2, 0.5);
43  v->DoDraw();
44 }