LDMX Software
tracking::geo::TrackersTrackingGeometry Class Reference

Public Member Functions

void buildTaggerLayoutMap (G4VPhysicalVolume *pvol, std::string surfacename)
 
void buildRecoilLayoutMap (G4VPhysicalVolume *pvol, std::string surfacename)
 
std::shared_ptr< Acts::PlaneSurface > getSurfacePtr (G4VPhysicalVolume *pvol, Acts::Transform3 ref_trans)
 
Acts::CuboidVolumeBuilder::VolumeConfig buildVolumeConfig (const G4VPhysicalVolume *detector, const std::map< std::string, std::vector< std::shared_ptr< const Acts::Surface > > > layout, double tracker_y_length, double tracker_z_length, const std::string &volumeName)
 
Acts::CuboidVolumeBuilder::VolumeConfig buildTSVolume ()
 
Acts::CuboidVolumeBuilder::VolumeConfig buildTargetVolume ()
 
- Public Member Functions inherited from tracking::geo::TrackingGeometry
 TrackingGeometry (const std::string &name, const Acts::GeometryContext &gctx, const std::string &gdml)
 
virtual ~TrackingGeometry ()=default
 Destructor.
 
G4VPhysicalVolume * findDaughterByName (G4VPhysicalVolume *pvol, G4String name)
 
void getAllDaughters (G4VPhysicalVolume *pvol)
 
void convertG4Rot (const G4RotationMatrix *g4rot, Acts::RotationMatrix3 &rot) const
 
Acts::Vector3 convertG4Pos (const G4ThreeVector &g4pos) const
 
void dumpGeometry (const std::string &outputDir, const Acts::GeometryContext &gctx) const
 
std::shared_ptr< const Acts::TrackingGeometry > getTG () const
 
Acts::Transform3 getTransform (const G4VPhysicalVolume &phex, bool toTrackingFrame=false) const
 
Acts::Transform3 toTracker (const Acts::Transform3 &trans) const
 
void makeLayerSurfacesMap ()
 
void getSurfaces (std::vector< const Acts::Surface * > &surfaces) const
 
const Acts::Surface * getSurface (int layerid) const
 
const std::string & fieldMapFile () const
 Full path to the field map file extracted from the GDML auxiliary data.
 
- Public Member Functions inherited from framework::ConditionsObject
 ConditionsObject (const std::string &name)
 Class constructor.
 
virtual ~ConditionsObject ()
 Destructor.
 
std::string getName () const
 Get the name of this object.
 

Static Public Attributes

static const std::string NAME = "TrackersTrackingGeometry"
 

Private Member Functions

 TrackersTrackingGeometry (const Acts::GeometryContext &gctx, const std::string &gdml, double tracker_y_length, double tracker_z_length)
 

Private Attributes

friend TrackersTrackingGeometryProvider
 
G4VPhysicalVolume * tagger_ {nullptr}
 
G4VPhysicalVolume * recoil_ {nullptr}
 
std::map< std::string, std::vector< std::shared_ptr< const Acts::Surface > > > tagger_layout_
 
std::map< std::string, std::vector< std::shared_ptr< const Acts::Surface > > > recoil_layout_
 

Additional Inherited Members

- Static Public Member Functions inherited from tracking::geo::TrackingGeometry
static bool compareZlocation (const G4VPhysicalVolume &pvol_a, const G4VPhysicalVolume &pvol_b)
 
- Public Attributes inherited from tracking::geo::TrackingGeometry
std::unordered_map< unsigned int, const Acts::Surface * > layer_surface_map_
 
std::vector< std::shared_ptr< tracking::geo::DetectorElement > > det_elements_
 
- Protected Attributes inherited from tracking::geo::TrackingGeometry
const Acts::GeometryContext & gctx_
 
std::string gdml_ {""}
 
Acts::RotationMatrix3 x_rot_
 
Acts::RotationMatrix3 y_rot_
 
std::shared_ptr< const Acts::TrackingGeometry > t_geometry_ {nullptr}
 
G4VPhysicalVolume * f_world_phys_vol_ {nullptr}
 

Detailed Description

Definition at line 46 of file TrackersTrackingGeometry.h.

Constructor & Destructor Documentation

◆ TrackersTrackingGeometry()

tracking::geo::TrackersTrackingGeometry::TrackersTrackingGeometry ( const Acts::GeometryContext & gctx,
const std::string & gdml,
double tracker_y_length,
double tracker_z_length )
private

Definition at line 12 of file TrackersTrackingGeometry.cxx.

15 : TrackingGeometry(NAME, gctx, gdml) {
16 std::vector<Acts::CuboidVolumeBuilder::VolumeConfig> vol_builder_configs;
17
18 tagger_ = findDaughterByName(f_world_phys_vol_, "tagger_PV");
19 if (tagger_) {
20 buildTaggerLayoutMap(tagger_, "tagger");
21 vol_builder_configs.push_back(buildVolumeConfig(
22 tagger_, tagger_layout_, tracker_y_length, tracker_z_length, "Tagger"));
23 } else {
24 ldmx_log(warn) << "No tagger_PV found in detector — skipping tagger "
25 "tracking volume";
26 }
27
28 recoil_ = findDaughterByName(f_world_phys_vol_, "recoil_PV");
29 if (recoil_) {
30 buildRecoilLayoutMap(recoil_, "recoil");
31 auto recoil_volume_cfg = buildVolumeConfig(
32 recoil_, recoil_layout_, tracker_y_length, tracker_z_length, "Recoil");
33
34 // Extend the recoil volume upstream so the low-x (ACTS) edge is at -1mm,
35 // placing the target (x=0) clearly inside the volume for the CKF Navigator.
36 // Only apply when the recoil volume actually straddles or is downstream of
37 // the target; for reduced geometries the recoil can be entirely upstream.
38 {
39 double upstream_x =
40 recoil_volume_cfg.position[0] - recoil_volume_cfg.length[0] / 2.0;
41 double downstream_x =
42 recoil_volume_cfg.position[0] + recoil_volume_cfg.length[0] / 2.0;
43 constexpr double low_x = -1.0; // mm
44 if (upstream_x < low_x && downstream_x > low_x) {
45 recoil_volume_cfg.length[0] = downstream_x - low_x;
46 recoil_volume_cfg.position[0] = (downstream_x + low_x) / 2.0;
47 }
48 }
49
50 vol_builder_configs.push_back(recoil_volume_cfg);
51 } else {
52 ldmx_log(warn) << "No recoil_PV found in detector — skipping recoil "
53 "tracking volume";
54 }
55
56 if (vol_builder_configs.empty()) {
57 ldmx_log(warn) << "No tracker volumes found — tracking geometry will be "
58 "empty";
59 return;
60 }
61
62 // Create the builder
63 Acts::CuboidVolumeBuilder cvb;
64
65 Acts::CuboidVolumeBuilder::Config config;
66 config.position = {-200, 0., 0.};
67 // acts x = global z
68 // global z: -200 - 900/2 = -650 to -200 + 900/2 = 250 mm
69 // global y: -70 to 70
70 // global x: -240 to 240
71 config.length = {900, tracker_y_length, tracker_z_length};
72 config.volumeCfg = vol_builder_configs;
73
74 cvb.setConfig(config);
75
76 Acts::TrackingGeometryBuilder::Config tgb_cfg;
77 tgb_cfg.trackingVolumeBuilders.push_back(
78 [=](const auto& cxt, const auto& inner, const auto&) {
79 return cvb.trackingVolume(cxt, inner, nullptr);
80 });
81
82 Acts::TrackingGeometryBuilder tgb(tgb_cfg);
83 t_geometry_ = tgb.trackingGeometry(gctx_);
84
85 // dumpGeometry("./");
86 makeLayerSurfacesMap();
87}
TrackingGeometry(const std::string &name, const Acts::GeometryContext &gctx, const std::string &gdml)

Member Function Documentation

◆ buildRecoilLayoutMap()

void tracking::geo::TrackersTrackingGeometry::buildRecoilLayoutMap ( G4VPhysicalVolume * pvol,
std::string surfacename )

Definition at line 89 of file TrackersTrackingGeometry.cxx.

90 {
91 ldmx_log(trace) << "Building layout for the " << pvol->GetName()
92 << " tracker";
93 getAllDaughters(pvol);
94
95 // Get the global transform
96 Acts::Transform3 tracker_transform = getTransform(*pvol);
97
98 G4LogicalVolume* l_vol = pvol->GetLogicalVolume();
99 for (G4int i = 0; i < l_vol->GetNoDaughters(); i++) {
100 std::string sln = l_vol->GetDaughter(i)->GetName();
101 if (sln.find(surfacename) != std::string::npos) {
102 G4VPhysicalVolume* component0_volume{nullptr};
103 G4VPhysicalVolume* active_sensor{nullptr};
104 Acts::Transform3 ref1_transform = getTransform(*(l_vol->GetDaughter(i)));
105 int sensor_copy_nr = -999;
106
107 // recoil_l1(4)_axial(stereo)->LDMXRecoilL14ModuleVolume_component0_physvol
108 // This works for v12
109 if (sln.find("axial") != std::string::npos ||
110 sln.find("stereo") != std::string::npos) {
111 component0_volume =
112 findDaughterByName(l_vol->GetDaughter(i),
113 "LDMXRecoilL14ModuleVolume_component0_physvol");
114 if (!component0_volume)
115 EXCEPTION_RAISE("BadGeometry",
116 "Could not find component0 volume for L14 Recoil");
117 active_sensor = findDaughterByName(
118 component0_volume,
119 "LDMXRecoilL14ModuleVolume_component0Sensor0_physvol");
120
121 }
122
123 // recoil_l5_sensorX->LDMXRecoilL56ModuleVolume_component0_physvol
124 // This works for v12
125 else if (sln.find("l5_sensor") != std::string::npos ||
126 sln.find("l6_sensor") != std::string::npos) {
127 component0_volume =
128 findDaughterByName(l_vol->GetDaughter(i),
129 "LDMXRecoilL56ModuleVolume_component0_physvol");
130 if (!component0_volume)
131 EXCEPTION_RAISE("BadGeometry",
132 "Could not find component0 volume for L56 Recoil");
133 active_sensor = findDaughterByName(
134 component0_volume,
135 "LDMXRecoilL56ModuleVolume_component0Sensor0_physvol");
136 }
137
138 // recoil_PV tracker->recoil_l14_sensor_vol_PV->recoil_l14_active_sensor
139 // This works for v14
140 else if (sln.find("sensor_vol")) {
141 active_sensor =
142 findDaughterByName(l_vol->GetDaughter(i), "active_sensor");
143 sensor_copy_nr = l_vol->GetDaughter(i)->GetCopyNo();
144 }
145
146 else
147 EXCEPTION_RAISE("BadGeometry", "Could not build recoil layout");
148
149 if (!active_sensor)
150 EXCEPTION_RAISE("BadGeometry",
151 "Could not find ActiveSensor for recoil volume");
152
153 Acts::Transform3 ref2_transform = Acts::Transform3::Identity();
154
155 if (component0_volume)
156 ref2_transform = getTransform(*(component0_volume));
157
158 std::shared_ptr<Acts::PlaneSurface> sensor_surface = getSurfacePtr(
159 active_sensor, tracker_transform * ref1_transform * ref2_transform);
160
161 // Build the layout
162 if (sln == "recoil_l1_axial" || sln == "recoil_l1_stereo" ||
163 sensor_copy_nr == 10 || sensor_copy_nr == 20)
164 recoil_layout_["recoil_tracker_L1"].push_back(sensor_surface);
165
166 if (sln == "recoil_l2_axial" || sln == "recoil_l2_stereo" ||
167 sensor_copy_nr == 30 || sensor_copy_nr == 40)
168 recoil_layout_["recoil_tracker_L2"].push_back(sensor_surface);
169
170 if (sln == "recoil_l3_axial" || sln == "recoil_l3_stereo" ||
171 sensor_copy_nr == 50 || sensor_copy_nr == 60)
172 recoil_layout_["recoil_tracker_L3"].push_back(sensor_surface);
173
174 if (sln == "recoil_l4_axial" || sln == "recoil_l4_stereo" ||
175 sensor_copy_nr == 70 || sensor_copy_nr == 80)
176 recoil_layout_["recoil_tracker_L4"].push_back(sensor_surface);
177
178 if (sln == "recoil_l5_sensor1" || sln == "recoil_l5_sensor2" ||
179 sln == "recoil_l5_sensor3" || sln == "recoil_l5_sensor4" ||
180 sln == "recoil_l5_sensor5" || sln == "recoil_l5_sensor6" ||
181 sln == "recoil_l5_sensor7" || sln == "recoil_l5_sensor8" ||
182 sln == "recoil_l5_sensor9" || sln == "recoil_l5_sensor10" ||
183 (sensor_copy_nr >= 90 && sensor_copy_nr <= 99))
184
185 recoil_layout_["recoil_tracker_L5"].push_back(sensor_surface);
186
187 if (sln == "recoil_l6_sensor1" || sln == "recoil_l6_sensor2" ||
188 sln == "recoil_l6_sensor3" || sln == "recoil_l6_sensor4" ||
189 sln == "recoil_l6_sensor5" || sln == "recoil_l6_sensor6" ||
190 sln == "recoil_l6_sensor7" || sln == "recoil_l6_sensor8" ||
191 sln == "recoil_l6_sensor9" || sln == "recoil_l6_sensor10" ||
192 (sensor_copy_nr >= 100 && sensor_copy_nr <= 109))
193 recoil_layout_["recoil_tracker_L6"].push_back(sensor_surface);
194
195 } // found the daughter
196 } // loop on daughters
197} // BuildRecoilLayoutMap

◆ buildTaggerLayoutMap()

void tracking::geo::TrackersTrackingGeometry::buildTaggerLayoutMap ( G4VPhysicalVolume * pvol,
std::string surfacename )

Definition at line 202 of file TrackersTrackingGeometry.cxx.

203 {
204 ldmx_log(trace) << "Building layout for the " << pvol->GetName()
205 << " tracker";
206 // getAllDaughters(pvol);
207
208 // Get the global transform
209 Acts::Transform3 tracker_transform = getTransform(*pvol);
210
211 G4LogicalVolume* l_vol = pvol->GetLogicalVolume();
212 for (G4int i = 0; i < l_vol->GetNoDaughters(); i++) {
213 std::string sln = l_vol->GetDaughter(i)->GetName();
214
215 // To distinguish which layers need to be selected
216 if (sln.find(surfacename) != std::string::npos) {
217 // v12
218
219 // Box for the module_ (slightly bigger than the sensor)
220 // LDMXTaggerModuleVolume_physvol -> LDMXTaggerModuleVolume_component0Box,
221 // this is the sensor + inactive region
222 // LDMXTaggerModuleVolume_component0Box->
223 // LDMXTaggerModuleVolume_component0Sensor0Box, this is the sensor itself
224 // (active region)
225
226 // tagger_ -> LDMXTaggerModuleVolume_physvol1 ->
227 // LDMXTaggerModuleVolume_component0_physvol
228 // ->LDMXTaggerModuleVolume_component0Sensor0_physvol
229 // -> Get Box for the dimension: GetLogical->GetSolid
230 // For the positioning of the sensor:
231 // A position of physvol1 + position of the component0_physvol +
232 // position of the sensor physvol. Thickness I can grab it from the box,
233 // or I just hardcode it. S transform1 * transform2 * transform3
234 // ....
235
236 // v14
237 // tagger_PV->tagger_sensor_vol_PV->tagger_active_sensor
238 // Then use the copyNumber..
239
240 // Get the sensor volume placement
241 Acts::Transform3 ref1_transform = getTransform(*(l_vol->GetDaughter(i)));
242
243 G4VPhysicalVolume* component0_volume = findDaughterByName(
244 l_vol->GetDaughter(i), "LDMXTaggerModuleVolume_component0_physvol");
245
246 Acts::Transform3 ref2_transform = Acts::Transform3::Identity();
247 G4VPhysicalVolume* active_sensor = nullptr;
248 int sensor_copy_nr = -999;
249
250 // Get Component0 transform. v12
251 if (component0_volume) {
252 ref2_transform = getTransform(*(component0_volume));
253 active_sensor = findDaughterByName(
254 component0_volume,
255 "LDMXTaggerModuleVolume_component0Sensor0_physvol");
256 }
257 // v14
258 else {
259 active_sensor =
260 findDaughterByName(l_vol->GetDaughter(i), "active_sensor");
261 sensor_copy_nr = (l_vol->GetDaughter(i))->GetCopyNo();
262 }
263
264 if (!active_sensor) {
265 ldmx_log(fatal) << "Could not find the ActiveSensor for tagger volume "
266 << l_vol->GetDaughter(i)->GetName();
267 }
268
269 // Get the surface
270 std::shared_ptr<Acts::PlaneSurface> sensor_surface = getSurfacePtr(
271 active_sensor, tracker_transform * ref1_transform * ref2_transform);
272
273 if (sln == "LDMXTaggerModuleVolume_physvol1" ||
274 sln == "LDMXTaggerModuleVolume_physvol2" || sensor_copy_nr == 130 ||
275 sensor_copy_nr == 140)
276 tagger_layout_["tagger_tracker_L1"].push_back(sensor_surface);
277
278 if (sln == "LDMXTaggerModuleVolume_physvol3" ||
279 sln == "LDMXTaggerModuleVolume_physvol4" || sensor_copy_nr == 110 ||
280 sensor_copy_nr == 120)
281 tagger_layout_["tagger_tracker_L2"].push_back(sensor_surface);
282
283 if (sln == "LDMXTaggerModuleVolume_physvol5" ||
284 sln == "LDMXTaggerModuleVolume_physvol6" || sensor_copy_nr == 90 ||
285 sensor_copy_nr == 100)
286 tagger_layout_["tagger_tracker_L3"].push_back(sensor_surface);
287
288 if (sln == "LDMXTaggerModuleVolume_physvol7" ||
289 sln == "LDMXTaggerModuleVolume_physvol8" || sensor_copy_nr == 70 ||
290 sensor_copy_nr == 80)
291 tagger_layout_["tagger_tracker_L4"].push_back(sensor_surface);
292
293 if (sln == "LDMXTaggerModuleVolume_physvol9" ||
294 sln == "LDMXTaggerModuleVolume_physvol10" || sensor_copy_nr == 50 ||
295 sensor_copy_nr == 60)
296 tagger_layout_["tagger_tracker_L5"].push_back(sensor_surface);
297
298 if (sln == "LDMXTaggerModuleVolume_physvol11" ||
299 sln == "LDMXTaggerModuleVolume_physvol12" || sensor_copy_nr == 30 ||
300 sensor_copy_nr == 40)
301 tagger_layout_["tagger_tracker_L6"].push_back(sensor_surface);
302
303 if (sln == "LDMXTaggerModuleVolume_physvol13" ||
304 sln == "LDMXTaggerModuleVolume_physvol14" || sensor_copy_nr == 10 ||
305 sensor_copy_nr == 20)
306 tagger_layout_["tagger_tracker_L7"].push_back(sensor_surface);
307
308 } // found a silicon surface
309 } // loop on daughters
310} // build the layout

◆ buildTargetVolume()

Acts::CuboidVolumeBuilder::VolumeConfig tracking::geo::TrackersTrackingGeometry::buildTargetVolume ( )
inline

Definition at line 67 of file TrackersTrackingGeometry.h.

67{ return {}; }

◆ buildTSVolume()

Acts::CuboidVolumeBuilder::VolumeConfig tracking::geo::TrackersTrackingGeometry::buildTSVolume ( )
inline

Definition at line 66 of file TrackersTrackingGeometry.h.

66{ return {}; }

◆ buildVolumeConfig()

Acts::CuboidVolumeBuilder::VolumeConfig tracking::geo::TrackersTrackingGeometry::buildVolumeConfig ( const G4VPhysicalVolume * detector,
const std::map< std::string, std::vector< std::shared_ptr< const Acts::Surface > > > layout,
double tracker_y_length,
double tracker_z_length,
const std::string & volumeName )

Definition at line 412 of file TrackersTrackingGeometry.cxx.

418 {
419 Acts::CuboidVolumeBuilder::VolumeConfig sub_det_volume_config;
420
421 // Get the transform wrt the world volume in tracker frame
422 Acts::Transform3 sub_det_transform = getTransform(*detector, true);
423
424 // Add 1mm to not make it sit on the first layer_ surface
425 Acts::Vector3 sub_det_position = {
426 sub_det_transform.translation()(0) - 1,
427 sub_det_transform.translation()(1),
428 sub_det_transform.translation()(2),
429 };
430
431 ldmx_log(trace) << sub_det_position;
432 // Get the size of the volume along the beam axis (G4 z -> ACTS x).
433 // The solid may be a G4Box or a boolean solid (e.g. G4SubtractionSolid
434 // for the reduced-geometry recoil), so use GetExtent() for generality.
435 G4VSolid* sub_det_solid = detector->GetLogicalVolume()->GetSolid();
436 double z_half;
437 auto* sub_det_box = dynamic_cast<G4Box*>(sub_det_solid);
438 if (sub_det_box) {
439 z_half = sub_det_box->GetZHalfLength();
440 } else {
441 G4VisExtent extent = sub_det_solid->GetExtent();
442 z_half = (extent.GetZmax() - extent.GetZmin()) / 2.0;
443 }
444
445 // In tracker coordinates. Add 1mm to compensate for the movement above
446 double x_length = 2 * (z_half + 1) * Acts::UnitConstants::mm;
447 ldmx_log(info) << "x_length = " << x_length
448 << " y_length = " << tracker_y_length
449 << " z_length = " << tracker_z_length;
450
451 sub_det_volume_config.position = sub_det_position;
452 sub_det_volume_config.length = {x_length, tracker_y_length, tracker_z_length};
453 sub_det_volume_config.name = volumeName;
454
455 // Vacuum material
456 Acts::Material subdet_mat = Acts::Material::Vacuum();
457 sub_det_volume_config.volumeMaterial =
458 std::make_shared<Acts::HomogeneousVolumeMaterial>(subdet_mat);
459
460 std::vector<Acts::CuboidVolumeBuilder::LayerConfig> layer_config;
461
462 // Prepare the layers
463 for (auto& layer : layout) {
464 ldmx_log(trace) << layer.first << " : surfaces==>" << layer.second.size();
465
466 Acts::CuboidVolumeBuilder::LayerConfig lcfg;
467 lcfg.surfaces = layer.second;
468
469 // Get the surface thickness
470 double clearance = 1.0; // mm
471 double thickness = layer.second.front()
472 ->surfaceMaterial()
473 ->materialSlab(Acts::Vector2{0., 0.})
474 .thickness();
475
476 lcfg.envelopeX = std::array<double, 2>{thickness / 2. + clearance,
477 thickness / 2. + clearance};
478 lcfg.active = true;
479 layer_config.push_back(lcfg);
480 }
481
482 sub_det_volume_config.layerCfg = layer_config;
483
484 return sub_det_volume_config;
485}

◆ getSurfacePtr()

std::shared_ptr< Acts::PlaneSurface > tracking::geo::TrackersTrackingGeometry::getSurfacePtr ( G4VPhysicalVolume * pvol,
Acts::Transform3 ref_trans )

Definition at line 312 of file TrackersTrackingGeometry.cxx.

313 {
314 if (!pvol) {
315 ldmx_log(fatal) << "pvol is nullptr";
316 }
317
318 // Get the surface transform
319 Acts::Transform3 surface_transform = getTransform(*pvol);
320 // Compose the sensor_transform with the reference transform
321 surface_transform = ref_trans * surface_transform;
322
323 // Now transform to the tracker frame
324 Acts::Transform3 surface_transform_tracker = toTracker(surface_transform);
325
326 ldmx_log(trace) << "THE SENSOR TRANSFORM - TRANSLATION";
327 ldmx_log(trace) << surface_transform.translation()(0);
328 ldmx_log(trace) << surface_transform.translation()(1);
329 ldmx_log(trace) << surface_transform.translation()(2);
330 ldmx_log(trace) << "THE SENSOR TRANSFORM - ROTATION";
331 ldmx_log(trace) << surface_transform.rotation();
332
333 ldmx_log(trace) << "TO THE TRACKER FRAME";
334 ldmx_log(trace) << surface_transform_tracker.translation()(0);
335 ldmx_log(trace) << surface_transform_tracker.translation()(1);
336 ldmx_log(trace) << surface_transform_tracker.translation()(2);
337 ldmx_log(trace) << "THE SENSOR TRANSFORM - ROTATION";
338 ldmx_log(trace) << surface_transform_tracker.rotation();
339
340 // This material is defined in different units with respect what acts expects.
341 // I decided to hardcode here. TODO: fix this
342
343 /*
344 G4Material* sens_mat = _ActiveSensor->GetLogicalVolume()->GetMaterial();
345 ldmx_log(trace)<<"Checking the material of
346 "<<l_vol->GetDaughter(i)->GetName()<<std::endl; ldmx_log(trace)<<"With
347 sensor::"<<_ActiveSensor->GetName()<<std::endl;
348 ldmx_log(trace)<<sens_mat->GetName()<<std::endl;
349 ldmx_log(trace)<<"RL="<<sens_mat->GetRadlen()<<"
350 lambda="<<sens_mat->GetNuclearInterLength()<<std::endl;
351 ldmx_log(trace)<<"A="<<sens_mat->GetA()<<" Z="<<sens_mat->GetZ()<<"
352 rho="<<sens_mat->GetDensity()<<std::endl;
353
354
355 Acts::Material silicon =
356 Acts::Material::fromMassDensity(sens_mat->GetRadlen(),
357 sens_mat->GetNuclearInterLength(),
358 sens_mat->GetA(),
359 sens_mat->GetZ(),
360 sens_mat->GetDensity());
361 */
362
363 // Define the silicon material
364 Acts::Material silicon = Acts::Material::fromMassDensity(
365 95.7 * Acts::UnitConstants::mm, 465.2 * Acts::UnitConstants::mm, 28.03,
366 14., 2.32 * Acts::UnitConstants::g / Acts::UnitConstants::cm3);
367
368 // Get the active sensor box
369 G4Box* surface_solid = (G4Box*)(pvol->GetLogicalVolume()->GetSolid());
370
371 ldmx_log(trace) << "Sensor Dimensions";
372 ldmx_log(trace) << surface_solid->GetXHalfLength() << " "
373 << surface_solid->GetYHalfLength() << " "
374 << surface_solid->GetZHalfLength() << " ";
375
376 // Form the material slab
377 double thickness =
378 2 * surface_solid->GetZHalfLength() * Acts::UnitConstants::mm;
379 Acts::MaterialSlab silicon_slab(silicon, thickness);
380
381 // Get the bounds
382 std::shared_ptr<const Acts::RectangleBounds> rect_bounds =
383 std::make_shared<const Acts::RectangleBounds>(Acts::RectangleBounds(
384 surface_solid->GetXHalfLength() * Acts::UnitConstants::mm,
385 surface_solid->GetYHalfLength() * Acts::UnitConstants::mm));
386
387 // Form the active sensor surface
388 std::shared_ptr<Acts::PlaneSurface> surface =
389 Acts::Surface::makeShared<Acts::PlaneSurface>(surface_transform_tracker,
390 rect_bounds);
391 surface->assignSurfaceMaterial(
392 std::make_shared<Acts::HomogeneousSurfaceMaterial>(silicon_slab));
393
394 // Create an alignable detector element and assign it to the surface.
395 // The default transformation is the surface parsed transformation
396
397 auto det_element = std::make_shared<tracking::geo::DetectorElement>(
398 std::static_pointer_cast<Acts::Surface>(surface),
399 surface_transform_tracker, thickness);
400
401 // This is the call that modify the behaviour of surface->transform(gctx)
402 // After this call each surface will use the underlying detectorElement
403 // transformation which will take care of effectively reading the gctx
404
405 surface->assignSurfacePlacement(*det_element);
406 det_elements_.push_back(det_element);
407
408 return surface;
409}

Member Data Documentation

◆ NAME

const std::string tracking::geo::TrackersTrackingGeometry::NAME = "TrackersTrackingGeometry"
static

Definition at line 48 of file TrackersTrackingGeometry.h.

◆ recoil_

G4VPhysicalVolume* tracking::geo::TrackersTrackingGeometry::recoil_ {nullptr}
private

Definition at line 76 of file TrackersTrackingGeometry.h.

76{nullptr};

◆ recoil_layout_

std::map<std::string, std::vector<std::shared_ptr<const Acts::Surface> > > tracking::geo::TrackersTrackingGeometry::recoil_layout_
private

Definition at line 89 of file TrackersTrackingGeometry.h.

◆ tagger_

G4VPhysicalVolume* tracking::geo::TrackersTrackingGeometry::tagger_ {nullptr}
private

Definition at line 75 of file TrackersTrackingGeometry.h.

75{nullptr};

◆ tagger_layout_

std::map<std::string, std::vector<std::shared_ptr<const Acts::Surface> > > tracking::geo::TrackersTrackingGeometry::tagger_layout_
private

Definition at line 87 of file TrackersTrackingGeometry.h.

◆ TrackersTrackingGeometryProvider

friend tracking::geo::TrackersTrackingGeometry::TrackersTrackingGeometryProvider
private

Definition at line 70 of file TrackersTrackingGeometry.h.


The documentation for this class was generated from the following files: