Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:13:29

0001 // stupid macro to turn on the geant4 display
0002 // we ask Fun4All for a pointer to PHG4Reco
0003 // using the ApplyCommand will start up the
0004 // G4 cmd interpreter and graphics system
0005 // the vis.mac contains the necessary commands to
0006 // start up the visualization, the next event will
0007 // be displayed. Do not execute this macro
0008 // before PHG4Reco was registered with Fun4All
0009 PHG4Reco * DisplayOn(const char *mac = "vis.mac")
0010 {
0011   char cmd[100];
0012   Fun4AllServer *se = Fun4AllServer::instance();
0013   PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco("PHG4RECO");
0014   g4->InitRun(se->topNode());
0015   sprintf(cmd, "/control/execute %s", mac);
0016   g4->ApplyCommand(cmd);
0017   return g4;
0018 }
0019 // print out the commands I always forget
0020 void displaycmd()
0021 {
0022   cout << "draw axis: " << endl;
0023   cout << " g4->ApplyCommand(\"/vis/scene/add/axes 0 0 0 50 cm\")" << endl;
0024   cout << "zoom" << endl;
0025   cout << " g4->ApplyCommand(\"/vis/viewer/zoom 1\")" << endl;
0026   cout << "viewpoint:" << endl;
0027   cout << " g4->ApplyCommand(\"/vis/viewer/set/viewpointThetaPhi 0 0\")" << endl;
0028   cout << "panTo:" << endl;
0029   cout << " g4->ApplyCommand(\"/vis/viewer/panTo 0 0 cm\")" << endl;
0030   cout << "print to eps:" << endl;
0031   cout << " g4->ApplyCommand(\"/vis/ogl/printEPS\")" << endl;
0032   cout << "set background color:" << endl;
0033   cout << " g4->ApplyCommand(\"/vis/viewer/set/background white\")" << endl;
0034 }