Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:17:19

0001 //====================================================================
0002 //  AIDA Detector description implementation
0003 //--------------------------------------------------------------------
0004 //
0005 //  Define the ROOT dictionaries for all data classes to be saved 
0006 //  which are created by the DDG4 examples.
0007 //
0008 //  Author     : M.Frank
0009 //
0010 //====================================================================
0011 #include <DD4hep/Detector.h>
0012 
0013 // ROOT include files
0014 #include <TGeoManager.h>
0015 #include <TEveGeoNode.h>
0016 #include <TGLViewer.h>
0017 #include <TGLUtil.h>
0018 #include <TGLClip.h>
0019 #include <TMap.h>
0020 #include <TEveElement.h>
0021 #include <TSysEvtHandler.h>
0022 #include <TTimer.h>
0023 #include <TVirtualPad.h>
0024 
0025 #define private public
0026 #include <TEveManager.h>
0027 
0028 using namespace dd4hep::detail;
0029 
0030 void TEve()    {
0031   Detector& description = Detector::getInstance();
0032   TGeoManager* mgr = description.manager();
0033   const char* fname = "file:../DD4hep/examples/CLICSiD/compact/compact.xml";
0034   description.apply("DD4hep_CompactLoader",1,(char**)&fname);
0035 
0036   TEveManager::Create();
0037   gEve->fGeometries->Add(new TObjString(fname),&description.manager());
0038   TEveGeoTopNode* tn = new TEveGeoTopNode(mgr, mgr->GetTopNode());
0039   tn->SetVisLevel(4);
0040   gEve->AddGlobalElement(tn);
0041 
0042   gEve->FullRedraw3D(kTRUE);
0043 
0044   // EClipType not exported to CINT (see TGLUtil.h):
0045   // 0 - no clip, 1 - clip plane, 2 - clip box
0046   TGLViewer *v = gEve->GetDefaultGLViewer();
0047   v->GetClipSet()->SetClipType(TGLClip::kClipPlane);
0048   v->ColorSet().Background().SetColor(kMagenta+4);
0049   v->SetGuideState(TGLUtil::kAxesEdge, kTRUE, kFALSE, 0);
0050   v->RefreshPadEditor(v);
0051   v->CurrentCamera().RotateRad(-1.2, 0.5);
0052   v->DoDraw();
0053 }