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_TestBeam_HCAL_SampleFrac.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Fun4All_TestBeam_HCAL_SampleFrac.C
1
#pragma once
2
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
3
#include <
fun4all/SubsysReco.h
>
4
#include <
fun4all/Fun4AllServer.h
>
5
#include <
fun4all/Fun4AllInputManager.h
>
6
#include <
fun4all/Fun4AllDummyInputManager.h
>
7
#include <
fun4all/Fun4AllOutputManager.h
>
8
#include <
fun4all/Fun4AllDstInputManager.h
>
9
#include <
fun4all/Fun4AllNoSyncDstInputManager.h
>
10
#include <
fun4all/Fun4AllDstOutputManager.h
>
11
#include <proto4showercalib/Proto4ShowerCalib.h>
12
#include <proto4samplefrac/Proto4SampleFrac.h>
13
14
R__LOAD_LIBRARY(libPrototype4.so)
15
R__LOAD_LIBRARY(libfun4all.so)
16
R__LOAD_LIBRARY(/direct/phenix+
u
/xusun/WorkSpace/sPHENIX/install/lib/libProto4HCalSampleFrac.so)
17
#endif
18
19
int
20
// Fun4All_TestBeam_HCAL_SampleFrac(const int nEvents = 1000, const int posID = 0, const int addID = 0, const string det = "HCALOUT")
21
// Fun4All_TestBeam_HCAL_SampleFrac(const int nEvents = 1000, const int runID = 0, const string det = "HCALIN")
22
Fun4All_TestBeam_HCAL_SampleFrac
(
const
int
nEvents
= 100000,
const
string
det =
"HCALOUT"
)
23
{
24
25
//---------------
26
// Load libraries
27
//---------------
28
gSystem->Load(
"libPrototype4.so"
);
29
gSystem->Load(
"libfun4all.so"
);
30
31
//---------------
32
// Fun4All server
33
//---------------
34
35
Fun4AllServer
*se =
Fun4AllServer::instance
();
36
se->
Verbosity
(1);
37
38
//--------------
39
// IO management
40
//--------------
41
42
// Hits file
43
Fun4AllInputManager
*hitsin =
new
Fun4AllDstInputManager
(
"DSTin"
);
44
// std::string inputFile = Form("/sphenix/user/xusun/software/macros/macros/prototype4/data/Simulation/Cosmic_orig/Cosmic_%s_%d%d.root",det.c_str(),posID,addID);
45
// std::string inputFile = Form("/sphenix/user/xusun/software/macros/macros/prototype4/data/Simulation/Cosmic_Scint/Cosmic_%s_%d%d.root",det.c_str(),posID,addID);
46
// std::string inputFile = Form("/sphenix/user/xusun/software/macros/macros/prototype4/data/Simulation/BeamTest_SF_orig/BeamTest_SF_%d.root",runID);
47
// std::string inputFile = Form("/sphenix/user/xusun/software/macros/macros/prototype4/data/Simulation/BeamTest_SF_Scint/BeamTest_SF_%d.root",runID);
48
// hitsin->fileopen(inputFile.c_str());
49
std::string
inputlist =
"../list/HCAL_Prototype4_SIM_SampleFrac.list"
;
50
hitsin->
AddListFile
(inputlist);
// you can also choose this and give a list of DST file names in the file.
51
se->
registerInputManager
(hitsin);
52
53
//load your analysis module's lib
54
gSystem->Load(
"/direct/phenix+u/xusun/WorkSpace/sPHENIX/install/lib/libProto4HCalSampleFrac.so"
);
55
56
//load your analysis module.
57
// std::string outputFile = Form("/sphenix/user/xusun/software/data/beam/SampleFrac/Proto4SampleFrac_%s_%d%d.root",det.c_str(),posID,addID);
58
// std::string outputFile = Form("/sphenix/user/xusun/software/data/beam/SampleFrac/Proto4SampleFrac_%s_%d.root",det.c_str(),runID);
59
std::string
outputFile = Form(
"/sphenix/user/xusun/TestBeam/SampleFrac/Proto4SampleFrac_%s.root"
,det.c_str());
60
Proto4SampleFrac
* hcal_ana =
new
Proto4SampleFrac
(det.c_str(),outputFile.c_str());
61
se->
registerSubsystem
(hcal_ana);
62
63
se->
run
(
nEvents
);
64
se->
End
();
65
66
std::cout <<
"All done"
<< std::endl;
67
delete
se;
68
69
return
0;
70
}
analysis
blob
master
Prototype4
HCal
macros
SampleFrac
Fun4All_TestBeam_HCAL_SampleFrac.C
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:56
using
1.8.2 with
sPHENIX GitHub integration