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
138
139
142 }
143 else {
145 }
146
147
150 }
151 else {
153 }
154
155
160 }
161 else {
163 }
164 }
165 else {
166 if (versionName == "SLHC") {
167 ATH_MSG_ERROR(
"Service builder tool not specified. Some services will not be built" );
168 }
169 else {
171 }
172 }
173
174 if(sqliteReader) {
175
176 ATH_MSG_INFO(
"Building the geometry from the SQLite file");
177
185
186 if (versionName ==
"IBL") switches.
setIBL();
187
188 PixelDetectorFactoryLite thePixelFactory(sqliteReader,
m_athenaComps,switches);
189 thePixelFactory.create(world);
190 m_manager=thePixelFactory.getDetectorManager();
191 }
192 else {
193
194 ATH_MSG_INFO(
"Building Pixel Detector with Version Tag: " << detectorKey
195 << " at Node: " << detectorNode);
196
197 ATH_MSG_INFO(
"Building the geometry in the standard way");
198
199
200 std::string pixelVersionTag = rdbAccessSvc->getChildTag("Pixel", detectorKey, detectorNode);
202
203
204
205 if (pixelVersionTag.empty()) {
206 ATH_MSG_INFO(
"No Pixel Version. Pixel Detector will not be built." );
207 return StatusCode::SUCCESS;
208 }
209
210
211
212
213 ATH_MSG_DEBUG(
"PixelDetectorTool: Detector Information coming from the database and job options IGNORED." );
214 ATH_MSG_DEBUG(
"Keys for Pixel Switches are " << detectorKey <<
" " << detectorNode );
215
216 if (versionName.empty()) {
218 versionName = "DC1";
219 }
220 else {
221 versionName = "DC2";
222 }
223 }
224
227 ATH_MSG_INFO(
"Overriding version name: " << versionName );
228 }
229
237
240 }
241 else {
243 }
244
245 if (versionName ==
"IBL") switches.
setIBL();
246
248
249 if(versionName == "DC1" || versionName == "DC2") {
250
252 thePixel.create(world);
253 m_manager = thePixel.getDetectorManager();
254 }
255 else if (versionName == "SR1") {
256
258 thePixel.create(world);
259 m_manager = thePixel.getDetectorManager();
260 }
261 else {
262
264 if(descrName.compare("TrackingGeometry")!=0) {
265 thePixel.create(world);
266 }
267 else {
268 ATH_MSG_INFO(
"Pixel - TrackingGeometry tag - no geometry built" );
269 }
270 m_manager = thePixel.getDetectorManager();
271 }
272
273 }
274 else {
275
277 thePixel.create(world);
278 m_manager = thePixel.getDetectorManager();
279 }
280 }
281
282
284
286
287
288 const SiDetectorManager * siDetManager =
m_manager;
290
291 return StatusCode::SUCCESS;
292}
#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)