 |
ATLAS Offline Software
|
#include <TgcReadoutGeomTool.h>
Definition at line 20 of file TgcReadoutGeomTool.h.
◆ buildReadOutElements()
Retrieve the list of full physical volumes & alignable nodes and connect them together afterwards
The keys should be formatted like <CHAMBERTYPE>_<STATIONNAME>_<STATIONETA>_<STATIONPHI> where CHAMBERTYPE has to start with TGC
Retrieve first the station Identifier
Definition at line 185 of file TgcReadoutGeomTool.cxx.
189 GeoModelIO::ReadGeoModel* sqliteReader =
m_geoDbTagSvc->getSqliteReader();
191 ATH_MSG_FATAL(
"Error, the tool works exclusively from sqlite geometry inputs");
192 return StatusCode::FAILURE;
195 FactoryCache facCache{};
198 #ifndef SIMULATIONBASE
199 auto layerBounds = std::make_shared<Acts::SurfaceBoundFactory>();
204 physNodeMap mapFPV = sqliteReader->getPublishedNodes<std::string, GeoFullPhysVol*>(
"Muon");
205 for (
auto& [
key,
pv] : mapFPV) {
209 std::vector<std::string> key_tokens =
tokenize(
key,
"_");
210 if (key_tokens.size() < 4 ||
211 !key_tokens[0].starts_with(
"TGC"))
215 const Identifier elementID = idHelper.elementID(key_tokens[1].substr(0,3),
atoi(key_tokens[2]),
atoi(key_tokens[3]),
isValid);
219 return StatusCode::FAILURE;
223 define.detElId = elementID;
224 define.chambDesign = key_tokens[0];
225 define.alignTransform =
m_geoUtilTool->findAlignableTransform(define.physVol);
226 #ifndef SIMULATIONBASE
227 define.layerBounds = layerBounds;
231 std::unique_ptr<TgcReadoutElement> readoutEle = std::make_unique<TgcReadoutElement>(std::move(define));
232 ATH_CHECK(
mgr.addTgcReadoutElement(std::move(readoutEle)));
235 return StatusCode::SUCCESS;
◆ constructRadialDesign()
Constructs a new radial strip design, if the table contains radial strips.
- Parameters
-
table | : Reference to the detector table entry defining the muonting points of the strips |
gapTrd | Pointer to the GeoShape describing the Tgc gas gap |
Definition at line 60 of file TgcReadoutGeomTool.cxx.
62 if (
table.bottomStripPos.empty()) {
65 const double halfMinX =
std::min(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
66 const double halfMaxX =
std::max(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
67 const double halfY = gapTrd->getZHalfLength();
69 auto design = std::make_unique<RadialStripDesign>();
71 design->defineTrapezoid(halfMinX, halfMaxX, halfY);
73 0.,0.,
table.bottomStripPos.size());
74 design->flipTrapezoid();
75 for (
size_t s = 0;
s <
table.bottomStripPos.size(); ++
s) {
76 design->addStrip(
table.bottomStripPos.at(
s),
◆ constructWireDesign()
Constructs a new wire group design, if the table has wires defined.
- Parameters
-
table | : Reference to the detector table entry defining the wires per group |
gapTrd | Pointer to the GeoShape describing the Tgc gas gap |
Definition at line 41 of file TgcReadoutGeomTool.cxx.
43 if (
table.wireGangs.empty()) {
46 const double halfMinX =
std::min(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
47 const double halfMaxX =
std::max(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
48 const double halfY = gapTrd->getZHalfLength();
49 auto design = std::make_unique<WireGroupDesign>();
50 design->defineTrapezoid(halfMinX, halfMaxX, halfY);
51 for (
unsigned gang :
table.wireGangs) {
52 design->declareGroup(gang);
54 const double wireOffSet = -0.5*
table.wirePitch * design->nAllWires();
◆ loadDimensions()
Loads the chamber dimensions from GeoModel.
Navigate through the GeoModel tree to find all gas volume leaves
Place the strip-readout into the readout element's sensor layouts
Wire groups measure eta & radial strips measure phi
Don't absorb the radial strip design into the same transform for the moment Acts needs first to support to measurements per surface or SpacePoints will become xAOD::UncalibratedMeasurements
Definition at line 82 of file TgcReadoutGeomTool.cxx.
85 <<std::endl<<std::endl<<
m_geoUtilTool->dumpVolume(define.physVol));
86 const GeoShape* shape =
m_geoUtilTool->extractShape(define.physVol);
89 return StatusCode::FAILURE;
92 if (shape->typeID() != GeoTrd::getClassTypeID()) {
94 <<
" is expected to be a trapezoid "<<
m_geoUtilTool->dumpShape(shape));
95 return StatusCode::FAILURE;
97 const GeoTrd* chambTrd =
static_cast<const GeoTrd*
>(shape);
98 define.halfWidthShort =
std::min(chambTrd->getYHalfLength1(), chambTrd->getYHalfLength2());
99 define.halfWidthLong =
std::max(chambTrd->getYHalfLength1(), chambTrd->getYHalfLength2());
100 define.halfHeight = chambTrd->getZHalfLength();
101 define.halfThickness = chambTrd->getXHalfLength1();
103 std::vector<physVolWithTrans> allGasGaps =
m_geoUtilTool->findAllLeafNodesByName(define.physVol,
"TgcGas");
104 if (allGasGaps.empty()) {
107 return StatusCode::FAILURE;
113 return StatusCode::SUCCESS;
115 unsigned layerIdx =
static_cast<unsigned>(layerReadout->hash());
116 if (layerIdx >= define.sensorLayouts.size()) {
118 return StatusCode::FAILURE;
120 define.sensorLayouts[layerIdx] = layerReadout;
121 return StatusCode::SUCCESS;
125 (
m_idHelperSvc->stationEta(define.detElId) > 0 ?
"A" :
"C"));
128 if (!wireReadout || !stripReadout) {
129 const wTgcTable&
table{factoryCache.parameterBook[
key]};
132 <<
" "<<define.chambDesign<<
", gasGap "<<(
gasGap+1));
133 return StatusCode::FAILURE;
135 const GeoShape* gapShape =
m_geoUtilTool->extractShape(pVolTrans.volume);
136 if (gapShape->typeID() != GeoTrd::getClassTypeID()) {
138 return StatusCode::FAILURE;
140 const GeoTrd* gapTrd =
static_cast<const GeoTrd*
>(gapShape);
144 wireDesign = (*factoryCache.wireLayouts.insert(std::move(wireDesign)).first);
147 radDesign = (*factoryCache.stripReadouts.insert(std::move(radDesign)).
first);
150 if (!wireReadout && wireDesign) {
159 if (
false && radDesign) {
160 wireReadout = std::make_unique<StripLayer>(factoryCache.trfNodeMaker.makeTransform(trans),
161 wireDesign, radDesign, layHash);
162 wireReadout->flipPhiRotation();
164 wireReadout = std::make_unique<StripLayer>(factoryCache.trfNodeMaker.makeTransform(trans),
165 wireDesign, layHash);
168 if (!stripReadout && radDesign) {
174 stripReadout = std::make_unique<StripLayer>(factoryCache.trfNodeMaker.makeTransform(trans),
178 ATH_CHECK(assignReadoutLayer(stripReadout));
179 ATH_CHECK(assignReadoutLayer(wireReadout));
183 return StatusCode::SUCCESS;
◆ readParameterBook()
StatusCode MuonGMR4::TgcReadoutGeomTool::readParameterBook |
( |
FactoryCache & |
cache | ) |
|
|
private |
Retrieves the auxillary tables from the database.
Definition at line 251 of file TgcReadoutGeomTool.cxx.
254 IRDBRecordset_ptr paramTable = accessSvc->getRecordsetPtr(
"TgcSensorLayout",
"");
255 if (paramTable->size() == 0) {
257 return StatusCode::FAILURE;
260 const std::string chambType = record->getString(
"technology");
261 const int gasGap = record->getInt(
"gasGap");
262 const std::vector<int> wireGangs{
tokenizeInt(record->getString(
"wireGangs"),
",")};
263 const std::vector<double> botStrips =
tokenizeDouble(record->getString(
"bottomStrips"),
",");
264 const std::vector<double> topStrips =
tokenizeDouble(record->getString(
"topStrips"),
",");
265 const std::vector<std::string>
sides =
tokenize(record->getString(
"side"),
";");
266 const double wirePitch = record->getDouble(
"wirePitch");
269 wTgcTable& parBook{cache.parameterBook[
key]};
270 parBook.wireGangs.insert(parBook.wireGangs.end(), wireGangs.begin(), wireGangs.end());
271 parBook.bottomStripPos = botStrips;
272 parBook.topStripPos = topStrips;
273 parBook.wirePitch = wirePitch;
278 ATH_MSG_DEBUG(
"Read in total "<<cache.parameterBook.size()<<
" chamber layouts");
279 return StatusCode::SUCCESS;
◆ writeSectorMapping()
Map the Tgc sectors to the classical Muon System sectors.
Map the Tgc sectors to the classic muon sectors
Definition at line 237 of file TgcReadoutGeomTool.cxx.
239 std::vector<const TgcReadoutElement*> tgcReadOutEles =
mgr.getAllTgcReadoutElements();
240 std::unique_ptr<std::vector<int>> tgcSectorMapping = std::make_unique<std::vector<int>>();
241 tgcSectorMapping->resize(
m_idHelperSvc->tgcIdHelper().module_hash_max());
244 for (
const TgcReadoutElement* readoutEle : tgcReadOutEles) {
245 int& sectNumb = (*tgcSectorMapping)[
m_idHelperSvc->moduleHash(readoutEle->identify())];
246 sectNumb = sectorMapping.getSector(readoutEle->center(gctx).phi());
249 return StatusCode::SUCCESS;
◆ m_geoDbTagSvc
◆ m_geoUtilTool
PublicToolHandle<IMuonGeoUtilityTool> MuonGMR4::TgcReadoutGeomTool::m_geoUtilTool {this,"GeoUtilTool", "" } |
|
private |
◆ m_idHelperSvc
Initial value:{this, "IdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
Definition at line 30 of file TgcReadoutGeomTool.h.
The documentation for this class was generated from the following files:
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
std::vector< double > tokenizeDouble(const std::string &the_str, std::string_view delimiter)
constexpr std::initializer_list< unsigned int > sides
Eigen::Matrix< double, 2, 1 > Vector2D
std::vector< int > tokenizeInt(const std::string &the_str, std::string_view delimiter)
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
#define ATH_MSG_VERBOSE(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
Amg::Transform3D getRotateX3D(double angle)
get a rotation transformation around X-axis
GeoModel::TransientConstSharedPtr< WireGroupDesign > WireDesignPtr
Eigen::Affine3d Transform3D
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Include the GeoPrimitives which need to be put first.
IMuonGeoUtilityTool::physVolWithTrans physVolWithTrans
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
GeoModel::TransientConstSharedPtr< RadialStripDesign > RadialStripDesignPtr
static IdentifierHash constructHash(unsigned measCh, unsigned gasGap, const bool isStrip)
Constructs the Hash out of the Identifier fields (channel, gasGap, isStrip)
std::unique_ptr< IRDBRecord > IRDBRecord_ptr
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
GeoIntrusivePtr< GeoVFullPhysVol > physVol
Pointer to the underlying physical volume in GeoModel.
RpcReadoutElement::defineArgs defineArgs