ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_DetectorFactoryLite Class Reference

#include <SCT_DetectorFactoryLite.h>

Inheritance diagram for SCT_DetectorFactoryLite:
Collaboration diagram for SCT_DetectorFactoryLite:

Public Member Functions

 SCT_DetectorFactoryLite (GeoModelIO::ReadGeoModel *sqliteReader, SCT_GeoModelAthenaComps *athenaComps, const SCT_Options &options)
virtual ~SCT_DetectorFactoryLite ()=default
virtual void create (GeoPhysVol *world) override
virtual const InDetDD::SCT_DetectorManagergetDetectorManager () const override
StoreGateSvcdetStore ()
const StoreGateSvcdetStore () const
const IGeoDbTagSvcgeoDbTagSvc () const
IRDBAccessSvcrdbAccessSvc ()
const IGeometryDBSvcgeomDB () const
MsgStream & msg (MSG::Level lvl) const
bool msgLvl (MSG::Level lvl)
InDetDD::AthenaCompsgetAthenaComps ()

Private Types

using FPVMap = std::map<std::string, GeoFullPhysVol*>
using AXFMap = std::map<std::string, GeoAlignableTransform*>

Private Member Functions

 SCT_DetectorFactoryLite (const SCT_DetectorFactoryLite &right)=delete
const SCT_DetectorFactoryLiteoperator= (const SCT_DetectorFactoryLite &right)=delete

Private Attributes

GeoModelIO::ReadGeoModel * m_sqliteReader {nullptr}
InDetDD::SCT_DetectorManagerm_detectorManager {nullptr}
std::unique_ptr< SCT_GeometryManagerm_geometryManager
std::unique_ptr< SCT_DataBasem_db
bool m_useDynamicAlignFolders {false}
std::shared_ptr< FPVMapm_mapFPV
std::shared_ptr< AXFMapm_mapAXF
InDetDD::AthenaCompsm_athenaComps

Detailed Description

Definition at line 33 of file SCT_DetectorFactoryLite.h.

Member Typedef Documentation

◆ AXFMap

using SCT_DetectorFactoryLite::AXFMap = std::map<std::string, GeoAlignableTransform*>
private

Definition at line 63 of file SCT_DetectorFactoryLite.h.

◆ FPVMap

using SCT_DetectorFactoryLite::FPVMap = std::map<std::string, GeoFullPhysVol*>
private

Definition at line 62 of file SCT_DetectorFactoryLite.h.

Constructor & Destructor Documentation

◆ SCT_DetectorFactoryLite() [1/2]

SCT_DetectorFactoryLite::SCT_DetectorFactoryLite ( GeoModelIO::ReadGeoModel * sqliteReader,
SCT_GeoModelAthenaComps * athenaComps,
const SCT_Options & options )

Definition at line 65 of file SCT_DetectorFactoryLite.cxx.

68 : InDetDD::DetectorFactoryBase(athenaComps),
69 m_sqliteReader (sqliteReader)
70{
71 // Create the detector manager
72 m_detectorManager = new SCT_DetectorManager(detStore());
73 // Create the database
74 m_db = std::make_unique<SCT_DataBase>(athenaComps);
75
76 // Create the Si common items
77 std::unique_ptr<InDetDD::SiCommonItems> commonItems{std::make_unique<InDetDD::SiCommonItems>(athenaComps->getIdHelper())};
78
79 // Create the geometry manager.
80 m_geometryManager = std::make_unique<SCT_GeometryManager>(m_db.get());
81 m_geometryManager->setOptions(options);
82 m_geometryManager->setCommonItems(commonItems.get());
83
84 // Add SiCommonItems to SCT_DetectorManager to hold and delete it.
85 m_detectorManager->setCommonItems(std::move(commonItems));
86
87 m_useDynamicAlignFolders = options.dynamicAlignFolders();
88 // Set Version information
89 // Get the geometry tag
90 IRDBRecordset_ptr switchSet
91 = rdbAccessSvc()->getRecordsetPtr("SctSwitches", "");
92 const IRDBRecord *switches = (*switchSet)[0];
93
94 std::string layout = "Final";
95 std::string description;
96 if (!switches->isFieldNull("LAYOUT")) {
97 layout = switches->getString("LAYOUT");
98 }
99 if (!switches->isFieldNull("DESCRIPTION")) {
100 description = switches->getString("DESCRIPTION");
101 }
102 std::string versionName = switches->getString("VERSIONNAME");
103 int versionMajorNumber = 3;
104 int versionMinorNumber = 6;
105 int versionPatchNumber = 0;
106 InDetDD::Version version("", // Redundant when GeoModel is read from SQLite
107 versionName,
108 layout,
110 versionMajorNumber,
111 versionMinorNumber,
112 versionPatchNumber);
113 m_detectorManager->setVersion(version);
114
115 m_mapFPV = std::shared_ptr<FPVMap>(new FPVMap(m_sqliteReader->getPublishedNodes<std::string, GeoFullPhysVol*>("SCT")));
116 m_mapAXF = std::shared_ptr<AXFMap>(new AXFMap(m_sqliteReader->getPublishedNodes<std::string, GeoAlignableTransform*>("SCT")));
117}
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
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.
std::unique_ptr< SCT_GeometryManager > m_geometryManager
std::map< std::string, GeoAlignableTransform * > AXFMap
InDetDD::SCT_DetectorManager * m_detectorManager
std::shared_ptr< AXFMap > m_mapAXF
std::unique_ptr< SCT_DataBase > m_db
std::shared_ptr< FPVMap > m_mapFPV
GeoModelIO::ReadGeoModel * m_sqliteReader
std::map< std::string, GeoFullPhysVol * > FPVMap
const SCT_ID * getIdHelper() const
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:91
str layout
Definition TileTB.py:76

◆ ~SCT_DetectorFactoryLite()

virtual SCT_DetectorFactoryLite::~SCT_DetectorFactoryLite ( )
virtualdefault

◆ SCT_DetectorFactoryLite() [2/2]

SCT_DetectorFactoryLite::SCT_DetectorFactoryLite ( const SCT_DetectorFactoryLite & right)
privatedelete

Member Function Documentation

◆ create()

void SCT_DetectorFactoryLite::create ( GeoPhysVol * world)
overridevirtual

Definition at line 119 of file SCT_DetectorFactoryLite.cxx.

120{
121
122 msg(MSG::INFO) << "Building SCT Detector." << endmsg;
123 msg(MSG::INFO) << " " << m_detectorManager->getVersion().fullDescription() << endmsg;
124
125 // Change precision.
126 int oldPrecision = std::cout.precision(6);
127
128 // The tree tops get added to world.
129 const SCT_GeneralParameters * sctGeneral = m_geometryManager->generalParameters();
130
131 std::string barrelLabel = "Barrel";
132 std::string forwardPlusLabel = "EndcapA";
133 std::string forwardMinusLabel = "EndcapC";
134
135 bool barrelPresent = sctGeneral->partPresent(barrelLabel);
136 bool forwardPlusPresent = sctGeneral->partPresent(forwardPlusLabel);
137 bool forwardMinusPresent = sctGeneral->partPresent(forwardMinusLabel);
138
139 //
140 // The Barrel
141 //
142 if (barrelPresent) {
143
144 msg(MSG::DEBUG) << "Building the SCT Barrel." << endmsg;
145
146 m_detectorManager->numerology().addBarrel(0);
147
148 // Create the SCT Barrel
149 SCT_Barrel sctBarrel("SCT_Barrel", m_detectorManager, m_geometryManager.get(), nullptr, m_sqliteReader, m_mapFPV, m_mapAXF);
150
151 SCT_Identifier id{m_geometryManager->athenaComps()->getIdHelper()};
152 id.setBarrelEC(0);
153 //GeoVPhysVol * barrelPV =
154 sctBarrel.build(id);
155 GeoFullPhysVol *barrelPV = (*m_mapFPV)["SCT_Barrel"];
156 GeoAlignableTransform * barrelTransform = (*m_mapAXF)["SCT_Barrel"];
157 m_detectorManager->addTreeTop(barrelPV);
158
159 // Store alignable transform
160 m_detectorManager->addAlignableTransform(3, id.getWaferId(), barrelTransform, barrelPV);
161
162 }
163
164 //
165 // The Positive Z Endcap (EndcapA)
166 //
167 if (forwardPlusPresent) {
168
169 msg(MSG::DEBUG) << "Building the SCT Endcap A (positive z)." << endmsg;
170
171 m_detectorManager->numerology().addEndcap(2);
172
173 // Create the Forward
174 SCT_Forward sctForwardPlus("SCT_ForwardA", +2, m_detectorManager, m_geometryManager.get(), nullptr, m_sqliteReader, m_mapFPV, m_mapAXF);
175 SCT_Identifier idFwdPlus{m_geometryManager->athenaComps()->getIdHelper()};
176 idFwdPlus.setBarrelEC(2);
177 //GeoVPhysVol * forwardPlusPV =
178 sctForwardPlus.build(idFwdPlus);
179
180 GeoFullPhysVol *forwardPlusPV = (*m_mapFPV)["SCT_ForwardPlus"];
181 GeoAlignableTransform * fwdGeoTransformPlus = (*m_mapAXF)["SCT_ForwardPlus"];
182
183 m_detectorManager->addTreeTop(forwardPlusPV);
184
185 // Store alignable transform
186 m_detectorManager->addAlignableTransform(3, idFwdPlus.getWaferId(), fwdGeoTransformPlus, forwardPlusPV);
187 }
188
189 //
190 // The Negative Z Endcap (EndcapC)
191 //
192
193 if (forwardMinusPresent) {
194
195 msg(MSG::DEBUG) << "Building the SCT Endcap C (negative z)." << endmsg;
196
197 m_detectorManager->numerology().addEndcap(-2);
198
199 SCT_Forward sctForwardMinus("SCT_ForwardC", -2, m_detectorManager, m_geometryManager.get(), nullptr, m_sqliteReader, m_mapFPV, m_mapAXF);
200
201 SCT_Identifier idFwdMinus{m_geometryManager->athenaComps()->getIdHelper()};
202 idFwdMinus.setBarrelEC(-2);
203 //GeoVPhysVol * forwardMinusPV =
204 sctForwardMinus.build(idFwdMinus);
205
206 GeoFullPhysVol *forwardMinusPV = (*m_mapFPV)["SCT_ForwardMinus"];
207 GeoAlignableTransform * fwdGeoTransformMinus = (*m_mapAXF)["SCT_ForwardMinus"];
208 m_detectorManager->addTreeTop(forwardMinusPV);
209
210
211 // Store alignable transform
212 m_detectorManager->addAlignableTransform(3, idFwdMinus.getWaferId(), fwdGeoTransformMinus, forwardMinusPV);
213 }
214
215 // Set the neighbours
216 m_detectorManager->initNeighbours();
217
218 // Set maximum number of strips in numerology.
219 for (int iDesign = 0; iDesign < m_detectorManager->numDesigns(); iDesign++) {
220 m_detectorManager->numerology().setMaxNumPhiCells(m_detectorManager->getSCT_Design(iDesign)->cells());
221 }
222
223 // Register the keys and the level corresponding to the key
224 // and whether it expects a global or local shift.
225 // level 0: sensor, level 1: module, level 2, layer/disc, level 3: whole barrel/enccap
226
227
229
230 m_detectorManager->addAlignFolderType(InDetDD::static_run1);
231 m_detectorManager->addFolder("/Indet/Align");
232 m_detectorManager->addChannel("/Indet/Align/ID",3,InDetDD::global);
233 m_detectorManager->addChannel("/Indet/Align/SCT",2,InDetDD::global);
234
235 if (barrelPresent) {
236 m_detectorManager->addChannel("/Indet/Align/SCTB1",1,InDetDD::local);
237 m_detectorManager->addChannel("/Indet/Align/SCTB2",1,InDetDD::local);
238 m_detectorManager->addChannel("/Indet/Align/SCTB3",1,InDetDD::local);
239 m_detectorManager->addChannel("/Indet/Align/SCTB4",1,InDetDD::local);
240 }
241 if (forwardPlusPresent) {
242 m_detectorManager->addChannel("/Indet/Align/SCTEA1",1,InDetDD::local);
243 m_detectorManager->addChannel("/Indet/Align/SCTEA2",1,InDetDD::local);
244 m_detectorManager->addChannel("/Indet/Align/SCTEA3",1,InDetDD::local);
245 m_detectorManager->addChannel("/Indet/Align/SCTEA4",1,InDetDD::local);
246 m_detectorManager->addChannel("/Indet/Align/SCTEA5",1,InDetDD::local);
247 m_detectorManager->addChannel("/Indet/Align/SCTEA6",1,InDetDD::local);
248 m_detectorManager->addChannel("/Indet/Align/SCTEA7",1,InDetDD::local);
249 m_detectorManager->addChannel("/Indet/Align/SCTEA8",1,InDetDD::local);
250 m_detectorManager->addChannel("/Indet/Align/SCTEA9",1,InDetDD::local);
251 }
252 if (forwardMinusPresent) {
253 m_detectorManager->addChannel("/Indet/Align/SCTEC1",1,InDetDD::local);
254 m_detectorManager->addChannel("/Indet/Align/SCTEC2",1,InDetDD::local);
255 m_detectorManager->addChannel("/Indet/Align/SCTEC3",1,InDetDD::local);
256 m_detectorManager->addChannel("/Indet/Align/SCTEC4",1,InDetDD::local);
257 m_detectorManager->addChannel("/Indet/Align/SCTEC5",1,InDetDD::local);
258 m_detectorManager->addChannel("/Indet/Align/SCTEC6",1,InDetDD::local);
259 m_detectorManager->addChannel("/Indet/Align/SCTEC7",1,InDetDD::local);
260 m_detectorManager->addChannel("/Indet/Align/SCTEC8",1,InDetDD::local);
261 m_detectorManager->addChannel("/Indet/Align/SCTEC9",1,InDetDD::local);
262 }
263 }
264
265 else {
267 m_detectorManager->addGlobalFolder("/Indet/AlignL1/ID");
268 m_detectorManager->addGlobalFolder("/Indet/AlignL2/SCT");
269 m_detectorManager->addChannel("/Indet/AlignL1/ID",3,InDetDD::global);
270 m_detectorManager->addChannel("/Indet/AlignL2/SCT",2,InDetDD::global);
271 m_detectorManager->addFolder("/Indet/AlignL3");
272
273 if (barrelPresent) {
274 m_detectorManager->addChannel("/Indet/AlignL3/SCTB1",1,InDetDD::local);
275 m_detectorManager->addChannel("/Indet/AlignL3/SCTB2",1,InDetDD::local);
276 m_detectorManager->addChannel("/Indet/AlignL3/SCTB3",1,InDetDD::local);
277 m_detectorManager->addChannel("/Indet/AlignL3/SCTB4",1,InDetDD::local);
278 }
279 if (forwardPlusPresent) {
280 m_detectorManager->addChannel("/Indet/AlignL3/SCTEA1",1,InDetDD::local);
281 m_detectorManager->addChannel("/Indet/AlignL3/SCTEA2",1,InDetDD::local);
282 m_detectorManager->addChannel("/Indet/AlignL3/SCTEA3",1,InDetDD::local);
283 m_detectorManager->addChannel("/Indet/AlignL3/SCTEA4",1,InDetDD::local);
284 m_detectorManager->addChannel("/Indet/AlignL3/SCTEA5",1,InDetDD::local);
285 m_detectorManager->addChannel("/Indet/AlignL3/SCTEA6",1,InDetDD::local);
286 m_detectorManager->addChannel("/Indet/AlignL3/SCTEA7",1,InDetDD::local);
287 m_detectorManager->addChannel("/Indet/AlignL3/SCTEA8",1,InDetDD::local);
288 m_detectorManager->addChannel("/Indet/AlignL3/SCTEA9",1,InDetDD::local);
289 }
290 if (forwardMinusPresent) {
291 m_detectorManager->addChannel("/Indet/AlignL3/SCTEC1",1,InDetDD::local);
292 m_detectorManager->addChannel("/Indet/AlignL3/SCTEC2",1,InDetDD::local);
293 m_detectorManager->addChannel("/Indet/AlignL3/SCTEC3",1,InDetDD::local);
294 m_detectorManager->addChannel("/Indet/AlignL3/SCTEC4",1,InDetDD::local);
295 m_detectorManager->addChannel("/Indet/AlignL3/SCTEC5",1,InDetDD::local);
296 m_detectorManager->addChannel("/Indet/AlignL3/SCTEC6",1,InDetDD::local);
297 m_detectorManager->addChannel("/Indet/AlignL3/SCTEC7",1,InDetDD::local);
298 m_detectorManager->addChannel("/Indet/AlignL3/SCTEC8",1,InDetDD::local);
299 m_detectorManager->addChannel("/Indet/AlignL3/SCTEC9",1,InDetDD::local);
300 }
301 }
302
303 // Return precision to its original value
304 std::cout.precision(oldPrecision);
305
306}
#define endmsg
bool partPresent(const std::string &partName) const
void setBarrelEC(int i)
Identifier getWaferId()
@ timedependent_run2
MsgStream & msg
Definition testRead.cxx:32

◆ detStore() [1/2]

StoreGateSvc * InDetDD::DetectorFactoryBase::detStore ( )
inlineinherited

Definition at line 27 of file InDetDetectorFactoryBase.h.

27{return m_athenaComps->detStore();}

◆ detStore() [2/2]

const StoreGateSvc * InDetDD::DetectorFactoryBase::detStore ( ) const
inlineinherited

Definition at line 28 of file InDetDetectorFactoryBase.h.

28{return std::as_const(*m_athenaComps).detStore();}

◆ geoDbTagSvc()

const IGeoDbTagSvc * InDetDD::DetectorFactoryBase::geoDbTagSvc ( ) const
inlineinherited

Definition at line 30 of file InDetDetectorFactoryBase.h.

30{return std::as_const(*m_athenaComps).geoDbTagSvc();}

◆ geomDB()

const IGeometryDBSvc * InDetDD::DetectorFactoryBase::geomDB ( ) const
inlineinherited

Definition at line 34 of file InDetDetectorFactoryBase.h.

34{return m_athenaComps->geomDB();}

◆ getAthenaComps()

InDetDD::AthenaComps * InDetDD::DetectorFactoryBase::getAthenaComps ( )
inlineinherited

Definition at line 42 of file InDetDetectorFactoryBase.h.

42{return m_athenaComps;}

◆ getDetectorManager()

const SCT_DetectorManager * SCT_DetectorFactoryLite::getDetectorManager ( ) const
overridevirtual

Definition at line 309 of file SCT_DetectorFactoryLite.cxx.

310{
311 return m_detectorManager;
312}

◆ msg()

MsgStream & InDetDD::DetectorFactoryBase::msg ( MSG::Level lvl) const
inlineinherited

Definition at line 37 of file InDetDetectorFactoryBase.h.

37{ return m_athenaComps->msg(lvl); }

◆ msgLvl()

bool InDetDD::DetectorFactoryBase::msgLvl ( MSG::Level lvl)
inlineinherited

Definition at line 40 of file InDetDetectorFactoryBase.h.

40{ return m_athenaComps->msgLvl(lvl); }

◆ operator=()

const SCT_DetectorFactoryLite & SCT_DetectorFactoryLite::operator= ( const SCT_DetectorFactoryLite & right)
privatedelete

◆ rdbAccessSvc()

IRDBAccessSvc * InDetDD::DetectorFactoryBase::rdbAccessSvc ( )
inlineinherited

Definition at line 32 of file InDetDetectorFactoryBase.h.

32{return m_athenaComps->rdbAccessSvc();}

Member Data Documentation

◆ m_athenaComps

InDetDD::AthenaComps* InDetDD::DetectorFactoryBase::m_athenaComps
privateinherited

Definition at line 46 of file InDetDetectorFactoryBase.h.

◆ m_db

std::unique_ptr<SCT_DataBase> SCT_DetectorFactoryLite::m_db
private

Definition at line 59 of file SCT_DetectorFactoryLite.h.

◆ m_detectorManager

InDetDD::SCT_DetectorManager* SCT_DetectorFactoryLite::m_detectorManager {nullptr}
private

Definition at line 57 of file SCT_DetectorFactoryLite.h.

57{nullptr};

◆ m_geometryManager

std::unique_ptr<SCT_GeometryManager> SCT_DetectorFactoryLite::m_geometryManager
private

Definition at line 58 of file SCT_DetectorFactoryLite.h.

◆ m_mapAXF

std::shared_ptr<AXFMap> SCT_DetectorFactoryLite::m_mapAXF
private

Definition at line 66 of file SCT_DetectorFactoryLite.h.

◆ m_mapFPV

std::shared_ptr<FPVMap> SCT_DetectorFactoryLite::m_mapFPV
private

Definition at line 65 of file SCT_DetectorFactoryLite.h.

◆ m_sqliteReader

GeoModelIO::ReadGeoModel* SCT_DetectorFactoryLite::m_sqliteReader {nullptr}
private

Definition at line 56 of file SCT_DetectorFactoryLite.h.

56{nullptr};

◆ m_useDynamicAlignFolders

bool SCT_DetectorFactoryLite::m_useDynamicAlignFolders {false}
private

Definition at line 60 of file SCT_DetectorFactoryLite.h.

60{false};

The documentation for this class was generated from the following files: