Create the Detector Node corresponding to this tool.
57{
59
60
61 ServiceHandle<IGeoDbTagSvc> geoDbTagSvc(
"GeoDbTagSvc",
name());
63
64 ServiceHandle<IRDBAccessSvc> rdbAccessSvc(geoDbTagSvc->getParamSvcName(),
name());
66
67
68 GeoModelExperiment* theExpt = nullptr;
69 ATH_CHECK(detStore()->retrieve(theExpt,
"ATLAS"));
70
72 GeoModelIO::ReadGeoModel* sqliteReader = geoDbTagSvc->getSqliteReader();
73
74 std::string detectorKey{""};
75 std::string detectorNode{""};
76 if(!sqliteReader) {
77 DecodeVersionKey decodeVersion(geoDbTagSvc.operator->(), "Pixel");
78 detectorKey = decodeVersion.tag();
79 detectorNode = decodeVersion.node();
80 if(decodeVersion.custom()) {
81 ATH_MSG_WARNING(
"PixelDetectorTool: Detector Information coming from a custom configuration!!" );
82 }
83 }
84
85 IRDBRecordset_ptr switchSet = rdbAccessSvc->getRecordsetPtr(
"PixelSwitches", detectorKey, detectorNode);
86 const IRDBRecord *switchTable = (*switchSet)[0];
87
88 std::string versionName;
89 std::string descrName="noDescr";
90
94 versionName = switchTable->
getString(
"VERSIONNAME");
95 }
97 descrName = switchTable->
getString(
"DESCRIPTION");
98 }
100
101
102 PixelSwitches switches;
103
110
111
114
115 const PixelID * idHelper = nullptr;
116 ATH_CHECK(detStore()->retrieve(idHelper,
"PixelID"));
117
118
124
125
128 }
129 else {
131 }
132
133
136 }
137 else {
139 }
140
141
146 }
147 else {
149 }
150 }
151 else {
152 if (versionName == "SLHC") {
153 ATH_MSG_ERROR(
"Service builder tool not specified. Some services will not be built" );
154 }
155 else {
157 }
158 }
159
160 if(sqliteReader) {
161
162 ATH_MSG_INFO(
"Building the geometry from the SQLite file");
163
171
172 if (versionName ==
"IBL") switches.
setIBL();
173
174 PixelDetectorFactoryLite thePixelFactory(sqliteReader,
m_athenaComps,switches);
175 thePixelFactory.create(world);
176 m_manager=thePixelFactory.getDetectorManager();
177 }
178 else {
179
180 ATH_MSG_INFO(
"Building Pixel Detector with Version Tag: " << detectorKey
181 << " at Node: " << detectorNode);
182
183 ATH_MSG_INFO(
"Building the geometry in the standard way");
184
185
186 std::string pixelVersionTag = rdbAccessSvc->getChildTag("Pixel", detectorKey, detectorNode);
188
189
190
191 if (pixelVersionTag.empty()) {
192 ATH_MSG_INFO(
"No Pixel Version. Pixel Detector will not be built." );
193 return StatusCode::SUCCESS;
194 }
195
196
197
198
199 ATH_MSG_DEBUG(
"PixelDetectorTool: Detector Information coming from the database and job options IGNORED." );
200 ATH_MSG_DEBUG(
"Keys for Pixel Switches are " << detectorKey <<
" " << detectorNode );
201
202 if (versionName.empty()) {
204 versionName = "DC1";
205 }
206 else {
207 versionName = "DC2";
208 }
209 }
210
213 ATH_MSG_INFO(
"Overriding version name: " << versionName );
214 }
215
223
226 }
227 else {
229 }
230
231 if (versionName ==
"IBL") switches.
setIBL();
232
234
235 if(versionName == "DC1" || versionName == "DC2") {
236
238 thePixel.create(world);
239 m_manager = thePixel.getDetectorManager();
240 }
241 else if (versionName == "SR1") {
242
244 thePixel.create(world);
245 m_manager = thePixel.getDetectorManager();
246 }
247 else {
248
250 if(descrName.compare("TrackingGeometry")!=0) {
251 thePixel.create(world);
252 }
253 else {
254 ATH_MSG_INFO(
"Pixel - TrackingGeometry tag - no geometry built" );
255 }
256 m_manager = thePixel.getDetectorManager();
257 }
258
259 }
260 else {
261
263 thePixel.create(world);
264 m_manager = thePixel.getDetectorManager();
265 }
266 }
267
268
270
272
273 return StatusCode::SUCCESS;
274}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
GeoPhysVol * getPhysVol()
Destructor.
void addManager(const GeoVDetectorManager *)
virtual bool isFieldNull(std::string_view fieldName) const =0
Check if the field value is NULL.
virtual int getInt(std::string_view fieldName) const =0
Get int field value.
virtual const std::string & getString(std::string_view fieldName) const =0
Get string 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)