51{
52
53
54 m_manager =
new InDetDD::InDetServMatManager();
55
56
57 DecodeVersionKey sctVersionKey(
geoDbTagSvc(),
"SCT");
58 DecodeVersionKey trtVersionKey(
geoDbTagSvc(),
"TRT");
59 DecodeVersionKey indetVersionKey(
geoDbTagSvc(),
"InnerDetector");
60 DecodeVersionKey atlasVersionKey(
geoDbTagSvc(),
"ATLAS");
61
62
63 msg(MSG::DEBUG) <<
"Building InDet Service Material with ATLAS Version Tag: " << atlasVersionKey.tag() <<
endmsg;
64 msg(MSG::DEBUG) <<
" with InDet Version Tag: " << indetVersionKey.tag() <<
" at Node: "
65 << indetVersionKey.node() <<
endmsg;
66 msg(MSG::DEBUG) <<
" with TRT Version Tag: " << trtVersionKey.tag() <<
" at Node: "
67 << trtVersionKey.node() <<
endmsg;
68 msg(MSG::DEBUG) <<
" with SCT Version Tag: " << sctVersionKey.tag() <<
" at Node: "
69 << sctVersionKey.node() <<
endmsg;
73
75
78 const IRDBRecord *envelopes = (*servEnvelopeTable)[0];
79
81
82 InDetMaterialManager * materialManager =
new InDetMaterialManager(
"InDetServMatMaterialManager",
getAthenaComps());
84
85 double safety = 0.001 * Gaudi::Units::mm;
86
87 double ZMaxBrlTRT = envelopes->
getDouble(
"ZMAXBRLTRT") * Gaudi::Units::mm;
88 double ZMaxBrlSCT = envelopes->
getDouble(
"ZMAXBRLSCT") * Gaudi::Units::mm;
89 double ZMinFwdSCTandTRT = envelopes->
getDouble(
"ZMINFWDSCTANDTRT") * Gaudi::Units::mm;
90 double ZMinSCTServInTRT = envelopes->
getDouble(
"ZMINSCTSERVINTRT") * Gaudi::Units::mm;
91 double ZMaxSCTServInTRT = envelopes->
getDouble(
"ZMAXSCTSERVINTRT") * Gaudi::Units::mm;
92 double ZMinPixServ = envelopes->
getDouble(
"ZMINPIXSERV") * Gaudi::Units::mm;
93 double ZMaxFwdTRTC = envelopes->
getDouble(
"ZMAXFWDTRTC") * Gaudi::Units::mm;
94 double ZMaxIDet = (*atls)[0]->getDouble("IDETZMX") * Gaudi::Units::cm + safety;
95
96 double RMinBrlSCT = envelopes->
getDouble(
"RMINBRLSCT") * Gaudi::Units::mm;
97 double RMaxBrlTRT = envelopes->
getDouble(
"RMAXBRLTRT") * Gaudi::Units::mm;
98 double RMinBrlTRT = envelopes->
getDouble(
"RMINBRLTRT") * Gaudi::Units::mm;
99 double RMaxFwdTRT = envelopes->
getDouble(
"RMAXFWDTRT") * Gaudi::Units::mm;
100 double RMaxFwdSCT = envelopes->
getDouble(
"RMAXFWDSCT") * Gaudi::Units::mm;
101 double RMaxFwdTRTC = envelopes->
getDouble(
"RMAXFWDTRTC") * Gaudi::Units::mm;
102 double RMinPixServ = envelopes->
getDouble(
"RMINPIXSERV") * Gaudi::Units::mm;
103 double RMaxPixServ = envelopes->
getDouble(
"RMAXPIXSERV") * Gaudi::Units::mm;
104 double RMaxIDet = (*atls)[0]->getDouble("IDETOR") * Gaudi::Units::cm + safety;
105
106
107
108
109
110
111
112
113
114
115
116 bool join1 = false;
117 bool join2 = false;
118
119 if (std::abs(RMaxFwdTRTC - RMinPixServ) <= 1*Gaudi::Units::mm){
120 join1 = true;
121 join2 = true;
122 RMaxFwdTRTC = RMinPixServ;
123 RMaxPixServ = RMinPixServ;
124 } else if ((RMaxFwdTRTC - 1*Gaudi::Units::mm) <= RMaxPixServ) {
125 join1 = true;
126 RMaxPixServ = RMaxFwdTRTC;
127 }
128
129
130
131
132
133
134 const GeoShapeUnion *ServVolAux = nullptr;
135
136 if (!join1) {
137 GeoPcon* pixServP = new GeoPcon(0.,2*Gaudi::Units::pi);
138 GeoPcon* pixServM = new GeoPcon(0.,2*Gaudi::Units::pi);
139
140
141 pixServP->addPlane(ZMinPixServ, RMinPixServ, RMaxPixServ);
142 pixServM->addPlane(-ZMinPixServ, RMinPixServ, RMaxPixServ);
143
144
145 pixServP->addPlane(ZMaxFwdTRTC, RMinPixServ, RMaxPixServ);
146 pixServP->addPlane(ZMaxFwdTRTC, RMinPixServ, RMaxIDet);
147 pixServM->addPlane(-ZMaxFwdTRTC, RMinPixServ, RMaxPixServ);
148 pixServM->addPlane(-ZMaxFwdTRTC, RMinPixServ, RMaxIDet);
149
150
151 pixServP->addPlane(ZMaxIDet, RMinPixServ, RMaxIDet);
152 pixServM->addPlane(-ZMaxIDet, RMinPixServ, RMaxIDet);
153
154 ServVolAux = new GeoShapeUnion(pixServP, pixServM);
155 }
156
157
158 GeoPcon *sctTrtServ = new GeoPcon(0.,2*Gaudi::Units::pi);
159
160
161 if (join1) {
162
163 sctTrtServ->addPlane(-ZMaxIDet, RMinPixServ, RMaxIDet);
164
165 if (!join2) {
166 sctTrtServ->addPlane(-ZMinPixServ, RMinPixServ, RMaxIDet);
167 sctTrtServ->addPlane(-ZMinPixServ, RMaxPixServ, RMaxIDet);
168 }
169 } else {
170
171 sctTrtServ->addPlane(-ZMaxIDet, RMaxFwdTRTC, RMaxIDet);
172 }
173
174
175 sctTrtServ->addPlane(-ZMaxSCTServInTRT, RMaxFwdTRTC, RMaxIDet);
176 sctTrtServ->addPlane(-ZMaxSCTServInTRT, RMaxFwdSCT, RMaxIDet);
177 sctTrtServ->addPlane(-ZMinSCTServInTRT, RMaxFwdSCT, RMaxIDet);
178 sctTrtServ->addPlane(-ZMinSCTServInTRT, RMaxFwdTRT, RMaxIDet);
179
180
181 sctTrtServ->addPlane(-ZMinFwdSCTandTRT, RMaxFwdTRT, RMaxIDet);
182 sctTrtServ->addPlane(-ZMinFwdSCTandTRT, RMinBrlSCT, RMaxIDet);
183
184
185 sctTrtServ->addPlane(-ZMaxBrlSCT, RMinBrlSCT, RMaxIDet);
186 sctTrtServ->addPlane(-ZMaxBrlSCT, RMinBrlTRT, RMaxIDet);
187
188
189 sctTrtServ->addPlane(-ZMaxBrlTRT, RMinBrlTRT, RMaxIDet);
190 sctTrtServ->addPlane(-ZMaxBrlTRT, RMaxBrlTRT, RMaxIDet);
191
192
193
194
195 sctTrtServ->addPlane(ZMaxBrlTRT, RMaxBrlTRT, RMaxIDet);
196 sctTrtServ->addPlane(ZMaxBrlTRT, RMinBrlTRT, RMaxIDet);
197
198
199 sctTrtServ->addPlane(ZMaxBrlSCT, RMinBrlTRT, RMaxIDet);
200 sctTrtServ->addPlane(ZMaxBrlSCT, RMinBrlSCT, RMaxIDet);
201
202
203 sctTrtServ->addPlane(ZMinFwdSCTandTRT, RMinBrlSCT, RMaxIDet);
204 sctTrtServ->addPlane(ZMinFwdSCTandTRT, RMaxFwdTRT, RMaxIDet);
205
206
207 sctTrtServ->addPlane(ZMinSCTServInTRT, RMaxFwdTRT, RMaxIDet);
208 sctTrtServ->addPlane(ZMinSCTServInTRT, RMaxFwdSCT, RMaxIDet);
209 sctTrtServ->addPlane(ZMaxSCTServInTRT, RMaxFwdSCT, RMaxIDet);
210 sctTrtServ->addPlane(ZMaxSCTServInTRT, RMaxFwdTRTC, RMaxIDet);
211
212
213 if (join1) {
214
215 if (!join2) {
216 sctTrtServ->addPlane(ZMinPixServ, RMaxPixServ, RMaxIDet);
217 sctTrtServ->addPlane(ZMinPixServ, RMinPixServ, RMaxIDet);
218 }
219
220 sctTrtServ->addPlane(ZMaxIDet, RMinPixServ, RMaxIDet);
221 } else {
222
223
224 sctTrtServ->addPlane(ZMaxIDet, RMaxFwdTRTC, RMaxIDet);
225 }
226
227 const GeoShape * ServVol = nullptr;
228 if (ServVolAux == nullptr) {
229 ServVol = sctTrtServ;
230 } else {
231 ServVol = new GeoShapeUnion(sctTrtServ, ServVolAux);
232 }
233 const GeoMaterial* air = materialManager->
getMaterial(
"std::Air");
234 const GeoLogVol* ServLog = new GeoLogVol("ServLog",ServVol,air);
235 GeoPhysVol* ServPhys = new GeoPhysVol(ServLog);
236
237
238
239
240 GeoNameTag *
tag =
new GeoNameTag(
"InDetServMat");
241 world->add(tag);
242 world->add(ServPhys);
244
246 PSMF.create(ServPhys);
247
248
250 SSMF.create(ServPhys);
251
252
254 TSMF.create(ServPhys);
255
256
258 EPMF.create(ServPhys);
259
260
262 RAMF.create(ServPhys);
263
264
266 SQCF.create(ServPhys);
267
268
269 InDetDD::DistortedMaterialManager xMatManager;
270 InDetDD::ExtraMaterial xMat(&xMatManager);
271 xMat.add(ServPhys, "InDetServMat");
272
273 delete materialManager;
274
275}
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
virtual std::string getChildTag(const std::string &childNode, const std::string &parentTag, const std::string &parentNode, const std::string &connName="ATLASDD")=0
Gets the tag name for the node by giving its parent node tag.
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
virtual double getDouble(const std::string &fieldName) const =0
Get double field value.
InDetDD::AthenaComps * getAthenaComps()
IRDBAccessSvc * rdbAccessSvc()
const IGeoDbTagSvc * geoDbTagSvc() const
void addScalingTable(const IRDBRecordset_ptr &scalingTable)
const GeoMaterial * getMaterial(const std::string &materialName)
Get material. First looks for locally defined material and if not found looks in GeoModel material ma...
InDetDD::InDetServMatManager * m_manager