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_DIRC.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4_DIRC.C
1
8
#ifndef MACRO_G4DIRC_C
9
#define MACRO_G4DIRC_C
10
11
#include <
GlobalVariables.C
>
12
13
#include <
g4eicdirc/G4EicDircSubsystem.h
>
14
#include <
g4trackfastsim/PHG4TrackFastSim.h
>
15
#include <eccefastpidreco/ECCEFastPIDReco.h>
16
#include <eccefastpidreco/ECCEhpDIRCFastPIDMap.h>
17
18
#include <
g4main/PHG4Reco.h
>
19
20
R__LOAD_LIBRARY
(libg4detectors.so)
21
R__LOAD_LIBRARY
(libg4eicdirc.so)
22
R__LOAD_LIBRARY
(libECCEFastPIDReco.so)
23
24
namespace Enable
25
{
26
bool
DIRC
=
false
;
27
bool
DIRC_RECO
=
false
;
28
bool
DIRC_OVERLAPCHECK
=
false
;
29
int
DIRC_VERBOSITY
= 0;
30
double
DIRC_SCALE
= 10;
//DIRC class is in mm, ECCE is in cm
31
32
// temp setting to disable DIRC photon simulation in production
33
bool
DIRC_DISABLE_PHOTON_SIMULATION
=
true
;
34
}
// namespace Enable
35
36
void
DIRCInit
()
37
{
38
BlackHoleGeometry::max_radius
=
std::max
(
BlackHoleGeometry::max_radius
, 210.);
39
BlackHoleGeometry::max_z
=
std::max
(
BlackHoleGeometry::max_z
, 280.);
40
}
41
42
void
DIRCSetup
(
PHG4Reco
* g4Reco)
43
{
44
bool
OverlapCheck =
Enable::OVERLAPCHECK
||
Enable::DIRC_OVERLAPCHECK
;
45
int
verbosity =
std::max
(
Enable::VERBOSITY
,
Enable::DIRC_VERBOSITY
);
46
47
// Per request from DIRC group on Oct-18
48
// Import DIRC geometry from https://github.com/niwgit/fun4all_eicmacros/blob/6b1fa3b/common/G4_DIRC_new.C#L47
49
G4EicDircSubsystem
*dircSubsys =
new
G4EicDircSubsystem
(
"hpDIRC"
);
50
dircSubsys->
SuperDetector
(
"hpDIRC"
);
51
dircSubsys->
set_double_param
(
"NBars"
, 10);
52
dircSubsys->
set_double_param
(
"Radius"
, 72.96 *
Enable::DIRC_SCALE
);
53
dircSubsys->
set_double_param
(
"Prizm_width"
, 35.135 *
Enable::DIRC_SCALE
);
54
dircSubsys->
set_double_param
(
"Prizm_length"
, 30.0 *
Enable::DIRC_SCALE
);
55
dircSubsys->
set_double_param
(
"Prizm_height_at_lens"
, 5.0 *
Enable::DIRC_SCALE
);
56
dircSubsys->
set_double_param
(
"Bar_thickness"
, 1.725 *
Enable::DIRC_SCALE
);
57
dircSubsys->
set_double_param
(
"Bar_width"
, 3.5 *
Enable::DIRC_SCALE
);
58
dircSubsys->
set_double_param
(
"BarL_length"
, 122.5 *
Enable::DIRC_SCALE
);
59
dircSubsys->
set_double_param
(
"BarS_length"
, 56.0 *
Enable::DIRC_SCALE
);
60
dircSubsys->
set_double_param
(
"Mirror_height"
, 2.0 *
Enable::DIRC_SCALE
);
61
dircSubsys->
set_double_param
(
"z_shift"
, -43.75 *
Enable::DIRC_SCALE
);
62
dircSubsys->
set_int_param
(
"Geom_type"
, 0);
// 0-whole DIRC, 1-one bar box
63
dircSubsys->
set_int_param
(
"Lens_id"
, 3);
// 3- 3-layer spherical lens
64
dircSubsys->
set_int_param
(
"MCP_rows"
, 6);
65
dircSubsys->
set_int_param
(
"MCP_columns"
, 4);
66
dircSubsys->
set_int_param
(
"NBoxes"
, 12);
// number of bar boxes
67
dircSubsys->
set_int_param
(
"Bar_pieces"
, 4);
// pieces glued in one bar
68
69
if
(
Enable::DIRC_DISABLE_PHOTON_SIMULATION
)
70
dircSubsys->
set_int_param
(
"disable_photon_sim"
, 1);
71
72
dircSubsys->
OverlapCheck
(OverlapCheck);
73
dircSubsys->
Verbosity
(verbosity);
74
dircSubsys->
SetActive
();
75
76
g4Reco->
registerSubsystem
(dircSubsys);
77
78
if
(
TRACKING::FastKalmanFilter
)
79
{
80
// project to an reference plane at z=170 cm
81
TRACKING::FastKalmanFilter
-> add_cylinder_state(
"hpDIRC"
, 70);
82
TRACKING::ProjectionNames
.insert(
"hpDIRC"
);
83
}
84
85
}
86
87
void
DIRCReco
()
88
{
89
int
verbosity =
std::max
(
Enable::VERBOSITY
,
Enable::DIRC_VERBOSITY
);
90
Fun4AllServer
*se =
Fun4AllServer::instance
();
91
92
ECCEhpDIRCFastPIDMap
* pidmap =
new
ECCEhpDIRCFastPIDMap
();
93
pidmap->
ReadMap
(
string
(getenv(
"CALIBRATIONROOT"
)) +
string
(
"/hpDIRC/FastPID/ctr_map_p1_0.95.root"
) );
94
95
ECCEFastPIDReco
* reco =
new
ECCEFastPIDReco
(pidmap,
EICPIDDefs::DIRC
,
"ECCEFastPIDReco-DIRC"
);
96
reco->
setMatchG4Hit
(
"G4HIT_hpDIRC"
);
97
reco->
Verbosity
(verbosity);
98
99
100
se->
registerSubsystem
(reco);
101
}
102
103
104
#endif
macros
blob
master
common
G4_DIRC.C
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:58
using
1.8.2 with
ECCE GitHub integration