forked from ECCE-EIC/macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
G4_Bbc.C
80 lines (66 loc) · 1.86 KB
/
G4_Bbc.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef MACRO_G4BBC_C
#define MACRO_G4BBC_C
#include <g4detectors/PHG4BbcSubsystem.h>
#include <g4bbc/BbcVertexFastSimReco.h>
#include <g4main/PHG4Reco.h>
#include <fun4all/Fun4AllServer.h>
R__LOAD_LIBRARY(libg4bbc.so)
R__LOAD_LIBRARY(libg4detectors.so)
namespace Enable
{
bool BBC = false;
bool BBCFAKE = false;
int BBC_VERBOSITY = 0;
} // namespace Enable
namespace G4BBC
{
double z_smearing = 0.; // should be 6 mm, temporarily perfect for TPC initial vertexing
double t_smearing = 0.02; // 20ps timing resolution
} // namespace G4BBC
void BbcInit()
{
if (Enable::BBC && Enable::BBCFAKE)
{
cout << "Enable::BBC and Enable::BBCFAKE cannot be true at the same time" << endl;
gSystem->Exit(1);
}
// Set boundary of tracked particles to include BBC (values in cm)
if (Enable::BBC)
{
BlackHoleGeometry::max_z = std::max(BlackHoleGeometry::max_z, 300.);
BlackHoleGeometry::min_z = std::min(BlackHoleGeometry::min_z, -300.);
BlackHoleGeometry::max_radius = std::max(BlackHoleGeometry::max_radius, 15.0);
}
}
void Bbc(PHG4Reco* g4Reco)
{
if (Enable::BBC)
{
PHG4BbcSubsystem* bbc = new PHG4BbcSubsystem("BBC");
bbc->SuperDetector("BBC");
g4Reco->registerSubsystem(bbc);
}
return;
}
void Bbc_Reco()
{
int verbosity = std::max(Enable::VERBOSITY, Enable::BBC_VERBOSITY);
//---------------
// Fun4All server
//---------------
Fun4AllServer* se = Fun4AllServer::instance();
if (Enable::BBCFAKE)
{
if (verbosity > 0)
{
cout << "BBCFAKE: Using smeared vtx and t0 resolutions of "
<< G4BBC::z_smearing << " cm and " << G4BBC::t_smearing * 1000 << " ps" << endl;
}
BbcVertexFastSimReco* bbcvertex = new BbcVertexFastSimReco();
bbcvertex->set_z_smearing(G4BBC::z_smearing);
bbcvertex->set_t_smearing(G4BBC::t_smearing);
se->registerSubsystem(bbcvertex);
}
return;
}
#endif