18 #include "GeoModelRead/ReadGeoModel.h"
19 #include "GeoModelKernel/GeoTube.h"
20 #include "GeoModelKernel/GeoBox.h"
21 #include "GeoModelKernel/GeoLogVol.h"
22 #include "GeoModelKernel/GeoPhysVol.h"
23 #include "GeoModelKernel/GeoNameTag.h"
24 #include "GeoModelKernel/GeoIdentifierTag.h"
25 #include "GeoModelKernel/GeoTransform.h"
26 #include "GeoModelKernel/GeoAlignableTransform.h"
27 #include "GeoModelKernel/GeoMaterial.h"
28 #include "GeoModelKernel/GeoShapeShift.h"
29 #include "GeoModelKernel/GeoDefinitions.h"
30 #include "GaudiKernel/PhysicalConstants.h"
35 inline double sqr(
double x) {
return x*
x;}
45 GeoModelIO::ReadGeoModel* sqliteReader,
46 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
47 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX)
104 if (
m_numModules % 2) std::cout <<
"SCT_FwdRing: Number of modules in ring must be even." << std::endl;
123 double moduleCount =
angle / divisionAngle;
124 int moduleCountInt =
static_cast<int>(floor(moduleCount +0.5 -0.0001));
126 m_startAngle = divisionAngle * (moduleCount - moduleCountInt);
132 double moduleCountNegEC = angleNegEC / divisionAngle;
133 m_moduleZero =
static_cast<int>(floor(moduleCountNegEC + 0.5 - 0.0001));
163 const GeoShape & ringEnvelopeShape = (*tmpShape << GeoTrf::Translate3D(0, 0, envelopeShift));
176 GeoPhysVol * ring=
nullptr;
177 bool negativeEndCap = (
id.getBarrelEC() < 0);
204 int idModule = idNumber;
206 if (negativeEndCap) {
239 ring->add(
new GeoNameTag(moduleName));
240 ring->add(
new GeoIdentifierTag(idModule));
241 GeoAlignableTransform * moduleTransform =
new GeoAlignableTransform(modulePos);
242 ring->add(moduleTransform);
243 id.setPhiModule(idModule);
255 double zModuleServices = 0;
256 double rModuleServices = 0;
257 GeoVPhysVol * moduleServices =
nullptr;
258 if (staggerUpperLower > 0){
269 ring->add(
new GeoTransform(GeoTrf::RotateZ3D(
phi)*GeoTrf::Translate3D(rModuleServices, 0, zModuleServices)));
270 ring->add(moduleServices);
296 int idModule = idNumber;
298 if (negativeEndCap) {
304 id.setPhiModule(idModule);
348 double moduleServicesHiLength = std::abs(coolingBlkMainR - coolingBlkSecR) + 0.5 *
m_coolingBlockHiMain->deltaR();
349 double moduleServicesLoLength = std::abs(coolingBlkMainR - coolingBlkSecR) + 0.5 *
m_coolingBlockLoMain->deltaR();
354 double moduleOrientation = (coolingBlkMainR > coolingBlkSecR) ? +1 : -1;
359 double coolingBlkHiSecRMid = coolingBlkSecR + moduleOrientation * 0.5 *
m_coolingBlockHiSec->deltaR();
360 double coolingBlkLoSecRMid = coolingBlkSecR + moduleOrientation * 0.5 *
m_coolingBlockLoSec->deltaR();
378 const GeoBox * moduleServicesHiShape =
new GeoBox(0.5*moduleServicesHiLength +
m_safety,
379 0.5*moduleServicesHiWidth +
m_safety,
380 0.5*moduleServicesHiThickness +
m_safety);
381 const GeoBox * moduleServicesLoShape =
new GeoBox(0.5*moduleServicesLoLength +
m_safety,
382 0.5*moduleServicesLoWidth +
m_safety,
383 0.5*moduleServicesLoThickness +
m_safety);
384 const GeoLogVol * moduleServicesHiLog =
new GeoLogVol(
"ModuleServicesHi", moduleServicesHiShape,
m_materials->
gasMaterial());
385 const GeoLogVol * moduleServicesLoLog =
new GeoLogVol(
"ModuleServicesLo", moduleServicesLoShape,
m_materials->
gasMaterial());