ROOT logo

From $ROOTSYS/tutorials/eve/geom_cms.C

// @(#)root/eve:$Id: geom_cms.C 31415 2009-11-24 23:31:46Z matevz $
// Author: Matevz Tadel

// Shows CMS geometry.

void geom_cms()
{
   TEveManager::Create();

   TFile::SetCacheFileDir(".");
   gGeoManager = gEve->GetGeometry("http://root.cern.ch/files/cms.root");
   gGeoManager->DefaultColors();

   TGeoVolume* top = gGeoManager->GetTopVolume()->FindNode("CMSE_1")->GetVolume();

   TEveGeoTopNode* trk = new TEveGeoTopNode(gGeoManager, top->FindNode("TRAK_1"));
   trk->SetVisLevel(6);
   gEve->AddGlobalElement(trk);

   TEveGeoTopNode* calo = new TEveGeoTopNode(gGeoManager, top->FindNode("CALO_1"));
   calo->SetVisLevel(3);
   gEve->AddGlobalElement(calo);

   TEveGeoTopNode* muon = new TEveGeoTopNode(gGeoManager, top->FindNode("MUON_1"));
   muon->SetVisLevel(4);
   gEve->AddGlobalElement(muon);

   gEve->FullRedraw3D(kTRUE);

   // EClipType not exported to CINT (see TGLUtil.h):
   // 0 - no clip, 1 - clip plane, 2 - clip box
   TGLViewer *v = gEve->GetDefaultGLViewer();
   v->GetClipSet()->SetClipType(1);
   v->ColorSet().Background().SetColor(kMagenta+4);
   v->SetGuideState(TGLUtil::kAxesEdge, kTRUE, kFALSE, 0);
   v->RefreshPadEditor(v);

   v->CurrentCamera().RotateRad(-1.2, 0.5);
   v->DoDraw();
}
 geom_cms.C:1
 geom_cms.C:2
 geom_cms.C:3
 geom_cms.C:4
 geom_cms.C:5
 geom_cms.C:6
 geom_cms.C:7
 geom_cms.C:8
 geom_cms.C:9
 geom_cms.C:10
 geom_cms.C:11
 geom_cms.C:12
 geom_cms.C:13
 geom_cms.C:14
 geom_cms.C:15
 geom_cms.C:16
 geom_cms.C:17
 geom_cms.C:18
 geom_cms.C:19
 geom_cms.C:20
 geom_cms.C:21
 geom_cms.C:22
 geom_cms.C:23
 geom_cms.C:24
 geom_cms.C:25
 geom_cms.C:26
 geom_cms.C:27
 geom_cms.C:28
 geom_cms.C:29
 geom_cms.C:30
 geom_cms.C:31
 geom_cms.C:32
 geom_cms.C:33
 geom_cms.C:34
 geom_cms.C:35
 geom_cms.C:36
 geom_cms.C:37
 geom_cms.C:38
 geom_cms.C:39
 geom_cms.C:40
 geom_cms.C:41
thumb