13 namespace ActsExamples {
19 double radius,
double zStagger,
double moduleHalfLength,
double lOverlap,
20 const std::pair<int, int>& binningSchema) {
21 int nPhiBins = binningSchema.first;
22 int nZbins = binningSchema.second;
24 std::vector<Acts::Vector3> mPositions;
25 mPositions.reserve(nPhiBins * nZbins);
27 double phiStep = 2 * M_PI / (nPhiBins);
28 double minPhi = -M_PI + 0.5 * phiStep;
29 double zStart = -0.5 * (nZbins - 1) * (2 * moduleHalfLength - lOverlap);
30 double zStep = 2 * std::abs(zStart) / (nZbins - 1);
32 for (
size_t zBin = 0; zBin < size_t(nZbins); ++zBin) {
34 double moduleZ = zStart + zBin * zStep;
36 (zBin % 2) != 0
u ? radius - 0.5 * zStagger : radius + 0.5 * zStagger;
37 for (
size_t phiBin = 0; phiBin < size_t(nPhiBins); ++phiBin) {
39 double modulePhi = minPhi + phiBin * phiStep;
41 moduleR * sin(modulePhi), moduleZ));
49 double z,
double ringStagger, std::vector<double> phiStagger,
50 std::vector<double> phiSubStagger,
double innerRadius,
double outerRadius,
51 const std::vector<size_t>& discBinning,
52 const std::vector<double>& moduleHalfLength) {
54 std::vector<double> radii;
56 std::vector<double> radialBoarders;
58 double deltaR = outerRadius - innerRadius;
60 if (discBinning.size() == 1) {
61 radii.push_back(0.5 * (innerRadius + outerRadius));
62 radialBoarders = {innerRadius, outerRadius};
64 double totalLength = 0;
66 for (
auto& mhlength : moduleHalfLength) {
67 totalLength += 2 * mhlength;
70 double rOverlap = (totalLength -
deltaR) / (moduleHalfLength.size() - 1);
72 double lastR = innerRadius;
76 radialBoarders.push_back(innerRadius);
78 for (
auto& mhlength : moduleHalfLength) {
80 radii.push_back(lastR + lastHl - lastOl + mhlength);
81 lastR = radii[radii.size() - 1];
85 radialBoarders.push_back(lastR + 2 * lastHl - 0.5 * lastOl);
89 std::vector<std::vector<Acts::Vector3>> mPositions;
90 for (
size_t ir = 0; ir < radii.size(); ++ir) {
93 double rz = radii.size() == 1 ? z
94 : ((ir % 2) != 0
u ? z + 0.5 * ringStagger
95 : z - 0.5 * ringStagger);
97 double psStagger = phiSubStagger.empty() ? 0. : phiSubStagger[ir];
99 psStagger, discBinning[ir]));
107 double phiSubStagger,
110 std::vector<Acts::Vector3> rPositions;
111 rPositions.reserve(nPhiBins);
113 double phiStep = 2 * M_PI / (nPhiBins);
114 double minPhi = -M_PI + 0.5 * phiStep;
116 for (
size_t iphi = 0; iphi < size_t(nPhiBins); ++iphi) {
122 if (phiSubStagger != 0. && ((nPhiBins % 4) == 0)) {
124 if ((iphi % 4) == 0
u) {
126 }
else if (((iphi + 1) % 4) == 0
u) {
127 rzs = -phiSubStagger;
131 double phi = minPhi + iphi * phiStep;
133 double rz = (iphi % 2) != 0
u ? z - 0.5 * phiStagger : z + 0.5 * phiStagger;
134 rPositions.push_back(
135 Acts::Vector3(radius * cos(phi), radius * sin(phi), rz + rzs));