File indexing completed on 2025-08-03 08:22:10
0001 #pragma once
0002
0003 #include <g4main/PHG4Reco.h>
0004
0005 #include <fun4all/Fun4AllServer.h>
0006
0007 R__LOAD_LIBRARY(libfun4all.so)
0008 R__LOAD_LIBRARY(libg4testbench.so)
0009
0010 namespace Enable
0011 {
0012 bool DISPLAY = false;
0013 }
0014
0015
0016
0017
0018 PHG4Reco *QTGui()
0019 {
0020 Fun4AllServer *se = Fun4AllServer::instance();
0021 PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco("PHG4RECO");
0022 g4->InitRun(se->topNode());
0023 g4->ApplyDisplayAction();
0024 g4->StartGui();
0025 return g4;
0026 }
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 PHG4Reco *DisplayOn(const char *mac = "vis.mac")
0037 {
0038 char cmd[100];
0039 Fun4AllServer *se = Fun4AllServer::instance();
0040 PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco("PHG4RECO");
0041 g4->InitRun(se->topNode());
0042 g4->ApplyDisplayAction();
0043 sprintf(cmd, "/control/execute %s", mac);
0044 g4->ApplyCommand(cmd);
0045 return g4;
0046 }
0047
0048 void displaycmd()
0049 {
0050 cout << "draw axis: " << endl;
0051 cout << " g4->ApplyCommand(\"/vis/scene/add/axes 0 0 0 50 cm\")" << endl;
0052 cout << "zoom" << endl;
0053 cout << " g4->ApplyCommand(\"/vis/viewer/zoom 1\")" << endl;
0054 cout << "viewpoint:" << endl;
0055 cout << " g4->ApplyCommand(\"/vis/viewer/set/viewpointThetaPhi 0 0\")" << endl;
0056 cout << "panTo:" << endl;
0057 cout << " g4->ApplyCommand(\"/vis/viewer/panTo 0 0 cm\")" << endl;
0058 cout << "print to eps:" << endl;
0059 cout << " g4->ApplyCommand(\"/vis/ogl/printEPS\")" << endl;
0060 cout << "set background color:" << endl;
0061 cout << " g4->ApplyCommand(\"/vis/viewer/set/background white\")" << endl;
0062 cout << "Overlap check:" << endl;
0063 cout << " g4->ApplyCommand(\"/geometry/test/run\")" << endl;
0064 }