Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Fun4All_Read_Dst.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Fun4All_Read_Dst.C
1
#ifndef MACRO_FUN4ALLREADDST_C
2
#define MACRO_FUN4ALLREADDST_C
3
4
#include <
g4histos/G4HitNtuple.h
>
5
6
#include <
fun4all/Fun4AllDstInputManager.h
>
7
#include <
fun4all/Fun4AllDstOutputManager.h
>
8
#include <
fun4all/Fun4AllDummyInputManager.h
>
9
#include <
fun4all/Fun4AllInputManager.h
>
10
#include <
fun4all/Fun4AllOutputManager.h
>
11
#include <
fun4all/Fun4AllServer.h
>
12
#include <
fun4all/SubsysReco.h
>
13
14
#include <
phool/recoConsts.h
>
15
16
R__LOAD_LIBRARY(libfun4all.so)
17
R__LOAD_LIBRARY(libg4testbench.so)
18
R__LOAD_LIBRARY(libg4histos.so)
19
20
void
Fun4All_Read_Dst
(
int
nEvents
= 1)
21
{
23
// Make the Server
25
Fun4AllServer
*se =
Fun4AllServer::instance
();
26
recoConsts
*rc =
recoConsts::instance
();
27
// if you want to fix the random seed to reproduce results
28
// set this flag
29
// rc->set_IntFlag("RANDOMSEED",12345);
30
31
G4HitNtuple
*hits =
new
G4HitNtuple
(
"Hits"
,
"HitsFromDst.root"
);
32
hits->
AddNode
(
"HoleInBox"
, 0);
33
se->
registerSubsystem
(hits);
34
36
// IOManagers...
38
39
// Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT","G4Example01.root");
40
// out->Verbosity(10);
41
// se->registerOutputManager(out);
42
43
// this (dummy) input manager just drives the event loop
44
Fun4AllInputManager
*
in
=
new
Fun4AllDstInputManager
(
"DSTin"
);
45
in->
fileopen
(
"G4Example01.root"
);
46
se->
registerInputManager
(in);
47
// events = 0 => run till end of input file
48
if
(nEvents < 0)
49
{
50
return
0;
51
}
52
se->
run
(nEvents);
53
se->
End
();
54
std::cout <<
"All done"
<< std::endl;
55
delete
se;
56
gSystem->Exit(0);
57
}
58
59
#endif
g4exampledetector
blob
master
simple
macros
Fun4All_Read_Dst.C
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:16
using
1.8.2 with
sPHENIX GitHub integration