Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DisplayOn.C
Go to the documentation of this file.
1 // stupid macro to turn on the geant4 display
2 // we ask Fun4All for a pointer to PHG4Reco
3 // using the ApplyCommand will start up the
4 // G4 cmd interpreter and graphics system
5 // the vis.mac contains the necessary commands to
6 // start up the visualization, the next event will
7 // be displayed. Do not execute this macro
8 // before PHG4Reco was registered with Fun4All
9 PHG4Reco * DisplayOn(const char *mac = "vis.mac")
10 {
11  char cmd[100];
13  PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco("PHG4RECO");
14  g4->InitRun(se->topNode());
15  sprintf(cmd, "/control/execute %s", mac);
16  g4->ApplyCommand(cmd);
17  return g4;
18 }
19 // print out the commands I always forget
20 void displaycmd()
21 {
22  cout << "draw axis: " << endl;
23  cout << " g4->ApplyCommand(\"/vis/scene/add/axes 0 0 0 50 cm\")" << endl;
24  cout << "zoom" << endl;
25  cout << " g4->ApplyCommand(\"/vis/viewer/zoom 1\")" << endl;
26  cout << "viewpoint:" << endl;
27  cout << " g4->ApplyCommand(\"/vis/viewer/set/viewpointThetaPhi 0 0\")" << endl;
28  cout << "panTo:" << endl;
29  cout << " g4->ApplyCommand(\"/vis/viewer/panTo 0 0 cm\")" << endl;
30  cout << "print to eps:" << endl;
31  cout << " g4->ApplyCommand(\"/vis/ogl/printEPS\")" << endl;
32  cout << "set background color:" << endl;
33  cout << " g4->ApplyCommand(\"/vis/viewer/set/background white\")" << endl;
34 }
Runs G4 as a subsystem.
Definition: PHG4Reco.h:38
static Fun4AllServer * instance()
Fun4AllServer * se
PHG4Reco * DisplayOn(const char *mac="vis.mac")
Definition: DisplayOn.C:9
PHCompositeNode * topNode() const
Definition: Fun4AllServer.h:59
int InitRun(PHCompositeNode *topNode)
Definition: PHG4Reco.cc:320
SubsysReco * getSubsysReco(const std::string &name)
int ApplyCommand(const std::string &cmd)
interface to G4 cmd interpreter
Definition: PHG4Reco.cc:566
void displaycmd()
Definition: DisplayOn.C:20
string cmd
Definition: submit_bnl.py:63