forked from sPHENIX-Collaboration/coresoftware
/
PHG4CylinderGeom_Spacalv1.h
330 lines (264 loc) · 5.77 KB
/
PHG4CylinderGeom_Spacalv1.h
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
// Tell emacs that this is a C++ source
// -*- C++ -*-.
// $$Id: PHG4CylinderGeom_Spacalv1.h,v 1.2 2014/08/12 03:49:12 jinhuang Exp $$
/*!
* \file ${file_name}
* \brief
* \author Jin Huang <jhuang@bnl.gov>
* \version $$Revision: 1.2 $$
* \date $$Date: 2014/08/12 03:49:12 $$
*/
#ifndef G4DETECTORS_PHG4CYLINDERGEOMSPACALV1_H
#define G4DETECTORS_PHG4CYLINDERGEOMSPACALV1_H
#include "PHG4CylinderGeomv2.h"
#include <iostream> // for cout, ostream
#include <map>
#include <string>
class PHParameters;
class PHG4CylinderGeom_Spacalv1 : public PHG4CylinderGeomv2
{
public:
/** @name Ctor DTor and IDs
*/
///@{
PHG4CylinderGeom_Spacalv1();
~PHG4CylinderGeom_Spacalv1() override
{
sector_map.clear();
}
// from PHObject
void identify(std::ostream &os = std::cout) const override;
// from TObject
void Print(Option_t *option = "") const override;
virtual void SetDefault();
//! load parameters from PHParameters, which interface to Database/XML/ROOT files
void ImportParameters(const PHParameters ¶m) override;
///@}
/** @name Set Cylinder Geometry
*/
///@{
double
get_max_radius() const
{
return get_radius() + get_thickness();
}
double
get_half_radius() const
{
return get_radius() + get_thickness() / 2.;
}
double
get_length() const
{
return get_zmax() - get_zmin();
}
double
get_xpos() const
{
return xpos;
}
void
set_xpos(double xpos)
{
this->xpos = xpos;
}
double
get_ypos() const
{
return ypos;
}
void
set_ypos(double ypos)
{
this->ypos = ypos;
}
double
get_zpos() const
{
return zpos;
}
void
set_zpos(double zpos)
{
this->zpos = zpos;
}
///@}
/** @name Azimuthal segments
*/
///@{
virtual int
get_azimuthal_n_sec() const;
virtual double
get_azimuthal_distance() const;
virtual double
get_z_distance() const;
//! sector map sector_ID -> azimuthal rotation.
typedef std::map<int, double> sector_map_t;
//! sector map sector_ID -> azimuthal rotation.
const sector_map_t &
get_sector_map() const
{
return sector_map;
}
//! sector map sector_ID -> azimuthal rotation.
sector_map_t &
get_sector_map()
{
return sector_map;
}
//! load a default map that populate all the sectors
void
init_default_sector_map();
///@}
/** @name Fiber geometry
*/
///@{
double
get_fiber_outer_r() const
{
return get_fiber_clading_thickness() + get_fiber_core_diameter() / 2;
}
double
get_fiber_clading_thickness() const
{
return fiber_clading_thickness;
}
void
set_fiber_clading_thickness(double fiberCladingThickness)
{
fiber_clading_thickness = fiberCladingThickness;
}
double
get_fiber_core_diameter() const
{
return fiber_core_diameter;
}
void
set_fiber_core_diameter(double fiberCoreDiameter)
{
fiber_core_diameter = fiberCoreDiameter;
}
double
get_fiber_distance() const
{
return fiber_distance;
}
void
set_fiber_distance(double fiberDistance)
{
fiber_distance = fiberDistance;
}
///@}
/** @name Materials
*/
///@{
std::string
get_absorber_mat() const
{
return absorber_mat;
}
void
set_absorber_mat(const std::string &absorberMat)
{
absorber_mat = absorberMat;
}
std::string
get_fiber_clading_mat() const
{
return fiber_clading_mat;
}
void
set_fiber_clading_mat(const std::string &fiberCladingMat)
{
fiber_clading_mat = fiberCladingMat;
}
std::string
get_fiber_core_mat() const
{
return fiber_core_mat;
}
void
set_fiber_core_mat(const std::string &fiberCoreMat)
{
fiber_core_mat = fiberCoreMat;
}
///@}
/** @name General options
*/
///@{
double
get_fiber_core_step_size() const
{
return get_fiber_core_diameter() / 10.;
}
enum config_t
{
//! fiber always placed radially
kNonProjective = 0,
//! alias of above, more explicit
k1DProjectiveSpacal = kNonProjective,
//! Fully projective spacal with 2D tapered modules
kFullProjective_2DTaper = 2,
//! Fully projective spacal with 2D tapered modules. To speed up construction, same-length fiber is used cross one tower
kFullProjective_2DTaper_SameLengthFiberPerTower = 3,
//! Fully projective spacal with 2D tapered modules and allow azimuthal tilts
kFullProjective_2DTaper_Tilted = 4,
//! Fully projective spacal with 2D tapered modules and allow azimuthal tilts. To speed up construction, same-length fiber is used cross one tower
kFullProjective_2DTaper_Tilted_SameLengthFiberPerTower = 5,
//! alias of above, the default 2D-projective SPACAL
k2DProjectiveSpacal = kFullProjective_2DTaper_Tilted_SameLengthFiberPerTower,
//! max allowed value, for boundary cross check
kInvalidSpacalConfig
};
config_t
get_config() const
{
return config;
}
void
set_config(config_t config)
{
this->config = config;
}
bool
is_virualize_fiber() const
{
return virualize_fiber;
}
virtual bool is_azimuthal_seg_visible() const
{
return false;
}
void
set_virualize_fiber(bool virualizeFiber = true)
{
virualize_fiber = virualizeFiber;
}
int get_construction_verbose() const
{
return construction_verbose;
}
void
set_construction_verbose(int constructionVerbose)
{
construction_verbose = constructionVerbose;
}
///@}
protected:
std::string absorber_mat;
std::string fiber_core_mat;
std::string fiber_clading_mat;
double xpos;
double ypos;
double zpos;
double fiber_core_diameter;
double fiber_clading_thickness;
double fiber_distance;
config_t config;
bool virualize_fiber;
int construction_verbose;
//! sector map sector_ID -> azimuthal rotation.
sector_map_t sector_map;
ClassDefOverride(PHG4CylinderGeom_Spacalv1, 2)
};
#endif