ATLAS Offline Software
Loading...
Searching...
No Matches
EMECSupportConstruction.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5// EMECSupportConstruction
6// April 2013 J.T. Insert extra material after PS in front of emec electronics
7// June 2009 AMS General code cleanup
8// Static variables avioded
9// Almost all hardcoded numbers copied to DB
10// 18-Sep-2006 V.N Updated material definitions
11// 19-Dec-2005 V.N Inversed angle alpha for filling of electronic boards
12// 28-Oct-2005 J.T. bug fixes, + InnerAluCone details
13// 20-July-2004 J.T. back support included as well
14// 06-Oct-2003 J.T. new class EMECSupportConstruction created for GeoModel:
15// 06-Oct-2003 J.T. code of LArEMECSupportConstruction revised to work in
16// the GeoModel framework
17// 06-Oct-2003 J.T. isModule parameter was introduced some time ago
18// (when and by whom - is not documented in this header)
19// This destroyed the geometry of the BARRETTE sections
20// either in the case of isModule=true or isModule=false.
21// Therefore I have recalled the previous(original) geometry
22// for isModule=false. In case of isModule=true, I kept
23// phistart=Position-PI/8, m_PhiSize=PI/4, such a way that
24// in case of Position=0, there is an electrode at phi=0
25// (what I think was a feature of the implemented module's
26// concept as well).
27// Back structure always should be rotated by 180deg
28// around x axis before placement into EMECMother.
29// Therefore in case of isModule=true, an appropriate
30// rotation around z is to be performed afterwards as well.
31// Cables and electronics are not included.
32
33
34// **** **** **** New Version of EMECSupportConstruction **** **** ****
35// 31-July-2005 Vakho
36// The idea was to reorganize EMECSupportConstruction in order to make it look
37// as closer as possible to LArG4EC/LArEMECSupportConstruction.
38//
39// Known issues
40//
41// 1. Front envelope. rmax of FrontInnerLongBar reduced from 574.0 to 572.0
42// in order to avoid clash with FrontMiddleRing (clash comes from G4 description)
43//
44// 2. Outer envelope. rmin of Wide- and NarrowStretchers increased from 2044.0 to 2048.0
45// in order to avoid clashes with TopIndexingRing (clash comes from G4 description)
46//
47// 3. Few polycones give a 'Solid Problem' error message when running G4 geometry test
48// on translated geometry. The reason is not clear. Visualization does not show
49// any problems for these solids and it looks like simulation is not affected either
50//
51//
52// ToDo:
53// 1. Use parameterisations wherever possible;
54
55#include<string>
56#include<sstream>
57#include<cassert>
58
59#include "GeoModelKernel/GeoElement.h"
60#include "GeoModelKernel/GeoMaterial.h"
61#include "GeoModelKernel/GeoFullPhysVol.h"
62#include "GeoModelKernel/GeoPhysVol.h"
63#include "GeoModelKernel/GeoVPhysVol.h"
64#include "GeoModelKernel/GeoLogVol.h"
65#include "GeoModelKernel/GeoBox.h"
66#include "GeoModelKernel/GeoPcon.h"
67#include "GeoModelKernel/GeoTubs.h"
68#include "GeoModelKernel/GeoCons.h"
69#include "GeoModelKernel/GeoPara.h"
70#include "GeoModelKernel/GeoNameTag.h"
71#include "GeoModelKernel/GeoTransform.h"
72#include "GeoModelKernel/GeoAlignableTransform.h"
73#include "GeoModelKernel/GeoIdentifierTag.h"
74#include "GeoModelKernel/GeoDefinitions.h"
75
79#include "GaudiKernel/MsgStream.h"
80#include "GaudiKernel/ISvcLocator.h"
81#include "GaudiKernel/PhysicalConstants.h"
82
86
89
90using namespace LArGeo;
91
93 std::string basename, double position)
94 : AthMessaging("EMECSupportConstruction")
95 , m_Type(type)
96 , m_pos_zside(pos_zside)
97 , m_isModule(is_module)
98 , m_BaseName(std::move(basename))
99 , m_Position(position)
100{
101 ISvcLocator *svcLocator = Gaudi::svcLocator();
102 SmartIF<StoreGateSvc> detStore{svcLocator->service("DetectorStore")};
103 if(!detStore.isValid()){
104 throw std::runtime_error("Error in EMECSupportConstruction, cannot access DetectorStore");
105 }
106 StoredMaterialManager* materialManager = nullptr;
107 if (detStore->retrieve(materialManager, std::string("MATERIALS")).isFailure()) {
108 throw std::runtime_error("Error in EMECSupportConstruction, cannot access MATERIALS");
109 }
110
111 m_PhiStart = 0.;
112 m_PhiSize = Gaudi::Units::twopi*Gaudi::Units::rad;
113
114 if(m_isModule){
115 m_PhiStart = m_Position - M_PI*Gaudi::Units::rad / 8.;
116 m_PhiSize = M_PI*Gaudi::Units::rad / 4.;
117 }
118
119 // Get the materials from the manager
120
121 m_Lead = materialManager->getMaterial("std::Lead");
122 if(!m_Lead) throw std::runtime_error("Error in EMECSupportConstruction, std::Lead is not found.");
123
124 m_Alu = materialManager->getMaterial("std::Aluminium");
125 if(!m_Alu) throw std::runtime_error("Error in EMECSupportConstruction, std::Aluminium is not found.");
126
127 m_Copper = materialManager->getMaterial("std::Copper");
128 if(!m_Copper) throw std::runtime_error("Error in EMECSupportConstruction, std::Copper is not found.");
129
130 m_LAr = materialManager->getMaterial("std::LiquidArgon");
131 if(!m_LAr) throw std::runtime_error("Error in EMECSupportConstruction, std::LiquidArgon is not found.");
132
133 m_Gten = materialManager->getMaterial("LAr::G10");
134 if(!m_Gten) throw std::runtime_error("Error in EMECSupportConstruction, LAr::G10 is not found.");
135
136 m_PermaliE730 = materialManager->getMaterial("LAr::Glue");
137 if(!m_PermaliE730) throw std::runtime_error("Error in EMECSupportConstruction, LAr::Glue is not found.");
138
139 m_G10FeOuter = materialManager->getMaterial("LAr::G10FeOuter");
140 if(!m_G10FeOuter) throw std::runtime_error("Error in EMECSupportConstruction, LAr::G10FeOuter is not found.");
141
142 m_G10FeInner = materialManager->getMaterial("LAr::G10FeInner");
143 if(!m_G10FeInner) throw std::runtime_error("Error in EMECSupportConstruction, LAr::G10FeInner is not found.");
144
145 m_Kapton_Cu = materialManager->getMaterial("LAr::KaptonC");
146 if(!m_Kapton_Cu) throw std::runtime_error("Error in EMECSupportConstruction, LAr::KaptonC is not found.");
147
148 m_Cable = materialManager->getMaterial("LAr::Cables");
149 if(!m_Cable) throw std::runtime_error("Error in EMECSupportConstruction, LAr::Cables is not found.");
150
151 SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
152 if(!geoModel.isValid())
153 throw std::runtime_error("Error cannot access GeoModelSvc");
154 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service("RDBAccessSvc")};
155 if(!rdbAccess.isValid())
156 throw std::runtime_error("Error cannot access RDBAccessSvc");
157
158 //emecExtraCyl, add extra material after PS
159 std::string AtlasVersion = geoModel->atlasVersion();
160 std::string LArVersion = geoModel->LAr_VersionOverride();
161 std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
162 std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
163 m_DB_emecExtraCyl = rdbAccess->getRecordsetPtr("LArCones",detectorKey, detectorNode);
164 //--
165
166 DecodeVersionKey larVersionKey(geoModel, "LAr");
167
169 rdbAccess->getRecordsetPtr("EmecGeometry", larVersionKey.tag(), larVersionKey.node());
170 if(m_DB_EmecGeometry->size() == 0){
171 m_DB_EmecGeometry = rdbAccess->getRecordsetPtr("EmecGeometry", "EmecGeometry-00");
172 }
173
175 rdbAccess->getRecordsetPtr("EmecWheelParameters", larVersionKey.tag(), larVersionKey.node());
176 if(m_DB_EmecWheelParameters->size() == 0){
177 m_DB_EmecWheelParameters = rdbAccess->getRecordsetPtr("EmecWheelParameters", "EmecWheelParameters-00");
178 }
179
180 m_DB_boxes = rdbAccess->getRecordsetPtr("EmecDMBoxes", larVersionKey.tag(), larVersionKey.node());
181 if(m_DB_boxes->size() == 0){
182 m_DB_boxes = rdbAccess->getRecordsetPtr("EmecDMBoxes", "EmecDMBoxes-00");
183 }
184 m_DB_numbers = rdbAccess->getRecordsetPtr("EmecDMNumbers", larVersionKey.tag(), larVersionKey.node());
185 if(m_DB_numbers->size() == 0){
186 m_DB_numbers = rdbAccess->getRecordsetPtr("EmecDMNumbers", "EmecDMNumbers-00");
187 }
188 m_DB_tubes = rdbAccess->getRecordsetPtr("EmecDMTubes", larVersionKey.tag(), larVersionKey.node());
189 if(m_DB_tubes->size() == 0){
190 m_DB_tubes = rdbAccess->getRecordsetPtr("EmecDMTubes", "EmecDMTubes-00");
191 }
192 m_DB_pcons = rdbAccess->getRecordsetPtr("EmecDMPCons", larVersionKey.tag(), larVersionKey.node());
193 if(m_DB_pcons->size() == 0){
194 m_DB_pcons = rdbAccess->getRecordsetPtr("EmecDMPCons", "EmecDMPCons-00");
195 }
196
197 m_DB_mn = rdbAccess->getRecordsetPtr("EmecMagicNumbers", larVersionKey.tag(), larVersionKey.node());
198 if(m_DB_mn->size() == 0){
199 m_DB_mn = rdbAccess->getRecordsetPtr("EmecMagicNumbers", "EmecMagicNumbers-00");
200 }
201
202 m_DB_EmecFan = rdbAccess->getRecordsetPtr("EmecFan", larVersionKey.tag(), larVersionKey.node());
203 if(m_DB_EmecFan->size() == 0){
204 m_DB_EmecFan = rdbAccess->getRecordsetPtr("EmecFan", "EmecFan-00");
205 }
206 m_DB_ColdContraction = rdbAccess->getRecordsetPtr("ColdContraction", larVersionKey.tag(), larVersionKey.node());
207 if(m_DB_ColdContraction->size() == 0){
208 m_DB_ColdContraction = rdbAccess->getRecordsetPtr("ColdContraction", "ColdContraction-00");
209 }
210}
211
213{
215 for(unsigned int i = 0; i < db->size(); ++ i) {
216 const std::string& key = (*db)[i]->getString(s);
217 result[key] = i;
218 }
219 return result;
220}
221
223{
225 for(unsigned int i = 0; i < db->size(); ++ i) {
226 const std::string& object = (*db)[i]->getString("OBJECTNAME");
227 if(object == s) {
228 const std::string& key = (*db)[i]->getString("PARNAME");
229 result[key] = i;
230 }
231 }
232 return result;
233}
234
235double EMECSupportConstruction::getNumber(const IRDBRecordset_ptr& db, const map_t &m, const std::string &idx,
236 const char *number, double defval) const
237{
238 map_t::const_iterator i = m.find(idx);
239 if(i == m.end()){
240 ATH_MSG_WARNING("Cannot get " << idx << "/" << number << " from DB");
241 return defval;
242 }
243 double value = (*db)[(*i).second]->getDouble(number);
244 assert(value == defval);
245 return value;
246}
247
248double EMECSupportConstruction::getNumber(const IRDBRecordset_ptr& db, const std::string &s,
249 const std::string &parameter, double defval) const
250{
251 for(unsigned int i = 0; i < db->size(); ++ i){
252 const std::string& object = (*db)[i]->getString("OBJECTNAME");
253 if(object == s){
254 const std::string& key = (*db)[i]->getString("PARNAME");
255 if(key == parameter){
256 double value = (*db)[i]->getDouble("PARVALUE");
257 assert(value == defval);
258 return value;
259 }
260 }
261 }
262 ATH_MSG_WARNING("Cannot get " << s << "/" << parameter << " from DB_numbers"
263 << ", default is " << defval);
264 return defval;
265}
266
268
269GeoIntrusivePtr<GeoPhysVol> EMECSupportConstruction::GetEnvelope(void) const
270{
271 switch(m_Type)
272 {
273 case Front: return front_envelope();
274 case Back: return back_envelope();
275 case Outer: return outer_envelope();
276 case Inner: return inner_envelope();
277 case Middle: return middle_envelope();
278 case FrontInner: return front_inner_envelope();
279 case BackInner: return back_inner_envelope();
280 case FrontOuter: return front_outer_envelope();
281 case BackOuter: return back_outer_envelope();
282 default:
283 {
284 ATH_MSG_WARNING("Unknown Type " << m_Type << " in GetEnvelope,"
285 << " null pointer returned");
286 return nullptr;
287 }
288 }
289}
290
291GeoPcon* EMECSupportConstruction::getPcon(const std::string& id) const
292{
293 double phi_start = m_PhiStart;
294 double phi_size = m_PhiSize;
295 std::vector<double> zplane, rmin, rmax;
296
297 std::string id1 = id;
298 if(id.starts_with( "FrontSupportMother")) id1 = "FrontSupportMother";
299 else if(id.starts_with( "BackSupportMother")) id1 = "BackSupportMother";
300 else if(id.find("Stretchers") != std::string::npos) id1 = "Stretchers";
301 else if(id == "FrontMiddleRing::LowerHole") id1 = "FrontMiddleRing::LH";
302 else if(id == "FrontMiddleRing::LowerGTen") id1 = "FrontMiddleRing::LGT";
303 else if(id == "FrontMiddleRing::UpperHole") id1 = "FrontMiddleRing::UH";
304 else if(id == "FrontMiddleRing::UpperGTen") id1 = "FrontMiddleRing::UGT";
305 else if(id == "BackMiddleRing::LowerHole") id1 = "BackMiddleRing::LH";
306 else if(id == "BackMiddleRing::LowerGTen") id1 = "BackMiddleRing::LGT";
307 else if(id == "BackMiddleRing::UpperHole") id1 = "BackMiddleRing::UH";
308 else if(id == "BackMiddleRing::UpperGTen") id1 = "BackMiddleRing::UGT";
309
310 std::map<int, unsigned int> pcone;
311 int nzplanes = 0;
312 double R0 = 0.;
313 for(unsigned int i = 0; i < m_DB_pcons->size(); ++ i){
314 const std::string& object = (*m_DB_pcons)[i]->getString("PCONNAME");
315 if(object == id1){
316 int key = (*m_DB_pcons)[i]->getInt("NZPLANE");
317 if(pcone.find(key) != pcone.end()){
318 ATH_MSG_WARNING("Duplicate NZPLANE in ");
319 nzplanes = 0;
320 break;
321 }
322 pcone[key] = i;
323 if(key >= 0) ++ nzplanes;
324 else R0 = (*m_DB_pcons)[i]->getDouble("RMIN")*Gaudi::Units::mm;
325 }
326 }
327 if(nzplanes > 0){
328 zplane.resize(nzplanes); rmin.resize(nzplanes); rmax.resize(nzplanes);
329 for(int n = 0; n < nzplanes; ++ n){
330 zplane[n] = (*m_DB_pcons)[pcone[n]]->getDouble("ZPOS")*Gaudi::Units::mm;
331 rmin[n] = R0 + (*m_DB_pcons)[pcone[n]]->getDouble("RMIN")*Gaudi::Units::mm;
332 rmax[n] = R0 + (*m_DB_pcons)[pcone[n]]->getDouble("RMAX")*Gaudi::Units::mm;
333 }
334 if(id1 == "FrontSupportMother"){
335 if(id.find("Inner") != std::string::npos){
336 zplane.resize(2); rmin.resize(2); rmax.resize(2);
337 double rlim = getNumber(m_DB_numbers, id, "Inner", 614.)*Gaudi::Units::mm;
338 rmax[0] = rlim;
339 rmax[1] = rlim;
340 } else if(id.find("Outer") != std::string::npos){
341 double rlim = getNumber(m_DB_numbers, id, "Outer", 603.-1.)*Gaudi::Units::mm;
342 rmin[0] = rlim;
343 rmin[1] = rlim;
344 }
345 }
346 if(id1 == "BackSupportMother"){
347 if(id.find("Inner") != std::string::npos){
348 zplane.resize(2); rmin.resize(2); rmax.resize(2);
349 double rlim = getNumber(m_DB_numbers, id, "Inner", 699.)*Gaudi::Units::mm;
350 rmax[0] = rlim;
351 rmax[1] = rlim;
352 } else if(id.find("Outer") != std::string::npos){
353 double rlim = getNumber(m_DB_numbers, id, "Outer", 687.-1.)*Gaudi::Units::mm;
354 rmin[0] = rlim;
355 rmin[1] = rlim;
356 }
357 }
358 if(id1 == "Stretchers"){
359 if(id == "WideStretchers"){
360 double dfiWS = 360./3./256.*24.*Gaudi::Units::deg; //this is the design variable for WS
361 phi_start = m_Position - dfiWS*0.5;
362 phi_size = dfiWS;
363 }
364 if(id == "NarrowStretchers"){
365 double lengthNS = getNumber(m_DB_numbers, id, "Width", 200.)*Gaudi::Units::mm; // transversal length of NS
366 double dfiNS = lengthNS / rmax[0] * Gaudi::Units::rad;
367 phi_start = m_Position - dfiNS*0.5;
368 phi_size = dfiNS;
369 }
370 }
371//#define DEBUG
372#ifdef DEBUG
373std::cout << "!!!! " << id << ":" << std::endl;
374for(int i = 0; i < nzplanes; ++ i){
375 std::cout << "\t" << i << " " << zplane[i] << " " << rmin[i] << " " << rmax[i] << std::endl;
376}
377#endif
378 } else {
379 if(id.starts_with( "FrontSupportMother")){
380 zplane.resize(6); rmin.resize(6); rmax.resize(6);
381 zplane[0] = 0. *Gaudi::Units::mm; rmin[0] = 292.*Gaudi::Units::mm-1.*Gaudi::Units::mm; rmax[0] = 2077.*Gaudi::Units::mm-7.*Gaudi::Units::mm;
382 zplane[1] = 61. *Gaudi::Units::mm; rmin[1] = 292.*Gaudi::Units::mm-1.*Gaudi::Units::mm; rmax[1] = 2077.*Gaudi::Units::mm-7.*Gaudi::Units::mm;
383 zplane[2] = 61. *Gaudi::Units::mm; rmin[2] = 2023.*Gaudi::Units::mm-7.*Gaudi::Units::mm; rmax[2] = 2077.*Gaudi::Units::mm-7.*Gaudi::Units::mm;
384 zplane[3] = 72.3*Gaudi::Units::mm; rmin[3] = 2023.*Gaudi::Units::mm-7.*Gaudi::Units::mm; rmax[3] = 2077.*Gaudi::Units::mm-7.*Gaudi::Units::mm;
385 zplane[4] = 124.2*Gaudi::Units::mm; rmin[4] = 2051.*Gaudi::Units::mm-7.*Gaudi::Units::mm; rmax[4] = 2077.*Gaudi::Units::mm-7.*Gaudi::Units::mm;
386 zplane[5] = 153. *Gaudi::Units::mm; rmin[5] = 2051.*Gaudi::Units::mm-7.*Gaudi::Units::mm; rmax[5] = 2077.*Gaudi::Units::mm-7.*Gaudi::Units::mm;
387 if(id == "FrontSupportMother::Outer"){
388 rmin[0] = 603.*Gaudi::Units::mm-1.*Gaudi::Units::mm;
389 rmin[1] = 603.*Gaudi::Units::mm-1.*Gaudi::Units::mm;
390 }
391 if(id == "FrontSupportMother::Inner"){
392 zplane.resize(2); rmin.resize(2); rmax.resize(2);
393 rmax[0] = 614.*Gaudi::Units::mm;
394 rmax[1] = 614.*Gaudi::Units::mm;
395 }
396 } else if(id.starts_with( "BackSupportMother")){
397 zplane.resize(4); rmin.resize(4); rmax.resize(4);
398 zplane[0] = 0.001*Gaudi::Units::mm; rmin[0] = 333.*Gaudi::Units::mm-1.*Gaudi::Units::mm; rmax[0] = 2077.*Gaudi::Units::mm-7.*Gaudi::Units::mm;
399 zplane[1] = 55. *Gaudi::Units::mm; rmin[1] = 333.*Gaudi::Units::mm-1.*Gaudi::Units::mm; rmax[1] = 2077.*Gaudi::Units::mm-7.*Gaudi::Units::mm;
400 zplane[2] = 55. *Gaudi::Units::mm; rmin[2] = 2051.*Gaudi::Units::mm-7.*Gaudi::Units::mm; rmax[2] = 2077.*Gaudi::Units::mm-7.*Gaudi::Units::mm;
401 zplane[3] = 147. *Gaudi::Units::mm; rmin[3] = 2051.*Gaudi::Units::mm-7.*Gaudi::Units::mm; rmax[3] = 2077.*Gaudi::Units::mm-7.*Gaudi::Units::mm;
402 if(id == "BackSupportMother::Outer"){
403 rmin[0] = 687.*Gaudi::Units::mm-1.*Gaudi::Units::mm;
404 rmin[1] = 687.*Gaudi::Units::mm-1.*Gaudi::Units::mm;
405 }
406 if(id == "BackSupportMother::Inner"){
407 zplane.resize(2); rmin.resize(2); rmax.resize(2);
408 rmax[0] = 699.*Gaudi::Units::mm;
409 rmax[1] = 699.*Gaudi::Units::mm;
410 }
411 } else if(id == "WideStretchers" || id == "NarrowStretchers"){
412 double dzS = 165.*Gaudi::Units::mm;
413 double dznotch = 10.*Gaudi::Units::mm; // half z extent of the notch
414 double drnotch = 6.5*Gaudi::Units::mm; // deepness of the noth in radial direction
415 double rmaxS = (2077. - 7.)*Gaudi::Units::mm;//ROuter+116. // -7 for cold
416 double rminS = rmaxS - 26.*Gaudi::Units::mm;
417 double rmidS = rminS + drnotch;
418 zplane.resize(6); rmin.resize(6); rmax.resize(6);
419 zplane[0] = -dzS ; rmin[0] = rminS; rmax[0] = rmaxS;
420 zplane[1] = -dznotch; rmin[1] = rminS; rmax[1] = rmaxS;
421 zplane[2] = -dznotch; rmin[2] = rmidS; rmax[2] = rmaxS;
422 zplane[3] = dznotch; rmin[3] = rmidS; rmax[3] = rmaxS;
423 zplane[4] = dznotch; rmin[4] = rminS; rmax[4] = rmaxS;
424 zplane[5] = dzS ; rmin[5] = rminS; rmax[5] = rmaxS;
425 if(id == "WideStretchers"){
426 double dfiWS = 360./3./256.*24.*Gaudi::Units::deg; //this is the design variable for WS
427 phi_start = m_Position - dfiWS*0.5;
428 phi_size = dfiWS;
429 }
430 if(id == "NarrowStretchers"){
431 double lengthNS = 200.*Gaudi::Units::mm; // transversal length of NS
432 double dfiNS = lengthNS / rmaxS * Gaudi::Units::rad;
433 phi_start = m_Position - dfiNS*0.5;
434 phi_size = dfiNS;
435 }
436 } else if(id == "OuterSupportMother"){
437 double dzS = 165.*Gaudi::Units::mm;
438 double rmaxS = (2077. - 7.)*Gaudi::Units::mm;//ROuter+116. // -7 for cold
439 double rminOTB = (2034. + 2.)*Gaudi::Units::mm;
440 double rmaxOTB = rminOTB + 3.*Gaudi::Units::mm;
441 double dzOTB = 201.*Gaudi::Units::mm;
442 zplane.resize(6); rmin.resize(6); rmax.resize(6);
443 zplane[0] = -dzOTB ; rmin[0] = rminOTB; rmax[0] = rmaxOTB;
444 zplane[1] = -dzS; rmin[1] = rminOTB; rmax[1] = rmaxOTB;
445 zplane[2] = -dzS; rmin[2] = rminOTB; rmax[2] = rmaxS;
446 zplane[3] = dzS; rmin[3] = rminOTB; rmax[3] = rmaxS;
447 zplane[4] = dzS; rmin[4] = rminOTB; rmax[4] = rmaxOTB;
448 zplane[5] = dzOTB ; rmin[5] = rminOTB; rmax[5] = rmaxOTB;
449 } else if(id == "FrontMiddleRing"){
450 double r0 =614.*Gaudi::Units::mm-2.*Gaudi::Units::mm ; // RMiddle=middle radius of the ring
451 zplane.resize(4); rmin.resize(4); rmax.resize(4);
452 zplane[0] = 0. *Gaudi::Units::mm; rmin[0] = r0 - 57.*Gaudi::Units::mm; rmax[0] = r0 + 57.*Gaudi::Units::mm;
453 zplane[1] = 27.5*Gaudi::Units::mm; rmin[1] = r0 - 57.*Gaudi::Units::mm; rmax[1] = r0 + 57.*Gaudi::Units::mm;
454 zplane[2] = 27.5*Gaudi::Units::mm; rmin[2] = r0 - 40.*Gaudi::Units::mm; rmax[2] = r0 + 40.*Gaudi::Units::mm;
455 zplane[3] = 59. *Gaudi::Units::mm; rmin[3] = r0 - 40.*Gaudi::Units::mm; rmax[3] = r0 + 40.*Gaudi::Units::mm;
456 } else if(id == "FrontMiddleRing::LowerHole"){
457 double r0 = 614.*Gaudi::Units::mm-2.*Gaudi::Units::mm; // RMiddle=middle radius of the ring
458 zplane.resize(6); rmin.resize(6); rmax.resize(6);
459 zplane[0] = 23. *Gaudi::Units::mm; rmin[0] = r0 - 28.3*Gaudi::Units::mm; rmax[0] = r0 - 8.*Gaudi::Units::mm;
460 zplane[1] = 27.5*Gaudi::Units::mm; rmin[1] = r0 - 28.3*Gaudi::Units::mm; rmax[1] = r0 - 8.*Gaudi::Units::mm;
461 zplane[2] = 27.5*Gaudi::Units::mm; rmin[2] = r0 - 40. *Gaudi::Units::mm; rmax[2] = r0 - 8.*Gaudi::Units::mm;
462 zplane[3] = 48.5*Gaudi::Units::mm; rmin[3] = r0 - 40. *Gaudi::Units::mm; rmax[3] = r0 - 8.*Gaudi::Units::mm;
463 zplane[4] = 48.5*Gaudi::Units::mm; rmin[4] = r0 - 28.3*Gaudi::Units::mm; rmax[4] = r0 - 8.*Gaudi::Units::mm;
464 zplane[5] = 53. *Gaudi::Units::mm; rmin[5] = r0 - 28.3*Gaudi::Units::mm; rmax[5] = r0 - 8.*Gaudi::Units::mm;
465 } else if(id == "FrontMiddleRing::LowerGTen"){
466 double r0 = 614.*Gaudi::Units::mm - 2.*Gaudi::Units::mm; // RMiddle=middle radius of the ring
467 zplane.resize(6); rmin.resize(6); rmax.resize(6);
468 zplane[0] = 23.*Gaudi::Units::mm; rmin[0] = r0 - 28.*Gaudi::Units::mm; rmax[0] = r0 - 8.*Gaudi::Units::mm;
469 zplane[1] = 28.*Gaudi::Units::mm; rmin[1] = r0 - 28.*Gaudi::Units::mm; rmax[1] = r0 - 8.*Gaudi::Units::mm;
470 zplane[2] = 28.*Gaudi::Units::mm; rmin[2] = r0 - 40.*Gaudi::Units::mm; rmax[2] = r0 - 8.*Gaudi::Units::mm;
471 zplane[3] = 48.*Gaudi::Units::mm; rmin[3] = r0 - 40.*Gaudi::Units::mm; rmax[3] = r0 - 8.*Gaudi::Units::mm;
472 zplane[4] = 48.*Gaudi::Units::mm; rmin[4] = r0 - 28.*Gaudi::Units::mm; rmax[4] = r0 - 8.*Gaudi::Units::mm;
473 zplane[5] = 53.*Gaudi::Units::mm; rmin[5] = r0 - 28.*Gaudi::Units::mm; rmax[5] = r0 - 8.*Gaudi::Units::mm;
474 } else if(id == "FrontMiddleRing::UpperHole"){
475 double r0 =614.*Gaudi::Units::mm-2.*Gaudi::Units::mm ; // RMiddle=middle radius of the ring
476 zplane.resize(6); rmin.resize(6); rmax.resize(6);
477 zplane[0] = 23. *Gaudi::Units::mm; rmin[0] = r0 + 8.*Gaudi::Units::mm; rmax[0] = r0 + 28.3*Gaudi::Units::mm;
478 zplane[1] = 27.5*Gaudi::Units::mm; rmin[1] = r0 + 8.*Gaudi::Units::mm; rmax[1] = r0 + 28.3*Gaudi::Units::mm;
479 zplane[2] = 27.5*Gaudi::Units::mm; rmin[2] = r0 + 8.*Gaudi::Units::mm; rmax[2] = r0 + 40. *Gaudi::Units::mm;
480 zplane[3] = 48.5*Gaudi::Units::mm; rmin[3] = r0 + 8.*Gaudi::Units::mm; rmax[3] = r0 + 40. *Gaudi::Units::mm;
481 zplane[4] = 48.5*Gaudi::Units::mm; rmin[4] = r0 + 8.*Gaudi::Units::mm; rmax[4] = r0 + 28.3*Gaudi::Units::mm;
482 zplane[5] = 53. *Gaudi::Units::mm; rmin[5] = r0 + 8.*Gaudi::Units::mm; rmax[5] = r0 + 28.3*Gaudi::Units::mm;
483 } else if(id == "FrontMiddleRing::UpperGTen"){
484 double r0 =614.*Gaudi::Units::mm-2.*Gaudi::Units::mm ; // RMiddle=middle radius of the ring
485 zplane.resize(6); rmin.resize(6); rmax.resize(6);
486 zplane[0] = 23.*Gaudi::Units::mm; rmin[0] = r0 + 8.*Gaudi::Units::mm; rmax[0] = r0 + 28.*Gaudi::Units::mm;
487 zplane[1] = 28.*Gaudi::Units::mm; rmin[1] = r0 + 8.*Gaudi::Units::mm; rmax[1] = r0 + 28.*Gaudi::Units::mm;
488 zplane[2] = 28.*Gaudi::Units::mm; rmin[2] = r0 + 8.*Gaudi::Units::mm; rmax[2] = r0 + 40.*Gaudi::Units::mm;
489 zplane[3] = 48.*Gaudi::Units::mm; rmin[3] = r0 + 8.*Gaudi::Units::mm; rmax[3] = r0 + 40.*Gaudi::Units::mm;
490 zplane[4] = 48.*Gaudi::Units::mm; rmin[4] = r0 + 8.*Gaudi::Units::mm; rmax[4] = r0 + 28.*Gaudi::Units::mm;
491 zplane[5] = 53.*Gaudi::Units::mm; rmin[5] = r0 + 8.*Gaudi::Units::mm; rmax[5] = r0 + 28.*Gaudi::Units::mm;
492 } else if(id == "FrontInnerRing"){
493 double r0 = 335.5*Gaudi::Units::mm-1.*Gaudi::Units::mm; // RInner = reference radius of the inner ring
494 zplane.resize(5); rmin.resize(5); rmax.resize(5);
495 zplane[0] = 0. *Gaudi::Units::mm; rmin[0] = r0 - 22.5*Gaudi::Units::mm; rmax[0] = r0 + 51.5*Gaudi::Units::mm;
496 zplane[1] = 6. *Gaudi::Units::mm; rmin[1] = r0 - 28.5*Gaudi::Units::mm; rmax[1] = r0 + 51.5*Gaudi::Units::mm;
497 zplane[2] = 27.5*Gaudi::Units::mm; rmin[2] = r0 - 28.5*Gaudi::Units::mm; rmax[2] = r0 + 51.5*Gaudi::Units::mm;
498 zplane[3] = 27.5*Gaudi::Units::mm; rmin[3] = r0 - 43.5*Gaudi::Units::mm; rmax[3] = r0 + 40.5*Gaudi::Units::mm;
499 zplane[4] = 59. *Gaudi::Units::mm; rmin[4] = r0 - 43.5*Gaudi::Units::mm; rmax[4] = r0 + 40.5*Gaudi::Units::mm;
500 } else if(id == "FrontInnerRing::Hole"){
501 double r0 = 335.5*Gaudi::Units::mm-1.*Gaudi::Units::mm; // RInner = reference radius of the inner ring
502 zplane.resize(6); rmin.resize(6); rmax.resize(6);
503 zplane[0] = 23. *Gaudi::Units::mm; rmin[0] = r0 + 6.5*Gaudi::Units::mm; rmax[0] = r0 + 29.5*Gaudi::Units::mm;
504 zplane[1] = 27.5*Gaudi::Units::mm; rmin[1] = r0 + 6.5*Gaudi::Units::mm; rmax[1] = r0 + 29.5*Gaudi::Units::mm;
505 zplane[2] = 27.5*Gaudi::Units::mm; rmin[2] = r0 + 6.5*Gaudi::Units::mm; rmax[2] = r0 + 40.5*Gaudi::Units::mm;
506 zplane[3] = 48.5*Gaudi::Units::mm; rmin[3] = r0 + 6.5*Gaudi::Units::mm; rmax[3] = r0 + 40.5*Gaudi::Units::mm;
507 zplane[4] = 48.5*Gaudi::Units::mm; rmin[4] = r0 + 6.5*Gaudi::Units::mm; rmax[4] = r0 + 29.5*Gaudi::Units::mm;
508 zplane[5] = 53. *Gaudi::Units::mm; rmin[5] = r0 + 6.5*Gaudi::Units::mm; rmax[5] = r0 + 29.5*Gaudi::Units::mm;
509 } else if(id == "FrontInnerRing::GTen"){
510 double r0 = 335.5*Gaudi::Units::mm-1.*Gaudi::Units::mm; // RInner = reference radius of the inner ring
511 zplane.resize(6); rmin.resize(6); rmax.resize(6);
512 zplane[0] = 23.*Gaudi::Units::mm; rmin[0] = r0 + 8.5*Gaudi::Units::mm; rmax[0] = r0 + 28.5*Gaudi::Units::mm;
513 zplane[1] = 28.*Gaudi::Units::mm; rmin[1] = r0 + 8.5*Gaudi::Units::mm; rmax[1] = r0 + 28.5*Gaudi::Units::mm;
514 zplane[2] = 28.*Gaudi::Units::mm; rmin[2] = r0 + 8.5*Gaudi::Units::mm; rmax[2] = r0 + 40.5*Gaudi::Units::mm;
515 zplane[3] = 48.*Gaudi::Units::mm; rmin[3] = r0 + 8.5*Gaudi::Units::mm; rmax[3] = r0 + 40.5*Gaudi::Units::mm;
516 zplane[4] = 48.*Gaudi::Units::mm; rmin[4] = r0 + 8.5*Gaudi::Units::mm; rmax[4] = r0 + 28.5*Gaudi::Units::mm;
517 zplane[5] = 53.*Gaudi::Units::mm; rmin[5] = r0 + 8.5*Gaudi::Units::mm; rmax[5] = r0 + 28.5*Gaudi::Units::mm;
518 } else if(id == "BackMiddleRing"){
519 double r0 = 699.*Gaudi::Units::mm-2.5*Gaudi::Units::mm; // RMiddle radius of the ring
520 zplane.resize(4); rmin.resize(4); rmax.resize(4);
521 zplane[0] = 0. *Gaudi::Units::mm; rmin[0] = r0 - 57.*Gaudi::Units::mm; rmax[0] = r0 + 57.*Gaudi::Units::mm;
522 zplane[1] = 21. *Gaudi::Units::mm; rmin[1] = r0 - 57.*Gaudi::Units::mm; rmax[1] = r0 + 57.*Gaudi::Units::mm;
523 zplane[2] = 21. *Gaudi::Units::mm; rmin[2] = r0 - 40.*Gaudi::Units::mm; rmax[2] = r0 + 40.*Gaudi::Units::mm;
524 zplane[3] = 52.5*Gaudi::Units::mm; rmin[3] = r0 - 40.*Gaudi::Units::mm; rmax[3] = r0 + 40.*Gaudi::Units::mm;
525 } else if(id == "BackMiddleRing::LowerHole"){
526 double r0 = 699.*Gaudi::Units::mm-2.5*Gaudi::Units::mm; // RMiddle radius of the ring
527 zplane.resize(6); rmin.resize(6); rmax.resize(6);
528 zplane[0] = 16.5*Gaudi::Units::mm; rmin[0] = r0 - 28.3*Gaudi::Units::mm; rmax[0] = r0 - 8.*Gaudi::Units::mm;
529 zplane[1] = 21. *Gaudi::Units::mm; rmin[1] = r0 - 28.3*Gaudi::Units::mm; rmax[1] = r0 - 8.*Gaudi::Units::mm;
530 zplane[2] = 21. *Gaudi::Units::mm; rmin[2] = r0 - 40. *Gaudi::Units::mm; rmax[2] = r0 - 8.*Gaudi::Units::mm;
531 zplane[3] = 42. *Gaudi::Units::mm; rmin[3] = r0 - 40. *Gaudi::Units::mm; rmax[3] = r0 - 8.*Gaudi::Units::mm;
532 zplane[4] = 42. *Gaudi::Units::mm; rmin[4] = r0 - 28.3*Gaudi::Units::mm; rmax[4] = r0 - 8.*Gaudi::Units::mm;
533// zplane[5] = 56.5*Gaudi::Units::mm; rmin[5] = r0 - 28.3*Gaudi::Units::mm; rmax[5] = r0 - 8.*Gaudi::Units::mm;
534 zplane[5] = 46.5*Gaudi::Units::mm; rmin[5] = r0 - 28.3*Gaudi::Units::mm; rmax[5] = r0 - 8.*Gaudi::Units::mm;
535 } else if(id == "BackMiddleRing::LowerGTen"){
536 double r0 = 699.*Gaudi::Units::mm-2.5*Gaudi::Units::mm; // RMiddle radius of the ring
537 zplane.resize(6); rmin.resize(6); rmax.resize(6);
538 zplane[0] = 16.5*Gaudi::Units::mm; rmin[0] = r0 - 28.*Gaudi::Units::mm; rmax[0] = r0 - 8.*Gaudi::Units::mm;
539 zplane[1] = 21.5*Gaudi::Units::mm; rmin[1] = r0 - 28.*Gaudi::Units::mm; rmax[1] = r0 - 8.*Gaudi::Units::mm;
540 zplane[2] = 21.5*Gaudi::Units::mm; rmin[2] = r0 - 40.*Gaudi::Units::mm; rmax[2] = r0 - 8.*Gaudi::Units::mm;
541 zplane[3] = 41.5*Gaudi::Units::mm; rmin[3] = r0 - 40.*Gaudi::Units::mm; rmax[3] = r0 - 8.*Gaudi::Units::mm;
542 zplane[4] = 41.5*Gaudi::Units::mm; rmin[4] = r0 - 28.*Gaudi::Units::mm; rmax[4] = r0 - 8.*Gaudi::Units::mm;
543 zplane[5] = 46.5*Gaudi::Units::mm; rmin[5] = r0 - 28.*Gaudi::Units::mm; rmax[5] = r0 - 8.*Gaudi::Units::mm;
544 } else if(id == "BackMiddleRing::UpperHole"){
545 double r0 = 699.*Gaudi::Units::mm-2.5*Gaudi::Units::mm; // RMiddle radius of the ring
546 zplane.resize(6); rmin.resize(6); rmax.resize(6);
547 zplane[0] = 16.5*Gaudi::Units::mm; rmin[0] = r0 + 8.*Gaudi::Units::mm; rmax[0] = r0 + 28.3*Gaudi::Units::mm;
548 zplane[1] = 21. *Gaudi::Units::mm; rmin[1] = r0 + 8.*Gaudi::Units::mm; rmax[1] = r0 + 28.3*Gaudi::Units::mm;
549 zplane[2] = 21. *Gaudi::Units::mm; rmin[2] = r0 + 8.*Gaudi::Units::mm; rmax[2] = r0 + 40. *Gaudi::Units::mm;
550 zplane[3] = 42. *Gaudi::Units::mm; rmin[3] = r0 + 8.*Gaudi::Units::mm; rmax[3] = r0 + 40. *Gaudi::Units::mm;
551 zplane[4] = 42. *Gaudi::Units::mm; rmin[4] = r0 + 8.*Gaudi::Units::mm; rmax[4] = r0 + 28.3*Gaudi::Units::mm;
552 zplane[5] = 46.5*Gaudi::Units::mm; rmin[5] = r0 + 8.*Gaudi::Units::mm; rmax[5] = r0 + 28.3*Gaudi::Units::mm;
553 } else if(id == "BackMiddleRing::UpperGTen"){
554 double r0 = 699.*Gaudi::Units::mm-2.5*Gaudi::Units::mm; // RMiddle radius of the ring
555 zplane.resize(6); rmin.resize(6); rmax.resize(6);
556 zplane[0] = 16.5*Gaudi::Units::mm; rmin[0] = r0 + 8.*Gaudi::Units::mm; rmax[0] = r0 + 28.*Gaudi::Units::mm;
557 zplane[1] = 21.5*Gaudi::Units::mm; rmin[1] = r0 + 8.*Gaudi::Units::mm; rmax[1] = r0 + 28.*Gaudi::Units::mm;
558 zplane[2] = 21.5*Gaudi::Units::mm; rmin[2] = r0 + 8.*Gaudi::Units::mm; rmax[2] = r0 + 40.*Gaudi::Units::mm;
559 zplane[3] = 41.5*Gaudi::Units::mm; rmin[3] = r0 + 8.*Gaudi::Units::mm; rmax[3] = r0 + 40.*Gaudi::Units::mm;
560 zplane[4] = 41.5*Gaudi::Units::mm; rmin[4] = r0 + 8.*Gaudi::Units::mm; rmax[4] = r0 + 28.*Gaudi::Units::mm;
561 zplane[5] = 46.5*Gaudi::Units::mm; rmin[5] = r0 + 8.*Gaudi::Units::mm; rmax[5] = r0 + 28.*Gaudi::Units::mm;
562 } else if(id == "BackInnerRing"){
563 double r0 =357.5*Gaudi::Units::mm-1.*Gaudi::Units::mm; // RInner = reference radius of the ring
564 zplane.resize(4); rmin.resize(4); rmax.resize(4);
565 zplane[0] = 0. *Gaudi::Units::mm; rmin[0] = r0 - 22.5*Gaudi::Units::mm; rmax[0] = r0 + 53.5*Gaudi::Units::mm;
566 zplane[1] = 22.5*Gaudi::Units::mm; rmin[1] = r0 - 22.5*Gaudi::Units::mm; rmax[1] = r0 + 53.5*Gaudi::Units::mm;
567 zplane[2] = 22.5*Gaudi::Units::mm; rmin[2] = r0 - 24.5*Gaudi::Units::mm; rmax[2] = r0 + 40.5*Gaudi::Units::mm;
568 zplane[3] = 54. *Gaudi::Units::mm; rmin[3] = r0 - 24.5*Gaudi::Units::mm; rmax[3] = r0 + 40.5*Gaudi::Units::mm;
569 } else if(id == "BackInnerRing::Hole"){
570 double r0 =357.5*Gaudi::Units::mm-1.*Gaudi::Units::mm; // RInner = reference radius of the ring
571 zplane.resize(6); rmin.resize(6); rmax.resize(6);
572 zplane[0] = 18. *Gaudi::Units::mm; rmin[0] = r0 + 6.5*Gaudi::Units::mm; rmax[0] = r0 + 29.5*Gaudi::Units::mm;
573 zplane[1] = 22.5*Gaudi::Units::mm; rmin[1] = r0 + 6.5*Gaudi::Units::mm; rmax[1] = r0 + 29.5*Gaudi::Units::mm;
574 zplane[2] = 22.5*Gaudi::Units::mm; rmin[2] = r0 + 6.5*Gaudi::Units::mm; rmax[2] = r0 + 40.5*Gaudi::Units::mm;
575 zplane[3] = 43.5*Gaudi::Units::mm; rmin[3] = r0 + 6.5*Gaudi::Units::mm; rmax[3] = r0 + 40.5*Gaudi::Units::mm;
576 zplane[4] = 43.5*Gaudi::Units::mm; rmin[4] = r0 + 6.5*Gaudi::Units::mm; rmax[4] = r0 + 29.5*Gaudi::Units::mm;
577 zplane[5] = 48. *Gaudi::Units::mm; rmin[5] = r0 + 6.5*Gaudi::Units::mm; rmax[5] = r0 + 29.5*Gaudi::Units::mm;
578 } else if(id == "BackInnerRing::GTen"){
579 double r0 =357.5*Gaudi::Units::mm-1.*Gaudi::Units::mm; // RInner = reference radius of the ring
580 zplane.resize(6); rmin.resize(6); rmax.resize(6);
581 zplane[0] = 18.*Gaudi::Units::mm; rmin[0] = r0 + 8.5*Gaudi::Units::mm; rmax[0] = r0 + 28.5*Gaudi::Units::mm;
582 zplane[1] = 23.*Gaudi::Units::mm; rmin[1] = r0 + 8.5*Gaudi::Units::mm; rmax[1] = r0 + 28.5*Gaudi::Units::mm;
583 zplane[2] = 23.*Gaudi::Units::mm; rmin[2] = r0 + 8.5*Gaudi::Units::mm; rmax[2] = r0 + 40.5*Gaudi::Units::mm;
584 zplane[3] = 43.*Gaudi::Units::mm; rmin[3] = r0 + 8.5*Gaudi::Units::mm; rmax[3] = r0 + 40.5*Gaudi::Units::mm;
585 zplane[4] = 43.*Gaudi::Units::mm; rmin[4] = r0 + 8.5*Gaudi::Units::mm; rmax[4] = r0 + 28.5*Gaudi::Units::mm;
586 zplane[5] = 48.*Gaudi::Units::mm; rmin[5] = r0 + 8.5*Gaudi::Units::mm; rmax[5] = r0 + 28.5*Gaudi::Units::mm;
587 } else if(id == "FrontOuterRing"){
588 double r0 = 1961.*Gaudi::Units::mm-7.*Gaudi::Units::mm; // ROuter = inner radius of the outer ring
589 zplane.resize(7); rmin.resize(7); rmax.resize(7);
590 zplane[0] = 0. *Gaudi::Units::mm; rmin[0] = r0 + 0.*Gaudi::Units::mm; rmax[0] = r0 + 111.*Gaudi::Units::mm;
591 zplane[1] = 5. *Gaudi::Units::mm; rmin[1] = r0 + 0.*Gaudi::Units::mm; rmax[1] = r0 + 116.*Gaudi::Units::mm;
592 zplane[2] = 20. *Gaudi::Units::mm; rmin[2] = r0 + 0.*Gaudi::Units::mm; rmax[2] = r0 + 116.*Gaudi::Units::mm;
593 zplane[3] = 20. *Gaudi::Units::mm; rmin[3] = r0 + 62.*Gaudi::Units::mm; rmax[3] = r0 + 116.*Gaudi::Units::mm;
594 zplane[4] = 63.3*Gaudi::Units::mm; rmin[4] = r0 + 62.*Gaudi::Units::mm; rmax[4] = r0 + 116.*Gaudi::Units::mm;
595 zplane[5] = 115.2*Gaudi::Units::mm; rmin[5] = r0 + 90.*Gaudi::Units::mm; rmax[5] = r0 + 116.*Gaudi::Units::mm;
596 zplane[6] = 144. *Gaudi::Units::mm; rmin[6] = r0 + 90.*Gaudi::Units::mm; rmax[6] = r0 + 116.*Gaudi::Units::mm;
597 } else if(id == "FrontOuterLongBar"){
598 zplane.resize(4); rmin.resize(4); rmax.resize(4);
599 zplane[0] = 0.*Gaudi::Units::mm; rmin[0] = 1969.7*Gaudi::Units::mm; rmax[0] = 2016.*Gaudi::Units::mm;
600 zplane[1] = 1.*Gaudi::Units::mm; rmin[1] = 1969.7*Gaudi::Units::mm; rmax[1] = 2016.*Gaudi::Units::mm;
601 zplane[2] = 1.*Gaudi::Units::mm; rmin[2] = 652. *Gaudi::Units::mm; rmax[2] = 2016.*Gaudi::Units::mm;
602 zplane[3] = 21.*Gaudi::Units::mm; rmin[3] = 652. *Gaudi::Units::mm; rmax[3] = 2016.*Gaudi::Units::mm;
603 //2020-46.3 ; RMiddle+40.//RMiddle+8+(lengthofbar=1398)
604 } else if(id == "BackOuterRing"){
605 double r0 = 1961.*Gaudi::Units::mm-7.*Gaudi::Units::mm;
606 zplane.resize(7); rmin.resize(7); rmax.resize(7);
607 zplane[0] = 0.*Gaudi::Units::mm; rmin[0] = r0 + 0.*Gaudi::Units::mm; rmax[0] = r0 + 111.*Gaudi::Units::mm;
608 zplane[1] = 5.*Gaudi::Units::mm; rmin[1] = r0 + 0.*Gaudi::Units::mm; rmax[1] = r0 + 116.*Gaudi::Units::mm;
609 zplane[2] = 15.*Gaudi::Units::mm; rmin[2] = r0 + 0.*Gaudi::Units::mm; rmax[2] = r0 + 116.*Gaudi::Units::mm;
610 zplane[3] = 15.*Gaudi::Units::mm; rmin[3] = r0 + 62.*Gaudi::Units::mm; rmax[3] = r0 + 116.*Gaudi::Units::mm;
611 zplane[4] = 41.*Gaudi::Units::mm; rmin[4] = r0 + 62.*Gaudi::Units::mm; rmax[4] = r0 + 116.*Gaudi::Units::mm;
612 zplane[5] = 41.*Gaudi::Units::mm; rmin[5] = r0 + 90.*Gaudi::Units::mm; rmax[5] = r0 + 116.*Gaudi::Units::mm;
613 zplane[6] = 139.*Gaudi::Units::mm; rmin[6] = r0 + 90.*Gaudi::Units::mm; rmax[6] = r0 + 116.*Gaudi::Units::mm;
614 } else if(id == "BackOuterLongBar"){
615 zplane.resize(4); rmin.resize(4); rmax.resize(4);
616 zplane[0] = 0.*Gaudi::Units::mm; rmin[0] = 1969.7*Gaudi::Units::mm; rmax[0] = 2016.*Gaudi::Units::mm;
617 zplane[1] = 1.*Gaudi::Units::mm; rmin[1] = 1969.7*Gaudi::Units::mm; rmax[1] = 2016.*Gaudi::Units::mm;
618 zplane[2] = 1.*Gaudi::Units::mm; rmin[2] = 736.5*Gaudi::Units::mm; rmax[2] = 2016.*Gaudi::Units::mm;
619 zplane[3] = 21.*Gaudi::Units::mm; rmin[3] = 736.5*Gaudi::Units::mm; rmax[3] = 2016.*Gaudi::Units::mm;
620 } else {
621 throw std::runtime_error("EMECSupportConstruction: wrong Pcone id");
622 }
623 ATH_MSG_WARNING("Cannot get " << id << " polycone fom DB");
624 } // zplane.empty()?
625
626 GeoPcon* shape = new GeoPcon(phi_start, phi_size);
627 for(size_t i = 0; i < zplane.size(); ++ i){
628 shape->addPlane(zplane[i], rmin[i], rmax[i]);
629 }
630
631 return shape;
632}
633
634GeoIntrusivePtr<GeoPhysVol> EMECSupportConstruction::front_envelope(void) const
635{
636 std::string id = "FrontSupportMother";
637 std::string name = m_BaseName + id;
638 GeoPcon *motherShape = getPcon(id);
639 GeoLogVol *motherLogical = new GeoLogVol(name, motherShape, m_LAr);
640 GeoIntrusivePtr<GeoPhysVol>motherPhysical= new GeoPhysVol(motherLogical);
641
642 put_front_outer_extracyl(motherPhysical); // put lead plate after PS
643 put_front_outer_ring(motherPhysical);
644 put_front_outer_longbar(motherPhysical);
645 put_front_indexing_rings(motherPhysical);
646 put_front_middle_ring(motherPhysical);
647 put_front_inner_ring(motherPhysical);
648 put_front_inner_longbar(motherPhysical);
649 put_front_outer_barettes(motherPhysical);
650 put_front_inner_barettes(motherPhysical);
651 put_front_outer_electronics(motherPhysical);
652
653 return motherPhysical;
654}
655
656GeoIntrusivePtr<GeoPhysVol> EMECSupportConstruction::back_envelope(void) const
657{
658 std::string id = "BackSupportMother";
659 std::string name = m_BaseName + id;
660 GeoPcon *motherShape = getPcon(id);
661 GeoLogVol *motherLogical = new GeoLogVol(name, motherShape, m_LAr);
662 GeoIntrusivePtr<GeoPhysVol>motherPhysical= new GeoPhysVol(motherLogical);
663
664 put_back_indexing_rings(motherPhysical);
665 put_back_outer_ring(motherPhysical);
666 put_back_middle_ring(motherPhysical);
667 put_back_inner_ring(motherPhysical);
668 put_back_inner_longbar(motherPhysical);
669 put_back_outer_longbar(motherPhysical);
670 put_back_inner_barettes(motherPhysical);
671 put_back_outer_barettes(motherPhysical);
672
673 return motherPhysical;
674}
675
676void EMECSupportConstruction::put_front_outer_barettes(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
677{
678
679 const double coldContraction=(*m_DB_ColdContraction)[0]->getDouble("ABSORBERCONTRACTION");
680 const double electrodeInvColdContraction=(*m_DB_ColdContraction)[0]->getDouble("ELECTRODEINVCONTRACTION");
681 const double leadThicknessOuter=(*m_DB_EmecFan)[0]->getDouble("LEADTHICKNESSOUTER")*Gaudi::Units::mm;
682 const double steelThickness=(*m_DB_EmecFan)[0]->getDouble("STEELTHICKNESS")*Gaudi::Units::mm;
683 const double glueThickness=(*m_DB_EmecFan)[0]->getDouble("GLUETHICKNESS")*Gaudi::Units::mm;
684 const double electrodeTotalThickness=(*m_DB_EmecFan)[0]->getDouble("ELECTRODETOTALTHICKNESS")*Gaudi::Units::mm;
685
686 const double outerAbsorberDy=(leadThicknessOuter/2+steelThickness+glueThickness)*coldContraction;
687 const double electrodeDy=electrodeTotalThickness/2/electrodeInvColdContraction;
688
689 std::string id = "FrontOuterBarrettes";
690 map_t tubes = getMap(m_DB_tubes, "TUBENAME");
691 map_t numbers = getNumbersMap(m_DB_numbers, id);
692
693 std::string name = m_BaseName + id;
694 double rminFOB = getNumber(m_DB_tubes, tubes, id, "RMIN", 614.-2.+40.);
695 double rmaxFOB = getNumber(m_DB_tubes, tubes, id, "RMAX", 1961.-7.+62.);
696 double dzFOB = getNumber(m_DB_tubes, tubes, id, "DZ", 11. / 2);
697 double zposFOB = getNumber(m_DB_numbers, numbers, "Z0", "PARVALUE", 50.) + dzFOB;
698 GeoTubs *shapeFOB = new GeoTubs(rminFOB, rmaxFOB, dzFOB, m_PhiStart, m_PhiSize);
699 GeoLogVol *logicalFOB = new GeoLogVol(name, shapeFOB, m_LAr);
700 GeoIntrusivePtr<GeoPhysVol>physFOB = new GeoPhysVol(logicalFOB);
701 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(zposFOB)));
702 motherPhysical->add(physFOB);
703
704 const int number_of_modules = 8;
705 const double moduldfi = Gaudi::Units::twopi / number_of_modules;
706 const int nofabs = (*m_DB_EmecWheelParameters)[1]->getInt("NABS");
707 const int nofdiv = nofabs / number_of_modules;
708 const double dfi = Gaudi::Units::twopi / nofabs;
709 //define a fi section including one absorber and electrode
710 name = m_BaseName + "FrontOuterBarrette::Module::Phidiv";
711 GeoTubs *shapeFOBMP = new GeoTubs(rminFOB, rmaxFOB, dzFOB, -dfi/4., dfi);
712 GeoLogVol *logicalFOBMP = new GeoLogVol(name, shapeFOBMP, m_LAr);
713 GeoIntrusivePtr<GeoPhysVol>physFOBMP = new GeoPhysVol(logicalFOBMP);
714
715 //longitudinal bar - absorber connection
716 name = m_BaseName + "FrontOuterBarrette::Abs";
717 double rmn = getNumber(m_DB_numbers, numbers, "R0", "PARVALUE", 613.38); // start of abs.
718 double dr = getNumber(m_DB_numbers, numbers, "DRabs", "PARVALUE", 41.4); // start of barrette rel to start of abs.
719 double dx = getNumber(m_DB_numbers, numbers, "Labs", "PARVALUE", 1290.) / 2.; // length of the connected part
720 assert(rmn + dr > rminFOB && rmn + dr + dx*2 < rmaxFOB);
721
722 const double r0A = rmn + dr + dx;
723 GeoBox *shapeFOBA = new GeoBox(dx, outerAbsorberDy, dzFOB);
724 GeoLogVol *logicalFOBA = new GeoLogVol(name, shapeFOBA, m_G10FeOuter);
725 GeoIntrusivePtr<GeoPhysVol>physFOBA = new GeoPhysVol(logicalFOBA);
726 physFOBMP->add(new GeoTransform(GeoTrf::TranslateX3D(r0A)));
727 physFOBMP->add(physFOBA);
728
729 name = m_BaseName + "FrontOuterBarrette::Ele"; // piece of electrode
730 dr = getNumber(m_DB_numbers, numbers, "DRele", "PARVALUE", 48.4);
731 dx = getNumber(m_DB_numbers, numbers, "Lele", "PARVALUE", 1283.8) / 2.;
732 assert(rmn + dr > rminFOB && rmn + dr + dx*2 < rmaxFOB);
733
734 const double r0E = rmn + dr + dx;
735 double x0 = r0E * cos(dfi/2.);
736 double y0 = r0E * sin(dfi/2.);
737 GeoBox *shapeFOBE = new GeoBox(dx, electrodeDy, dzFOB);
738 GeoLogVol *logicalFOBE = new GeoLogVol(name, shapeFOBE, m_Kapton_Cu);
739 GeoIntrusivePtr<GeoPhysVol>physFOBE = new GeoPhysVol(logicalFOBE);
740 physFOBMP->add(new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(x0,y0,0.)*GeoTrf::RotateZ3D(dfi/2.))));
741 physFOBMP->add(physFOBE);
742
743 if(m_isModule){
744 name = m_BaseName + "FrontOuterBarrette::Module::Phidiv";
745 for(int i = 0; i < nofdiv - 1; ++ i){
746 double fi = m_PhiStart + dfi/2. + i * dfi;
747 physFOB->add(new GeoIdentifierTag(i));
748 physFOB->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
749 physFOB->add(physFOBMP);
750 }
751 name = m_BaseName + "FrontOuterBarrette::Abs";
752 double fi = m_PhiStart + dfi/2.+ (nofdiv-1) * dfi;
753 x0 = r0A*cos(fi);
754 y0 = r0A*sin(fi);
755 physFOB->add(new GeoIdentifierTag(nofdiv-1));
756 physFOB->add(new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(x0,y0,0.)*GeoTrf::RotateZ3D(fi))));
757 physFOB->add(physFOBA);
758 } else {
759 // in case one wants to build the whole wheel:
760 // define a (virtual)module
761 name = m_BaseName + "FrontOuterBarrette::Module";
762 GeoTubs *shapeFOBM = new GeoTubs(rminFOB, rmaxFOB, dzFOB, -dfi/4., moduldfi);
763 GeoLogVol *logicalFOBM = new GeoLogVol(name, shapeFOBM, m_LAr);
764 GeoIntrusivePtr<GeoPhysVol>physFOBM = new GeoPhysVol(logicalFOBM);
765 //position the fi divisions into module
766 name = m_BaseName + "FrontOuterBarrette::Module::Phidiv";
767 for(int i = 0; i < nofdiv; ++ i){
768 double fi = i * dfi;
769 physFOBM->add(new GeoIdentifierTag(i));
770 physFOBM->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
771 physFOBM->add(physFOBMP);
772 }
773 //position modules into Barrette mother to create the full wheel
774 name = m_BaseName + "FrontOuterBarrette::Module";
775 for(int i = 0; i < number_of_modules; ++ i){
776 double fi = dfi/2.+ i * moduldfi;
777 physFOB->add(new GeoIdentifierTag(i));
778 physFOB->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
779 physFOB->add(physFOBM);
780 }
781 }
782}
783
784void EMECSupportConstruction::put_front_inner_barettes(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
785{
786
787 const double coldContraction=(*m_DB_ColdContraction)[0]->getDouble("ABSORBERCONTRACTION");
788 const double electrodeInvColdContraction=(*m_DB_ColdContraction)[0]->getDouble("ELECTRODEINVCONTRACTION");
789 const double leadThicknessInner=(*m_DB_EmecFan)[0]->getDouble("LEADTHICKNESSINNER")*Gaudi::Units::mm;
790 const double steelThickness=(*m_DB_EmecFan)[0]->getDouble("STEELTHICKNESS")*Gaudi::Units::mm;
791 const double glueThickness=(*m_DB_EmecFan)[0]->getDouble("GLUETHICKNESS")*Gaudi::Units::mm;
792 const double electrodeTotalThickness=(*m_DB_EmecFan)[0]->getDouble("ELECTRODETOTALTHICKNESS")*Gaudi::Units::mm;
793
794 const double innerAbsorberDy=(leadThicknessInner/2+steelThickness+glueThickness)*coldContraction;
795 const double electrodeDy=electrodeTotalThickness/2/electrodeInvColdContraction;
796
797 std::string id = "FrontInnerBarrettes";
798 map_t tubes = getMap(m_DB_tubes, "TUBENAME");
799 map_t numbers = getNumbersMap(m_DB_numbers, id);
800 std::string name = m_BaseName + id;
801
802 double rminFIB = getNumber(m_DB_tubes, tubes, id, "RMIN", 335.5-1.+40.5); //RInner + 40.5// -1mm for rcold
803 double rmaxFIB = getNumber(m_DB_tubes, tubes, id, "RMAX", 614.-2.-40.); //RMiddle-40.mm // -2mm for cold
804 double dzFIB = getNumber(m_DB_tubes, tubes, id, "DZ", 11. / 2);
805 double zposFIB = getNumber(m_DB_numbers, numbers, "Z0", "PARVALUE", 50.) + dzFIB;
806
807 GeoTubs *shapeFIB = new GeoTubs(rminFIB, rmaxFIB, dzFIB, m_PhiStart, m_PhiSize);
808 GeoLogVol *logicalFIB = new GeoLogVol(name, shapeFIB, m_LAr);
809 GeoIntrusivePtr<GeoPhysVol>physFIB = new GeoPhysVol(logicalFIB);
810 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(zposFIB)));
811 motherPhysical->add(physFIB);
812
813 const int number_of_modules = 8;
814 const double moduldfi = Gaudi::Units::twopi / number_of_modules;
815 const int nofabs = (*m_DB_EmecWheelParameters)[0]->getInt("NABS");
816 const int nofdiv = nofabs / number_of_modules;
817 const double dfi = Gaudi::Units::twopi / nofabs;
818
819 name = m_BaseName + "FrontInnerBarrette::Module::Phidiv";
820 GeoTubs *shapeFIBMP = new GeoTubs(rminFIB,rmaxFIB,dzFIB, -dfi/4., dfi);
821 GeoLogVol *logicalFIBMP = new GeoLogVol(name, shapeFIBMP, m_LAr);
822 GeoIntrusivePtr<GeoPhysVol>physFIBMP = new GeoPhysVol(logicalFIBMP);
823
824 name = m_BaseName + "FrontInnerBarrette::Abs";
825 double rmn = getNumber(m_DB_numbers, numbers, "R0", "PARVALUE", 302.31); // start of abs.
826 double dr = getNumber(m_DB_numbers, numbers, "DRabs", "PARVALUE", 75.6); // start of barrette rel to start of abs.
827 double dx = getNumber(m_DB_numbers, numbers, "Labs", "PARVALUE", 192.) / 2.; // length of the connected part
828 assert(rmn + dr > rminFIB && rmn + dr + dx*2 < rmaxFIB);
829
830 const double r0A = rmn + dr + dx;
831 GeoBox *shapeFIBA = new GeoBox(dx, innerAbsorberDy, dzFIB);
832 GeoLogVol *logicalFIBA = new GeoLogVol(name, shapeFIBA, m_G10FeInner);
833 GeoIntrusivePtr<GeoPhysVol>physFIBA = new GeoPhysVol(logicalFIBA);
834 physFIBMP->add(new GeoTransform(GeoTrf::TranslateX3D(r0A)));
835 physFIBMP->add(physFIBA);
836
837 name = m_BaseName + "FrontInnerBarrette::Ele"; // piece of electrode
838 dr = getNumber(m_DB_numbers, numbers, "DRele", "PARVALUE", 106.3);
839 dx = getNumber(m_DB_numbers, numbers, "Lele", "PARVALUE", 144.4) / 2.;
840 assert(rmn + dr > rminFIB && rmn + dr + dx*2 < rmaxFIB);
841
842 const double r0E = rmn + dr + dx;
843 double x0 = r0E * cos(dfi/2.);
844 double y0 = r0E * sin(dfi/2.);
845 GeoBox *shapeFIBE = new GeoBox(dx, electrodeDy, dzFIB);
846 GeoLogVol *logicalFIBE = new GeoLogVol(name, shapeFIBE, m_Kapton_Cu);
847 GeoIntrusivePtr<GeoPhysVol>physFIBE = new GeoPhysVol(logicalFIBE);
848 physFIBMP->add(new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(x0,y0,0.)*GeoTrf::RotateZ3D(dfi/2.))));
849 physFIBMP->add(physFIBE);
850
851 if(m_isModule){
852 name = m_BaseName + "FrontInnerBarrette::Phidiv";
853 for(int i = 0; i < nofdiv - 1; ++ i){
854 double fi = m_PhiStart + dfi/2. + i * dfi;
855 physFIB->add(new GeoIdentifierTag(i));
856 physFIB->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
857 physFIB->add(physFIBMP);
858 }
859 name = m_BaseName + "FrontInnerBarrette::Abs";
860 double fi = m_PhiStart + dfi/2.+ (nofdiv-1) * dfi;
861 x0 = r0A * cos(fi);
862 y0 = r0A * sin(fi);
863 physFIB->add(new GeoIdentifierTag(nofdiv-1));
864 physFIB->add(new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(x0,y0,0.)*GeoTrf::RotateZ3D(fi))));
865 physFIB->add(physFIBA);
866 } else {
867 // in case one wants to build the whole wheel:
868 // define a (virtual)module
869 name = m_BaseName + "FrontInnerBarrette::Module";
870 GeoTubs *shapeFIBM = new GeoTubs(rminFIB, rmaxFIB, dzFIB, -dfi/4., moduldfi);
871 GeoLogVol *logicalFIBM = new GeoLogVol(name, shapeFIBM, m_LAr);
872 GeoIntrusivePtr<GeoPhysVol>physFIBM = new GeoPhysVol(logicalFIBM);
873 name = m_BaseName + "FrontInnerBarrette::Module::Phidiv";
874 for(int i = 0; i < nofdiv; ++ i){
875 double fi = i * dfi;
876 physFIBM->add(new GeoIdentifierTag(i));
877 physFIBM->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
878 physFIBM->add(physFIBMP);
879 }
880 //position modules into Barrette mother to create the full wheel
881 name = m_BaseName + "FrontInnerBarrette::Module";
882 for(int i = 0; i < number_of_modules; ++ i){
883 double fi = dfi/2.+ i * moduldfi;
884 physFIB->add(new GeoIdentifierTag(i));
885 physFIB->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
886 physFIB->add(physFIBM);
887 }
888 }
889}
890
891// It seems we need to accout for z side for BOB only at the moment
892void EMECSupportConstruction::put_back_outer_barettes(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
893{
894
895 const double coldContraction=(*m_DB_ColdContraction)[0]->getDouble("ABSORBERCONTRACTION");
896 const double electrodeInvColdContraction=(*m_DB_ColdContraction)[0]->getDouble("ELECTRODEINVCONTRACTION");
897 const double leadThicknessOuter=(*m_DB_EmecFan)[0]->getDouble("LEADTHICKNESSOUTER")*Gaudi::Units::mm;
898 const double steelThickness=(*m_DB_EmecFan)[0]->getDouble("STEELTHICKNESS")*Gaudi::Units::mm;
899 const double glueThickness=(*m_DB_EmecFan)[0]->getDouble("GLUETHICKNESS")*Gaudi::Units::mm;
900 const double electrodeTotalThickness=(*m_DB_EmecFan)[0]->getDouble("ELECTRODETOTALTHICKNESS")*Gaudi::Units::mm;
901
902 const double outerAbsorberDy=(leadThicknessOuter/2+steelThickness+glueThickness)*coldContraction;
903 const double electrodeDy=electrodeTotalThickness/2/electrodeInvColdContraction;
904
905 const std::string id = "BackOuterBarrettes";
906
907 map_t tubes = getMap(m_DB_tubes, "TUBENAME");
908 map_t numbers = getNumbersMap(m_DB_numbers, id);
909
910 std::string baseName = m_BaseName;
911 if(!m_isModule) baseName += m_pos_zside? "Pos::" : "Neg::";
912 std::string name = baseName + id;
913
914 double rminBOB = getNumber(m_DB_tubes, tubes, id, "RMIN", 699.-2.5+40.); //RMiddle+40. // -2.5 for cold
915 double rmaxBOB = getNumber(m_DB_tubes, tubes, id, "RMAX", 1961.-7.+62.); //ROuter+62. // -7 for cold
916 double dzBOB = getNumber(m_DB_tubes, tubes, id, "DZ", 11. / 2);
917 double zposBOB = getNumber(m_DB_numbers, numbers, "Z0", "PARVALUE", 44.) + dzBOB;
918 GeoTubs *shapeBOB = new GeoTubs(rminBOB, rmaxBOB, dzBOB, m_PhiStart, m_PhiSize);
919 GeoLogVol *logicalBOB = new GeoLogVol(name, shapeBOB, m_LAr);
920 GeoIntrusivePtr<GeoPhysVol>physBOB = new GeoPhysVol(logicalBOB);
921 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(zposBOB)));
922 motherPhysical->add(physBOB);
923
924 const int number_of_modules = 8;
925 const double moduldfi = Gaudi::Units::twopi / number_of_modules;
926 int nofabs = (*m_DB_EmecWheelParameters)[1]->getInt("NABS");
927 int nofdiv = nofabs / number_of_modules;
928 double dfi = Gaudi::Units::twopi / nofabs;
929
930 name = baseName + "BackOuterBarrette::Module::Phidiv";
931 GeoTubs *shapeBOBMP = new GeoTubs(rminBOB, rmaxBOB, dzBOB, -dfi/4., dfi);
932 GeoLogVol *logicalBOBMP = new GeoLogVol(name, shapeBOBMP, m_LAr);
933 GeoIntrusivePtr<GeoPhysVol>physBOBMP = new GeoPhysVol(logicalBOBMP);
934
935 name = baseName + "BackOuterBarrette::Abs"; //longitudinal bar - absorber connection
936 double rmn = getNumber(m_DB_numbers, numbers, "R0", "PARVALUE", 698.4); // start of abs.
937 double dr = getNumber(m_DB_numbers, numbers, "DRabs", "PARVALUE", 42.1); // start of barrette rel to start of abs
938 double dx = getNumber(m_DB_numbers, numbers, "Labs", "PARVALUE", 1229.) / 2.; // length of the connected part
939 assert(rmn + dr > rminBOB && rmn + dr + dx * 2 < rmaxBOB);
940
941 const double r0A = rmn + dr + dx;
942 GeoBox *shapeBOBA = new GeoBox(dx, outerAbsorberDy, dzBOB);
943 GeoLogVol *logicalBOBA = new GeoLogVol(name, shapeBOBA, m_G10FeOuter);
944 GeoIntrusivePtr<GeoPhysVol>physBOBA = new GeoPhysVol(logicalBOBA);
945 physBOBMP->add(new GeoTransform(GeoTrf::TranslateX3D(r0A)));
946 physBOBMP->add(physBOBA);
947
948 name = baseName + "BackOuterBarrette::Ele"; // piece of electrode
949 dr = getNumber(m_DB_numbers, numbers, "DRele", "PARVALUE", 41.);
950 dx = getNumber(m_DB_numbers, numbers, "Lele", "PARVALUE", 1246.9) / 2.;
951 assert(rmn + dr > rminBOB && rmn + dr + dx*2 < rmaxBOB);
952
953 double r0E = rmn + dr + dx;
954 double y0 = r0E * sin(dfi/2.);
955 double x0 = r0E * cos(dfi/2.);
956 GeoBox *shapeBOBE = new GeoBox(dx, electrodeDy, dzBOB);
957 GeoLogVol *logicalBOBE = new GeoLogVol(name, shapeBOBE, m_Kapton_Cu);
958 GeoIntrusivePtr<GeoPhysVol>physBOBE = new GeoPhysVol(logicalBOBE);
959 physBOBMP->add(new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(x0,y0,0.)*GeoTrf::RotateZ3D(dfi/2.))));
960 physBOBMP->add(physBOBE);
961
962 if(m_isModule){
963 // Put phi divisions directly to Barrette Mother
964 name = baseName + "BackOuterBarrette::Module::Phidiv";
965 for(int i = 0; i < nofdiv - 1; ++ i){
966 double fi = m_PhiStart + dfi/2. + i * dfi;
967 physBOB->add(new GeoIdentifierTag(i));
968 physBOB->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
969 physBOB->add(physBOBMP);
970 }
971 name = baseName + "BackOuterBarrette::Abs";
972 double fi = m_PhiStart + dfi/2.+ (nofdiv - 1) * dfi;
973 x0 = r0A * cos(fi);
974 y0 = r0A * sin(fi);
975 physBOB->add(new GeoIdentifierTag(nofdiv - 1));
976 physBOB->add(new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(x0,y0,0.)*GeoTrf::RotateZ3D(fi))));
977 physBOB->add(physBOBA);
978 } else {
979 // in case one wants to build the whole wheel:
980 // define a (virtual)module
981 name = m_BaseName + "BackOuterBarrette::Module";
982 GeoTubs *shapeBOBM = new GeoTubs(rminBOB, rmaxBOB, dzBOB, -dfi/4.,moduldfi);
983 GeoLogVol *logicalBOBM = new GeoLogVol(name, shapeBOBM, m_LAr);
984 GeoIntrusivePtr<GeoPhysVol>physBOBM = new GeoPhysVol(logicalBOBM);
985 //position the fi divisions into module
986 name = baseName + "BackOuterBarrette::Module::Phidiv";
987 for(int i = 0; i < nofdiv; ++ i){
988 double fi = dfi * i;
989 physBOBM->add(new GeoIdentifierTag(i));
990 physBOBM->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
991 physBOBM->add(physBOBMP);
992 }
993 //position modules into Barrette mother to create the full wheel
994 name = baseName + "BackOuterBarrette::Module";
995 for(int i = 0; i < number_of_modules; ++ i){
996 double fi = dfi/2.+ i * moduldfi;
997 physBOB->add(new GeoIdentifierTag(i));
998 physBOB->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
999 physBOB->add(physBOBM);
1000 }
1001 }
1002}
1003
1004void EMECSupportConstruction::put_back_inner_barettes(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1005{
1006 const double coldContraction=(*m_DB_ColdContraction)[0]->getDouble("ABSORBERCONTRACTION");
1007 const double electrodeInvColdContraction=(*m_DB_ColdContraction)[0]->getDouble("ELECTRODEINVCONTRACTION");
1008 const double leadThicknessInner=(*m_DB_EmecFan)[0]->getDouble("LEADTHICKNESSINNER")*Gaudi::Units::mm;
1009 const double steelThickness=(*m_DB_EmecFan)[0]->getDouble("STEELTHICKNESS")*Gaudi::Units::mm;
1010 const double glueThickness=(*m_DB_EmecFan)[0]->getDouble("GLUETHICKNESS")*Gaudi::Units::mm;
1011 const double electrodeTotalThickness=(*m_DB_EmecFan)[0]->getDouble("ELECTRODETOTALTHICKNESS")*Gaudi::Units::mm;
1012
1013 const double innerAbsorberDy=(leadThicknessInner/2+steelThickness+glueThickness)*coldContraction;
1014 const double electrodeDy=electrodeTotalThickness/2/electrodeInvColdContraction;
1015
1016
1017
1018 std::string id = "BackInnerBarrettes";
1019
1020 map_t tubes = getMap(m_DB_tubes, "TUBENAME");
1021 map_t numbers = getNumbersMap(m_DB_numbers, id);
1022
1023 std::string name = m_BaseName + id;
1024 double rminBIB = getNumber(m_DB_tubes, tubes, id, "RMIN", 357.5-1.+40.5); //RInner +40.5// -1.Gaudi::Units::mm for cold
1025 double rmaxBIB = getNumber(m_DB_tubes, tubes, id, "RMAX", 699.-2.5-40.); //RMiddle-40 //-2.5mm for cold
1026 double dzBIB = getNumber(m_DB_tubes, tubes, id, "DZ", 11. / 2);
1027 double zposBIB = getNumber(m_DB_numbers, numbers, "Z0", "PARVALUE", 44.) + dzBIB;
1028 GeoTubs *shapeBIB = new GeoTubs(rminBIB, rmaxBIB, dzBIB, m_PhiStart, m_PhiSize);
1029 GeoLogVol *logicalBIB = new GeoLogVol(name, shapeBIB, m_LAr);
1030 GeoIntrusivePtr<GeoPhysVol>physBIB = new GeoPhysVol(logicalBIB);
1031 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(zposBIB)));
1032 motherPhysical->add(physBIB);
1033
1034 const int number_of_modules = 8;
1035 const double moduldfi = Gaudi::Units::twopi / number_of_modules;
1036 const int nofabs = (*m_DB_EmecWheelParameters)[0]->getInt("NABS");
1037 const int nofdiv = nofabs / number_of_modules;
1038 const double dfi = Gaudi::Units::twopi / nofabs;
1039
1040 name = m_BaseName + "BackInnerBarrette::Module::Phidiv";
1041 GeoTubs *shapeBIBMP = new GeoTubs(rminBIB, rmaxBIB, dzBIB, -dfi/4., dfi);
1042 GeoLogVol *logicalBIBMP = new GeoLogVol(name, shapeBIBMP, m_LAr);
1043 GeoIntrusivePtr<GeoPhysVol>physBIBMP = new GeoPhysVol(logicalBIBMP);
1044
1045 //longitudinal bar - absorber connection
1046 id = "BackInnerBarrette::Abs";
1047 name = m_BaseName + id;
1048 double rmn = getNumber(m_DB_numbers, numbers, "R0", "PARVALUE", 344.28); // start of abs.
1049 double dr = getNumber(m_DB_numbers, numbers, "DRabs", "PARVALUE", 56.1); // start of barrette rel to start of abs.
1050 double dx = getNumber(m_DB_numbers, numbers, "Labs", "PARVALUE", 255.) / 2.;
1051
1052 assert(rmn+dr>rminBIB && rmn+dr+dx*2.<rmaxBIB);
1053 const double r0A = rmn + dr + dx;
1054 GeoBox *shapeBIBA = new GeoBox(dx, innerAbsorberDy, dzBIB);
1055 GeoLogVol *logicalBIBA = new GeoLogVol(name, shapeBIBA, m_G10FeInner);
1056 GeoIntrusivePtr<GeoPhysVol>physBIBA = new GeoPhysVol(logicalBIBA);
1057 physBIBMP->add(new GeoTransform(GeoTrf::TranslateX3D(r0A)));
1058 physBIBMP->add(physBIBA);
1059
1060 id = "BackInnerBarrette::Ele"; // piece of electrode
1061 name = m_BaseName + id;
1062 dr = getNumber(m_DB_numbers, numbers, "DRele", "PARVALUE", 76.6);
1063 dx = getNumber(m_DB_numbers, numbers, "Lele", "PARVALUE", 208.9) / 2.;
1064 assert(rmn + dr > rminBIB && rmn + dr + dx * 2. < rmaxBIB);
1065
1066 const double r0E = rmn + dr + dx;
1067 double y0 = r0E * sin(dfi * 0.5);
1068 double x0 = r0E * cos(dfi * 0.5);
1069 GeoBox *shapeBIBE = new GeoBox(dx, electrodeDy, dzBIB);
1070 GeoLogVol *logicalBIBE = new GeoLogVol(name, shapeBIBE, m_Kapton_Cu);
1071 GeoIntrusivePtr<GeoPhysVol>physBIBE = new GeoPhysVol(logicalBIBE);
1072 physBIBMP->add(new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(x0, y0, 0.)*GeoTrf::RotateZ3D(dfi*0.5))));
1073 physBIBMP->add(physBIBE);
1074
1075 if(m_isModule){
1076/*
1077 Put phi divisions directly to Barrette Mother
1078 which goes from Phistart to m_PhiStart+m_PhiSize.
1079 This is the barrette volume of the Module itself in fact.
1080 Positioning will be done such a way, that in case of
1081 m_Position=0, there should be an electrode at phi=0.
1082 Only nofdiv-1 section can be positioned,
1083 otherwise a phi section will leak out of the phi boundary
1084 of the Module.
1085 The abs. and electr. pieces at the phi limits of the Module
1086 could be positioned individually(not done);
1087*/
1088 name = m_BaseName + "BackInnerBarrette::Module::Phidiv";
1089 for(int i = 0; i < nofdiv - 1; ++ i){
1090 double fi = m_PhiStart + dfi/2. + i * dfi;
1091 physBIB->add(new GeoIdentifierTag(i));
1092 physBIB->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
1093 physBIB->add(physBIBMP);
1094 }
1095 name = m_BaseName + "BackInnerBarrette::Abs";
1096 double fi = m_PhiStart + dfi/2.+ (nofdiv - 1) * dfi;
1097 x0 = r0A*cos(fi);
1098 y0 = r0A*sin(fi);
1099 physBIB->add(new GeoIdentifierTag(nofdiv - 1));
1100 physBIB->add(new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(x0, y0, 0.)*GeoTrf::RotateZ3D(fi))));
1101 physBIB->add(physBIBA);
1102 } else {
1103 // in case one wants to build the whole wheel:
1104 // define a (virtual)module
1105 name = m_BaseName + "BackInnerBarrette::Module";
1106 GeoTubs *shapeBIBM = new GeoTubs(rminBIB, rmaxBIB, dzBIB, -dfi/4., moduldfi);
1107 GeoLogVol *logicalBIBM = new GeoLogVol(name, shapeBIBM, m_LAr);
1108 GeoIntrusivePtr<GeoPhysVol>physBIBM = new GeoPhysVol(logicalBIBM);
1109 //position the fi divisions into module
1110 name = m_BaseName + "BackInnerBarrette::Module::Phidiv";
1111 for(int i = 0; i < nofdiv; ++ i){
1112 double fi = dfi * i;
1113 physBIBM->add(new GeoIdentifierTag(i));
1114 physBIBM->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
1115 physBIBM->add(physBIBMP);
1116 }
1117 //position modules into Barrette mother to create the full wheel
1118 name = m_BaseName + "BackInnerBarrette::Module";
1119 for(int i = 0; i < number_of_modules; ++ i){
1120 double fi = dfi*0.5 + i * moduldfi;
1121 physBIB->add(new GeoIdentifierTag(i));
1122 physBIB->add(new GeoTransform(GeoTrf::RotateZ3D(fi)));
1123 physBIB->add(physBIBM);
1124 }
1125 }
1126}
1127
1128GeoIntrusivePtr<GeoPhysVol> EMECSupportConstruction::outer_envelope(void) const
1129{
1130 map_t tubes = getMap(m_DB_tubes, "TUBENAME");
1131 std::string id = "OuterTransversalBars";
1132 std::string name = m_BaseName + id;
1133 double rminOTB = getNumber(m_DB_tubes, tubes, id, "RMIN", (2034. + 2.)*Gaudi::Units::mm);
1134 double rmaxOTB = getNumber(m_DB_tubes, tubes, id, "RMAX", rminOTB + 3.*Gaudi::Units::mm);
1135 double dzOTB = getNumber(m_DB_tubes, tubes, id, "DZ", 201.*Gaudi::Units::mm);
1136 GeoTubs* shapeOTB = new GeoTubs(rminOTB, rmaxOTB, dzOTB, m_PhiStart, m_PhiSize);
1137 GeoLogVol* logicalOTB = new GeoLogVol(name, shapeOTB, m_Gten);
1138 GeoIntrusivePtr<GeoPhysVol> physOTB = new GeoPhysVol(logicalOTB);
1139
1140 id = "TopIndexingRing";
1141 name = m_BaseName + id;
1142 double rminTIR = getNumber(m_DB_tubes, tubes, id, "RMIN", rmaxOTB);
1143 double rmaxTIR = getNumber(m_DB_tubes, tubes, id, "RMAX", rminTIR + 9.*Gaudi::Units::mm);
1144 double dzTIR = getNumber(m_DB_tubes, tubes, id, "DZ", 10.*Gaudi::Units::mm);
1145 GeoTubs* shapeTIR = new GeoTubs(rminTIR, rmaxTIR, dzTIR, m_PhiStart, m_PhiSize);
1146 GeoLogVol* logicalTIR = new GeoLogVol(name, shapeTIR, m_Alu);
1147 GeoIntrusivePtr<GeoPhysVol> physTIR = new GeoPhysVol(logicalTIR);
1148 id += "::Hole";
1149 name = m_BaseName + id;
1150 double dzTIRH = getNumber(m_DB_tubes, tubes, id, "DZ", 4.5*Gaudi::Units::mm);
1151 double rmaxTIRH = getNumber(m_DB_tubes, tubes, id, "RMAX", rmaxTIR);
1152 double rminTIRH = getNumber(m_DB_tubes, tubes, id, "RMIN", rmaxTIRH - 2.*Gaudi::Units::mm);
1153 GeoTubs* shapeTIRH = new GeoTubs(rminTIRH, rmaxTIRH, dzTIRH, m_PhiStart, m_PhiSize);
1154 GeoLogVol* logicalTIRH = new GeoLogVol(name, shapeTIRH, m_LAr);
1155 GeoIntrusivePtr<GeoPhysVol> physTIRH = new GeoPhysVol(logicalTIRH);
1156 physTIR->add(physTIRH);
1157
1158 id = "WideStretchers";
1159 name = m_BaseName + id;
1160 GeoPcon* shapeWS = getPcon(id);
1161 GeoLogVol* logicalWS = new GeoLogVol(name, shapeWS, m_Alu);
1162 GeoIntrusivePtr<GeoPhysVol> physWS = new GeoPhysVol(logicalWS);
1163
1164 id = "NarrowStretchers";
1165 name = m_BaseName + id;
1166 GeoPcon* shapeNS = getPcon(id);
1167 GeoLogVol* logicalNS = new GeoLogVol(name, shapeNS, m_Alu);
1168 GeoIntrusivePtr<GeoPhysVol> physNS = new GeoPhysVol(logicalNS);
1169
1170 id = "OuterSupportMother";
1171 name = m_BaseName + id;
1172 GeoPcon *motherShape = getPcon(id);
1173 GeoLogVol *motherLogical = new GeoLogVol(name, motherShape, m_LAr);
1174 GeoIntrusivePtr<GeoPhysVol>motherPhysical= new GeoPhysVol(motherLogical);
1175
1176 motherPhysical->add(physTIR);
1177 motherPhysical->add(physOTB);
1178
1179 const int number_of_stretchers = 8; // for full wheel
1180 if(m_isModule){
1181 motherPhysical->add(new GeoIdentifierTag(0));
1182 motherPhysical->add(physNS);
1183 // place two narrow stretchers on edges instead of one wide
1184 double dfi = M_PI / number_of_stretchers;
1185 double dfiNS = shapeNS->getDPhi();
1186 motherPhysical->add(new GeoIdentifierTag(1));
1187 motherPhysical->add(new GeoTransform(GeoTrf::RotateZ3D(dfi - dfiNS*0.5)));
1188 motherPhysical->add(physNS);
1189 motherPhysical->add(new GeoIdentifierTag(2));
1190 motherPhysical->add(new GeoTransform(GeoTrf::RotateZ3D(-dfi + dfiNS*0.5)));
1191 motherPhysical->add(physNS);
1192 } else {
1193 double dfi = Gaudi::Units::twopi / number_of_stretchers;
1194 int copyno = 0;
1195 for(int i = 0; i < number_of_stretchers; ++ i, ++ copyno){
1196 double fiW = i * dfi;
1197 motherPhysical->add(new GeoIdentifierTag(copyno));
1198 motherPhysical->add(new GeoTransform(GeoTrf::RotateZ3D(fiW)));
1199 motherPhysical->add(physWS);
1200 double fiN = (i + 0.5) * dfi;
1201 motherPhysical->add(new GeoIdentifierTag(copyno));
1202 motherPhysical->add(new GeoTransform(GeoTrf::RotateZ3D(fiN)));
1203 motherPhysical->add(physNS);
1204 }
1205 }
1206
1207 return motherPhysical;
1208}
1209
1210GeoIntrusivePtr<GeoPhysVol> EMECSupportConstruction::inner_envelope(void) const
1211{
1212 std::string id = "InnerAluCone";
1213 map_t numbers = getNumbersMap(m_DB_numbers, id);
1214 std::string name0 = m_BaseName + id;
1215
1216// double dz = LArWheelCalculator::GetWheelThickness() * 0.5; //257.*Gaudi::Units::mm; //zWheelThickness/2.
1217 double dz = 0.5 * (*m_DB_mn)[0]->getDouble("ACTIVELENGTH")*Gaudi::Units::mm;
1218 try {
1219 dz += (*m_DB_mn)[0]->getDouble("STRAIGHTSTARTSECTION")*Gaudi::Units::mm;
1220 }
1221 catch(...){
1222 dz += 2.*Gaudi::Units::mm;
1223 ATH_MSG_WARNING("cannot get STRAIGHTSTARTSECTION from DB");
1224 }
1225
1226 double r1min = getNumber(m_DB_numbers, numbers, "R1MIN", "PARVALUE", (292.-1.)*Gaudi::Units::mm); //lower radius of front inner ring, -1mm for cold
1227 double r2min = getNumber(m_DB_numbers, numbers, "R2MIN", "PARVALUE", (333.-1.)*Gaudi::Units::mm); //lower radius of back inner ring, -1mm for cold
1228 //RInnerFront-43.5;RInnerBack-24.5
1229 const double talpha = (r2min - r1min)*0.5/dz;
1230 const double calpha = 2.*dz/sqrt(pow(2.*dz,2.)+pow(r2min-r1min,2.));
1231 const double inv_calpha = 1. / calpha;
1232 const double alpha = atan(talpha);
1233 double surfthick = getNumber(m_DB_numbers, numbers, "surfthick", "PARVALUE", 1.*Gaudi::Units::mm); // thickness of the cone shell
1234 double barthick = getNumber(m_DB_numbers, numbers, "barthick", "PARVALUE", 5.*Gaudi::Units::mm); // thickness of the Alu bars
1235 double r1max = pow(barthick/2.,2.)+ pow(r1min+(surfthick+barthick)*inv_calpha,2.);
1236 r1max = sqrt(r1max)+surfthick*inv_calpha;
1237 double r2max = r2min+(r1max-r1min);
1238
1239 GeoCons* shapeIAC = new GeoCons ( r1min ,r2min,
1240 r1max, r2max,
1241 dz, m_PhiStart, m_PhiSize);
1242
1243 GeoLogVol* logicalIAC = new GeoLogVol (name0, shapeIAC, m_LAr);
1244 GeoIntrusivePtr<GeoPhysVol> physIAC = new GeoPhysVol(logicalIAC);
1245
1246 if(m_isModule) return physIAC; // keep simplified shape
1247
1248 // otherwise get the details: (9 Alu bars/module, between 2 shells)
1249
1250 std::string name = name0 + "::InnerShell";
1251 GeoCons* shapeIACIS = new GeoCons(
1252 r1min , r2min,
1253 r1min+surfthick*inv_calpha, r2min+surfthick*inv_calpha,
1254 dz, m_PhiStart, m_PhiSize);
1255 GeoLogVol* logicalIACIS = new GeoLogVol (name,shapeIACIS,m_Alu);
1256 GeoIntrusivePtr<GeoPhysVol> physIACIS = new GeoPhysVol(logicalIACIS);
1257 physIAC->add(physIACIS);
1258
1259 name = name0 + "::OuterShell";
1260//-----------------------------/
1261
1262 GeoCons* shapeIACOS = new GeoCons (
1263 r1max-surfthick*inv_calpha, r2max-surfthick*inv_calpha,
1264 r1max, r2max,
1265 dz, m_PhiStart, m_PhiSize);
1266 GeoLogVol* logicalIACOS = new GeoLogVol (name,shapeIACOS,m_Alu);
1267 GeoIntrusivePtr<GeoPhysVol> physIACOS = new GeoPhysVol(logicalIACOS);
1268 physIAC->add(physIACOS);
1269
1270 name = name0 + "::Phidiv";
1271//-------------------------/
1272
1273 const int nofmodul = 8;
1274 const double moduldphi = Gaudi::Units::twopi / nofmodul;
1275 GeoCons* shapeIACP = new GeoCons(
1276 r1min+surfthick*inv_calpha,r2min+surfthick*inv_calpha,
1277 r1max-surfthick*inv_calpha,r2max-surfthick*inv_calpha,
1278 dz, -moduldphi/2.,moduldphi);
1279 GeoLogVol* logicalIACP = new GeoLogVol (name,shapeIACP,m_LAr);
1280 GeoIntrusivePtr<GeoPhysVol> physIACP = new GeoPhysVol(logicalIACP);
1281
1282 name = name0 + "::AluBar";
1283//-------------------------/
1284
1285 GeoPara* shapeIACAB = new GeoPara(
1286 barthick/2.*inv_calpha,barthick/2.,dz,
1287 0.,alpha,0.);
1288 GeoLogVol* logicalIACAB= new GeoLogVol (name,shapeIACAB, m_Alu);
1289 GeoIntrusivePtr<GeoPhysVol> physIACAB= new GeoPhysVol(logicalIACAB);
1290
1291 const double dphi = Gaudi::Units::twopi / 256.;
1292 const int nbar = 9;
1293 const double phi[9]={-15.,-11.,-7.5,-4.,0.,4.,7.5,11.,15.}; // phipos of the bars
1294 const double r0=r1min+(surfthick+barthick/2.)*inv_calpha+dz*talpha;
1295
1296 for(int i = 0; i < nbar; ++ i){ // put the Alu bars into the module
1297 double fi=phi[i]*dphi;
1298 double cfi=cos(fi);
1299 double sfi=sin(fi);
1300 physIACP->add(new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(r0*cfi,r0*sfi,0.)*GeoTrf::RotateZ3D(fi))));
1301 physIACP->add(physIACAB);
1302 }
1303
1304 name = name0 + "::Phidiv";
1305 for(int i=0;i<nofmodul;i++){ // put modules into wheel
1306 double fi=(i+0.5)*moduldphi;
1307 physIAC->add( new GeoIdentifierTag(i));
1308 physIAC->add( new GeoTransform(GeoTrf::RotateZ3D(fi)));
1309 physIAC->add(physIACP);
1310 }
1311
1312 return physIAC;
1313}
1314
1316GeoIntrusivePtr<GeoPhysVol> EMECSupportConstruction::middle_envelope(void) const
1317{
1318 double dMechFocaltoWRP = (*m_DB_EmecGeometry)[0]->getDouble("Z1") *Gaudi::Units::cm;
1319 double LArEMECHalfCrack = (*m_DB_EmecGeometry)[0]->getDouble("DCRACK") *Gaudi::Units::cm;
1320 double LArTotalThickness = (*m_DB_EmecGeometry)[0]->getDouble("ETOT") *Gaudi::Units::cm;
1321
1322 double eta_mid = (*m_DB_EmecWheelParameters)[0]->getDouble("ETAEXT");
1323
1324 double tanThetaMid = 2. * exp(-eta_mid) / (1. - exp(-2.*eta_mid));
1325 const double cosThetaMid = (1. - exp(2.*-eta_mid)) / (1. + exp(-2.*eta_mid));
1326 const double inv_cosThetaMid = 1. / cosThetaMid;
1327
1328 double z0 = LArTotalThickness * 0.5 + dMechFocaltoWRP;
1329 double length = 462.*Gaudi::Units::mm;
1330 double rthickness = 1.5*Gaudi::Units::mm * inv_cosThetaMid;
1331
1332 std::string name = m_BaseName + "InnerTransversalBars";
1333 double dz = length * cosThetaMid * 0.5;
1334 double rmin0 = (z0 - dz) * tanThetaMid - LArEMECHalfCrack + inv_cosThetaMid;
1335 double rmin1 = (z0 + dz) * tanThetaMid - LArEMECHalfCrack + inv_cosThetaMid;
1336
1337 GeoCons* shapeITB = new GeoCons(rmin0, rmin1, rmin0 + rthickness, rmin1 + rthickness,
1338 dz, m_PhiStart, m_PhiSize);
1339
1340 GeoLogVol* logicalITB = new GeoLogVol (name,shapeITB,m_Gten);
1341 GeoIntrusivePtr<GeoPhysVol> physITB = new GeoPhysVol(logicalITB);
1342
1343 return physITB;
1344}
1345
1346void EMECSupportConstruction::put_front_middle_ring(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1347{
1348
1349 std::string id = "FrontMiddleRing";
1350 std::string name = m_BaseName + id;
1351
1352 double z0 = getNumber(m_DB_numbers, id, "Z0", 2.);
1353 GeoPcon *shapeFMR = getPcon(id);
1354 GeoLogVol *logicalFMR = new GeoLogVol(name, shapeFMR, m_PermaliE730);
1355 GeoIntrusivePtr<GeoPhysVol>physFMR = new GeoPhysVol(logicalFMR);
1356 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1357 motherPhysical->add(physFMR);
1358
1359 id = "FrontMiddleRing::LowerHole";
1360 name = m_BaseName + id;
1361 GeoPcon *shapeFMRLH = getPcon(id);
1362 GeoLogVol *logicalFMRLH = new GeoLogVol(name, shapeFMRLH, m_LAr);
1363 GeoIntrusivePtr<GeoPhysVol>physFMRLH = new GeoPhysVol(logicalFMRLH);
1364 physFMR->add(physFMRLH);
1365
1366 // endpiece of the inner longitudinal bar embedded into middle ring
1367 id = "FrontMiddleRing::LowerGTen";
1368 name = m_BaseName + id;
1369 GeoPcon *shapeFMRLG = getPcon(id);
1370 GeoLogVol *logicalFMRLG = new GeoLogVol(name, shapeFMRLG, m_Gten);
1371 GeoIntrusivePtr<GeoPhysVol>physFMRLG = new GeoPhysVol(logicalFMRLG);
1372 physFMRLH->add(physFMRLG);
1373
1374 id = "FrontMiddleRing::UpperHole";
1375 name = m_BaseName + id;
1376 GeoPcon *shapeFMRUH = getPcon(id);
1377 GeoLogVol *logicalFMRUH = new GeoLogVol(name, shapeFMRUH, m_LAr);
1378 GeoIntrusivePtr<GeoPhysVol>physFMRUH = new GeoPhysVol(logicalFMRUH);
1379 physFMR->add(physFMRUH);
1380
1381 // endpiece of the outer longitudinal bar embedded into middle ring
1382 id = "FrontMiddleRing::UpperGTen";
1383 name = m_BaseName + id;
1384 GeoPcon *shapeFMRUG = getPcon(id);
1385 GeoLogVol *logicalFMRUG = new GeoLogVol(name, shapeFMRUG, m_Gten);
1386 GeoIntrusivePtr<GeoPhysVol>physFMRUG = new GeoPhysVol(logicalFMRUG);
1387 physFMRUH->add(physFMRUG);
1388}
1389
1390void EMECSupportConstruction::put_front_inner_ring(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1391{
1392 std::string id = "FrontInnerRing";
1393 double z0 = getNumber(m_DB_numbers, id, "Z0", 2.); // z pos. of front face of the ring rel. to front of envelope
1394 std::string name = m_BaseName + id;
1395 GeoPcon *shapeFIR = getPcon(id);
1396 GeoLogVol *logicalFIR = new GeoLogVol(name, shapeFIR, m_Alu);
1397 GeoIntrusivePtr<GeoPhysVol>physFIR = new GeoPhysVol(logicalFIR);
1398 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1399 motherPhysical->add(physFIR);
1400
1401 id = "FrontInnerRing::Hole";
1402 name = m_BaseName + id;
1403 GeoPcon *shapeFIRH = getPcon(id);
1404 GeoLogVol *logicalFIRH = new GeoLogVol(name, shapeFIRH, m_LAr);
1405 GeoIntrusivePtr<GeoPhysVol>physFIRH = new GeoPhysVol(logicalFIRH);
1406 physFIR->add(physFIRH);
1407
1408 //endpiece of the inner longitudinal embedded into inner ring
1409 id = "FrontInnerRing::GTen";
1410 name = m_BaseName + id;
1411 GeoPcon *shapeFIRG = getPcon(id);
1412 GeoLogVol *logicalFIRG = new GeoLogVol(name, shapeFIRG, m_Gten);
1413 GeoIntrusivePtr<GeoPhysVol>physFIRG = new GeoPhysVol(logicalFIRG);
1414 physFIRH->add(physFIRG);
1415}
1416
1417void EMECSupportConstruction::put_front_inner_longbar(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1418{
1419 map_t tubes = getMap(m_DB_tubes, "TUBENAME");
1420 std::string id = "FrontInnerLongBar";
1421 std::string name = m_BaseName + id;
1422 // double rmin=376.; //RInner +40.5
1423 double rmin = getNumber(m_DB_tubes, tubes, id, "RMIN", 375.); // Suggested by Jozsef (vakho)
1424 // double rmax=574.; //RMiddle-40.
1425 double rmax = getNumber(m_DB_tubes, tubes, id, "RMAX", 572.); // To avoid clash with FrontMiddleRing (vakho)
1426 double dz = getNumber(m_DB_tubes, tubes, id, "DZ", 20./2);
1427 double z0 = getNumber(m_DB_numbers, id, "Z0", 30.) + dz;
1428 GeoTubs *shapeFILB = new GeoTubs(rmin, rmax, dz, m_PhiStart, m_PhiSize);
1429 GeoLogVol *logicalFILB = new GeoLogVol(name,shapeFILB,m_Gten);
1430 GeoIntrusivePtr<GeoPhysVol>physFILB = new GeoPhysVol(logicalFILB);
1431 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1432 motherPhysical->add(physFILB);
1433}
1434
1435void EMECSupportConstruction::put_back_middle_ring(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1436{
1437 std::string id = "BackMiddleRing";
1438 double z0 = getNumber(m_DB_numbers, id, "Z0", 2.5);
1439 std::string name = m_BaseName + id;
1440 GeoPcon *shapeBMR = getPcon(id);
1441 GeoLogVol *logicalBMR = new GeoLogVol(name, shapeBMR, m_Alu);
1442 GeoIntrusivePtr<GeoPhysVol>physBMR = new GeoPhysVol(logicalBMR);
1443 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1444 motherPhysical->add(physBMR);
1445
1446 id = "BackMiddleRing::LowerHole";
1447 name = m_BaseName + id;
1448 GeoPcon *shapeBMRLH = getPcon(id);
1449 GeoLogVol *logicalBMRLH = new GeoLogVol(name, shapeBMRLH, m_LAr);
1450 GeoIntrusivePtr<GeoPhysVol>physBMRLH = new GeoPhysVol(logicalBMRLH);
1451 physBMR->add( physBMRLH);
1452
1453 //endpiece of the inner longitudinal
1454 id = "BackMiddleRing::LowerGTen";
1455 name = m_BaseName + id;
1456 GeoPcon *shapeBMRLG = getPcon(id);
1457 GeoLogVol *logicalBMRLG = new GeoLogVol(name, shapeBMRLG, m_Gten);
1458 GeoIntrusivePtr<GeoPhysVol>physBMRLG = new GeoPhysVol(logicalBMRLG);
1459 physBMRLH->add(physBMRLG);
1460
1461 id = "BackMiddleRing::UpperHole";
1462 name = m_BaseName + id;
1463 GeoPcon *shapeBMRUH = getPcon(id);
1464 GeoLogVol *logicalBMRUH = new GeoLogVol(name, shapeBMRUH, m_LAr);
1465 GeoIntrusivePtr<GeoPhysVol>physBMRUH = new GeoPhysVol(logicalBMRUH);
1466 physBMR->add( physBMRUH);
1467
1468 //endpiece of the outer longitudinal bar embedded into middle ring
1469 id = "BackMiddleRing::UpperGTen";
1470 name = m_BaseName + id;
1471 GeoPcon *shapeBMRUG = getPcon(id);
1472 GeoLogVol *logicalBMRUG = new GeoLogVol(name, shapeBMRUG, m_Gten);
1473 GeoIntrusivePtr<GeoPhysVol>physBMRUG = new GeoPhysVol(logicalBMRUG);
1474 physBMRUH->add(physBMRUG);
1475}
1476
1477void EMECSupportConstruction::put_back_inner_ring(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1478{
1479 std::string id = "BackInnerRing";
1480 double z0 = getNumber(m_DB_numbers, id, "Z0", 1.); // z pos. of back face of the ring rel. to back of envelope
1481 std::string name = m_BaseName + id;
1482 GeoPcon *shapeBIR = getPcon(id);
1483 GeoLogVol *logicalBIR = new GeoLogVol(name, shapeBIR, m_Alu);
1484 GeoIntrusivePtr<GeoPhysVol>physBIR = new GeoPhysVol(logicalBIR);
1485 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1486 motherPhysical->add(physBIR);
1487
1488 id = "BackInnerRing::Hole";
1489 name = m_BaseName + id;
1490 GeoPcon *shapeBIRH = getPcon(id);
1491 GeoLogVol *logicalBIRH = new GeoLogVol(name, shapeBIRH, m_LAr);
1492 GeoIntrusivePtr<GeoPhysVol>physBIRH = new GeoPhysVol(logicalBIRH);
1493 physBIR->add(physBIRH);
1494
1495 //endpiece of the inner longitudinal bar
1496 id = "BackInnerRing::GTen";
1497 name = m_BaseName + id;
1498 GeoPcon *shapeBIRG = getPcon(id);
1499 GeoLogVol *logicalBIRG = new GeoLogVol(name, shapeBIRG, m_Gten);
1500 GeoIntrusivePtr<GeoPhysVol>physBIRG = new GeoPhysVol(logicalBIRG);
1501 physBIRH->add(physBIRG);
1502}
1503
1504void EMECSupportConstruction::put_back_inner_longbar(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1505{
1506 std::string id = "BackInnerLongBar";
1507 std::string name = m_BaseName + id;
1508 map_t tubes = getMap(m_DB_tubes, "TUBENAME");
1509
1510 double rmin = getNumber(m_DB_tubes, tubes, id, "RMIN", 357.5-1.+40.5);//RInner +40.5
1511 double rmax = getNumber(m_DB_tubes, tubes, id, "RMAX", 699.-2.5-40.);//RMiddle-40.
1512 double dz = getNumber(m_DB_tubes, tubes, id, "DZ", 20./2.);
1513 double z0 = getNumber(m_DB_numbers, id, "Z0", 24.) + dz;
1514 GeoTubs *shapeBILB = new GeoTubs(rmin, rmax, dz, m_PhiStart, m_PhiSize);
1515 GeoLogVol *logicalBILB = new GeoLogVol(name, shapeBILB, m_Gten);
1516 GeoIntrusivePtr<GeoPhysVol>physBILB = new GeoPhysVol(logicalBILB);
1517 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1518 motherPhysical->add(physBILB);
1519}
1520
1521void EMECSupportConstruction::put_front_outer_ring(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1522{
1523 std::string id = "FrontOuterRing";
1524 double z0 = getNumber(m_DB_numbers, id, "Z0", 9.); //position of the front face of the ring rel. to front of envelope
1525 std::string name = m_BaseName + id;
1526 GeoPcon *shapeFOR = getPcon(id);
1527 GeoLogVol *logicalFOR = new GeoLogVol(name, shapeFOR, m_Alu);
1528 GeoIntrusivePtr<GeoPhysVol>physFOR = new GeoPhysVol(logicalFOR);
1529 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1530 motherPhysical->add(physFOR);
1531}
1532
1533void EMECSupportConstruction::put_front_outer_longbar(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1534{
1535 std::string id = "FrontOuterLongBar";
1536 double z0 = getNumber(m_DB_numbers, id, "Z0", 29.);//rel to front of envelope
1537 std::string name = m_BaseName + id;
1538 GeoPcon *shapeFOLB = getPcon(id);
1539 GeoLogVol *logicalFOLB = new GeoLogVol(name, shapeFOLB, m_Gten);
1540 GeoIntrusivePtr<GeoPhysVol>physFOLB = new GeoPhysVol(logicalFOLB);
1541 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1542 motherPhysical->add(physFOLB);
1543}
1544
1545void EMECSupportConstruction::put_front_indexing_rings(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1546{
1547 map_t tubes = getMap(m_DB_tubes, "TUBENAME");
1548 map_t numbers = getNumbersMap(m_DB_numbers, "FrontIndexingRings");
1549
1550 double r0 = getNumber(m_DB_numbers, numbers, "Router", "PARVALUE", 1565.-5.);
1551 double r1 = getNumber(m_DB_numbers, numbers, "Rinner", "PARVALUE", 1025.-4.);
1552 std::string id = "FrontIndexingRing";
1553 double ring_rmin = getNumber(m_DB_tubes, tubes, id, "RMIN", -15.);
1554 double ring_rmax = getNumber(m_DB_tubes, tubes, id, "RMAX", 15.);
1555 double ring_dz = getNumber(m_DB_tubes, tubes, id, "DZ", 21./2.);
1556 double z_hole = -ring_dz;
1557 double z0 = getNumber(m_DB_numbers, numbers, "Z0", "PARVALUE", 9.) + ring_dz;
1558 double gten_dz = getNumber(m_DB_numbers, numbers, "GTenDZ", "PARVALUE", (16. - 11.) / 2);
1559 id += "::Hole";
1560 double hole_rmin = getNumber(m_DB_tubes, tubes, id, "RMIN", -6.5);
1561 double hole_rmax = getNumber(m_DB_tubes, tubes, id, "RMAX", 6.5);
1562 double hole_dz = getNumber(m_DB_tubes, tubes, id, "DZ", 5.55/2.);
1563
1564 std::string name = m_BaseName + "FrontHighRIndexingRing";
1565 GeoTubs *shapeFHIR = new GeoTubs(r0 + ring_rmin, r0 + ring_rmax, ring_dz, m_PhiStart, m_PhiSize);
1566 GeoLogVol *logicalFHIR = new GeoLogVol(name, shapeFHIR, m_Alu);
1567 GeoIntrusivePtr<GeoPhysVol>physFHIR = new GeoPhysVol(logicalFHIR);
1568 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1569 motherPhysical->add(physFHIR);
1570
1571 name = m_BaseName + "FrontHighRIndexingRing::Hole";
1572 GeoTubs *shapeFHIRH = new GeoTubs(r0 + hole_rmin, r0 + hole_rmax, hole_dz, m_PhiStart, m_PhiSize);
1573 GeoLogVol *logicalFHIRH = new GeoLogVol(name, shapeFHIRH, m_LAr);
1574 GeoIntrusivePtr<GeoPhysVol>physFHIRH = new GeoPhysVol(logicalFHIRH);
1575 physFHIR->add(new GeoTransform(GeoTrf::TranslateZ3D(z_hole + hole_dz)));
1576 physFHIR->add(physFHIRH);
1577
1578 // the piece of long.bar on which indexing alu ring is sitting
1579 name = m_BaseName + "FrontHighRIndexingRing::GTen";
1580// GeoTubs *shapeFHIRG = new GeoTubs(r0 + ring_rmin, r0 + ring_rmax, ring_dz, m_PhiStart, m_PhiSize);
1581 GeoTubs *shapeFHIRG = new GeoTubs(r0 + ring_rmin, r0 + ring_rmax, gten_dz, m_PhiStart, m_PhiSize);
1582 GeoLogVol *logicalFHIRG = new GeoLogVol(name, shapeFHIRG, m_Gten);
1583 GeoIntrusivePtr<GeoPhysVol>physFHIRG = new GeoPhysVol(logicalFHIRG);
1584 physFHIR->add(new GeoTransform(GeoTrf::TranslateZ3D(ring_dz - gten_dz)));
1585 physFHIR->add(physFHIRG);
1586
1587 name = m_BaseName + "FrontLowRIndexingRing";
1588 GeoTubs *shapeFLIR = new GeoTubs(r1 + ring_rmin, r1 + ring_rmax, ring_dz, m_PhiStart, m_PhiSize);
1589 GeoLogVol *logicalFLIR = new GeoLogVol(name, shapeFLIR, m_Alu);
1590 GeoIntrusivePtr<GeoPhysVol>physFLIR = new GeoPhysVol(logicalFLIR);
1591 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1592 motherPhysical->add(physFLIR);
1593
1594 name = m_BaseName + "FrontLowRIndexingRing::Hole";
1595 GeoTubs *shapeFLIRH = new GeoTubs(r1 + hole_rmin, r1 + hole_rmax, hole_dz, m_PhiStart, m_PhiSize);
1596 GeoLogVol *logicalFLIRH = new GeoLogVol(name, shapeFLIRH, m_LAr);
1597 GeoIntrusivePtr<GeoPhysVol>physFLIRH = new GeoPhysVol(logicalFLIRH);
1598 physFLIR->add(new GeoTransform(GeoTrf::TranslateZ3D(z_hole + hole_dz)));
1599 physFLIR->add(physFLIRH);
1600
1601 name = m_BaseName + "FrontLowRIndexingRing::GTen"; //piece of long.bar
1602// GeoTubs *shapeFLIRG = new GeoTubs(r1 + ring_rmin, r1 + ring_rmax, ring_dz, m_PhiStart, m_PhiSize);
1603 GeoTubs *shapeFLIRG = new GeoTubs(r1 + ring_rmin, r1 + ring_rmax, gten_dz, m_PhiStart, m_PhiSize);
1604 GeoLogVol *logicalFLIRG = new GeoLogVol(name, shapeFLIRG, m_Gten);
1605 GeoIntrusivePtr<GeoPhysVol>physFLIRG = new GeoPhysVol(logicalFLIRG);
1606 physFLIR->add(new GeoTransform(GeoTrf::TranslateZ3D(ring_dz - gten_dz)));
1607 physFLIR->add(physFLIRG);
1608}
1609
1610void EMECSupportConstruction::put_back_indexing_rings(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1611{
1612 map_t tubes = getMap(m_DB_tubes, "TUBENAME");
1613 map_t numbers = getNumbersMap(m_DB_numbers, "BackIndexingRings");
1614
1615 double r0 = getNumber(m_DB_numbers, numbers, "Router", "PARVALUE", 1437.-5.);
1616 double r1 = getNumber(m_DB_numbers, numbers, "Rinner", "PARVALUE", 1051.-4.);
1617 std::string id = "BackIndexingRing";
1618 double ring_rmin = getNumber(m_DB_tubes, tubes, id, "RMIN", -15.);
1619 double ring_rmax = getNumber(m_DB_tubes, tubes, id, "RMAX", 15.);
1620 double ring_dz = getNumber(m_DB_tubes, tubes, id, "DZ", 16./2.);
1621 double z_hole = -ring_dz;
1622 double z0 = getNumber(m_DB_numbers, numbers, "Z0", "PARVALUE", 8.) + ring_dz;
1623 double gten_dz = getNumber(m_DB_numbers, numbers, "GTenDZ", "PARVALUE", (16. - 11.) / 2);
1624 id += "::Hole";
1625 double hole_rmin = getNumber(m_DB_tubes, tubes, id, "RMIN", -6.5);
1626 double hole_rmax = getNumber(m_DB_tubes, tubes, id, "RMAX", 6.5);
1627 double hole_dz = getNumber(m_DB_tubes, tubes, id, "DZ", 5.55/2.);
1628
1629 std::string name = m_BaseName + "BackHighRIndexingRing";
1630 GeoTubs *shapeBHIR = new GeoTubs(r0 + ring_rmin, r0 + ring_rmax, ring_dz, m_PhiStart, m_PhiSize);
1631 GeoLogVol *logicalBHIR = new GeoLogVol(name, shapeBHIR, m_Alu);
1632 GeoIntrusivePtr<GeoPhysVol>physBHIR = new GeoPhysVol(logicalBHIR);
1633 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1634 motherPhysical->add(physBHIR);
1635
1636 // the piece of long.bar on which indexing alu ring is sitting
1637 name += "::GTen";
1638// GeoTubs *shapeBHIRG = new GeoTubs(r0 + ring_rmin, r0 + ring_rmax, ring_dz, m_PhiStart, m_PhiSize);
1639 GeoTubs *shapeBHIRG = new GeoTubs(r0 + ring_rmin, r0 + ring_rmax, gten_dz, m_PhiStart, m_PhiSize);
1640 GeoLogVol *logicalBHIRG = new GeoLogVol(name, shapeBHIRG, m_Gten);
1641 GeoIntrusivePtr<GeoPhysVol>physBHIRG = new GeoPhysVol(logicalBHIRG);
1642 physBHIR->add(new GeoTransform(GeoTrf::TranslateZ3D(ring_dz - gten_dz)));
1643 physBHIR->add(physBHIRG);
1644
1645 name = m_BaseName + "BackHighRIndexingRing::Hole";
1646 GeoTubs* shapeBHIRH = new GeoTubs(r0 + hole_rmin, r0 + hole_rmax, hole_dz, m_PhiStart, m_PhiSize);
1647 GeoLogVol* logicalBHIRH = new GeoLogVol(name, shapeBHIRH, m_LAr);
1648 GeoIntrusivePtr<GeoPhysVol> physBHIRH = new GeoPhysVol(logicalBHIRH);
1649 physBHIR->add(new GeoTransform(GeoTrf::TranslateZ3D(z_hole + hole_dz)));
1650 physBHIR->add(physBHIRH);
1651
1652 name = m_BaseName + "BackLowRIndexingRing";
1653 GeoTubs *shapeBLIR = new GeoTubs(r1 + ring_rmin, r1 + ring_rmax, ring_dz, m_PhiStart, m_PhiSize);
1654 GeoLogVol *logicalBLIR = new GeoLogVol(name, shapeBLIR, m_Alu);
1655 GeoIntrusivePtr<GeoPhysVol>physBLIR = new GeoPhysVol(logicalBLIR);
1656 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1657 motherPhysical->add(physBLIR);
1658
1659 name += "::GTen";
1660// GeoTubs *shapeBLIRG = new GeoTubs(r1 + ring_rmin, r1 + ring_rmax, ring_dz, m_PhiStart, m_PhiSize);
1661 GeoTubs *shapeBLIRG = new GeoTubs(r1 + ring_rmin, r1 + ring_rmax, gten_dz, m_PhiStart, m_PhiSize);
1662 GeoLogVol *logicalBLIRG = new GeoLogVol(name, shapeBLIRG, m_Gten);
1663 GeoIntrusivePtr<GeoPhysVol>physBLIRG = new GeoPhysVol(logicalBLIRG);
1664 physBLIR->add(new GeoTransform(GeoTrf::TranslateZ3D(ring_dz - gten_dz)));
1665 physBLIR->add(physBLIRG);
1666
1667 name = m_BaseName + "BackLowRIndexingRing::Hole";
1668 GeoTubs *shapeBLIRH = new GeoTubs(r1 + hole_rmin, r1 + hole_rmax, hole_dz, m_PhiStart, m_PhiSize);
1669 GeoLogVol *logicalBLIRH = new GeoLogVol(name, shapeBLIRH, m_LAr);
1670 GeoIntrusivePtr<GeoPhysVol>physBLIRH = new GeoPhysVol(logicalBLIRH);
1671 physBLIR->add(new GeoTransform(GeoTrf::TranslateZ3D(z_hole + hole_dz)));
1672 physBLIR->add(physBLIRH);
1673}
1674
1675void EMECSupportConstruction::put_back_outer_ring(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1676{
1677 std::string id = "BackOuterRing";
1678 double z0 = getNumber(m_DB_numbers, id, "Z0", 8.);
1679 std::string name = m_BaseName + id;
1680 GeoPcon *shapeBOR = getPcon(id);
1681 GeoLogVol *logicalBOR = new GeoLogVol(name, shapeBOR, m_Alu);
1682 GeoIntrusivePtr<GeoPhysVol>physBOR = new GeoPhysVol(logicalBOR);
1683 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1684 motherPhysical->add(physBOR);
1685}
1686
1687void EMECSupportConstruction::put_back_outer_longbar(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1688{
1689 std::string id = "BackOuterLongBar";
1690 double z0 = getNumber(m_DB_numbers, id, "Z0", 23.);
1691 std::string name = m_BaseName + id;
1692 GeoPcon *shapeBOLB = getPcon(id);
1693 GeoLogVol *logicalBOLB = new GeoLogVol(name, shapeBOLB, m_Gten);
1694 GeoIntrusivePtr<GeoPhysVol>physBOLB = new GeoPhysVol(logicalBOLB);
1695 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(z0)));
1696 motherPhysical->add(physBOLB);
1697}
1698
1699void EMECSupportConstruction::put_front_outer_extracyl(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const{
1700
1701 // put extra material after PS
1702
1703 unsigned int nextra=m_DB_emecExtraCyl->size();
1704 if(nextra>0){
1705
1706 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
1707 if(!detStore.isValid()){
1708 throw std::runtime_error("Error in EMECSupportConstruction/extracyl, cannot access DetectorStore");
1709 }
1710 StoredMaterialManager* materialManager = nullptr;
1711 if (detStore->retrieve(materialManager, std::string("MATERIALS")).isFailure()) {
1712 throw std::runtime_error("Error in EMECSupportConstruction: cannot find MATERIALS.");
1713 }
1714
1715 bool finloop=false;
1716 double dzmax=6.6;
1717 for(unsigned int i=0;i<nextra;i++){
1718 const std::string& name=(*m_DB_emecExtraCyl)[i]->getString("CONE");
1719 if(name.find("EmecCylAfterPS") != std::string::npos){
1720 double rmin=(*m_DB_emecExtraCyl)[i]->getDouble("RMIN1"); //PS rmin
1721 double rmax=(*m_DB_emecExtraCyl)[i]->getDouble("RMAX1"); //PS rmax
1722 double dz = (*m_DB_emecExtraCyl)[i]->getDouble("DZ"); //leadthickness
1723 if(dz>0. && dz<= dzmax){
1724
1725 const std::string& material=(*m_DB_emecExtraCyl)[i]->getString("MATERIAL"); //lead
1726 const GeoMaterial *mat = materialManager->getMaterial(material);
1727 if (!mat) {
1728 throw std::runtime_error("Error in EMECSupportConstruction/extracyl,material for CylBeforePS is not found.");
1729 }
1730
1731 std::string id = "ExtraCyl_afterPS";
1732 std::string name = m_BaseName + id;
1733
1734 GeoTubs *solidCyl = new GeoTubs(rmin, rmax, dz/2., m_PhiStart, m_PhiSize);
1735 GeoLogVol *logicCyl = new GeoLogVol(name, solidCyl, mat);
1736 GeoIntrusivePtr<GeoPhysVol>physCyl = new GeoPhysVol(logicCyl);
1737
1738 motherPhysical->add(new GeoTransform(GeoTrf::TranslateZ3D(dz/2.)));
1739 motherPhysical->add(physCyl);
1740
1741 std::cout<<"******************************************************"<<std::endl;
1742 std::cout<<" EMECSupportConstruction insert extra material after PS"<<std::endl;
1743 std::cout<<" ExtraCyl params: name,mat= "<<name<<" "<<mat->getName()
1744 <<" rmin,rmax,dzthick,zpos="<<rmin<<" "<<rmax<<" "<<dz<<" "<<dz/2.
1745 <<" PhiStart,PhiSize="<<m_PhiStart<<" "<<m_PhiSize
1746 <<std::endl;
1747 std::cout<<"******************************************************"<<std::endl;
1748
1749 finloop=true;
1750 } // cehck on dz thickness
1751 } // cehck on EmecCylAfterPS exist
1752 if(finloop)break;
1753 } // loop for records
1754 } // check on record length
1755} // end of put_front_outer_extracyl
1756
1757void EMECSupportConstruction::put_front_outer_electronics(GeoIntrusivePtr<GeoPhysVol>motherPhysical) const
1758{
1759 map_t boxes = getMap(m_DB_boxes, "BOXNAME");
1760 map_t tubes = getMap(m_DB_tubes, "TUBENAME");
1761 map_t fbn = getNumbersMap(m_DB_numbers, "FrontBoard");
1762 map_t mbn = getNumbersMap(m_DB_numbers, "MotherBoard");
1763 map_t fcson = getNumbersMap(m_DB_numbers, "FrontCables::SideOuter");
1764
1765 std::string id = "FrontBoard";
1766
1767 std::string idx = id + "I";
1768 std::string name = m_BaseName + idx;
1769 // up to low indexing ring // -4. for cold
1770 double rmax = getNumber(m_DB_tubes, tubes, idx, "RMAX", 1025.-4. - 15.);
1771 // up to middle ring, //-2mm for cold
1772 double rmin = getNumber(m_DB_tubes, tubes, idx, "RMIN", 614.-2. + 57.);
1773 double dz_boards = getNumber(m_DB_tubes, tubes, idx, "DZ", 1.);
1774 double phi_size = M_PI / getNumber(m_DB_numbers, fbn, "PhiSizeDiv", "PARVALUE", 16.);
1775 double phi_start = -0.5 * phi_size;
1776 GeoTubs *bi_shape = new GeoTubs(rmin, rmax, dz_boards, phi_start, phi_size);
1777 GeoLogVol *bi_l = new GeoLogVol(name, bi_shape, m_Gten);
1778 GeoIntrusivePtr<GeoPhysVol>bi_phys = new GeoPhysVol(bi_l);
1779 double z_boards = getNumber(m_DB_numbers, fbn, "Zdist", "PARVALUE", 29.) - dz_boards;// 29 - start of longbar
1780
1781 idx = id + "M";
1782 name = m_BaseName + idx;
1783 rmin = getNumber(m_DB_tubes, tubes, idx, "RMIN", 1025.-4. + 15.); // -4. for cold
1784 rmax = getNumber(m_DB_tubes, tubes, idx, "RMAX", (1565.-5. - 15.)); // -5. for cold
1785 dz_boards = getNumber(m_DB_tubes, tubes, idx, "DZ", 1.);
1786 GeoTubs *bm_shape = new GeoTubs(rmin, rmax, dz_boards, phi_start, phi_size);
1787 GeoLogVol *bm_l = new GeoLogVol(name, bm_shape, m_Gten);
1788 GeoIntrusivePtr<GeoPhysVol>bm_phys = new GeoPhysVol(bm_l);
1789
1790 idx = id + "O";
1791 name = m_BaseName + idx;
1792 rmin = getNumber(m_DB_tubes, tubes, idx, "RMIN", (1565.-5. + 15.)); // -5. for cold
1793 rmax = getNumber(m_DB_tubes, tubes, idx, "RMAX", (1961.-7.)); // -7mm for cold
1794 dz_boards = getNumber(m_DB_tubes, tubes, idx, "DZ", 1.);
1795 GeoTubs *bo_shape = new GeoTubs(rmin, rmax, dz_boards, phi_start, phi_size);
1796 GeoLogVol *bo_l = new GeoLogVol(name, bo_shape, m_Gten);
1797 GeoIntrusivePtr<GeoPhysVol>bo_phys = new GeoPhysVol(bo_l);
1798
1799 // !!!To be checked whether the MBs do not cross the indexing ring in cold
1800 id = "MotherBoard";
1801 double z_mb = z_boards - dz_boards;
1802 std::string mb_n[5] = { "F1", "F2", "F3", "F4", "F5" };
1803 const double mb_dy[5] = { 74., 57., 57., 60., 44. };
1804 const double mb_dx[5] = { 38.5, 60., 138.5, 100., 165. };
1805 const double mb_dz_cu[5] = { .1, .15, .15, .15, .2 };
1806 // non-const arrays are updated from DB
1807 double mb_r[5] = { (1739.-5.) , (1640.-5.), (1400.-4.), (1140. - 4.), (835.-1.)};
1808 double mb_dz[5] = { 1.4, 1.1, 1.25, 1.1, 1.25 };
1809
1810 GeoIntrusivePtr<GeoPhysVol>mb_p[5];
1811 for(int i = 0; i < 5; ++ i){
1812 idx = id + "::" + mb_n[i];
1813 name = m_BaseName + idx;
1814 double dx = getNumber(m_DB_boxes, boxes, idx, "HLEN", mb_dx[i]);
1815 double dy = getNumber(m_DB_boxes, boxes, idx, "HWDT", mb_dy[i]);
1816 mb_dz[i] = getNumber(m_DB_boxes, boxes, idx, "HHGT", mb_dz[i]);
1817 GeoBox *mb_s = new GeoBox(dx, dy, mb_dz[i]);
1818 GeoLogVol *mb_l = new GeoLogVol(name, mb_s, m_Gten);
1819 mb_p[i] = new GeoPhysVol(mb_l);
1820
1821 name += "::Cu";
1822 std::ostringstream tmp;
1823 tmp << "Cu" << (i + 1) << "z";
1824 double dz1 = getNumber(m_DB_numbers, mbn, tmp.str(), "PARVALUE", mb_dz_cu[i]);
1825 GeoBox *cu = new GeoBox(dx, dy, dz1);
1826 GeoLogVol *cul = new GeoLogVol(name, cu, m_Copper);
1827 GeoIntrusivePtr<GeoPhysVol>cup = new GeoPhysVol(cul);
1828 mb_p[i]->add(new GeoTransform(GeoTrf::TranslateZ3D(dz1 - mb_dz[i])));
1829 mb_p[i]->add(cup);
1830
1831 tmp.str("");
1832 tmp << "R" << (i + 1);
1833 mb_r[i] = getNumber(m_DB_numbers, mbn, tmp.str(), "PARVALUE", mb_r[i]);
1834 }
1835
1836 id = "FrontCables";
1837
1838 idx = id + "::Outer";
1839 name = m_BaseName + idx;
1840
1841 double dz_oc = getNumber(m_DB_tubes, tubes, idx, "DZ", 5.);// 1cm = about 0.14 RL
1842 rmin = getNumber(m_DB_tubes, tubes, idx, "RMIN", 1780.); // ?? what is it for cold?
1843 rmax = getNumber(m_DB_tubes, tubes, idx, "RMAX", 1961.-7.); // -7mm for cold; To be checked
1844 GeoTubs *oc_s = new GeoTubs(rmin, rmax, dz_oc, phi_start, phi_size);
1845 GeoLogVol *oc_l = new GeoLogVol(name, oc_s, m_Cable);
1846 GeoIntrusivePtr<GeoPhysVol>oc_p = new GeoPhysVol(oc_l);
1847 double z_oc = z_boards - dz_boards - dz_oc;
1848
1849 idx = id + "::SideOuter";
1850 name = m_BaseName + idx;
1851 double dz_soc = getNumber(m_DB_tubes, tubes, idx, "DZ", 1.2);
1852 rmin = getNumber(m_DB_tubes, tubes, idx, "RMIN", 1000.);
1853 rmax = getNumber(m_DB_tubes, tubes, idx, "RMAX", 1780.);
1854 double dphi_sc = getNumber(m_DB_numbers, fcson, "Width", "PARVALUE", 100.) / rmax;
1855 GeoTubs *soc_s = new GeoTubs(rmin, rmax, dz_soc, -0.5 * dphi_sc, dphi_sc);
1856 GeoLogVol *soc_l = new GeoLogVol(name, soc_s, m_Cable);
1857 GeoIntrusivePtr<GeoPhysVol>soc_p = new GeoPhysVol(soc_l);
1858 // relative to indexing rings
1859 double z_soc = getNumber(m_DB_numbers, fcson, "Zdist", "PARVALUE", 9.) - dz_soc;
1860
1861 const int number_of_sectors = m_isModule? 4: 32;
1862 for(int i = 0; i < number_of_sectors; ++ i){
1863 double phi = m_Position + (i - 2) * phi_size - phi_start;
1864
1865 GeoIdentifierTag* iTag = new GeoIdentifierTag(i);
1866 GeoTransform* xf = new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(0., 0., z_boards)*GeoTrf::Transform3D(GeoTrf::RotateZ3D(phi))));
1867 GeoTransform* xf1 = new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(0., 0., z_oc)*GeoTrf::RotateZ3D(phi)));
1868
1869 motherPhysical->add(iTag);
1870 motherPhysical->add(xf);
1871 motherPhysical->add(bi_phys);
1872
1873 motherPhysical->add(iTag);
1874 motherPhysical->add(xf);
1875 motherPhysical->add(bm_phys);
1876
1877 motherPhysical->add(iTag);
1878 motherPhysical->add(xf);
1879 motherPhysical->add(bo_phys);
1880
1881 motherPhysical->add(iTag);
1882 motherPhysical->add(xf1);
1883 motherPhysical->add(oc_p);
1884
1885 for(int j = 0; j < 5; ++ j){
1886 GeoTransform* xf2 = new GeoTransform(
1887 GeoTrf::Transform3D(GeoTrf::RotateZ3D(phi)*GeoTrf::Translate3D(mb_r[j], 0., z_mb - mb_dz[j])));
1888 motherPhysical->add(iTag);
1889 motherPhysical->add(xf2);
1890 motherPhysical->add(mb_p[j]);
1891 }
1892
1893 GeoTransform* xf3 = new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(0., 0., z_soc)*GeoTrf::RotateZ3D(m_Position + (i - 2) * phi_size + 0.5 * dphi_sc)));;
1894
1895 GeoTransform* xf4 = new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translate3D(0., 0., z_soc)*GeoTrf::RotateZ3D(m_Position + (i - 1) * phi_size - 0.5 * dphi_sc)));
1896
1897 motherPhysical->add(new GeoIdentifierTag(i * 2));
1898 motherPhysical->add(xf3);
1899 motherPhysical->add(soc_p);
1900
1901 motherPhysical->add(new GeoIdentifierTag(i * 2 + 1));
1902 motherPhysical->add(xf4);
1903 motherPhysical->add(soc_p);
1904 }
1905}
1906
1907GeoIntrusivePtr<GeoPhysVol> EMECSupportConstruction::front_inner_envelope(void) const
1908{
1909 std::string id = "FrontSupportMother";
1910 std::string name = m_BaseName + id;
1911 GeoPcon *motherShape = getPcon(id + "::Inner");
1912 GeoLogVol *motherLogical = new GeoLogVol(name, motherShape, m_LAr);
1913 GeoIntrusivePtr<GeoPhysVol>motherPhysical = new GeoPhysVol(motherLogical);
1914
1915 put_front_inner_ring(motherPhysical);
1916 put_front_inner_longbar(motherPhysical);
1917 put_front_inner_barettes(motherPhysical);
1918
1919 return motherPhysical;
1920}
1921
1922GeoIntrusivePtr<GeoPhysVol> EMECSupportConstruction::back_inner_envelope(void) const
1923{
1924 std::string id = "BackSupportMother";
1925 std::string name = m_BaseName + id;
1926 GeoPcon *motherShape = getPcon(id + "::Inner");
1927 GeoLogVol *motherLogical = new GeoLogVol(name, motherShape, m_LAr);
1928 GeoIntrusivePtr<GeoPhysVol>motherPhysical = new GeoPhysVol(motherLogical);
1929
1930 put_back_inner_ring(motherPhysical);
1931 put_back_inner_longbar(motherPhysical);
1932 put_back_inner_barettes(motherPhysical);
1933
1934 return motherPhysical;
1935}
1936
1937GeoIntrusivePtr<GeoPhysVol> EMECSupportConstruction::front_outer_envelope(void) const
1938{
1939 std::string id = "FrontSupportMother";
1940 std::string name = m_BaseName + id;
1941 GeoPcon *motherShape = getPcon(id + "::Outer");
1942 GeoLogVol *motherLogical = new GeoLogVol(name, motherShape, m_LAr);
1943 GeoIntrusivePtr<GeoPhysVol>motherPhysical= new GeoPhysVol(motherLogical);
1944
1945 put_front_outer_ring(motherPhysical);
1946 put_front_outer_longbar(motherPhysical);
1947 put_front_indexing_rings(motherPhysical);
1948 put_front_middle_ring(motherPhysical);
1949 put_front_outer_barettes(motherPhysical);
1950 put_front_outer_electronics(motherPhysical);
1951
1952 return motherPhysical;
1953}
1954
1955GeoIntrusivePtr<GeoPhysVol> EMECSupportConstruction::back_outer_envelope(void) const
1956{
1957 std::string id = "BackSupportMother";
1958 std::string name = m_BaseName + id;
1959 GeoPcon *motherShape = getPcon(id + "::Outer");
1960 GeoLogVol *motherLogical = new GeoLogVol(name, motherShape, m_LAr);
1961 GeoIntrusivePtr<GeoPhysVol>motherPhysical= new GeoPhysVol(motherLogical);
1962
1963 put_back_indexing_rings(motherPhysical);
1964 put_back_outer_ring(motherPhysical);
1965 put_back_middle_ring(motherPhysical);
1966 put_back_outer_longbar(motherPhysical);
1967 put_back_outer_barettes(motherPhysical);
1968
1969 return motherPhysical;
1970}
#define M_PI
Scalar phi() const
phi method
#define ATH_MSG_WARNING(x)
Declaration of EMECConstruction class.
Declaration of EMECSupportConstruction class.
double length(const pvec &v)
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition of the abstract IRDBRecord interface.
Definition of the abstract IRDBRecordset interface.
constexpr int pow(int base, int exp) noexcept
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
const std::string & tag() const
Return version tag.
const std::string & node() const
Return the version node.
GeoIntrusivePtr< GeoPhysVol > outer_envelope(void) const
void put_back_inner_longbar(GeoIntrusivePtr< GeoPhysVol >) const
GeoIntrusivePtr< GeoPhysVol > back_envelope(void) const
void put_front_outer_ring(GeoIntrusivePtr< GeoPhysVol >) const
void put_back_outer_longbar(GeoIntrusivePtr< GeoPhysVol >) const
GeoIntrusivePtr< GeoPhysVol > front_outer_envelope(void) const
EMECSupportConstruction(type_t type, bool pos_zside=true, bool is_module=false, std::string basename="LAr::EMEC::", double position=0.)
void put_front_inner_ring(GeoIntrusivePtr< GeoPhysVol >) const
void put_front_inner_longbar(GeoIntrusivePtr< GeoPhysVol >) const
void put_front_indexing_rings(GeoIntrusivePtr< GeoPhysVol >) const
GeoIntrusivePtr< GeoPhysVol > back_inner_envelope(void) const
void put_back_indexing_rings(GeoIntrusivePtr< GeoPhysVol >) const
void put_front_inner_barettes(GeoIntrusivePtr< GeoPhysVol >) const
void put_front_outer_longbar(GeoIntrusivePtr< GeoPhysVol >) const
GeoIntrusivePtr< GeoPhysVol > front_envelope(void) const
map_t getMap(const IRDBRecordset_ptr &db, const std::string &s) const
std::map< std::string, unsigned int > map_t
double getNumber(const IRDBRecordset_ptr &db, const map_t &m, const std::string &idx, const char *number, double defval=0.) const
void put_back_inner_barettes(GeoIntrusivePtr< GeoPhysVol >) const
void put_back_middle_ring(GeoIntrusivePtr< GeoPhysVol >) const
virtual GeoIntrusivePtr< GeoPhysVol > GetEnvelope(void) const
GeoIntrusivePtr< GeoPhysVol > middle_envelope(void) const
!!!
void put_front_outer_extracyl(GeoIntrusivePtr< GeoPhysVol >) const
void put_back_outer_ring(GeoIntrusivePtr< GeoPhysVol >) const
void put_front_outer_electronics(GeoIntrusivePtr< GeoPhysVol >) const
GeoPcon * getPcon(const std::string &) const
void put_back_outer_barettes(GeoIntrusivePtr< GeoPhysVol >) const
void put_front_middle_ring(GeoIntrusivePtr< GeoPhysVol >) const
map_t getNumbersMap(const IRDBRecordset_ptr &db, const std::string &s) const
void put_back_inner_ring(GeoIntrusivePtr< GeoPhysVol >) const
GeoIntrusivePtr< GeoPhysVol > inner_envelope(void) const
GeoIntrusivePtr< GeoPhysVol > back_outer_envelope(void) const
void put_front_outer_barettes(GeoIntrusivePtr< GeoPhysVol >) const
GeoIntrusivePtr< GeoPhysVol > front_inner_envelope(void) const
This class holds one or more material managers and makes them storeable, under StoreGate.
virtual const GeoMaterial * getMaterial(const std::string &name)=0
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138
STL namespace.
std::string basename(std::string name)
Definition utils.cxx:207
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186