LDMX Software
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
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 > GetSurface (G4VPhysicalVolume *pvol, Acts::Transform3 ref_trans)
 
Acts::CuboidVolumeBuilder::VolumeConfig buildTrackerVolume ()
 
Acts::CuboidVolumeBuilder::VolumeConfig buildRecoilVolume ()
 
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, bool debug)
 
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
 
- 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, bool debug)
 

Private Attributes

friend TrackersTrackingGeometryProvider
 
G4VPhysicalVolume * Tagger_
 
G4VPhysicalVolume * Recoil_
 
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
 
float TrackerYLength_ {480.}
 
float TrackerZLength_ {240.}
 

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< DetectorElement > > detElements
 
- Protected Attributes inherited from tracking::geo::TrackingGeometry
const Acts::GeometryContext & gctx_
 
std::string gdml_ {""}
 
bool debug_ {false}
 
Acts::RotationMatrix3 x_rot_
 
Acts::RotationMatrix3 y_rot_
 
std::shared_ptr< const Acts::TrackingGeometry > tGeometry_ {nullptr}
 
G4VPhysicalVolume * fWorldPhysVol_ {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,
bool  debug 
)
private

Definition at line 9 of file TrackersTrackingGeometry.cxx.

11 : TrackingGeometry(NAME, gctx, gdml, debug) {
12 if (debug_) std::cout << "Looking for Tagger and Recoil volumes" << std::endl;
13
14 Tagger_ = findDaughterByName(fWorldPhysVol_, "tagger_PV");
15 // v12
16 // BuildTaggerLayoutMap(Tagger_, "LDMXTaggerModuleVolume_physvol");
17 // v14
18 BuildTaggerLayoutMap(Tagger_, "tagger");
19 Acts::CuboidVolumeBuilder::VolumeConfig tagger_volume_cfg =
20 buildTrackerVolume();
21
22 Recoil_ = findDaughterByName(fWorldPhysVol_, "recoil_PV");
23 BuildRecoilLayoutMap(Recoil_, "recoil");
24 Acts::CuboidVolumeBuilder::VolumeConfig recoil_volume_cfg =
25 buildRecoilVolume();
26
27 std::vector<Acts::CuboidVolumeBuilder::VolumeConfig> volBuilderConfigs{
28 tagger_volume_cfg, recoil_volume_cfg};
29
30 // Create the builder
31 Acts::CuboidVolumeBuilder cvb;
32
33 Acts::CuboidVolumeBuilder::Config config;
34 config.position = {-200, 0., 0.};
35 config.length = {900, 480, 240};
36 config.volumeCfg = volBuilderConfigs;
37
38 cvb.setConfig(config);
39
40 Acts::TrackingGeometryBuilder::Config tgbCfg;
41 tgbCfg.trackingVolumeBuilders.push_back(
42 [=](const auto& cxt, const auto& inner, const auto&) {
43 return cvb.trackingVolume(cxt, inner, nullptr);
44 });
45
46 Acts::TrackingGeometryBuilder tgb(tgbCfg);
47 tGeometry_ = tgb.trackingGeometry(gctx_);
48
49 // dumpGeometry("./");
50 makeLayerSurfacesMap();
51}
TrackingGeometry(const std::string &name, const Acts::GeometryContext &gctx, const std::string &gdml, bool debug)

Member Function Documentation

◆ BuildRecoilLayoutMap()

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

Definition at line 220 of file TrackersTrackingGeometry.cxx.

221 {
222 if (debug_) {
223 std::cout << "Building layout for the " << pvol->GetName() << " tracker"
224 << std::endl;
225 getAllDaughters(pvol);
226 }
227
228 // Get the global transform
229 Acts::Transform3 tracker_transform = GetTransform(*pvol);
230
231 G4LogicalVolume* l_vol = pvol->GetLogicalVolume();
232 for (G4int i = 0; i < l_vol->GetNoDaughters(); i++) {
233 std::string sln = l_vol->GetDaughter(i)->GetName();
234 if (sln.find(surfacename) != std::string::npos) {
235 G4VPhysicalVolume* _Component0Volume{nullptr};
236 G4VPhysicalVolume* _ActiveSensor{nullptr};
237 Acts::Transform3 ref1_transform = GetTransform(*(l_vol->GetDaughter(i)));
238 int SensorCopyNr = -999;
239
240 // recoil_l1(4)_axial(stereo)->LDMXRecoilL14ModuleVolume_component0_physvol
241 // This works for v12
242 if (sln.find("axial") != std::string::npos ||
243 sln.find("stereo") != std::string::npos) {
244 _Component0Volume =
245 findDaughterByName(l_vol->GetDaughter(i),
246 "LDMXRecoilL14ModuleVolume_component0_physvol");
247 if (!_Component0Volume)
248 throw std::runtime_error(
249 "Could not find component0 volume for L14 Recoil");
250 _ActiveSensor = findDaughterByName(
251 _Component0Volume,
252 "LDMXRecoilL14ModuleVolume_component0Sensor0_physvol");
253
254 }
255
256 // recoil_l5_sensorX->LDMXRecoilL56ModuleVolume_component0_physvol
257 // This works for v12
258 else if (sln.find("l5_sensor") != std::string::npos ||
259 sln.find("l6_sensor") != std::string::npos) {
260 _Component0Volume =
261 findDaughterByName(l_vol->GetDaughter(i),
262 "LDMXRecoilL56ModuleVolume_component0_physvol");
263 if (!_Component0Volume)
264 throw std::runtime_error(
265 "Could not find component0 volume for L56 Recoil");
266 _ActiveSensor = findDaughterByName(
267 _Component0Volume,
268 "LDMXRecoilL56ModuleVolume_component0Sensor0_physvol");
269 }
270
271 // recoil_PV tracker->recoil_l14_sensor_vol_PV->recoil_l14_active_sensor
272 // This works for v14
273 else if (sln.find("sensor_vol")) {
274 _ActiveSensor =
275 findDaughterByName(l_vol->GetDaughter(i), "active_sensor");
276 SensorCopyNr = l_vol->GetDaughter(i)->GetCopyNo();
277 }
278
279 else
280 throw std::runtime_error("Could not build recoil layout");
281
282 if (!_ActiveSensor)
283 throw std::runtime_error(
284 "Could not find ActiveSensor for recoil volume");
285
286 Acts::Transform3 ref2_transform = Acts::Transform3::Identity();
287
288 if (_Component0Volume)
289 ref2_transform = GetTransform(*(_Component0Volume));
290
291 std::shared_ptr<Acts::PlaneSurface> sensorSurface = GetSurface(
292 _ActiveSensor, tracker_transform * ref1_transform * ref2_transform);
293
294 // Build the layout
295 if (sln == "recoil_l1_axial" || sln == "recoil_l1_stereo" ||
296 SensorCopyNr == 10 || SensorCopyNr == 20)
297 recoil_layout["recoil_tracker_L1"].push_back(sensorSurface);
298
299 if (sln == "recoil_l2_axial" || sln == "recoil_l2_stereo" ||
300 SensorCopyNr == 30 || SensorCopyNr == 40)
301 recoil_layout["recoil_tracker_L2"].push_back(sensorSurface);
302
303 if (sln == "recoil_l3_axial" || sln == "recoil_l3_stereo" ||
304 SensorCopyNr == 50 || SensorCopyNr == 60)
305 recoil_layout["recoil_tracker_L3"].push_back(sensorSurface);
306
307 if (sln == "recoil_l4_axial" || sln == "recoil_l4_stereo" ||
308 SensorCopyNr == 70 || SensorCopyNr == 80)
309 recoil_layout["recoil_tracker_L4"].push_back(sensorSurface);
310
311 if (sln == "recoil_l5_sensor1" || sln == "recoil_l5_sensor2" ||
312 sln == "recoil_l5_sensor3" || sln == "recoil_l5_sensor4" ||
313 sln == "recoil_l5_sensor5" || sln == "recoil_l5_sensor6" ||
314 sln == "recoil_l5_sensor7" || sln == "recoil_l5_sensor8" ||
315 sln == "recoil_l5_sensor9" || sln == "recoil_l5_sensor10" ||
316 (SensorCopyNr >= 90 && SensorCopyNr <= 99))
317
318 recoil_layout["recoil_tracker_L5"].push_back(sensorSurface);
319
320 if (sln == "recoil_l6_sensor1" || sln == "recoil_l6_sensor2" ||
321 sln == "recoil_l6_sensor3" || sln == "recoil_l6_sensor4" ||
322 sln == "recoil_l6_sensor5" || sln == "recoil_l6_sensor6" ||
323 sln == "recoil_l6_sensor7" || sln == "recoil_l6_sensor8" ||
324 sln == "recoil_l6_sensor9" || sln == "recoil_l6_sensor10" ||
325 (SensorCopyNr >= 100 && SensorCopyNr <= 109))
326 recoil_layout["recoil_tracker_L6"].push_back(sensorSurface);
327
328 } // found the daughter
329 } // loop on daughters
330} // BuildRecoilLayoutMap

◆ buildRecoilVolume()

Acts::CuboidVolumeBuilder::VolumeConfig tracking::geo::TrackersTrackingGeometry::buildRecoilVolume ( )

Definition at line 55 of file TrackersTrackingGeometry.cxx.

55 {
56 Acts::CuboidVolumeBuilder::VolumeConfig subDetVolumeConfig;
57 Acts::Transform3 subDet_transform = GetTransform(*Recoil_, true);
58 if (debug_) {
59 std::cout << subDet_transform.translation() << std::endl;
60 std::cout << subDet_transform.rotation() << std::endl;
61 }
62
63 // Add 1mm to not make it sit on the first layer surface - Ask Omar if it's
64 // OK
65 Acts::Vector3 sub_det_position = {
66 subDet_transform.translation()(0) - 1,
67 subDet_transform.translation()(1),
68 subDet_transform.translation()(2),
69 };
70
71 // Get the size of the volume
72 G4Box* subDetBox = (G4Box*)(Recoil_->GetLogicalVolume()->GetSolid());
73
74 // In tracker coordinates. I add 1mm so that it compensates with the 1mm
75 // movement of above
76 double x_length =
77 2 * (subDetBox->GetZHalfLength() + 1) * Acts::UnitConstants::mm;
78
79 // double y_length = 2*subDetBox->GetXHalfLength() * Acts::UnitConstants::mm;
80 // double z_length = 2*subDetBox->GetYHalfLength() * Acts::UnitConstants::mm;
81
82 // The bField is defined only between -70, 70 along ACTS Z Axis (-130,130 in
83 // the extended version)
84 double y_length = TrackerYLength_;
85 double z_length = TrackerZLength_;
86
87 if (debug_) {
88 std::cout << Recoil_->GetName() << std::endl;
89 std::cout << "position" << std::endl;
90 std::cout << sub_det_position << std::endl;
91 std::cout << "x_length " << x_length << " y_length " << y_length
92 << " z_length " << z_length << std::endl;
93 }
94
95 subDetVolumeConfig.position = sub_det_position;
96 subDetVolumeConfig.length = {x_length, y_length, z_length};
97 subDetVolumeConfig.name = "Recoil";
98
99 // Vacuum material
100 Acts::Material subdet_mat = Acts::Material();
101 subDetVolumeConfig.volumeMaterial =
102 std::make_shared<Acts::HomogeneousVolumeMaterial>(subdet_mat);
103
104 std::vector<Acts::CuboidVolumeBuilder::LayerConfig> layerConfig;
105
106 // Prepare the layers
107 for (auto& layer : recoil_layout) {
108 if (debug_) {
109 std::cout << layer.first << " : surfaces==>" << layer.second.size()
110 << std::endl;
111 }
112
113 Acts::CuboidVolumeBuilder::LayerConfig lcfg;
114 lcfg.surfaces = layer.second;
115 // Get the surface thickness
116 double clearance = 0.01;
117 double thickness = layer.second.front()
118 ->surfaceMaterial()
119 ->materialSlab(Acts::Vector2{0., 0.})
120 .thickness();
121
122 // std::cout<<"Sensor Thickness from Material slab "<< thickness<<std::endl;
123
124 lcfg.envelopeX = std::array<double, 2>{thickness / 2. + clearance,
125 thickness / 2. + clearance};
126 lcfg.active = true;
127 layerConfig.push_back(lcfg);
128 }
129
130 subDetVolumeConfig.layerCfg = layerConfig;
131
132 return subDetVolumeConfig;
133}

◆ BuildTaggerLayoutMap()

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

Definition at line 335 of file TrackersTrackingGeometry.cxx.

336 {
337 if (debug_) {
338 std::cout << "Building layout for the " << pvol->GetName() << " tracker"
339 << std::endl;
340 getAllDaughters(pvol);
341 }
342
343 // Get the global transform
344 Acts::Transform3 tracker_transform = GetTransform(*pvol);
345
346 G4LogicalVolume* l_vol = pvol->GetLogicalVolume();
347 for (G4int i = 0; i < l_vol->GetNoDaughters(); i++) {
348 std::string sln = l_vol->GetDaughter(i)->GetName();
349
350 // To distinguish which layers need to be selected
351 if (sln.find(surfacename) != std::string::npos) {
352 // v12
353
354 // Box for the module (slightly bigger than the sensor)
355 // LDMXTaggerModuleVolume_physvol -> LDMXTaggerModuleVolume_component0Box,
356 // this is the sensor + inactive region
357 // LDMXTaggerModuleVolume_component0Box->
358 // LDMXTaggerModuleVolume_component0Sensor0Box, this is the sensor itself
359 // (active region)
360
361 // Tagger_ -> LDMXTaggerModuleVolume_physvol1 ->
362 // LDMXTaggerModuleVolume_component0_physvol
363 // ->LDMXTaggerModuleVolume_component0Sensor0_physvol
364 // -> Get Box for the dimension: GetLogical->GetSolid
365 // For the positioning of the sensor:
366 // A position of physvol1 + position of the component0_physvol +
367 // position of the sensor physvol. Thickness I can grab it from the box,
368 // or I just hardcode it. S transform1 * transform2 * transform3
369 // ....
370
371 // v14
372 // tagger_PV->tagger_sensor_vol_PV->tagger_active_sensor
373 // Then use the copyNumber..
374
375 // Get the sensor volume placement
376 Acts::Transform3 ref1_transform = GetTransform(*(l_vol->GetDaughter(i)));
377
378 G4VPhysicalVolume* _Component0Volume = findDaughterByName(
379 l_vol->GetDaughter(i), "LDMXTaggerModuleVolume_component0_physvol");
380
381 Acts::Transform3 ref2_transform = Acts::Transform3::Identity();
382 G4VPhysicalVolume* _ActiveSensor = nullptr;
383 int SensorCopyNr = -999;
384
385 // Get Component0 transform. v12
386 if (_Component0Volume) {
387 ref2_transform = GetTransform(*(_Component0Volume));
388 _ActiveSensor = findDaughterByName(
389 _Component0Volume,
390 "LDMXTaggerModuleVolume_component0Sensor0_physvol");
391 }
392 // v14
393 else {
394 _ActiveSensor =
395 findDaughterByName(l_vol->GetDaughter(i), "active_sensor");
396 SensorCopyNr = (l_vol->GetDaughter(i))->GetCopyNo();
397 }
398
399 if (!_ActiveSensor) {
400 throw std::runtime_error(
401 "Could not find the ActiveSensor from Component0Volume");
402 }
403
404 // Get the surface
405 std::shared_ptr<Acts::PlaneSurface> sensorSurface = GetSurface(
406 _ActiveSensor, tracker_transform * ref1_transform * ref2_transform);
407
408 if (sln == "LDMXTaggerModuleVolume_physvol1" ||
409 sln == "LDMXTaggerModuleVolume_physvol2" || SensorCopyNr == 130 ||
410 SensorCopyNr == 140)
411 tagger_layout["tagger_tracker_L1"].push_back(sensorSurface);
412
413 if (sln == "LDMXTaggerModuleVolume_physvol3" ||
414 sln == "LDMXTaggerModuleVolume_physvol4" || SensorCopyNr == 110 ||
415 SensorCopyNr == 120)
416 tagger_layout["tagger_tracker_L2"].push_back(sensorSurface);
417
418 if (sln == "LDMXTaggerModuleVolume_physvol5" ||
419 sln == "LDMXTaggerModuleVolume_physvol6" || SensorCopyNr == 90 ||
420 SensorCopyNr == 100)
421 tagger_layout["tagger_tracker_L3"].push_back(sensorSurface);
422
423 if (sln == "LDMXTaggerModuleVolume_physvol7" ||
424 sln == "LDMXTaggerModuleVolume_physvol8" || SensorCopyNr == 70 ||
425 SensorCopyNr == 80)
426 tagger_layout["tagger_tracker_L4"].push_back(sensorSurface);
427
428 if (sln == "LDMXTaggerModuleVolume_physvol9" ||
429 sln == "LDMXTaggerModuleVolume_physvol10" || SensorCopyNr == 50 ||
430 SensorCopyNr == 60)
431 tagger_layout["tagger_tracker_L5"].push_back(sensorSurface);
432
433 if (sln == "LDMXTaggerModuleVolume_physvol11" ||
434 sln == "LDMXTaggerModuleVolume_physvol12" || SensorCopyNr == 30 ||
435 SensorCopyNr == 40)
436 tagger_layout["tagger_tracker_L6"].push_back(sensorSurface);
437
438 if (sln == "LDMXTaggerModuleVolume_physvol13" ||
439 sln == "LDMXTaggerModuleVolume_physvol14" || SensorCopyNr == 10 ||
440 SensorCopyNr == 20)
441 tagger_layout["tagger_tracker_L7"].push_back(sensorSurface);
442
443 } // found a silicon surface
444 } // loop on daughters
445} // build the layout

◆ buildTargetVolume()

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

Definition at line 62 of file TrackersTrackingGeometry.h.

62{ return {}; }

◆ buildTrackerVolume()

Acts::CuboidVolumeBuilder::VolumeConfig tracking::geo::TrackersTrackingGeometry::buildTrackerVolume ( )

Definition at line 136 of file TrackersTrackingGeometry.cxx.

136 {
137 Acts::CuboidVolumeBuilder::VolumeConfig subDetVolumeConfig;
138
139 // Get the transform wrt the world volume in tracker frame
140 Acts::Transform3 subDet_transform = GetTransform(*Tagger_, true);
141
142 // Add 1mm to not make it sit on the first layer surface - Ask Omar if it's
143 // OK
144 Acts::Vector3 sub_det_position = {
145 subDet_transform.translation()(0) - 1,
146 subDet_transform.translation()(1),
147 subDet_transform.translation()(2),
148 };
149
150 // Get the size of the volume
151 G4Box* subDetBox = (G4Box*)(Tagger_->GetLogicalVolume()->GetSolid());
152
153 // In tracker coordinates. I add 1mm so that it compensates with the 1mm
154 // movement of above
155 double x_length =
156 2 * (subDetBox->GetZHalfLength() + 1) * Acts::UnitConstants::mm;
157
158 // double y_length = 2*subDetBox->GetXHalfLength() * Acts::UnitConstants::mm;
159 // double z_length = 2*subDetBox->GetYHalfLength() * Acts::UnitConstants::mm;
160
161 // The bField is defined only between -70, 70 along ACTS Z Axis (-130,130 in
162 // the extended version)
163 double y_length = TrackerYLength_;
164 double z_length = TrackerZLength_;
165
166 if (debug_) {
167 std::cout << Tagger_->GetName() << std::endl;
168 std::cout << "position" << std::endl;
169 std::cout << sub_det_position << std::endl;
170 std::cout << "x_length " << x_length << " y_length " << y_length
171 << " z_length " << z_length << std::endl;
172
173 std::cout << subDet_transform.translation() << std::endl;
174 std::cout << subDet_transform.rotation() << std::endl;
175 }
176
177 subDetVolumeConfig.position = sub_det_position;
178 subDetVolumeConfig.length = {x_length, y_length, z_length};
179 subDetVolumeConfig.name = "Tagger";
180
181 // Vacuum material
182 Acts::Material subdet_mat = Acts::Material();
183 subDetVolumeConfig.volumeMaterial =
184 std::make_shared<Acts::HomogeneousVolumeMaterial>(subdet_mat);
185
186 std::vector<Acts::CuboidVolumeBuilder::LayerConfig> layerConfig;
187
188 // Prepare the layers
189 for (auto& layer : tagger_layout) {
190 if (debug_) {
191 std::cout << layer.first << " : surfaces==>" << layer.second.size()
192 << std::endl;
193 // for (auto& surface : layer.second) surface->toStreamImpl(gctx_,
194 // std::cout);
195 for (auto& surface : layer.second) surface->toStream(gctx_);
196 }
197
198 Acts::CuboidVolumeBuilder::LayerConfig lcfg;
199 lcfg.surfaces = layer.second;
200 // Get the surface thickness
201 double clearance = 0.01;
202 double thickness = layer.second.front()
203 ->surfaceMaterial()
204 ->materialSlab(Acts::Vector2{0., 0.})
205 .thickness();
206
207 // std::cout<<"Sensor Thickness from Material slab "<< thickness<<std::endl;
208
209 lcfg.envelopeX = std::array<double, 2>{thickness / 2. + clearance,
210 thickness / 2. + clearance};
211 lcfg.active = true;
212 layerConfig.push_back(lcfg);
213 }
214
215 subDetVolumeConfig.layerCfg = layerConfig;
216
217 return subDetVolumeConfig;
218}

◆ buildTSVolume()

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

Definition at line 61 of file TrackersTrackingGeometry.h.

61{ return {}; }

◆ GetSurface()

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

Definition at line 447 of file TrackersTrackingGeometry.cxx.

448 {
449 if (!pvol)
450 throw std::runtime_error(
451 "TrackersTrackingGeometry::GetSurface:: pvol is nullptr");
452
453 // Get the surface transform
454 Acts::Transform3 surface_transform = GetTransform(*pvol);
455 // Compose the sensor_transform with the reference transform
456 surface_transform = ref_trans * surface_transform;
457
458 // Now transform to the tracker frame
459 Acts::Transform3 surface_transform_tracker = toTracker(surface_transform);
460
461 if (debug_) {
462 std::cout << "THE SENSOR TRANSFORM - TRANSLATION" << std::endl;
463 std::cout << surface_transform.translation()(0) << std::endl;
464 std::cout << surface_transform.translation()(1) << std::endl;
465 std::cout << surface_transform.translation()(2) << std::endl;
466 std::cout << "THE SENSOR TRANSFORM - ROTATION" << std::endl;
467 std::cout << surface_transform.rotation() << std::endl;
468
469 std::cout << "TO THE TRACKER FRAME" << std::endl;
470 std::cout << surface_transform_tracker.translation()(0) << std::endl;
471 std::cout << surface_transform_tracker.translation()(1) << std::endl;
472 std::cout << surface_transform_tracker.translation()(2) << std::endl;
473 std::cout << "THE SENSOR TRANSFORM - ROTATION" << std::endl;
474 std::cout << surface_transform_tracker.rotation() << std::endl;
475 }
476
477 // This material is defined in different units with respect what acts expects.
478 // I decided to hardcode here. TODO: fix this
479
480 /*
481 G4Material* sens_mat = _ActiveSensor->GetLogicalVolume()->GetMaterial();
482 if (debug_) {
483 std::cout<<"Checking the material of
484 "<<l_vol->GetDaughter(i)->GetName()<<std::endl; std::cout<<"With
485 sensor::"<<_ActiveSensor->GetName()<<std::endl;
486 std::cout<<sens_mat->GetName()<<std::endl;
487 std::cout<<"RL="<<sens_mat->GetRadlen()<<"
488 lambda="<<sens_mat->GetNuclearInterLength()<<std::endl;
489 std::cout<<"A="<<sens_mat->GetA()<<" Z="<<sens_mat->GetZ()<<"
490 rho="<<sens_mat->GetDensity()<<std::endl;
491 }
492
493 Acts::Material silicon =
494 Acts::Material::fromMassDensity(sens_mat->GetRadlen(),
495 sens_mat->GetNuclearInterLength(),
496 sens_mat->GetA(),
497 sens_mat->GetZ(),
498 sens_mat->GetDensity());
499 */
500
501 // Define the silicon material
502 Acts::Material silicon = Acts::Material::fromMassDensity(
503 95.7 * Acts::UnitConstants::mm, 465.2 * Acts::UnitConstants::mm, 28.03,
504 14., 2.32 * Acts::UnitConstants::g / Acts::UnitConstants::cm3);
505
506 // Get the active sensor box
507 G4Box* surfaceSolid = (G4Box*)(pvol->GetLogicalVolume()->GetSolid());
508
509 if (debug_) {
510 std::cout << "Sensor Dimensions" << std::endl;
511 std::cout << surfaceSolid->GetXHalfLength() << " "
512 << surfaceSolid->GetYHalfLength() << " "
513 << surfaceSolid->GetZHalfLength() << " " << std::endl;
514 }
515
516 // Form the material slab
517 double thickness =
518 2 * surfaceSolid->GetZHalfLength() * Acts::UnitConstants::mm;
519 Acts::MaterialSlab silicon_slab(silicon, thickness);
520
521 // Get the bounds
522 std::shared_ptr<const Acts::RectangleBounds> rect_bounds =
523 std::make_shared<const Acts::RectangleBounds>(Acts::RectangleBounds(
524 surfaceSolid->GetXHalfLength() * Acts::UnitConstants::mm,
525 surfaceSolid->GetYHalfLength() * Acts::UnitConstants::mm));
526
527 // Form the active sensor surface
528 std::shared_ptr<Acts::PlaneSurface> surface =
529 Acts::Surface::makeShared<Acts::PlaneSurface>(surface_transform_tracker,
530 rect_bounds);
531 surface->assignSurfaceMaterial(
532 std::make_shared<Acts::HomogeneousSurfaceMaterial>(silicon_slab));
533
534 // Create an alignable detector element and assign it to the surface.
535 // The default transformation is the surface parsed transformation
536
537 auto detElement = std::make_shared<DetectorElement>(
538 surface, surface_transform_tracker, thickness);
539
540 // This is the call that modify the behaviour of surface->transform(gctx)
541 // After this call each surface will use the underlying detectorElement
542 // transformation which will take care of effectively reading the gctx
543
544 surface->assignDetectorElement(std::move(*detElement));
545 detElements.push_back(detElement);
546
547 return surface;
548}

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_
private

Definition at line 70 of file TrackersTrackingGeometry.h.

◆ recoil_layout

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

Definition at line 83 of file TrackersTrackingGeometry.h.

◆ Tagger_

G4VPhysicalVolume* tracking::geo::TrackersTrackingGeometry::Tagger_
private

Definition at line 69 of file TrackersTrackingGeometry.h.

◆ tagger_layout

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

Definition at line 81 of file TrackersTrackingGeometry.h.

◆ TrackersTrackingGeometryProvider

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

Definition at line 65 of file TrackersTrackingGeometry.h.

◆ TrackerYLength_

float tracking::geo::TrackersTrackingGeometry::TrackerYLength_ {480.}
private

Definition at line 85 of file TrackersTrackingGeometry.h.

85{480.};

◆ TrackerZLength_

float tracking::geo::TrackersTrackingGeometry::TrackerZLength_ {240.}
private

Definition at line 86 of file TrackersTrackingGeometry.h.

86{240.};

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