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");
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");
69 <<
"\tShift " <<
shift;
70 for (
int i = 0;
i < (
int)(sideRod.size());
i++) {
71 edm::LogVerbatim(
"TOBGeom") << sideRod[
i] <<
" to be positioned " << sideRodX.size()
72 <<
" times at y = " << sideRodY[
i] <<
" z = " << sideRodZ[
i] <<
" and x";
73 for (
double j : sideRodX)
77 <<
"positioned " << endRod1Y.size() <<
" times at";
78 for (
int i = 0;
i < (
int)(endRod1Y.size());
i++)
79 edm::LogVerbatim(
"TOBGeom") <<
"\t[" <<
i <<
"]\ty = " << endRod1Y[
i] <<
"\tz = " << endRod1Z[
i];
81 <<
"positioned at y = " << endRod2Y <<
" z = " << endRod2Z;
83 <<
"positioned at z = " << cableZ;
85 <<
"positioned " << clampX.size() <<
" times at";
86 for (
int i = 0;
i < (
int)(clampX.size());
i++)
87 edm::LogVerbatim(
"TOBGeom") <<
"\t[" <<
i <<
"]\tx = " << clampX[
i] <<
"\tz = " << clampZ[
i];
89 <<
"positioned " << sideCoolX.size() <<
" times at";
90 for (
int i = 0;
i < (
int)(sideCoolX.size());
i++)
91 edm::LogVerbatim(
"TOBGeom") <<
"\t[" <<
i <<
"]\tx = " << sideCoolX[
i] <<
"\ty = " << sideCoolY[
i]
92 <<
"\tz = " << sideCoolZ[
i];
94 <<
"positioned with " << endCoolRot <<
" rotation at" 95 <<
" y = " << endCoolY <<
" z = " << endCoolZ;
97 <<
"positioned " << optFibreX.size() <<
" times at";
98 for (
int i = 0;
i < (
int)(optFibreX.size());
i++)
99 edm::LogVerbatim(
"TOBGeom") <<
"\t[" <<
i <<
"]\tx = " << optFibreX[
i] <<
"\tz = " << optFibreZ[
i];
101 <<
"positioned " << sideClampX.size() <<
" times at";
102 for (
int i = 0;
i < (
int)(sideClampX.size());
i++)
103 edm::LogVerbatim(
"TOBGeom") <<
"\t[" <<
i <<
"]\tx = " << sideClampX[
i] <<
"\tdz = " << sideClamp1DZ[
i];
105 <<
"positioned " << sideClampX.size() <<
" times at";
106 for (
int i = 0;
i < (
int)(sideClampX.size());
i++)
107 edm::LogVerbatim(
"TOBGeom") <<
"\t[" <<
i <<
"]\tx = " << sideClampX[
i] <<
"\tdz = " << sideClamp2DZ[
i];
108 edm::LogVerbatim(
"TOBGeom") <<
"DDTOBRodAlgo debug:\t" <<
module <<
" positioned " << moduleRot.size() <<
" times";
109 for (
int i = 0;
i < (
int)(moduleRot.size());
i++)
110 edm::LogVerbatim(
"TOBGeom") <<
"\tRotation " << moduleRot[
i] <<
"\ty = " << moduleY[
i] <<
"\tz = " << moduleZ[
i];
111 edm::LogVerbatim(
"TOBGeom") <<
"DDTOBRodAlgo debug:\t" <<
connect.size() <<
" ICC positioned with no rotation";
114 edm::LogVerbatim(
"TOBGeom") <<
"DDTOBRodAlgo debug:\t" << aohName <<
" AOH will be positioned on ICC's";
115 for (
int i = 0;
i < (
int)(aohCopies.size());
i++)
116 edm::LogVerbatim(
"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 edm::LogVerbatim(
"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 edm::LogVerbatim(
"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 edm::LogVerbatim(
"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 edm::LogVerbatim(
"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 edm::LogVerbatim(
"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 edm::LogVerbatim(
"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 edm::LogVerbatim(
"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 edm::LogVerbatim(
"TOBGeom") <<
child <<
" number " <<
i + 1 <<
" positioned in " << centName <<
" at " << r
222 edm::LogVerbatim(
"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 edm::LogVerbatim(
"TOBGeom") <<
child <<
" number " << copyNumber <<
" positioned in " << centName <<
" at " << r
236 <<
" with no rotation";
238 if (aohCopies[
i] == 2) {
243 edm::LogVerbatim(
"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 edm::LogVerbatim(
"TOBGeom") <<
child <<
" number " << copyNumber <<
" positioned in " << centName <<
" at " 267 <<
rr <<
" with no rotation";
Log< level::Info, true > LogVerbatim
const dd4hep::Rotation3D & rotation(const std::string &name) const
#define DECLARE_DDCMS_DETELEMENT(name, func)
static long algorithm(Detector &, cms::DDParsingContext &ctxt, xml_h e)
std::string_view name() const
Namespace of DDCMS conversion namespace.
static unsigned int const shift
dd4hep::Volume volume(const std::string &name, bool exc=true) const