EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BuildGenericDetector.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BuildGenericDetector.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2018 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
26 #include "Acts/Utilities/Units.hpp"
29 
30 #include <array>
31 #include <cmath>
32 #include <iostream>
33 #include <list>
34 #include <memory>
35 #include <vector>
36 
37 namespace Acts {
38 class TrackingGeometry;
39 }
40 
41 namespace ActsExamples {
42 namespace Generic {
43 
50 std::vector<Acts::Vector3D> modulePositionsCylinder(
51  double radius, double zStagger, double moduleHalfLength, double lOverlap,
52  const std::pair<int, int>& binningSchema);
53 
60 std::vector<Acts::Vector3D> modulePositionsRing(double z, double radius,
61  double phiStagger,
62  double phiSubStagger,
63  int nPhiBins);
64 
75 std::vector<std::vector<Acts::Vector3D>> modulePositionsDisc(
76  double z, double ringStagger, std::vector<double> phiStagger,
77  std::vector<double> phiSubStagger, double innerRadius, double outerRadius,
78  const std::vector<size_t>& discBinning,
79  const std::vector<double>& moduleHalfLength);
80 
100 template <typename detector_element_t>
101 std::unique_ptr<const Acts::TrackingGeometry> buildDetector(
102  const typename detector_element_t::ContextType& gctx,
103  std::vector<std::vector<std::shared_ptr<detector_element_t>>>&
104  detectorStore,
105  size_t level,
106  std::shared_ptr<const Acts::IMaterialDecorator> matDecorator = nullptr,
107  bool protoMaterial = false,
110  Acts::Logging::Level volumeLLevel = Acts::Logging::INFO) {
111  using namespace Acts::UnitLiterals;
112 
113  using ProtoLayerCreator = ProtoLayerCreatorT<detector_element_t>;
114  using LayerBuilder = LayerBuilderT<detector_element_t>;
115 
116  // configure surface array creator
118  auto surfaceArrayCreator = std::make_shared<const Acts::SurfaceArrayCreator>(
119  sacConfig, Acts::getDefaultLogger("SurfaceArrayCreator", surfaceLLevel));
120  // configure the layer creator that uses the surface array creator
122  lcConfig.surfaceArrayCreator = surfaceArrayCreator;
123  auto layerCreator = std::make_shared<const Acts::LayerCreator>(
124  lcConfig, Acts::getDefaultLogger("LayerCreator", layerLLevel));
125  // configure the layer array creator
127  auto layerArrayCreator = std::make_shared<const Acts::LayerArrayCreator>(
128  lacConfig, Acts::getDefaultLogger("LayerArrayCreator", layerLLevel));
129  // tracking volume array creator
131  auto tVolumeArrayCreator =
132  std::make_shared<const Acts::TrackingVolumeArrayCreator>(
133  tvacConfig,
134  Acts::getDefaultLogger("TrackingVolumeArrayCreator", volumeLLevel));
135  // configure the cylinder volume helper
137  cvhConfig.layerArrayCreator = layerArrayCreator;
138  cvhConfig.trackingVolumeArrayCreator = tVolumeArrayCreator;
139  auto cylinderVolumeHelper =
140  std::make_shared<const Acts::CylinderVolumeHelper>(
141  cvhConfig,
142  Acts::getDefaultLogger("CylinderVolumeHelper", volumeLLevel));
143  //-------------------------------------------------------------------------------------
144  // vector of the volume builders
145  std::vector<std::shared_ptr<const Acts::ITrackingVolumeBuilder>>
146  volumeBuilders;
147 
148  // Prepare the proto material - in case it's desinged to do so
149  // - cylindrical
150  Acts::BinUtility pCylinderUtility(10, -1, 1, Acts::closed, Acts::binPhi);
151  pCylinderUtility += Acts::BinUtility(10, -1, 1, Acts::open, Acts::binZ);
152  auto pCylinderMaterial =
153  std::make_shared<const Acts::ProtoSurfaceMaterial>(pCylinderUtility);
154  // - disc
155  Acts::BinUtility pDiscUtility(10, 0, 1, Acts::open, Acts::binR);
156  pDiscUtility += Acts::BinUtility(10, -1, 1, Acts::closed, Acts::binPhi);
157  auto pDiscMaterial =
158  std::make_shared<const Acts::ProtoSurfaceMaterial>(pDiscUtility);
159  // - plane
160  Acts::BinUtility pPlaneUtility(1, -1, 1, Acts::open, Acts::binX);
161  auto pPlaneMaterial =
162  std::make_shared<const Acts::ProtoSurfaceMaterial>(pPlaneUtility);
163 
164  //-------------------------------------------------------------------------------------
165  // Beam Pipe
166  //-------------------------------------------------------------------------------------
167  // BeamPipe material
168  const auto beryllium = Acts::Material::fromMassDensity(
169  352.8_mm, 407_mm, 9.012, 4.0, 1.848_g / 1_cm3);
170  std::shared_ptr<const Acts::ISurfaceMaterial> beamPipeMaterial =
171  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
172  Acts::MaterialSlab(beryllium, 0.8_mm));
173  if (protoMaterial) {
174  beamPipeMaterial = pCylinderMaterial;
175  }
176 
177  // configure the beam pipe layer builder
179  bplConfig.layerIdentification = "BeamPipe";
180  bplConfig.centralLayerRadii = std::vector<double>(1, 19.);
181  bplConfig.centralLayerHalflengthZ = std::vector<double>(1, 3000.);
182  bplConfig.centralLayerThickness = std::vector<double>(1, 0.8);
183  bplConfig.centralLayerMaterial = {beamPipeMaterial};
184  auto beamPipeBuilder = std::make_shared<const Acts::PassiveLayerBuilder>(
185  bplConfig, Acts::getDefaultLogger("BeamPipeLayerBuilder", layerLLevel));
186  // create the volume for the beam pipe
188  bpvConfig.trackingVolumeHelper = cylinderVolumeHelper;
189  bpvConfig.volumeName = "BeamPipe";
190  bpvConfig.layerBuilder = beamPipeBuilder;
191  bpvConfig.layerEnvelopeR = {1. * Acts::UnitConstants::mm,
193  bpvConfig.buildToRadiusZero = true;
194  bpvConfig.volumeSignature = 0;
195  auto beamPipeVolumeBuilder =
196  std::make_shared<const Acts::CylinderVolumeBuilder>(
197  bpvConfig,
198  Acts::getDefaultLogger("BeamPipeVolumeBuilder", volumeLLevel));
199  // add to the list of builders
200  volumeBuilders.push_back(beamPipeVolumeBuilder);
201 
202  //-------------------------------------------------------------------------------------
203  //-------------------------------------------------------------------------------------
204  // Pixel detector
205  //-------------------------------------------------------------------------------------
206  // some prep work
207  // envelope for layers
208  std::pair<double, double> pcEnvelope(2., 2.);
209 
210  double pCentralModuleT = 0.15;
211  double pEndcapModuleT = 0.15;
212 
213  // Module material properties - X0, L0, A, Z, Rho
214  // Acts::Material pcMaterial(95.7, 465.2, 28.03, 14., 2.32e-3);
215  const auto silicon = Acts::Material::fromMassDensity(95.7_mm, 465.2_mm, 28.03,
216  14., 2.32_g / 1_cm3);
217  Acts::MaterialSlab pcModuleMaterial(silicon, pCentralModuleT);
218  Acts::MaterialSlab peModuleMaterial(silicon, pEndcapModuleT);
219  // Layer material properties - thickness, X0, L0, A, Z, Rho
220  Acts::MaterialSlab pcmbProperties(silicon, 1.5_mm);
221  Acts::MaterialSlab pcmecProperties(silicon, 1.5_mm);
222 
223  // Module, central and disc material
224  std::shared_ptr<const Acts::ISurfaceMaterial> pCentralMaterial =
225  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(pcmbProperties);
226  std::shared_ptr<const Acts::ISurfaceMaterial> pEndcapMaterial =
227  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(pcmecProperties);
228  std::shared_ptr<const Acts::ISurfaceMaterial> pCentralModuleMaterial =
229  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
230  pcModuleMaterial);
231  std::shared_ptr<const Acts::ISurfaceMaterial> pEndcapModuleMaterial =
232  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
233  peModuleMaterial);
234  if (protoMaterial) {
235  pCentralMaterial = pCylinderMaterial;
236  pCentralModuleMaterial = pPlaneMaterial;
237  pEndcapMaterial = pDiscMaterial;
238  pEndcapModuleMaterial = pPlaneMaterial;
239  }
240 
241  // configure the pixel proto layer builder
242  typename ProtoLayerCreator::Config pplConfig;
243  // standard, an approach envelope
244  pplConfig.approachSurfaceEnvelope = 1.;
245  // BARREL :
246  // 4 pixel layers
247  // configure the central barrel
248  pplConfig.centralLayerBinMultipliers = {1, 1};
249  pplConfig.centralLayerRadii = {32., 72., 116., 172.};
250  pplConfig.centralLayerEnvelopes = {pcEnvelope, pcEnvelope, pcEnvelope,
251  pcEnvelope};
252  pplConfig.centralModuleBinningSchema = {
253  {16, 14}, {32, 14}, {52, 14}, {78, 14}};
254  pplConfig.centralModuleTiltPhi = {0.14, 0.14, 0.14, 0.14};
255  pplConfig.centralModuleHalfX = {8.4, 8.4, 8.4, 8.4};
256  pplConfig.centralModuleHalfY = {36., 36., 36., 36.};
257  pplConfig.centralModuleThickness = {pCentralModuleT, pCentralModuleT,
258  pCentralModuleT, pCentralModuleT};
259  pplConfig.centralModuleMaterial = {
260  pCentralModuleMaterial, pCentralModuleMaterial, pCentralModuleMaterial,
261  pCentralModuleMaterial};
262  // pitch definitions
263  pplConfig.centralModuleReadoutBinsX = {336, 336, 336, 336};
264  pplConfig.centralModuleReadoutBinsY = {1280, 1280, 1280, 1280};
265  pplConfig.centralModuleReadoutSide = {-1, -1, -1, -1};
266  pplConfig.centralModuleLorentzAngle = {0.12, 0.12, 0.12, 0.12};
267 
268  // no frontside/backside
269  pplConfig.centralModuleFrontsideStereo = {};
270  pplConfig.centralModuleBacksideStereo = {};
271  pplConfig.centralModuleBacksideGap = {};
272  // mPositions
273  std::vector<std::vector<Acts::Vector3D>> pplCentralModulePositions;
274  for (size_t plb = 0; plb < pplConfig.centralLayerRadii.size(); ++plb) {
275  // call the helper function
276  pplCentralModulePositions.push_back(
277  modulePositionsCylinder(pplConfig.centralLayerRadii[plb],
278  0.5, // 1 mm stagger
279  pplConfig.centralModuleHalfY[plb],
280  2., // 4 mm module overlap in z
281  pplConfig.centralModuleBinningSchema[plb]));
282  }
283  pplConfig.centralModulePositions = pplCentralModulePositions;
284  // ENDCAP :
285  // 7 pixel layers each side
286  // configure the endcaps
287  pplConfig.posnegLayerBinMultipliers = {1, 1};
288 
289  pplConfig.posnegLayerPositionsZ = {
293  1500 * Acts::UnitConstants::mm};
294 
295  pplConfig.posnegLayerEnvelopeR = {
300  std::vector<double> perHX = {8.4, 8.4}; // half length x
301  std::vector<double> perHY = {36., 36.}; // half length y
302  std::vector<size_t> perBP = {40, 68}; // bins in phi
303  std::vector<double> perT = {pEndcapModuleT,
304  pEndcapModuleT}; // module thickness
305  std::vector<size_t> perBX = {336, 336}; // bins in x
306  std::vector<size_t> perBY = {1280, 1280}; // bins in y
307  std::vector<int> perRS = {-1, -1}; // readout side
308  std::vector<double> perLA = {0., 0.}; // lorentz angle
309  std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>> perM = {
310  pEndcapModuleMaterial, pEndcapModuleMaterial}; // material
311 
312  pplConfig.posnegModuleMinHalfX = std::vector<std::vector<double>>(7, perHX);
313  pplConfig.posnegModuleMaxHalfX = {};
314  pplConfig.posnegModuleHalfY = std::vector<std::vector<double>>(7, perHY);
315  pplConfig.posnegModulePhiBins = std::vector<std::vector<size_t>>(7, perBP);
316  pplConfig.posnegModuleThickness = std::vector<std::vector<double>>(7, perT);
317  pplConfig.posnegModuleReadoutBinsX =
318  std::vector<std::vector<size_t>>(7, perBX);
319  pplConfig.posnegModuleReadoutBinsY =
320  std::vector<std::vector<size_t>>(7, perBY);
321  pplConfig.posnegModuleReadoutSide = std::vector<std::vector<int>>(7, perRS);
322  pplConfig.posnegModuleLorentzAngle =
323  std::vector<std::vector<double>>(7, perLA);
324  pplConfig.posnegModuleMaterial =
325  std::vector<std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>>>(
326  7, perM);
327 
328  // no frontside/backside
329  pplConfig.posnegModuleFrontsideStereo = {};
330  pplConfig.posnegModuleBacksideStereo = {};
331  pplConfig.posnegModuleBacksideGap = {};
332  // mPositions
333  std::vector<std::vector<std::vector<Acts::Vector3D>>>
334  pplPosnegModulePositions;
335  for (size_t id = 0; id < pplConfig.posnegLayerPositionsZ.size(); ++id) {
336  pplPosnegModulePositions.push_back(modulePositionsDisc(
337  pplConfig.posnegLayerPositionsZ[id], 0.0, {4.0, 4.0}, {0.5, 0.}, 30.,
338  176., pplConfig.posnegModulePhiBins[id],
339  pplConfig.posnegModuleHalfY[id]));
340  }
341  pplConfig.posnegModulePositions = pplPosnegModulePositions;
342 
344  ProtoLayerCreator pplCreator(
345  pplConfig, Acts::getDefaultLogger("PixelProtoLayerCreator", layerLLevel));
346 
347  // configure pixel layer builder
348  typename LayerBuilder::Config plbConfig;
349  plbConfig.layerCreator = layerCreator;
350  plbConfig.layerIdentification = "Pixel";
351  // material concentration alsways outside the modules
352  plbConfig.centralProtoLayers =
353  pplCreator.centralProtoLayers(gctx, detectorStore);
354  plbConfig.centralLayerMaterialConcentration = {1, 1, 1, 1};
355  plbConfig.centralLayerMaterial = {pCentralMaterial, pCentralMaterial,
356  pCentralMaterial, pCentralMaterial};
357  if (level > 0) {
358  // material concentration is always behind the layer in the pixels
359  plbConfig.posnegLayerMaterialConcentration = std::vector<int>(7, 0);
360  // layer structure surface has pixel material properties
361  plbConfig.posnegLayerMaterial = {
362  pEndcapMaterial, pEndcapMaterial, pEndcapMaterial, pEndcapMaterial,
363  pEndcapMaterial, pEndcapMaterial, pEndcapMaterial};
364  // negative proto layers
365  plbConfig.negativeProtoLayers =
366  pplCreator.negativeProtoLayers(gctx, detectorStore);
367  plbConfig.positiveProtoLayers =
368  pplCreator.positiveProtoLayers(gctx, detectorStore);
369  }
370  // define the builder
371  auto pixelLayerBuilder = std::make_shared<const LayerBuilder>(
372  plbConfig, Acts::getDefaultLogger("PixelLayerBuilder", layerLLevel));
373  //-------------------------------------------------------------------------------------
374  // build the pixel volume
376  pvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
377  pvbConfig.volumeName = "Pixel";
378  pvbConfig.buildToRadiusZero = false;
379  pvbConfig.layerEnvelopeR = {1. * Acts::UnitConstants::mm,
381  pvbConfig.layerBuilder = pixelLayerBuilder;
382  pvbConfig.volumeSignature = 0;
383  auto pixelVolumeBuilder = std::make_shared<const Acts::CylinderVolumeBuilder>(
384  pvbConfig, Acts::getDefaultLogger("PixelVolumeBuilder", volumeLLevel));
385  // add to the list of builders
386  volumeBuilders.push_back(pixelVolumeBuilder);
387 
388  if (level > 1) {
389  //-------------------------------------------------------------------------------------
390  //-------------------------------------------------------------------------------------
391  // Pixel Support Tybe (PST)
392  //-------------------------------------------------------------------------------------
393  // Material
394  std::shared_ptr<const Acts::ISurfaceMaterial> pstMaterial =
395  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
396  Acts::MaterialSlab(beryllium, 1.8_mm));
397  if (protoMaterial) {
398  pstMaterial = pCylinderMaterial;
399  }
400 
401  // Configuration
403  pstConfig.layerIdentification = "PST";
404  pstConfig.centralLayerRadii = std::vector<double>(1, 200.);
405  pstConfig.centralLayerHalflengthZ = std::vector<double>(1, 2800.);
406  pstConfig.centralLayerThickness = std::vector<double>(1, 1.8);
407  pstConfig.centralLayerMaterial = {pstMaterial};
408  auto pstBuilder = std::make_shared<const Acts::PassiveLayerBuilder>(
409  pstConfig, Acts::getDefaultLogger("PSTBuilder", layerLLevel));
410  // create the volume for the beam pipe
412  pstvolConfig.trackingVolumeHelper = cylinderVolumeHelper;
413  pstvolConfig.volumeName = "PST";
414  pstvolConfig.buildToRadiusZero = false;
415  pstvolConfig.layerBuilder = pstBuilder;
416  pstvolConfig.volumeSignature = 0;
417  auto pstVolumeBuilder = std::make_shared<const Acts::CylinderVolumeBuilder>(
418  pstvolConfig, Acts::getDefaultLogger("PSTVolumeBuilder", volumeLLevel));
419  // add to the detector builds
420  volumeBuilders.push_back(pstVolumeBuilder);
421 
422  //-------------------------------------------------------------------------------------
423  // SHORT strip detector
424  //-------------------------------------------------------------------------------------
425  // first add a Pixel Support Tube
426  // STRIPS
427  //
428  // fill necessary vectors for configuration
429  //-------------------------------------------------------------------------------------
430  // some prep work
431 
432  double ssCentralModuleT = 0.25;
433  double ssEndcapModuleT = 0.25;
434  // envelope double
435  std::pair<double, double> ssEnvelope(2., 2.);
436 
437  // Module material properties - X0, L0, A, Z, Rho
438  // Acts::Material sscMaterial(95.7, 465.2, 28.03, 14., 2.32e-3);
439  Acts::MaterialSlab sscModuleMaterial(silicon, ssCentralModuleT);
440  Acts::MaterialSlab sseModuleMaterial(silicon, ssEndcapModuleT);
441 
442  // Layer material properties - thickness, X0, L0, A, Z, Rho
443  Acts::MaterialSlab ssbmProperties(silicon, 2_mm);
444  Acts::MaterialSlab ssecmProperties(silicon, 2.5_mm);
445 
446  // Module, central and disc material
447  std::shared_ptr<const Acts::ISurfaceMaterial> ssCentralMaterial =
448  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
449  ssbmProperties);
450  std::shared_ptr<const Acts::ISurfaceMaterial> ssEndcapMaterial =
451  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
452  ssecmProperties);
453  std::shared_ptr<const Acts::ISurfaceMaterial> ssCentralModuleMaterial =
454  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
455  sscModuleMaterial);
456  std::shared_ptr<const Acts::ISurfaceMaterial> ssEndcapModuleMaterial =
457  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
458  sseModuleMaterial);
459  if (protoMaterial) {
460  ssCentralMaterial = pCylinderMaterial;
461  ssCentralModuleMaterial = pPlaneMaterial;
462  ssEndcapMaterial = pDiscMaterial;
463  ssEndcapModuleMaterial = pPlaneMaterial;
464  }
465 
466  // ----------------------------------------------------------------------------
467  // Configure the short strip proto layer builder
468  typename ProtoLayerCreator::Config ssplConfig;
469  // configure the central barrel
470  ssplConfig.centralLayerBinMultipliers = {1, 1};
471  ssplConfig.centralLayerRadii = {260., 360., 500., 660.};
472  ssplConfig.centralLayerEnvelopes = {ssEnvelope, ssEnvelope, ssEnvelope,
473  ssEnvelope};
474 
475  ssplConfig.centralModuleBinningSchema = {
476  {40, 21}, {56, 21}, {78, 21}, {102, 21}};
477  ssplConfig.centralModuleTiltPhi = {-0.15, -0.15, -0.15, -0.15};
478  ssplConfig.centralModuleHalfX = {24., 24., 24., 24.};
479  ssplConfig.centralModuleHalfY = {54., 54., 54., 54.};
480  ssplConfig.centralModuleThickness = {ssCentralModuleT, ssCentralModuleT,
481  ssCentralModuleT, ssCentralModuleT};
482 
483  ssplConfig.centralModuleReadoutBinsX = {600, 600, 600, 600}; // 80 um pitch
484  ssplConfig.centralModuleReadoutBinsY = {90, 90, 90, 90}; // 1.2 mm strixels
485  ssplConfig.centralModuleReadoutSide = {1, 1, 1, 1};
486  ssplConfig.centralModuleLorentzAngle = {0.12, 0.12, 0.12, 0.12};
487 
488  ssplConfig.centralModuleMaterial = {
489  ssCentralModuleMaterial, ssCentralModuleMaterial,
490  ssCentralModuleMaterial, ssCentralModuleMaterial};
491  ssplConfig.centralModuleFrontsideStereo = {};
492  ssplConfig.centralModuleBacksideStereo = {};
493  ssplConfig.centralModuleBacksideGap = {};
494  // mPositions
495  std::vector<std::vector<Acts::Vector3D>> ssplCentralModulePositions;
496  for (size_t sslb = 0; sslb < ssplConfig.centralLayerRadii.size(); ++sslb) {
497  // call the helper function
498  ssplCentralModulePositions.push_back(
499  modulePositionsCylinder(ssplConfig.centralLayerRadii[sslb],
500  3., // 3 mm stagger
501  ssplConfig.centralModuleHalfY[sslb],
502  5., // 5 mm module overlap
503  ssplConfig.centralModuleBinningSchema[sslb]));
504  }
505  ssplConfig.centralModulePositions = ssplCentralModulePositions;
506 
507  // configure the endcaps
508  std::vector<double> mrMinHx = {16.4, 24.2, 32.2};
509  std::vector<double> mrMaxHx = {24.2, 32.2, 40.0};
510  std::vector<double> mrHy = {78., 78., 78.};
511 
512  // simplified strixels readout
513  std::vector<size_t> mrReadoutBinsX = {605, 805, 1000}; // 80 um pitch
514  std::vector<size_t> mrReadoutBinsY = {130, 130, 130}; // 1.2 mm strixels
515  std::vector<int> mrReadoutSide = {1, 1, 1};
516  std::vector<double> mrLorentzAngle = {0., 0., 0.};
517 
518  std::vector<size_t> mPhiBins = {54, 56, 60};
519  std::vector<double> mThickness = {ssEndcapModuleT, ssEndcapModuleT,
520  ssEndcapModuleT};
521  std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>> mMaterial = {
522  ssEndcapModuleMaterial, ssEndcapModuleMaterial, ssEndcapModuleMaterial};
523 
524  ssplConfig.posnegLayerBinMultipliers = {1, 2};
525 
526  ssplConfig.posnegLayerPositionsZ = {1220., 1500., 1800.,
527  2150., 2550., 2950.};
528  size_t nposnegs = ssplConfig.posnegLayerPositionsZ.size();
529  ssplConfig.posnegLayerEnvelopeR = std::vector<double>(nposnegs, 5.);
530 
531  ssplConfig.posnegModuleMinHalfX =
532  std::vector<std::vector<double>>(nposnegs, mrMinHx);
533  ssplConfig.posnegModuleMaxHalfX =
534  std::vector<std::vector<double>>(nposnegs, mrMaxHx);
535  ssplConfig.posnegModuleHalfY =
536  std::vector<std::vector<double>>(nposnegs, mrHy);
537  ssplConfig.posnegModulePhiBins =
538  std::vector<std::vector<size_t>>(nposnegs, mPhiBins);
539  ssplConfig.posnegModuleThickness =
540  std::vector<std::vector<double>>(nposnegs, mThickness);
541 
542  ssplConfig.posnegModuleReadoutBinsX =
543  std::vector<std::vector<size_t>>(nposnegs, mrReadoutBinsX);
544  ssplConfig.posnegModuleReadoutBinsY =
545  std::vector<std::vector<size_t>>(nposnegs, mrReadoutBinsY);
546  ssplConfig.posnegModuleReadoutSide =
547  std::vector<std::vector<int>>(nposnegs, mrReadoutSide);
548  ssplConfig.posnegModuleLorentzAngle =
549  std::vector<std::vector<double>>(nposnegs, mrLorentzAngle);
550 
551  ssplConfig.posnegModuleMaterial =
552  std::vector<std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>>>(
553  nposnegs, mMaterial);
554 
555  ssplConfig.posnegModuleFrontsideStereo = {};
556  ssplConfig.posnegModuleBacksideStereo = {};
557  ssplConfig.posnegModuleBacksideGap = {};
558 
559  // mPositions
560  std::vector<std::vector<std::vector<Acts::Vector3D>>>
561  ssplPosnegModulePositions;
562  for (size_t id = 0; id < ssplConfig.posnegLayerPositionsZ.size(); ++id) {
563  ssplPosnegModulePositions.push_back(modulePositionsDisc(
564  ssplConfig.posnegLayerPositionsZ[id], 6.0, {3., 3., 3.}, {0., 0., 0.},
565  240., 700., ssplConfig.posnegModulePhiBins[id],
566  ssplConfig.posnegModuleHalfY[id]));
567  }
568  ssplConfig.posnegModulePositions = ssplPosnegModulePositions;
569 
570  // The ProtoLayer creator
571  ProtoLayerCreator ssplCreator(
572  ssplConfig,
573  Acts::getDefaultLogger("SStripProtoLayerCreator", layerLLevel));
574 
575  // configure short strip layer builder
576  typename LayerBuilder::Config sslbConfig;
577  sslbConfig.layerCreator = layerCreator;
578  sslbConfig.layerIdentification = "SStrip";
579 
580  sslbConfig.centralProtoLayers =
581  ssplCreator.centralProtoLayers(gctx, detectorStore);
582  sslbConfig.centralLayerMaterialConcentration = {-1, -1, -1, -1};
583  sslbConfig.centralLayerMaterial = {ssCentralMaterial, ssCentralMaterial,
584  ssCentralMaterial, ssCentralMaterial};
585 
586  if (level > 2) {
587  sslbConfig.negativeProtoLayers =
588  ssplCreator.negativeProtoLayers(gctx, detectorStore);
589  sslbConfig.positiveProtoLayers =
590  ssplCreator.positiveProtoLayers(gctx, detectorStore);
591 
592  sslbConfig.posnegLayerMaterialConcentration =
593  std::vector<int>(nposnegs, 0);
594  sslbConfig.posnegLayerMaterial =
595  std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>>(
596  nposnegs, ssEndcapMaterial);
597  }
598 
599  // define the builder
600  auto sstripLayerBuilder = std::make_shared<const LayerBuilder>(
601  sslbConfig, Acts::getDefaultLogger("SStripLayerBuilder", layerLLevel));
602  //-------------------------------------------------------------------------------------
603  // build the pixel volume
605  ssvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
606  ssvbConfig.volumeName = "SStrip";
607  ssvbConfig.buildToRadiusZero = false;
608  ssvbConfig.layerBuilder = sstripLayerBuilder;
609  ssvbConfig.volumeSignature = 0;
610  auto sstripVolumeBuilder =
611  std::make_shared<const Acts::CylinderVolumeBuilder>(
612  ssvbConfig,
613  Acts::getDefaultLogger("SStripVolumeBuilder", volumeLLevel));
614 
615  //-------------------------------------------------------------------------------------
616  // add to the list of builders
617  volumeBuilders.push_back(sstripVolumeBuilder);
618  //-------------------------------------------------------------------------------------
619  //-------------------------------------------------------------------------------------
620  // LONG strip detector
621  //-------------------------------------------------------------------------------------
622  // fill necessary vectors for configuration
623  //-------------------------------------------------------------------------------------
624 
625  // some prep work
626  // envelope double
627  std::pair<double, double> lsEnvelope(2., 2.);
628 
629  double lsCentralModuleT = 0.35;
630  double lsEndcapModuleT = 0.35;
631 
632  // Module material properties - X0, L0, A, Z, Rho
633  // Acts::Material lsMaterial(95.7, 465.2, 28.03, 14., 2.32e-3);
634  Acts::MaterialSlab lscModuleMaterial(silicon, lsCentralModuleT);
635  Acts::MaterialSlab lseModuleMaterial(silicon, lsEndcapModuleT);
636 
637  // Layer material properties - thickness, X0, L0, A, Z, Rho - barrel
638  Acts::MaterialSlab lsbmProperties(silicon, 2.5_mm);
639  Acts::MaterialSlab lsecmProperties(silicon, 3.5_mm);
640 
641  // Module, central and disc material
642  std::shared_ptr<const Acts::ISurfaceMaterial> lsCentralMaterial =
643  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
644  lsbmProperties);
645  std::shared_ptr<const Acts::ISurfaceMaterial> lsEndcapMaterial =
646  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
647  lsecmProperties);
648  std::shared_ptr<const Acts::ISurfaceMaterial> lsCentralModuleMaterial =
649  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
650  lscModuleMaterial);
651  std::shared_ptr<const Acts::ISurfaceMaterial> lsEndcapModuleMaterial =
652  std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
653  lseModuleMaterial);
654  if (protoMaterial) {
655  lsCentralMaterial = pCylinderMaterial;
656  lsCentralModuleMaterial = pPlaneMaterial;
657  lsEndcapMaterial = pDiscMaterial;
658  lsEndcapModuleMaterial = pPlaneMaterial;
659  }
660 
661  // The proto layer creator
662  typename ProtoLayerCreator::Config lsplConfig;
663 
664  // configure the central barrel
665  lsplConfig.centralLayerBinMultipliers = {1, 1};
666  lsplConfig.centralLayerRadii = {820., 1020.};
667  lsplConfig.centralLayerEnvelopes = {lsEnvelope, lsEnvelope};
668 
669  lsplConfig.centralModuleBinningSchema = {{120, 21}, {152, 21}};
670  lsplConfig.centralModuleTiltPhi = {-0.15, -0.15};
671  lsplConfig.centralModuleHalfX = {24., 24.};
672  lsplConfig.centralModuleHalfY = {54., 54.};
673  lsplConfig.centralModuleThickness = {lsCentralModuleT, lsCentralModuleT};
674  lsplConfig.centralModuleMaterial = {lsCentralModuleMaterial,
675  lsCentralModuleMaterial};
676 
677  lsplConfig.centralModuleReadoutBinsX = {400, 400}; // 120 um pitch
678  lsplConfig.centralModuleReadoutBinsY = {10, 10}; // 10 strips = 10.8 mm
679  lsplConfig.centralModuleReadoutSide = {1, 1};
680  lsplConfig.centralModuleLorentzAngle = {0.08, 0.08};
681 
682  lsplConfig.centralModuleFrontsideStereo = {};
683  lsplConfig.centralModuleBacksideStereo = {};
684  lsplConfig.centralModuleBacksideGap = {};
685  // mPositions
686  std::vector<std::vector<Acts::Vector3D>> lslbCentralModulePositions;
687  for (size_t lslb = 0; lslb < lsplConfig.centralLayerRadii.size(); ++lslb) {
688  // call the helper function
689  lslbCentralModulePositions.push_back(
690  modulePositionsCylinder(lsplConfig.centralLayerRadii[lslb],
691  3., // 3 mm stagger
692  lsplConfig.centralModuleHalfY[lslb],
693  5., // 5 mm module overlap
694  lsplConfig.centralModuleBinningSchema[lslb]));
695  }
696 
697  lsplConfig.centralModulePositions = lslbCentralModulePositions;
698  // configure the endcaps
699  mrMinHx = {54., 66.};
700  mrMaxHx = {64.2, 72.};
701  mrHy = {78., 78.};
702  mPhiBins = {48, 50};
703  mThickness = {lsEndcapModuleT, lsEndcapModuleT};
704  mMaterial = {lsEndcapModuleMaterial, lsEndcapModuleMaterial};
705 
706  mrReadoutBinsX = {1070, 1200}; // 120 um pitch
707  mrReadoutBinsY = {15, 15}; // 15 strips - 10.2 mm
708  mrReadoutSide = {1, 1};
709  mrLorentzAngle = {0., 0.};
710 
711  // endcap
712  lsplConfig.posnegLayerBinMultipliers = {1, 2};
713  lsplConfig.posnegLayerPositionsZ = {1220., 1500., 1800.,
714  2150., 2550., 2950.};
715  nposnegs = lsplConfig.posnegLayerPositionsZ.size();
716  lsplConfig.posnegLayerEnvelopeR = std::vector<double>(nposnegs, 5.);
717 
718  lsplConfig.posnegModuleMinHalfX =
719  std::vector<std::vector<double>>(nposnegs, mrMinHx);
720  lsplConfig.posnegModuleMaxHalfX =
721  std::vector<std::vector<double>>(nposnegs, mrMaxHx);
722  lsplConfig.posnegModuleHalfY =
723  std::vector<std::vector<double>>(nposnegs, mrHy);
724  lsplConfig.posnegModulePhiBins =
725  std::vector<std::vector<size_t>>(nposnegs, mPhiBins);
726  lsplConfig.posnegModuleThickness =
727  std::vector<std::vector<double>>(nposnegs, mThickness);
728 
729  lsplConfig.posnegModuleReadoutBinsX =
730  std::vector<std::vector<size_t>>(nposnegs, mrReadoutBinsX);
731  lsplConfig.posnegModuleReadoutBinsY =
732  std::vector<std::vector<size_t>>(nposnegs, mrReadoutBinsY);
733  lsplConfig.posnegModuleReadoutSide =
734  std::vector<std::vector<int>>(nposnegs, mrReadoutSide);
735  lsplConfig.posnegModuleLorentzAngle =
736  std::vector<std::vector<double>>(nposnegs, mrLorentzAngle);
737 
738  lsplConfig.posnegModuleMaterial =
739  std::vector<std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>>>(
740  nposnegs, mMaterial);
741  lsplConfig.posnegModuleFrontsideStereo = {};
742  lsplConfig.posnegModuleBacksideStereo = {};
743  lsplConfig.posnegModuleBacksideGap = {};
744 
745  // mPositions
746  std::vector<std::vector<std::vector<Acts::Vector3D>>>
747  lssbPosnegModulePositions;
748  for (size_t id = 0; id < lsplConfig.posnegLayerPositionsZ.size(); ++id) {
749  lssbPosnegModulePositions.push_back(modulePositionsDisc(
750  lsplConfig.posnegLayerPositionsZ[id],
751  8.0, // staggering of rings, we put the disk strucutre in between
752  {3., 3.}, {0., 0.}, 750., 1020., lsplConfig.posnegModulePhiBins[id],
753  lsplConfig.posnegModuleHalfY[id]));
754  }
755  lsplConfig.posnegModulePositions = lssbPosnegModulePositions;
756 
757  // The ProtoLayer creator
758  ProtoLayerCreator lsplCreator(
759  lsplConfig,
760  Acts::getDefaultLogger("LStripProtoLayerCreator", layerLLevel));
761 
762  // configure short strip layer builder
763  typename LayerBuilder::Config lslbConfig;
764  lslbConfig.layerCreator = layerCreator;
765  lslbConfig.layerIdentification = "LStrip";
766  lslbConfig.centralLayerMaterialConcentration = {-1, -1};
767  lslbConfig.centralLayerMaterial = {lsCentralMaterial, lsCentralMaterial};
768  lslbConfig.centralProtoLayers =
769  lsplCreator.centralProtoLayers(gctx, detectorStore);
770 
771  if (level > 2) {
772  lslbConfig.posnegLayerMaterialConcentration =
773  std::vector<int>(nposnegs, 0);
774  lslbConfig.posnegLayerMaterial =
775  std::vector<std::shared_ptr<const Acts::ISurfaceMaterial>>(
776  nposnegs, lsEndcapMaterial);
777  lslbConfig.negativeProtoLayers =
778  lsplCreator.negativeProtoLayers(gctx, detectorStore);
779  lslbConfig.positiveProtoLayers =
780  lsplCreator.positiveProtoLayers(gctx, detectorStore);
781  }
782 
783  // define the builder
784  auto lstripLayerBuilder = std::make_shared<const LayerBuilder>(
785  lslbConfig, Acts::getDefaultLogger("LStripLayerBuilder", layerLLevel));
786  //-------------------------------------------------------------------------------------
787  // build the pixel volume
789  lsvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
790  lsvbConfig.volumeName = "LStrip";
791  lsvbConfig.buildToRadiusZero = false;
792  lsvbConfig.layerBuilder = lstripLayerBuilder;
793  lsvbConfig.volumeSignature = 0;
794  auto lstripVolumeBuilder =
795  std::make_shared<const Acts::CylinderVolumeBuilder>(
796  lsvbConfig,
797  Acts::getDefaultLogger("LStripVolumeBuilder", volumeLLevel));
798  // add to the list of builders
799  volumeBuilders.push_back(lstripVolumeBuilder);
800  }
801 
802  //-------------------------------------------------------------------------------------
803  // create the tracking geometry
805  // Add the builde call functions
806  for (auto& vb : volumeBuilders) {
807  tgConfig.trackingVolumeBuilders.push_back(
808  [=](const auto& context, const auto& inner, const auto&) {
809  return vb->trackingVolume(context, inner);
810  });
811  }
812  tgConfig.trackingVolumeHelper = cylinderVolumeHelper;
813  tgConfig.materialDecorator = matDecorator;
814 
815  auto cylinderGeometryBuilder =
816  std::make_shared<const Acts::TrackingGeometryBuilder>(
817  tgConfig,
818  Acts::getDefaultLogger("TrackerGeometryBuilder", volumeLLevel));
819  // get the geometry
820  auto trackingGeometry = cylinderGeometryBuilder->trackingGeometry(gctx);
822  return trackingGeometry;
823 }
824 
825 } // end of namespace Generic
826 } // end of namespace ActsExamples