20 #include "GeoModelKernel/GeoVolumeCursor.h"
24 #include "GaudiKernel/MsgStream.h"
25 #include "GaudiKernel/SystemOfUnits.h"
35 #define MLOG(x) if (m_log->level()<=MSG::x) *m_log << MSG::x
41 GeoModelIO::ReadGeoModel* ,
47 , m_paramsSvc(paramsSvc)
48 , m_switches(switches)
63 (*m_log) <<
MSG::INFO <<
" Entering TileDetectorFactoryLite::create()" <<
endmsg;
73 auto sectionBuilder = std::make_unique<TileGeoSectionBuilder>(theMaterialManager,dbManager,
m_switches,
m_log);
77 (*m_log) <<
MSG::INFO <<
"Getting auxiliary data from SQLite..." <<
endmsg;
80 (*m_log) <<
MSG::DEBUG <<
"data rows in the 'TileReadoutData' RecordSet: " << tileReadoutDataRecordSet->size() <<
endmsg;
82 double barrelPeriodThickness = 0., extendedPeriodThickness = 0.;
83 if (tileReadoutDataRecordSet->size()>0) {
84 if ( (*tileReadoutDataRecordSet)[0]->getString(
"NAME") ==
"barrelPeriodThickness" ) {
85 barrelPeriodThickness = (*tileReadoutDataRecordSet)[0]->getDouble(
"VALUE");
87 std::string errMsg =
"barrelPeriodThickness not found in position [0] in the TileReadoutData' RecordSet!!!";
88 (*m_log) << MSG::ERROR << errMsg <<
endmsg;
89 throw std::runtime_error(errMsg);
91 if ( (*tileReadoutDataRecordSet)[1]->getString(
"NAME") ==
"extendedPeriodThickness" ) {
92 extendedPeriodThickness = (*tileReadoutDataRecordSet)[1]->getDouble(
"VALUE");
94 std::string errMsg =
"extendedPeriodThickness not found in position [1] in the TileReadoutData' RecordSet!!!";
95 (*m_log) << MSG::ERROR << errMsg <<
endmsg;
96 throw std::runtime_error(errMsg);
99 std::string
errorMsg =
"The 'TileReadoutData' recordSet is empty!!!";
103 (*m_log) <<
MSG::DEBUG <<
"barrelPeriodThickness: " << barrelPeriodThickness <<
", extendedPeriodThickness: " << extendedPeriodThickness <<
endmsg;
106 sectionBuilder->setBarrelPeriodThickness(barrelPeriodThickness);
107 sectionBuilder->setExtendedPeriodThickness(extendedPeriodThickness);
114 int nModulesInSection[6] = {0,0,0,0,0,0};
115 double zShiftInSection[6] = {0.0,0.0,0.0,0.0,0.0,0.0,};
120 for (
int EnvCounter = 0; EnvCounter < NumberOfEnv; ++EnvCounter) {
129 <<
" EnvCounter is " << EnvCounter
130 <<
" EnvType is " << EnvType
135 if (EnvType == 1 || EnvType == 0) {
136 nModulesInSection[0] = nModulesInSection[1] = NumberOfMod;
137 zShiftInSection[0] = zShiftInSection[1] = Zshift;
138 }
else if (EnvType>0 and EnvType < 6) {
139 nModulesInSection[EnvType] = NumberOfMod;
140 zShiftInSection[EnvType] = Zshift;
151 int side[6] = {0,1,0,1,0,1};
153 (*m_log) <<
MSG::DEBUG <<
"Loop over Tile detector regions, and call computeCellDim() when needed..." <<
endmsg;
154 for (
int ii=0; ii<6; ++ii) {
156 (*m_log) <<
MSG::DEBUG <<
"ii: " << ii <<
", region: " << dete[ii] <<
endmsg;
159 (*m_log) <<
MSG::DEBUG <<
"ii: " << ii <<
", region: " << dete[ii] <<
" --> calling computeCellDim()..." <<
endmsg;
162 zShiftInSection[ii+1],
163 zShiftInSection[ii]);
166 (*m_log) <<
MSG::DEBUG <<
"Get TileDetDescriptor and call fillDescriptor()..." <<
endmsg;
168 sectionBuilder->fillDescriptor(descriptor, dete[ii],
side[ii],
171 nModulesInSection[ii],
172 zShiftInSection[ii]);
174 (*m_log) <<
MSG::DEBUG <<
"Get an Identifier for the region and add it to the detectorManager..." <<
endmsg;
176 descriptor->
set(idRegion);
183 GeoVolumeCursor
cursor(world);
185 std::string volName =
cursor.getName();
186 if (volName.compare(0,4,
"Tile")==0) {
187 (*m_log) <<
MSG::DEBUG <<
"Adding vol '" << volName <<
"' to detManager" <<
endmsg;
193 (*m_log) <<
MSG::DEBUG <<
"Tile geometry from SQLite has been created." <<
endmsg;