File indexing completed on 2025-12-17 09:20:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <phgeom/PHGeomUtility.h>
0012
0013 #include <fun4all/Fun4AllDstInputManager.h>
0014 #include <fun4all/Fun4AllDstOutputManager.h>
0015 #include <fun4all/Fun4AllDummyInputManager.h>
0016 #include <fun4all/Fun4AllInputManager.h>
0017 #include <fun4all/Fun4AllNoSyncDstInputManager.h>
0018 #include <fun4all/Fun4AllOutputManager.h>
0019 #include <fun4all/Fun4AllServer.h>
0020 #include <fun4all/SubsysReco.h>
0021
0022 #include <phool/recoConsts.h>
0023
0024 #include <TEveGeoNode.h>
0025 #include <TEveManager.h>
0026 #include <TGLClip.h>
0027 #include <TGLUtil.h>
0028 #include <TGLViewer.h>
0029 #include <TGeoManager.h>
0030 #include <TROOT.h>
0031
0032 #include <cassert>
0033 #include <string>
0034
0035 R__LOAD_LIBRARY(libphgeom.so)
0036 R__LOAD_LIBRARY(libg4dst.so)
0037 R__LOAD_LIBRARY(libfun4all.so)
0038
0039
0040
0041 void PHGeom_DSTInspection(const std::string &DST_file_name = "G4sPHENIX.root",
0042 bool do_clip = true)
0043 {
0044 TEveManager::Create();
0045
0046 Fun4AllServer *se = Fun4AllServer::instance();
0047 se->Verbosity(1);
0048 recoConsts *rc = recoConsts::instance();
0049 rc->set_IntFlag("RUNNUMBER", 12345);
0050
0051 Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
0052 hitsin->fileopen(DST_file_name);
0053 se->registerInputManager(hitsin);
0054
0055
0056 se->run(1);
0057
0058 PHGeomUtility::GetTGeoManager(se->topNode());
0059
0060 assert(gGeoManager);
0061
0062 if (!gROOT->GetListOfGeometries()->FindObject(gGeoManager))
0063 {
0064 gROOT->GetListOfGeometries()->Add(gGeoManager);
0065 }
0066 if (!gROOT->GetListOfBrowsables()->FindObject(gGeoManager))
0067 {
0068 gROOT->GetListOfBrowsables()->Add(gGeoManager);
0069 }
0070
0071
0072 TGeoNode *current = gGeoManager->GetCurrentNode();
0073
0074
0075
0076
0077 for (int igeom = 0; igeom < current->GetNdaughters(); igeom++)
0078 {
0079 TGeoNode *geo_node = (TGeoNode *) current->GetNodes()->UncheckedAt(igeom);
0080 geo_node->GetVolume()->VisibleDaughters(kFALSE);
0081 geo_node->GetVolume()->SetTransparency(2);
0082
0083 if (std::string(geo_node->GetName()).find("PIPE") != std::string::npos)
0084 {
0085 geo_node->GetVolume()->SetTransparency(0);
0086 }
0087 }
0088 TEveGeoTopNode *eve_node = new TEveGeoTopNode(gGeoManager, current);
0089 eve_node->SetVisLevel(6);
0090 gEve->AddGlobalElement(eve_node);
0091 gEve->FullRedraw3D(kTRUE);
0092
0093
0094
0095 TGLViewer *v = gEve->GetDefaultGLViewer();
0096 if (do_clip)
0097 {
0098 v->GetClipSet()->SetClipType(TGLClip::kClipPlane);
0099 }
0100
0101 v->SetGuideState(TGLUtil::kAxesEdge, kTRUE, kFALSE, nullptr);
0102 v->RefreshPadEditor(v);
0103
0104 v->CurrentCamera().RotateRad(-1.6, 0.);
0105 v->DoDraw();
0106 }