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
146 }
147 else {
149 }
150
151
154 }
155 else {
157 }
158
159
164 }
165 else {
167 }
168 }
169 else {
170 if (versionName == "SLHC") {
171 ATH_MSG_ERROR(
"Service builder tool not specified. Some services will not be built" );
172 }
173 else {
175 }
176 }
177
178 if(sqliteReader) {
179
180 ATH_MSG_INFO(
"Building the geometry from the SQLite file");
181
189
190 if (versionName ==
"IBL") switches.
setIBL();
191
192 PixelDetectorFactoryLite thePixelFactory(sqliteReader,
m_athenaComps,switches);
193 thePixelFactory.create(world);
194 m_manager=thePixelFactory.getDetectorManager();
195 }
196 else {
197
198 ATH_MSG_INFO(
"Building Pixel Detector with Version Tag: " << detectorKey
199 << " at Node: " << detectorNode);
200
201 ATH_MSG_INFO(
"Building the geometry in the standard way");
202
203
204 std::string pixelVersionTag = rdbAccessSvc->getChildTag("Pixel", detectorKey, detectorNode);
206
207
208
209 if (pixelVersionTag.empty()) {
210 ATH_MSG_INFO(
"No Pixel Version. Pixel Detector will not be built." );
211 return StatusCode::SUCCESS;
212 }
213
214
215
216
217 ATH_MSG_DEBUG(
"PixelDetectorTool: Detector Information coming from the database and job options IGNORED." );
218 ATH_MSG_DEBUG(
"Keys for Pixel Switches are " << detectorKey <<
" " << detectorNode );
219
220 if (versionName.empty()) {
222 versionName = "DC1";
223 }
224 else {
225 versionName = "DC2";
226 }
227 }
228
231 ATH_MSG_INFO(
"Overriding version name: " << versionName );
232 }
233
241
244 }
245 else {
247 }
248
249 if (versionName ==
"IBL") switches.
setIBL();
250
252
253 if(versionName == "DC1" || versionName == "DC2") {
254
256 thePixel.create(world);
257 m_manager = thePixel.getDetectorManager();
258 }
259 else if (versionName == "SR1") {
260
262 thePixel.create(world);
263 m_manager = thePixel.getDetectorManager();
264 }
265 else {
266
268 if(descrName.compare("TrackingGeometry")!=0) {
269 thePixel.create(world);
270 }
271 else {
272 ATH_MSG_INFO(
"Pixel - TrackingGeometry tag - no geometry built" );
273 }
274 m_manager = thePixel.getDetectorManager();
275 }
276
277 }
278 else {
279
281 thePixel.create(world);
282 m_manager = thePixel.getDetectorManager();
283 }
284 }
285
286
288
290
291
292 const SiDetectorManager * siDetManager =
m_manager;
294
295 return StatusCode::SUCCESS;
296}
#define ATH_CHECK
Evaluate an expression and check for errors.
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)