-
Notifications
You must be signed in to change notification settings - Fork 31
/
G4_BMMG.C
125 lines (107 loc) · 4.37 KB
/
G4_BMMG.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#ifndef MACRO_G4BMMG_C
#define MACRO_G4BMMG_C
#include <GlobalVariables.C>
#include <fun4all/Fun4AllServer.h>
#include <g4barrelmmg/CreateCZHitContainer.h>
#include <g4barrelmmg/PHG4CylinderStripSubsystem.h>
#include <g4main/PHG4Reco.h>
#include <g4trackfastsim/PHG4TrackFastSim.h>
R__LOAD_LIBRARY(libg4barrelmmg.so)
R__LOAD_LIBRARY(libfun4all.so)
R__LOAD_LIBRARY(libg4testbench.so)
R__LOAD_LIBRARY(libg4detectors.so)
namespace Enable
{
bool BMMG = false;
bool use_2Dreadout = true;
bool BMMG_OVERLAPCHECK = true;
int BMMG_VERBOSITY = 0;
} // namespace Enable
namespace BMMG
{
const int n_layer = 3;
const double rad[BMMG::n_layer] = {45., 47.4, 67.4}; // approximate radial location
const double len[BMMG::n_layer] = {140, 150, 280.0};
} // namespace BMMG
void BMMGInit(int verbosity = 1)
{
BlackHoleGeometry::max_radius = std::max(BlackHoleGeometry::max_radius, BMMG::rad[BMMG::n_layer - 1] / 10. + 0.7);
BlackHoleGeometry::max_z = std::max(BlackHoleGeometry::max_z, BMMG::len[BMMG::n_layer - 1] / 2.0 + 1.0);
BlackHoleGeometry::min_z = std::min(BlackHoleGeometry::min_z, -BMMG::len[BMMG::n_layer - 1] / 2.0 - 10.);
}
void BMMGSetup(PHG4Reco* g4Reco)
{
int verbosity = std::max(Enable::VERBOSITY, Enable::BMMG_VERBOSITY);
Fun4AllServer* se = Fun4AllServer::instance();
se->Verbosity(verbosity);
bool OverlapCheck = Enable::OVERLAPCHECK || Enable::BMMG_OVERLAPCHECK;
gSystem->Load("libfun4all");
gSystem->Load("libg4detectors.so");
gSystem->Load("libg4testbench.so");
gSystem->Load("libg4trackfastsim.so");
PHG4CylinderStripSubsystem* barrel_mmg;
double gap_betweenCZ = 1.5;
double Gap_betweenlayer = 1.5;
double thickness = 0.36499;
int nCZlayer = 2;
if (Enable::use_2Dreadout)
{
gap_betweenCZ = 0;
nCZlayer = 1;
}
const double prapidity = 1;
for (int ilayer = 0; ilayer < BMMG::n_layer; ilayer++)
{
barrel_mmg = new PHG4CylinderStripSubsystem(Form("BMT_%d", ilayer), ilayer);
barrel_mmg->set_double_param("radius", BMMG::rad[ilayer]);
barrel_mmg->set_string_param("gas", "myMMGas");
//barrel_mmg->set_double_param("steplimits", 300e-4);
barrel_mmg->set_double_param("phi0", 15 * ilayer);
barrel_mmg->set_double_param("gap", gap_betweenCZ);
barrel_mmg->SetActive();
barrel_mmg->SuperDetector("BMT");
barrel_mmg->set_int_param("lengthviarapidity", 0);
barrel_mmg->set_double_param("gas1thickness", 0.15);
barrel_mmg->set_double_param("length", BMMG::len[ilayer]);
barrel_mmg->set_double_param("deadzone", 0.2);
barrel_mmg->set_int_param("nhit", 1);
barrel_mmg->OverlapCheck(true);
barrel_mmg->set_int_param("use_2Dreadout", Enable::use_2Dreadout);
g4Reco->registerSubsystem(barrel_mmg);
} // ilayer loop
if (TRACKING::FastKalmanFilter)
{
if (Enable::use_2Dreadout)
{
TRACKING::FastKalmanFilter->add_phg4hits(
"G4HIT_BMT", // const std::string& phg4hitsNames,
PHG4TrackFastSim::Cylinder, // const DETECTOR_TYPE phg4dettype,
2.5 / 2 / sqrt(12), //1./sqrt(12), // radial-resolution , only used for Vertical Plane Detector Type
75e-4, //150e-4, // azimuthal-resolution [cm]
75e-4, //150e-4, // z-resolution [cm]
1, // efficiency,
0); // noise hits
}
else
{
TRACKING::FastKalmanFilter->add_phg4hits(
"G4HIT_CZBMT", // const std::string& phg4hitsNames,
PHG4TrackFastSim::Cylinder, // const DETECTOR_TYPE phg4dettype,
2.5 / 2 / sqrt(12), //1/sqrt(12), // radial-resolution [cm], only used for Vertical Plane Detector Type
75e-4, //150e-4, // azimuthal-resolution [cm]
75e-4, //150e-4, // z-resolution [cm]
1, // efficiency,
0); // noise hits
}
}
return;
}
void BMMGT_Reco()
{
gSystem->Load("libfun4all.so");
gSystem->Load("libg4detectors.so");
int verbosity = std::max(Enable::VERBOSITY, Enable::BMMG_VERBOSITY);
Fun4AllServer* se = Fun4AllServer::instance();
return;
}
#endif