Logo ROOT   6.18/05
Reference Guide
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
10void geom_cms()
11{
13
15 gGeoManager = gEve->GetGeometry("http://root.cern.ch/files/cms.root");
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);
23
24 auto calo = new TEveGeoTopNode(gGeoManager, top->FindNode("CALO_1"));
25 calo->SetVisLevel(3);
27
28 auto muon = new TEveGeoTopNode(gGeoManager, top->FindNode("MUON_1"));
29 muon->SetVisLevel(4);
31
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}
SVector< double, 2 > v
Definition: Dict.h:5
const Bool_t kFALSE
Definition: RtypesCore.h:88
const Bool_t kTRUE
Definition: RtypesCore.h:87
@ kMagenta
Definition: Rtypes.h:64
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:601
A wrapper over a TGeoNode, possibly displaced with a global trasformation stored in TEveElement.
Definition: TEveGeoNode.h:93
void SetVisLevel(Int_t vl)
Definition: TEveGeoNode.h:115
void AddGlobalElement(TEveElement *element, TEveElement *parent=0)
Add a global element, i.e.
TGLViewer * GetDefaultGLViewer() const
Get TGLViewer of the default TEveViewer.
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
void FullRedraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Perform 3D redraw of all scenes and viewers.
TGeoManager * GetGeometry(const TString &filename)
Get geometry with given filename.
static Bool_t SetCacheFileDir(ROOT::Internal::TStringView cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
Definition: TFile.h:316
@ kAxesEdge
Definition: TGLUtil.h:948
void DefaultColors()
Set default volume colors according to A of material.
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
Returns deepest node containing current point.
TGeoVolume * GetTopVolume() const
Definition: TGeoManager.h:531
TGeoVolume * GetVolume() const
Definition: TGeoNode.h:94
TGeoNode * FindNode(const char *name) const
search a daughter inside the list of nodes
void geom_cms()
Definition: geom_cms.C:79