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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4_Bbc.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4_Bbc.C
1
#ifndef MACRO_G4BBC_C
2
#define MACRO_G4BBC_C
3
4
#include <
GlobalVariables.C
>
5
6
#include <
g4detectors/PHG4BbcSubsystem.h
>
7
8
#include <
g4bbc/BbcVertexFastSimReco.h
>
9
#include <
g4main/PHG4Reco.h
>
10
11
#include <
fun4all/Fun4AllServer.h
>
12
13
14
R__LOAD_LIBRARY
(libg4bbc.so)
15
R__LOAD_LIBRARY
(libg4detectors.so)
16
17
namespace Enable
18
{
19
bool
BBC
=
false
;
// Actual BBC detector
20
bool
BBC_SUPPORT
=
false
;
// BBC Supports
21
bool
BBCFAKE
=
false
;
// Just generate fake bbc vtx, t0
22
int
BBC_VERBOSITY
= 0;
23
}
// namespace Enable
24
25
namespace
G4BBC
26
{
27
double
z_smearing
= 0.;
// should be 6 mm, temporarily perfect for TPC initial vertexing
28
double
t_smearing
= 0.02;
// 20ps timing resolution
29
}
// namespace G4BBC
30
31
void
BbcInit
()
32
{
33
if
(
Enable::BBC
&&
Enable::BBCFAKE
)
34
{
35
cout <<
"Enable::BBC and Enable::BBCFAKE cannot be true at the same time"
<< endl;
36
gSystem->Exit(1);
37
}
38
// Set boundary of tracked particles to include BBC (values in cm)
39
if
(
Enable::BBC
)
40
{
41
BlackHoleGeometry::max_z
=
std::max
(
BlackHoleGeometry::max_z
, 300.);
42
BlackHoleGeometry::min_z
=
std::min
(
BlackHoleGeometry::min_z
, -300.);
43
BlackHoleGeometry::max_radius
=
std::max
(
BlackHoleGeometry::max_radius
, 15.0);
44
}
45
}
46
47
void
Bbc
(
PHG4Reco
* g4Reco)
48
{
49
bool
SupportActive =
Enable::SUPPORT
||
Enable::BBC_SUPPORT
;
50
if
(
Enable::BBC
)
51
{
52
PHG4BbcSubsystem
* bbc =
new
PHG4BbcSubsystem
(
"BBC"
);
53
bbc->
SuperDetector
(
"BBC"
);
54
bbc->
OverlapCheck
(
Enable::OVERLAPCHECK
);
55
bbc->
SetActive
();
56
if
(SupportActive)
57
{
58
bbc->
SetSupportActive
(SupportActive);
59
}
60
g4Reco->
registerSubsystem
(bbc);
61
}
62
return
;
63
}
64
65
void
Bbc_Reco
()
66
{
67
int
verbosity =
std::max
(
Enable::VERBOSITY
,
Enable::BBC_VERBOSITY
);
68
69
//---------------
70
// Fun4All server
71
//---------------
72
73
Fun4AllServer
* se =
Fun4AllServer::instance
();
74
75
if
(
Enable::BBCFAKE
)
76
{
77
if
(verbosity > 0)
78
{
79
cout <<
"BBCFAKE: Using smeared vtx and t0 resolutions of "
80
<<
G4BBC::z_smearing
<<
" cm and "
<<
G4BBC::t_smearing
* 1000 <<
" ps"
<< endl;
81
}
82
BbcVertexFastSimReco
* bbcvertex =
new
BbcVertexFastSimReco
();
83
bbcvertex->
set_z_smearing
(
G4BBC::z_smearing
);
84
bbcvertex->
set_t_smearing
(
G4BBC::t_smearing
);
85
se->
registerSubsystem
(bbcvertex);
86
}
87
88
return
;
89
}
90
#endif
fun4all_macros
blob
master
common
G4_Bbc.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:54
using
1.8.2 with
EIC GitHub integration