/
G4_DIRC.C
166 lines (137 loc) · 5.43 KB
/
G4_DIRC.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#ifndef MACRO_G4DIRC_C
#define MACRO_G4DIRC_C
#include <GlobalVariables.C>
#include <g4detectors/PHG4CylinderSubsystem.h>
#include <g4detectors/PHG4SectorSubsystem.h>
#include <g4detectors/PHG4ConeSubsystem.h>
#include <g4eicdirc/G4EicDircSubsystem.h>
#include <g4main/PHG4Reco.h>
#include <cmath>
R__LOAD_LIBRARY(libg4eicdirc.so)
/*!
* \file G4_DIRC.C
* \brief Macro setting up the barrel DIRC
* \author Jin Huang <jhuang@bnl.gov>
* \version $Revision: 1.3 $
* \date $Date: 2013/10/09 01:08:17 $
*/
namespace Enable
{
bool DIRC = false;
bool DIRC_OVERLAPCHECK = false;
} // namespace Enable
namespace G4DIRC
{
double z_prism = 30;
double z_start = -275+z_prism;
double z_end = 125;
double length = 0.;
double z_shift = 0.;
double outer_skin_radius = 89.25;
double dRad = 5.6;
double dInSkin = 7.54;
namespace SETTING
{
bool USECEMCGeo = true;
bool USEskinSupports = true;
bool NEWDIRC = true;
}
} // namespace G4DIRC
void DIRCInit()
{
if (!G4DIRC::SETTING::USECEMCGeo){
G4DIRC::outer_skin_radius = 78.;
G4DIRC::dRad = 8.;
G4DIRC::dInSkin = 9.;
G4DIRC::z_end = -287 + G4DIRC::z_prism;
G4DIRC::z_end = +168;
}
G4DIRC::z_shift = 0.5 * (G4DIRC::z_end + G4DIRC::z_start);
G4DIRC::length = G4DIRC::z_end - G4DIRC::z_start;
BlackHoleGeometry::max_radius = std::max(BlackHoleGeometry::max_radius, G4DIRC::outer_skin_radius);
BlackHoleGeometry::max_z = std::max(BlackHoleGeometry::max_z, G4DIRC::z_end);
BlackHoleGeometry::min_z = std::min(BlackHoleGeometry::min_z, G4DIRC::z_start- G4DIRC::z_prism);
}
//! Babar DIRC (Without most of support structure)
//! Ref: I. Adam et al. The DIRC particle identification system for the BaBar experiment.
//! Nucl. Instrum. Meth., A538:281-357, 2005. doi:10.1016/j.nima.2004.08.129.
double DIRCSetup(PHG4Reco *g4Reco)
{
bool OverlapCheck = Enable::OVERLAPCHECK || Enable::DIRC_OVERLAPCHECK;
if(G4DIRC::SETTING::NEWDIRC){
// double z = 185;
// double dz = 40;
G4EicDircSubsystem *dircSubsys = new G4EicDircSubsystem("hpDIRC");
dircSubsys->SuperDetector("hpDIRC");
//dircSubsys->set_double_param("place_z", z + dz * 0.5);// relative position to mother vol.
dircSubsys->OverlapCheck(OverlapCheck);
dircSubsys->Verbosity(0);
dircSubsys->SetActive();
g4Reco->registerSubsystem(dircSubsys);
} else {
double radiator_R = G4DIRC::outer_skin_radius-G4DIRC::dRad;
PHG4SectorSubsystem *dirc;
dirc = new PHG4SectorSubsystem("DIRC");
dirc->get_geometry().set_normal_polar_angle(M_PI / 2);
dirc->get_geometry().set_normal_start(radiator_R * PHG4Sector::Sector_Geometry::Unit_cm());
dirc->get_geometry().set_min_polar_angle(atan2(radiator_R, G4DIRC::z_end));
dirc->get_geometry().set_max_polar_angle(atan2(radiator_R, G4DIRC::z_start));
dirc->get_geometry().set_min_polar_edge(PHG4Sector::Sector_Geometry::FlatEdge());
dirc->get_geometry().set_max_polar_edge(PHG4Sector::Sector_Geometry::FlatEdge());
dirc->get_geometry().set_material("Quartz");
dirc->get_geometry().set_N_Sector(12);
dirc->OverlapCheck(OverlapCheck);
dirc->get_geometry().AddLayer("Radiator", "Quartz", 1.7 * PHG4Sector::Sector_Geometry::Unit_cm(), true);
g4Reco->registerSubsystem(dirc);
PHG4CylinderSubsystem *cyl;
// The cylinder skins provide most of the strength
// and stiffness of the CST. The thickness of the inner
// and outer skins is 1.27 and 0.76 mm, respectively
double inner_R = G4DIRC::outer_skin_radius-G4DIRC::dInSkin;
// Inner skin:
if (G4DIRC::SETTING::USEskinSupports){
cyl = new PHG4CylinderSubsystem("DIRC_CST_Inner_Skin", 10);
cyl->set_double_param("radius", inner_R);
cyl->set_double_param("length", G4DIRC::length + G4DIRC::z_prism);
cyl->set_string_param("material", "G4_Al");
cyl->set_double_param("thickness", 0.127);
cyl->set_double_param("place_x", 0.);
cyl->set_double_param("place_y", 0.);
cyl->set_double_param("place_z", G4DIRC::z_shift - G4DIRC::z_prism * 0.5);
cyl->SetActive(0);
cyl->SuperDetector("DIRC");
cyl->OverlapCheck(OverlapCheck);
g4Reco->registerSubsystem(cyl);
// Outer skin:
cyl = new PHG4CylinderSubsystem("DIRC_CST_Outer_Skin", 11);
cyl->set_double_param("radius", G4DIRC::outer_skin_radius - 0.076);
cyl->set_double_param("length", G4DIRC::length);
cyl->set_string_param("material", "G4_Al");
cyl->set_double_param("thickness", 0.076);
cyl->set_double_param("place_x", 0.);
cyl->set_double_param("place_y", 0.);
cyl->set_double_param("place_z", G4DIRC::z_shift);
cyl->SetActive(0);
cyl->SuperDetector("DIRC");
cyl->OverlapCheck(OverlapCheck);
g4Reco->registerSubsystem(cyl);
}
// simple approximation for DIRC prism
PHG4ConeSubsystem *cone = new PHG4ConeSubsystem("DIRC_Prism");
cone->set_color(0, 1, 0);
// cone->SetR1(radiator_R, radiator_R + 20);
// cone->SetR2(radiator_R, radiator_R + 2);
cone->SetR1(radiator_R, radiator_R + 20);
cone->SetR2(radiator_R, radiator_R + 2);
cone->SetZlength(0.5 * G4DIRC::z_prism);
cone->SetPlaceZ(G4DIRC::z_start - 0.5 * G4DIRC::z_prism);
cone->SetMaterial("Quartz");
cone->SetActive(0);
cone->SuperDetector("DIRC");
cone->OverlapCheck(OverlapCheck);
g4Reco->registerSubsystem(cone);
}
// Done
return G4DIRC::outer_skin_radius;
}
#endif