Create the Detector Node corresponding to this tool.
71{
73
74
75 ServiceHandle<IGeoDbTagSvc> geoDbTagSvc(
"GeoDbTagSvc",
name());
77
78 ServiceHandle<IRDBAccessSvc> rdbAccessSvc(geoDbTagSvc->getParamSvcName(),
name());
80
81
82 GeoModelExperiment* theExpt = nullptr;
84
86 GeoModelIO::ReadGeoModel* sqliteReader = geoDbTagSvc->getSqliteReader();
87
88 std::string detectorKey{""};
89 std::string detectorNode{""};
90 if(!sqliteReader) {
91 DecodeVersionKey decodeVersion(geoDbTagSvc.operator->(), "Pixel");
92 detectorKey = decodeVersion.tag();
93 detectorNode = decodeVersion.node();
94 if(decodeVersion.custom()) {
95 ATH_MSG_WARNING(
"PixelDetectorTool: Detector Information coming from a custom configuration!!" );
96 }
97 }
98
99 IRDBRecordset_ptr switchSet = rdbAccessSvc->getRecordsetPtr(
"PixelSwitches", detectorKey, detectorNode);
100 const IRDBRecord *switchTable = (*switchSet)[0];
101
102 std::string versionName;
103 std::string descrName="noDescr";
104
108 versionName = switchTable->
getString(
"VERSIONNAME");
109 }
111 descrName = switchTable->
getString(
"DESCRIPTION");
112 }
114
115
116 PixelSwitches switches;
117
124
125
128
129 const PixelID * idHelper = nullptr;
131
132
134
135
142
143
147 } else {
149 }
151 }
152 else {
154 }
155
156
160 }
161 else {
163 }
165 }
166 else {
168 }
169
170
175 }
176 else {
178 }
179 }
180 else {
181 if (versionName == "SLHC") {
182 ATH_MSG_ERROR(
"Service builder tool not specified. Some services will not be built" );
183 }
184 else {
186 }
187 }
188
189 if(sqliteReader) {
190
191 ATH_MSG_INFO(
"Building the geometry from the SQLite file");
192
200
201 if (versionName ==
"IBL") switches.
setIBL();
202
203 PixelDetectorFactoryLite thePixelFactory(sqliteReader,
m_athenaComps,switches);
204 thePixelFactory.create(world);
205 m_manager=thePixelFactory.getDetectorManager();
206 }
207 else {
208
209 ATH_MSG_INFO(
"Building Pixel Detector with Version Tag: " << detectorKey
210 << " at Node: " << detectorNode);
211
212 ATH_MSG_INFO(
"Building the geometry in the standard way");
213
214
215 std::string pixelVersionTag = rdbAccessSvc->getChildTag("Pixel", detectorKey, detectorNode);
217
218
219
220 if (pixelVersionTag.empty()) {
221 ATH_MSG_INFO(
"No Pixel Version. Pixel Detector will not be built." );
222 return StatusCode::SUCCESS;
223 }
224
225
226
227
228 ATH_MSG_DEBUG(
"PixelDetectorTool: Detector Information coming from the database and job options IGNORED." );
229 ATH_MSG_DEBUG(
"Keys for Pixel Switches are " << detectorKey <<
" " << detectorNode );
230
231 if (versionName.empty()) {
233 versionName = "DC1";
234 }
235 else {
236 versionName = "DC2";
237 }
238 }
239
242 ATH_MSG_INFO(
"Overriding version name: " << versionName );
243 }
244
252
255 }
256 else {
258 }
259
260 if (versionName ==
"IBL") switches.
setIBL();
261
263
264 if(versionName == "DC1" || versionName == "DC2") {
265
267 thePixel.create(world);
268 m_manager = thePixel.getDetectorManager();
269 }
270 else if (versionName == "SR1") {
271
273 thePixel.create(world);
274 m_manager = thePixel.getDetectorManager();
275 }
276 else {
277
279 if(descrName.compare("TrackingGeometry")!=0) {
280 thePixel.create(world);
281 }
282 else {
283 ATH_MSG_INFO(
"Pixel - TrackingGeometry tag - no geometry built" );
284 }
285 m_manager = thePixel.getDetectorManager();
286 }
287
288 }
289 else {
290
292 thePixel.create(world);
293 m_manager = thePixel.getDetectorManager();
294 }
295 }
296
297
299
301
302
303 const SiDetectorManager * siDetManager =
m_manager;
305
306 return StatusCode::SUCCESS;
307}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
GeoPhysVol * getPhysVol()
Destructor.
void addManager(const GeoVDetectorManager *)
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
virtual bool isFieldNull(const std::string &fieldName) const =0
Check if the field value is NULL.
virtual int getInt(const std::string &fieldName) const =0
Get int field value.
void setInitialLayout(bool flag)
void setIBL(bool flag=true)
void setServices(bool flag)
void setServicesOnLadder(bool flag)
void setDC1Geometry(bool flag)
void setDBM(bool flag=false)
void setDynamicAlignFolders(const bool useDynAlignFolders)
void setAlignable(bool flag)
retrieve(aClass, aKey=None)