EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
BeastMagneticField
delphes_EIC
Doxygen_Assist
east
eic-smear
EicRoot
eicsmear-jetexample
eicsmeardetectors
EicToyModel
estarlight
Fun4All-lmon
fun4all_coresoftware
fun4all_eic_qa
fun4all_eic_tutorials
fun4all_eicdetectors
fun4all_eicmacros
fun4all_g4jleic
fun4all_GenFit
fun4all_macros
fun4all_tutorials
blob
master
AnaTutorial
block
CaloAna
clusters
CreateSubsysRecoModule
cylinder
DisplayOn.C
Fun4All_G4_Cylinder.C
MyHitTTree.C
eventgenerator_display
IonGun
MagneticField
materialscan
Momentum
myjetanalysis
MyOwnTTree
PHG4DSTReader
g4exampledetector
g4lblvtx
online_distribution
PEPSI
doxygen_mainpage.h
File Members
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
DisplayOn.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file DisplayOn.C
1
#pragma once
2
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
3
#include <
fun4all/Fun4AllServer.h
>
4
#include <
g4main/PHG4Reco.h
>
5
#endif
6
// stupid macro to turn on the geant4 display
7
// we ask Fun4All for a pointer to PHG4Reco
8
// using the ApplyCommand will start up the
9
// G4 cmd interpreter and graphics system
10
// the vis.mac contains the necessary commands to
11
// start up the visualization, the next event will
12
// be displayed. Do not execute this macro
13
// before PHG4Reco was registered with Fun4All
14
PHG4Reco
*
DisplayOn
(
const
char
*mac =
"cyl.mac"
)
15
{
16
char
cmd[100];
17
Fun4AllServer
*se =
Fun4AllServer::instance
();
18
PHG4Reco
*
g4
= (
PHG4Reco
*) se->
getSubsysReco
(
"PHG4RECO"
);
19
g4->
InitRun
(se->
topNode
());
20
g4->
ApplyDisplayAction
();
21
sprintf(cmd,
"/control/execute %s"
, mac);
22
g4->
ApplyCommand
(cmd);
23
return
g4
;
24
}
25
// print out the commands I always forget
26
void
displaycmd
()
27
{
28
cout <<
"draw axis: "
<< endl;
29
cout <<
" g4->ApplyCommand(\"/vis/scene/add/axes 0 0 0 50 cm\")"
<< endl;
30
cout <<
"zoom"
<< endl;
31
cout <<
" g4->ApplyCommand(\"/vis/viewer/zoom 1\")"
<< endl;
32
cout <<
"viewpoint:"
<< endl;
33
cout <<
" g4->ApplyCommand(\"/vis/viewer/set/viewpointThetaPhi 0 0\")"
<< endl;
34
cout <<
"panTo:"
<< endl;
35
cout <<
" g4->ApplyCommand(\"/vis/viewer/panTo 0 0 cm\")"
<< endl;
36
cout <<
"print to eps:"
<< endl;
37
cout <<
" g4->ApplyCommand(\"/vis/ogl/printEPS\")"
<< endl;
38
cout <<
"set background color:"
<< endl;
39
cout <<
" g4->ApplyCommand(\"/vis/viewer/set/background white\")"
<< endl;
40
}
fun4all_tutorials
blob
master
cylinder
DisplayOn.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:53
using
1.8.2 with
EIC GitHub integration