ECCE @ EIC Software
Reference for
ECCE @ 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_EToF.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4_EToF.C
1
#ifndef MACRO_G4EToF_C
2
#define MACRO_G4EToF_C
3
4
#include <
GlobalVariables.C
>
5
6
#include <
fun4all/Fun4AllServer.h
>
7
#include <
g4etof/PHG4ECAPToFSubsystem.h
>
8
9
#include <
g4main/PHG4Reco.h
>
10
#include <
g4trackfastsim/PHG4TrackFastSim.h
>
11
12
R__LOAD_LIBRARY
(libg4etof.so)
13
//R__LOAD_LIBRARY(libfun4all.so)
14
R__LOAD_LIBRARY
(libg4detectors.so)
15
16
namespace Enable
17
{
18
bool
ETOF
=
false
;
19
bool
ETOF_GAS
=
false
;
20
bool
ETOF_OVERLAPCHECK
=
false
;
21
int
ETOF_VERBOSITY
= 0;
22
}
// namespace Enable
23
24
namespace
ETOF
25
{
26
int
f_gas_lyr
= 6.;
// total number of layers
27
int
f_mrpc_lyr
= 7.;
//total number of layers
28
int
b_gas_lyr
= 6.;
// total number of layers
29
int
b_mrpc_lyr
= 7.;
//total number of layers
30
int
pcb_lyr
= 3.;
31
int
mylar_lyr
= 4.;
32
int
cu_lyr
= 4.;
33
int
carbon_lyr
= 4.;
34
int
honeycomb_lyr
= 2.;
35
double
z_start
= -165.;
// cm , from left side of -ve Z axis moving towards origin
36
double
R_in
= 6.5;
// cm
37
double
R_out
= 68.;
//cm
38
double
gas_gap
= 0.0220;
// 220 microns
39
double
mrpc_thick
= 0.04;
// 400 microns
40
double
pcb_thick
= 0.06;
// 600 microns
41
double
cu_thick
= 0.003;
// 30 microns, layer over pcb, (1 each on outer pcb and 2 on central pcb = 4)
42
double
carbon_thick
= 0.01;
// 100 microns , 2 layers
43
double
mylar_thick
= 0.04;
// 400 microns, 4 layers
44
double
honeycomb_thick
= 0.75;
// 7.5 mm, 2 honeycomb
45
46
double
tof_width
= (
f_gas_lyr
+
b_gas_lyr
) *
gas_gap
+ (
f_mrpc_lyr
+
b_mrpc_lyr
) *
mrpc_thick
+
carbon_lyr
*
carbon_thick
+
pcb_lyr
*
pcb_thick
+
cu_lyr
*
cu_thick
+
mylar_lyr
*
mylar_thick
+
honeycomb_lyr
*
honeycomb_thick
;
47
48
double
z_end
= (
z_start
+
tof_width
);
49
50
}
// namespace ETOF
51
52
void
ETOFInit
()
53
{
54
BlackHoleGeometry::max_radius
=
std::max
(
BlackHoleGeometry::max_radius
,
ETOF::R_out
);
55
BlackHoleGeometry::max_z
=
std::max
(
BlackHoleGeometry::max_z
,
ETOF::z_end
- 5);
56
BlackHoleGeometry::min_z
=
std::min
(
BlackHoleGeometry::min_z
,
ETOF::z_start
+ 5);
57
}
58
59
void
ETOFSetup
(
PHG4Reco
* g4Reco)
60
{
61
bool
GasActive =
Enable::ABSORBER
||
Enable::ETOF_GAS
;
62
bool
OverlapCheck =
Enable::OVERLAPCHECK
||
Enable::ETOF_OVERLAPCHECK
;
63
int
verbosity =
std::max
(
Enable::VERBOSITY
,
Enable::ETOF_VERBOSITY
);
64
65
Fun4AllServer
* se =
Fun4AllServer::instance
();
66
se->
Verbosity
(verbosity);
67
68
PHG4ECAPToFSubsystem
* eTOF =
new
PHG4ECAPToFSubsystem
(
"eTOF"
, 1);
69
eTOF->
Verbosity
(verbosity);
70
71
eTOF->
set_int_param
(
"n_fgas_layer"
,
ETOF::f_gas_lyr
);
72
eTOF->
set_int_param
(
"n_bgas_layer"
,
ETOF::b_gas_lyr
);
73
eTOF->
set_double_param
(
"gas_gap"
,
ETOF::gas_gap
);
74
eTOF->
set_double_param
(
"glass_thick"
,
ETOF::mrpc_thick
);
75
eTOF->
set_double_param
(
"Carbon_thick"
,
ETOF::carbon_thick
);
76
eTOF->
set_double_param
(
"pcb_thick"
,
ETOF::pcb_thick
);
77
eTOF->
set_double_param
(
"cu_thick"
,
ETOF::cu_thick
);
78
eTOF->
set_double_param
(
"honeycomb_thick"
,
ETOF::honeycomb_thick
);
79
eTOF->
set_double_param
(
"mylar_thick"
,
ETOF::mylar_thick
);
80
eTOF->
set_double_param
(
"Rin"
,
ETOF::R_in
);
81
eTOF->
set_double_param
(
"Rout"
,
ETOF::R_out
);
82
eTOF->
set_double_param
(
"z_begin"
,
ETOF::z_start
);
83
eTOF->
set_int_param
(
"use_g4steps"
, 1);
84
eTOF->
SetActive
(1);
85
eTOF->
SuperDetector
(
"ETOF"
);
86
if
(GasActive)
87
{
88
eTOF->
SetAbsorberActive
(1);
89
}
90
eTOF->
OverlapCheck
(OverlapCheck);
91
92
g4Reco->
registerSubsystem
(eTOF);
93
94
//trd_hcap->OverlapCheck(1);
95
96
if
(verbosity > 1) cout <<
" ETOF gas layer :"
<<
ETOF::f_gas_lyr
<< endl;
97
98
if
(
TRACKING::FastKalmanFilter
)
99
{
100
/*
101
TRACKING::FastKalmanFilter->add_phg4hits(string("G4HIT_") + string(Form("ACTIVEGAS_ETOF")), // const std::string& phg4hitsNames,
102
PHG4TrackFastSim::Vertical_Plane, // const DETECTOR_TYPE phg4dettype,
103
1, //1. / sqrt(12.), // const float radres,
104
5.0e-1,//55e-4, // const float phires,
105
5.0e-1,//55e-4, // const float lonres,
106
1, // const float eff,
107
0); // const float noise
108
109
*/
110
111
//Reference plane projection at initial R of ToF
112
TRACKING::FastKalmanFilter
->
add_zplane_state
(
string
(
"G4HIT_"
) +
string
(Form(
"ACTIVEGAS_ETOF"
)),
ETOF::z_start
);
113
TRACKING::ProjectionNames
.insert(
string
(
"G4HIT_"
) +
string
(Form(
"ACTIVEGAS_ETOF"
)));
114
}
115
return
;
116
}
117
118
void
ETOF_Reco
()
119
{
120
gSystem->Load(
"libfun4all.so"
);
121
gSystem->Load(
"libg4detectors.so"
);
122
123
int
verbosity =
std::max
(
Enable::VERBOSITY
,
Enable::ETOF_VERBOSITY
);
124
Fun4AllServer
* se =
Fun4AllServer::instance
();
125
//se->Verbosity(INT_MAX-10);
126
127
return
;
128
}
129
130
#endif
macros
blob
master
common
G4_EToF.C
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:58
using
1.8.2 with
ECCE GitHub integration