1 #include "DD4hep/DetFactoryHelper.h"
12 string parentName =
args.parentName();
16 vector<string> sideRod =
args.vecStr(
"SideRodName");
17 vector<double> sideRodX =
args.vecDble(
"SideRodX");
18 vector<double> sideRodY =
args.vecDble(
"SideRodY");
19 vector<double> sideRodZ =
args.vecDble(
"SideRodZ");
20 string endRod1 =
args.str(
"EndRod1Name");
21 vector<double> endRod1Y =
args.vecDble(
"EndRod1Y");
22 vector<double> endRod1Z =
args.vecDble(
"EndRod1Z");
23 string endRod2 =
args.str(
"EndRod2Name");
24 double endRod2Y =
args.dble(
"EndRod2Y");
25 double endRod2Z =
args.dble(
"EndRod2Z");
27 string cable =
args.str(
"CableName");
28 double cableZ =
args.dble(
"CableZ");
30 string clamp =
args.str(
"ClampName");
31 vector<double> clampX =
args.vecDble(
"ClampX");
32 vector<double> clampZ =
args.vecDble(
"ClampZ");
33 string sideCool =
args.str(
"SideCoolName");
34 vector<double> sideCoolX =
args.vecDble(
"SideCoolX");
35 vector<double> sideCoolY =
36 args.vecDble(
"SideCoolY");
37 vector<double> sideCoolZ =
args.vecDble(
"SideCoolZ");
38 string endCool =
args.str(
"EndCoolName");
39 string endCoolRot =
args.str(
"EndCoolRot");
40 double endCoolY =
args.dble(
"EndCoolY");
41 double endCoolZ =
args.dble(
"EndCoolZ");
43 string optFibre =
args.str(
"OptFibreName");
44 vector<double> optFibreX =
args.vecDble(
"optFibreX");
45 vector<double> optFibreZ =
args.vecDble(
"optFibreZ");
47 string sideClamp1 =
args.str(
"SideClamp1Name");
48 vector<double> sideClampX =
args.vecDble(
"SideClampX");
49 vector<double> sideClamp1DZ =
args.vecDble(
"SideClamp1DZ");
50 string sideClamp2 =
args.str(
"SideClamp2Name");
51 vector<double> sideClamp2DZ =
args.vecDble(
"SideClamp2DZ");
53 string module =
args.str(
"ModuleName");
54 vector<string> moduleRot =
args.vecStr(
"ModuleRot");
55 vector<double> moduleY =
args.vecDble(
"ModuleY");
56 vector<double> moduleZ =
args.vecDble(
"ModuleZ");
59 vector<double> connectY =
args.vecDble(
"ICCY");
60 vector<double> connectZ =
args.vecDble(
"ICCZ");
62 string aohName =
args.str(
"AOHName");
63 vector<double> aohCopies =
args.vecDble(
"AOHCopies");
64 vector<double> aohX =
args.vecDble(
"AOHx");
65 vector<double> aohY =
args.vecDble(
"AOHy");
66 vector<double> aohZ =
args.vecDble(
"AOHz");
68 LogDebug(
"TOBGeom") <<
"Parent " << parentName <<
" Central " <<
central <<
" NameSpace " << ns.
name() <<
"\tShift "
70 for (
int i = 0;
i < (
int)(sideRod.size());
i++) {
71 LogDebug(
"TOBGeom") << sideRod[
i] <<
" to be positioned " << sideRodX.size() <<
" times at y = " << sideRodY[
i]
72 <<
" z = " << sideRodZ[
i] <<
" and x";
73 for (
double j : sideRodX)
74 LogDebug(
"TOBGeom") <<
"\tsideRodX[" <<
i <<
"] = " <<
j;
76 LogDebug(
"TOBGeom") << endRod1 <<
" to be "
77 <<
"positioned " << endRod1Y.size() <<
" times at";
78 for (
int i = 0;
i < (
int)(endRod1Y.size());
i++)
79 LogDebug(
"TOBGeom") <<
"\t[" <<
i <<
"]\ty = " << endRod1Y[
i] <<
"\tz = " << endRod1Z[
i];
80 LogDebug(
"TOBGeom") << endRod2 <<
" to be "
81 <<
"positioned at y = " << endRod2Y <<
" z = " << endRod2Z;
82 LogDebug(
"TOBGeom") << cable <<
" to be "
83 <<
"positioned at z = " << cableZ;
84 LogDebug(
"TOBGeom") << clamp <<
" to be "
85 <<
"positioned " << clampX.size() <<
" times at";
86 for (
int i = 0;
i < (
int)(clampX.size());
i++)
87 LogDebug(
"TOBGeom") <<
"\t[" <<
i <<
"]\tx = " << clampX[
i] <<
"\tz = " << clampZ[
i];
88 LogDebug(
"TOBGeom") << sideCool <<
" to be "
89 <<
"positioned " << sideCoolX.size() <<
" times at";
90 for (
int i = 0;
i < (
int)(sideCoolX.size());
i++)
91 LogDebug(
"TOBGeom") <<
"\t[" <<
i <<
"]\tx = " << sideCoolX[
i] <<
"\ty = " << sideCoolY[
i]
92 <<
"\tz = " << sideCoolZ[
i];
93 LogDebug(
"TOBGeom") << endCool <<
" to be "
94 <<
"positioned with " << endCoolRot <<
" rotation at"
95 <<
" y = " << endCoolY <<
" z = " << endCoolZ;
96 LogDebug(
"TOBGeom") << optFibre <<
" to be "
97 <<
"positioned " << optFibreX.size() <<
" times at";
98 for (
int i = 0;
i < (
int)(optFibreX.size());
i++)
99 LogDebug(
"TOBGeom") <<
"\t[" <<
i <<
"]\tx = " << optFibreX[
i] <<
"\tz = " << optFibreZ[
i];
100 LogDebug(
"TOBGeom") << sideClamp1 <<
" to be "
101 <<
"positioned " << sideClampX.size() <<
" times at";
102 for (
int i = 0;
i < (
int)(sideClampX.size());
i++)
103 LogDebug(
"TOBGeom") <<
"\t[" <<
i <<
"]\tx = " << sideClampX[
i] <<
"\tdz = " << sideClamp1DZ[
i];
104 LogDebug(
"TOBGeom") << sideClamp2 <<
" to be "
105 <<
"positioned " << sideClampX.size() <<
" times at";
106 for (
int i = 0;
i < (
int)(sideClampX.size());
i++)
107 LogDebug(
"TOBGeom") <<
"\t[" <<
i <<
"]\tx = " << sideClampX[
i] <<
"\tdz = " << sideClamp2DZ[
i];
108 LogDebug(
"TOBGeom") <<
"DDTOBRodAlgo debug:\t" << module <<
" positioned " << moduleRot.size() <<
" times";
109 for (
int i = 0;
i < (
int)(moduleRot.size());
i++)
110 LogDebug(
"TOBGeom") <<
"\tRotation " << moduleRot[
i] <<
"\ty = " << moduleY[
i] <<
"\tz = " << moduleZ[
i];
111 LogDebug(
"TOBGeom") <<
"DDTOBRodAlgo debug:\t" <<
connect.size() <<
" ICC positioned with no rotation";
113 LogDebug(
"TOBGeom") <<
"\t" <<
connect[
i] <<
"\ty = " << connectY[
i] <<
"\tz = " << connectZ[
i];
114 LogDebug(
"TOBGeom") <<
"DDTOBRodAlgo debug:\t" << aohName <<
" AOH will be positioned on ICC's";
115 for (
int i = 0;
i < (
int)(aohCopies.size());
i++)
116 LogDebug(
"TOBGeom") <<
" copies " << aohCopies[
i] <<
"\tx = " << aohX[
i] <<
"\ty = " << aohY[
i]
117 <<
"\tz = " << aohZ[
i];
119 const string& centName =
central;
121 const string& rodName = parentName;
125 for (
int i = 0;
i < (
int)(sideRod.size());
i++) {
126 for (
int j = 0;
j < (
int)(sideRodX.size());
j++) {
130 LogDebug(
"TOBGeom") <<
child <<
" number " <<
j + 1 <<
" positioned in " << rodName <<
" at " <<
r
131 <<
" with no rotation";
135 for (
int i = 0;
i < (
int)(clampX.size());
i++) {
139 LogDebug(
"TOBGeom") <<
child <<
" number " <<
i + 1 <<
" positioned in " << rodName <<
" at " <<
r
140 <<
" with no rotation";
143 for (
int i = 0;
i < (
int)(sideCoolX.size());
i++) {
147 LogDebug(
"TOBGeom") <<
child <<
" number " <<
i + 1 <<
" positioned in " << rodName <<
" at " <<
r
148 <<
" with no rotation";
151 for (
int i = 0;
i < (
int)(optFibreX.size());
i++) {
155 LogDebug(
"TOBGeom") <<
child <<
" number " <<
i + 1 <<
" positioned in " << rodName <<
" at " <<
r
156 <<
" with no rotation";
160 for (
int i = 0;
i < (
int)(sideClamp1DZ.size());
i++) {
165 LogDebug(
"TOBGeom") <<
child <<
" number " <<
i + 1 <<
" positioned in " << rodName <<
" at " <<
r
166 <<
" with no rotation";
168 for (
int i = 0;
i < (
int)(sideClamp2DZ.size());
i++) {
173 LogDebug(
"TOBGeom") <<
child <<
" number " <<
i + 1 <<
" positioned in " << rodName <<
" at " <<
r
174 <<
" with no rotation";
179 for (
int i = 0;
i < (
int)(endRod1Y.size());
i++) {
183 LogDebug(
"TOBGeom") <<
child <<
" number " <<
i + 1 <<
" positioned in " << centName <<
" at " <<
r
184 <<
" with no rotation";
190 <<
"positioned in " << centName <<
" at " <<
r1 <<
" with no rotation";
194 const Rotation3D& rot2 = ns.
rotation(endCoolRot);
196 cent.placeVolume(ns.
volume(
child), 1, Transform3D(rot2,
r2));
198 <<
"positioned in " << centName <<
" at " <<
r2 <<
" with " << rot2;
205 <<
"positioned in " << centName <<
" at " << r3 <<
" with no rotation";
208 for (
int i = 0;
i < (
int)(moduleRot.size());
i++) {
213 LogDebug(
"TOBGeom") <<
child <<
" number " <<
i + 1 <<
" positioned in " << centName <<
" at " <<
r <<
" with "
222 LogDebug(
"TOBGeom") <<
child <<
" number " <<
i + 1 <<
" positioned in " << centName <<
" at " <<
r
223 <<
" with no rotation";
228 for (
int i = 0;
i < (
int)(aohCopies.size());
i++) {
229 if (aohCopies[
i] != 0) {
235 LogDebug(
"TOBGeom") <<
child <<
" number " << copyNumber <<
" positioned in " << centName <<
" at " <<
r
236 <<
" with no rotation";
238 if (aohCopies[
i] == 2) {
243 LogDebug(
"TOBGeom") <<
child <<
" number " << copyNumber <<
" positioned in " << centName <<
" at " <<
r
244 <<
" with no rotation";
247 if (aohCopies[
i] == 4) {
249 for (
unsigned int j = 1;
j < 4;
j++) {
266 LogDebug(
"TOBGeom") <<
child <<
" number " << copyNumber <<
" positioned in " << centName <<
" at " <<
rr
267 <<
" with no rotation";
272 LogDebug(
"TOBGeom") <<
"<<== End of DDTOBRodAlgo construction ...";