ATLAS Offline Software
Loading...
Searching...
No Matches
MuonGMR4::ReadoutGeomCnvAlg Class Reference

#include <ReadoutGeomCnvAlg.h>

Inheritance diagram for MuonGMR4::ReadoutGeomCnvAlg:
Collaboration diagram for MuonGMR4::ReadoutGeomCnvAlg:

Classes

struct  ConstructionCache
 Cache object holding the constructed detector manager, and the intermediate GeoModel objects needed to build the legacy readout geometry. More...

Public Member Functions

 ~ReadoutGeomCnvAlg ()=default
StatusCode execute (const EventContext &ctx) const override
StatusCode initialize () override
virtual bool isReEntrant () const override
 Avoid scheduling algorithm multiple times.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode buildStation (const ActsTrk::GeometryContext &gctx, const Identifier &stationId, ConstructionCache &cacheObj) const
 builds a station object from readout element.
StatusCode cloneReadoutVolume (const ActsTrk::GeometryContext &gctx, const Identifier &stationId, ConstructionCache &cacheObj, GeoIntrusivePtr< GeoVFullPhysVol > &clonedPhysVol, MuonGM::MuonStation *&station) const
 Clones the fullPhysical volume of the readoutElement and embeds it into the associated station.
GeoIntrusivePtr< GeoVFullPhysVol > cloneNswWedge (const ActsTrk::GeometryContext &gctx, const MuonGMR4::MuonReadoutElement &nswRE, ConstructionCache &cacheObj) const
 Clones the full phyical volume associated to the NSw readout element.
StatusCode buildMdt (const ActsTrk::GeometryContext &gctx, ConstructionCache &cacheObj) const
 Converts all Mdt readout elements from the R4 format into the legacy Trk format.
StatusCode buildRpc (const ActsTrk::GeometryContext &gctx, ConstructionCache &cacheObj) const
 Converts all Rpc readout elements from the R4 format into the legacy Trk format.
StatusCode buildSTGC (const ActsTrk::GeometryContext &gctx, ConstructionCache &cacheObj) const
 Converts all sTgc readout elements from the R4 format into the legacy Trk format.
StatusCode buildMM (const ActsTrk::GeometryContext &gctx, ConstructionCache &cacheObj) const
 Converts all Mm readout elements from the R4 format into the legacy Trk format.
StatusCode buildTgc (const ActsTrk::GeometryContext &gctx, ConstructionCache &cacheObj) const
 Converts all Tgc readout elements from the R4 format into the legacy Trk format.
StatusCode dumpAndCompare (const ActsTrk::GeometryContext &gctx, const MuonGMR4::RpcReadoutElement &refEle, const MuonGM::RpcReadoutElement &testEle) const
 Compares the R4 readout element with the constructed Trk readout element.
StatusCode dumpAndCompare (const ActsTrk::GeometryContext &gctx, const MuonGMR4::MdtReadoutElement &refEle, const MuonGM::MdtReadoutElement &testEle) const
 Compares the R4 readout element with the constructed Trk readout element.
StatusCode dumpAndCompare (const ActsTrk::GeometryContext &gctx, const MuonGMR4::MmReadoutElement &refEle, const MuonGM::MMReadoutElement &testEle) const
 Compares the R4 readout element with the constructed Trk readout element.
StatusCode dumpAndCompare (const ActsTrk::GeometryContext &gctx, const MuonGMR4::TgcReadoutElement &refEle, const MuonGM::TgcReadoutElement &testEle) const
 Compares the R4 readout element with the constructed Trk readout element.
StatusCode dumpAndCompare (const ActsTrk::GeometryContext &gctx, const MuonGMR4::sTgcReadoutElement &refEle, const MuonGM::sTgcReadoutElement &testEle) const
 Compares the R4 readout element with the constructed Trk readout element.
StatusCode checkIdCompability (const MuonGMR4::MuonReadoutElement &refEle, const MuonGM::MuonReadoutElement &testEle) const
 Checks whether the Identifier fields of both readout elements are identical.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
SG::WriteCondHandleKey< MuonGM::MuonDetectorManagerm_writeKey {this, "WriteKey", "MuonDetectorManager"}
SG::ReadCondHandleKeyArray< ActsTrk::DetectorAlignStorem_alignStoreKeys {this, "AlignmentKeys", {}, "Alignment key"}
Gaudi::Property< bool > m_checkGeo {this, "checkGeo", false, "Checks the positions of the sensors"}
Gaudi::Property< bool > m_dumpGeo {this, "dumpGeo", false, "Dumps the constructed geometry"}
Gaudi::Property< bool > m_splitTrfCache {this, "splitTrfCache", false, ""}
 Instantiate a new transform cache to ensure lazy transform population in the event processing.
Gaudi::Property< std::string > m_geoDumpName {this,"geoDumpName", "ConvMuonGeoModel.db",}
const MuonGMR4::MuonDetectorManagerm_detMgr {nullptr}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 32 of file ReadoutGeomCnvAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~ReadoutGeomCnvAlg()

MuonGMR4::ReadoutGeomCnvAlg::~ReadoutGeomCnvAlg ( )
default

Member Function Documentation

◆ buildMdt()

StatusCode MuonGMR4::ReadoutGeomCnvAlg::buildMdt ( const ActsTrk::GeometryContext & gctx,
ConstructionCache & cacheObj ) const
private

Converts all Mdt readout elements from the R4 format into the legacy Trk format.

Parameters
gctxCurrent geometry context carrying the current alignment
cacheObjMutable reference to the GeoModel constuction cache

Access the B-Line and As-built parameters

Build the mother station

1 cm is added as safety margin to the Mdt multilayer envelope

Need to check how to obtain this parameter from the new geometry newElement->m_cutoutShift;

Determine the tube length's

Define the tube staggering

Add the readout element to the detector manager

Definition at line 694 of file ReadoutGeomCnvAlg.cxx.

694 {
696 SubDetAlignment alignItr = gctx.getStore(ActsTrk::DetectorType::Mdt);
697 const MdtAlignmentStore* alignStore = alignItr ?
698 static_cast<const MdtAlignmentStore*>(alignItr->internalAlignment.get()) : nullptr;
699
700 const std::vector<const MuonGMR4::MdtReadoutElement*> mdtReadOuts{m_detMgr->getAllMdtReadoutElements()};
701 ATH_MSG_INFO("Copy "<<mdtReadOuts.size()<<" Mdt readout elements to the legacy system");
702 for (const MuonGMR4::MdtReadoutElement* copyMe : mdtReadOuts) {
703 const Identifier reId = copyMe->identify();
704 ATH_MSG_DEBUG("Translate "<<m_idHelperSvc->toStringDetEl(reId));
706 GeoIntrusivePtr<GeoVFullPhysVol> physVol{};
707 MuonGM::MuonStation* station{nullptr};
708 ATH_CHECK(cloneReadoutVolume(gctx,reId, cacheObj, physVol, station));
709 if (copyMe->multilayer() == 1) {
710 const MuonGMR4::MdtReadoutElement* otherRE = copyMe->complementaryRE();
711 const double height = std::max(copyMe->moduleHeight(), otherRE->moduleHeight()) -
712 (copyMe->tubePitch() - 2. * copyMe->tubeRadius());
713
714 const double modHalTHickO{0.5*otherRE->moduleThickness()},
715 modHalfThick{-0.5*copyMe->moduleThickness()};
716
717 const double thickness = ( (otherRE->asBuiltRefFrame()*(modHalTHickO* Amg::Vector3D::UnitX())) -
718 (copyMe->asBuiltRefFrame()*(modHalfThick* Amg::Vector3D::UnitX()))).z();
719 if (copyMe->isBarrel()) {
720 station->setMdtZsize(height);
721 station->setMdtRsize(thickness);
722 } else {
723 station->setMdtRsize(height);
724 station->setMdtZsize(thickness);
725 }
726 }
727 const MuonGMR4::MdtReadoutElement::parameterBook& pars{copyMe->getParameters()};
728 auto newElement = std::make_unique<MuonGM::MdtReadoutElement>(physVol,
729 m_idHelperSvc->stationNameString(reId),
730 cacheObj.detMgr.get());
731 newElement->setIdentifier(reId);
732 newElement->setMultilayer(copyMe->multilayer());
733 newElement->setNMdtInStation(m_idHelperSvc->mdtIdHelper().multilayerMax(reId));
734 // cppcheck-suppress invalidLifetime; ok: mgr took ownership.
735 newElement->setParentMuonStation(station);
736
738 newElement->setLongSsize(2*pars.longHalfX - 1._cm);
739 newElement->setSsize(2*pars.shortHalfX - 1._cm);
740 newElement->setLongRsize(2*pars.halfY);
741 newElement->setRsize(2*pars.halfY);
742 newElement->setZsize(2*pars.halfHeight);
743 newElement->setLongZsize(2*pars.halfHeight);
744
745 newElement->m_nlayers = copyMe->numLayers();
746 newElement->m_ntubesperlayer = copyMe->numTubesInLay();
747 newElement->m_deadlength = pars.deadLength;
748 newElement->m_endpluglength = pars.endPlugLength;
749 newElement->m_innerRadius = pars.tubeInnerRad;
750 newElement->m_tubeWallThickness = pars.tubeWall;
751 newElement->m_tubepitch = pars.tubePitch;
754
756 const MuonGMR4::MdtTubeLayer& tubeLay{*pars.tubeLayers[0]};
757 unsigned int step{1};
758 double lastLength{2.*tubeLay.uncutHalfLength(1)};
759 for (unsigned tube = 0; tube < copyMe->numTubesInLay(); ++tube) {
760 const double currLength = 2.*tubeLay.uncutHalfLength(tube);
761 ATH_MSG_VERBOSE(m_idHelperSvc->toString(copyMe->identify())<< ", tube "<<tube<<", length: "<<currLength);
762 if (std::abs(lastLength - currLength) > std::numeric_limits<float>::epsilon() ||
763 tube == copyMe->numTubesInLay() -1) {
764 newElement->m_tubelength[step-1] = lastLength;
765 newElement->m_tubelength[step] = currLength;
766 if (step == 1) {
767 newElement->m_ntubesinastep = tube;
768 }
769 lastLength = currLength;
770 ++step;
771 }
772 }
773 newElement->m_nsteps = step;
774
776 double xOffSet{pars.halfY}, yOffSet{pars.halfHeight};
777 if (newElement->barrel()) std::swap(xOffSet, yOffSet);
778 for (unsigned lay = 1; lay <= copyMe->numLayers(); ++lay) {
779 const IdentifierHash tubeHash{copyMe->measurementHash(lay, 1)};
780 const Amg::Vector3D locTube = copyMe->localTubePos(tubeHash);
781 newElement->m_firstwire_x[lay-1] = locTube.z() + xOffSet;
782 newElement->m_firstwire_y[lay-1] = locTube.x() + yOffSet;
783 }
784 MdtAlignmentStore::chamberDistortions distort = alignStore ? alignStore->getDistortion(reId) :
785 MdtAlignmentStore::chamberDistortions{};
786
787 if (!station->hasMdtAsBuiltParams()){
788 station->setMdtAsBuiltParams(distort.asBuilt);
789 }
790 if (!station->hasBLines()){
791 station->setBline(distort.bLine);
792 }
793 const Amg::Vector3D refPoint = copyMe->bLineReferencePoint();
794 station->setBlineFixedPointInAmdbLRS(refPoint.x(), refPoint.y(), refPoint.z());
795
796 newElement->geoInitDone();
797 newElement->setBLinePar(distort.bLine);
798 newElement->fillCache();
799 ATH_CHECK(dumpAndCompare(gctx, *copyMe, *newElement));
801 cacheObj.detMgr->addMdtReadoutElement(std::move(newElement));
802 }
803 return StatusCode::SUCCESS;
804}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
AlignmentStorePtr & getStore(const DetectorType type)
Returns the mutable alignable store for the ATLAS detector type (Pixel, Mdt, etc.)
chamberDistortions getDistortion(const Identifier &detElId) const
Returns a chamber distortion that's cached for the corresponding Mdt chamber element.
double moduleHeight() const
Returns the height of the chamber (Distance bottom - topWidth)
Amg::Transform3D asBuiltRefFrame() const
Returns the transformation to go into the reference frame of the as-buit & b-line model starting from...
double moduleThickness() const
Returns the thickness of the chamber.
double uncutHalfLength(const unsigned int tube) const
Returns the uncut-half length of the given tube.
StatusCode cloneReadoutVolume(const ActsTrk::GeometryContext &gctx, const Identifier &stationId, ConstructionCache &cacheObj, GeoIntrusivePtr< GeoVFullPhysVol > &clonedPhysVol, MuonGM::MuonStation *&station) const
Clones the fullPhysical volume of the readoutElement and embeds it into the associated station.
StatusCode dumpAndCompare(const ActsTrk::GeometryContext &gctx, const MuonGMR4::RpcReadoutElement &refEle, const MuonGM::RpcReadoutElement &testEle) const
Compares the R4 readout element with the constructed Trk readout element.
const MuonGMR4::MuonDetectorManager * m_detMgr
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
void setBlineFixedPointInAmdbLRS(double s0, double z0, double t0)
bool hasBLines() const
void setMdtAsBuiltParams(const MdtAsBuiltPar *xtomo)
void setMdtRsize(const double rSize)
void setMdtZsize(const double zSize)
void setBline(const BLinePar *bline)
bool hasMdtAsBuiltParams() const
@ Mdt
MuonSpectrometer.
Eigen::Matrix< double, 3, 1 > Vector3D
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)

◆ buildMM()

StatusCode MuonGMR4::ReadoutGeomCnvAlg::buildMM ( const ActsTrk::GeometryContext & gctx,
ConstructionCache & cacheObj ) const
private

Converts all Mm readout elements from the R4 format into the legacy Trk format.

Parameters
gctxCurrent geometry context carrying the current alignment
cacheObjMutable reference to the GeoModel constuction cache

Loop over the gas gaps & efine the

Definition at line 521 of file ReadoutGeomCnvAlg.cxx.

521 {
522
523 SubDetAlignment alignItr = gctx.getStore(ActsTrk::DetectorType::Mm);
524 const auto alignStore = alignItr ?
525 static_cast<const MmAlignmentStore*>(alignItr->internalAlignment.get()) : nullptr;
526
527 if (alignStore) {
528 cacheObj.detMgr->setMMPassivation(alignStore->passivation);
529 }
530 const std::vector<const MuonGMR4::MmReadoutElement*> mmReadouts{m_detMgr->getAllMmReadoutElements()};
531 ATH_MSG_INFO("Copy "<<mmReadouts.size()<<" Mm readout elements to the legacy system");
532
533 for (const MuonGMR4::MmReadoutElement* copyMe : mmReadouts) {
534 const Identifier reId = copyMe->identify();
535 GeoIntrusivePtr<GeoVFullPhysVol> physVol{cloneNswWedge(gctx, *copyMe, cacheObj)};
536 auto newRE = std::make_unique<MuonGM::MMReadoutElement>(physVol,
537 m_idHelperSvc->stationNameString(reId),
538 copyMe->stationEta(),
539 copyMe->stationPhi(),
540 copyMe->multilayer(), cacheObj.detMgr.get());
542 for (unsigned int gasGap = 0; gasGap < copyMe->nGasGaps(); ++gasGap) {
543 const MuonGMR4::StripLayer& stripLayer{copyMe->stripLayer(MuonGMR4::MmReadoutElement::createHash(gasGap +1, 0))};
544 const MuonGMR4::StripDesign& designFrom{stripLayer.design()};
545
546 newRE->m_Xlg[gasGap] = stripLayer.toOrigin() *
547 Amg::getRotateZ3D(-designFrom.stereoAngle()) *
548 Amg::getRotateY3D(90. * Gaudi::Units::deg);
549 ATH_MSG_VERBOSE("Layer transform "<<gasGap<<" "<<GeoTrf::toString(newRE->m_Xlg[gasGap], true));
550
551 MuonGM::MuonChannelDesign& designTo{newRE->m_etaDesign[gasGap]};
552 designTo.defineTrapezoid(designFrom.shortHalfHeight(),
553 designFrom.longHalfHeight(),
554 designFrom.halfWidth(),
555 designFrom.stereoAngle());
558 designTo.inputPitch = designFrom.stripPitch();
559 designTo.inputWidth = designTo.inputPitch * std::cos(designTo.stereoAngle());
560 designTo.nMissedBottomEta = designTo.nMissedBottomStereo = designFrom.firstStripNumber() - 1;
561 designTo.totalStrips = designFrom.numStrips();
562 designTo.nch = designFrom.numStrips();
563
564 designTo.setFirstPos(designFrom.firstStripPos().x() + 0.5*designTo.inputPitch);
565 }
566
567 newRE->fillCache();
568 if (alignStore && alignStore->getBLine(reId)) {
569 newRE->setBLinePar(*alignStore->getBLine(reId));
570 }
571 ATH_CHECK(dumpAndCompare(gctx, *copyMe, *newRE));
572 cacheObj.detMgr->addMMReadoutElement(std::move(newRE));
573 }
574 return StatusCode::SUCCESS;
575}
static IdentifierHash createHash(const int gasGap, const int strip)
GeoIntrusivePtr< GeoVFullPhysVol > cloneNswWedge(const ActsTrk::GeometryContext &gctx, const MuonGMR4::MuonReadoutElement &nswRE, ConstructionCache &cacheObj) const
Clones the full phyical volume associated to the NSw readout element.
double halfWidth() const
Returns the half height of the strip panel.
double stereoAngle() const
Returns the value of the stereo angle.
int firstStripNumber() const
Returns the number of the first strip.
const Amg::Vector2D & firstStripPos() const
Vector indicating the first strip position.
double stripPitch() const
Distance between two adjacent strips.
double shortHalfHeight() const
Returns the shorter half height of the panel.
double longHalfHeight() const
Returns the longer half height of the panel.
virtual int numStrips() const
Number of strips on the panel.
const StripDesign & design(bool phiView=false) const
Returns the underlying strip design.
const Amg::Transform3D & toOrigin() const
Returns the transformation to go from the strip layer center to the origin of the Strip chamber.
@ Mm
Maybe not needed in the migration.
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
double stereoAngle() const
returns the stereo angle
void defineTrapezoid(double HalfShortY, double HalfLongY, double HalfHeight)
set the trapezoid dimensions
void setFirstPos(const double pos)
Set the position of the first strip along the x-axis.

◆ buildRpc()

StatusCode MuonGMR4::ReadoutGeomCnvAlg::buildRpc ( const ActsTrk::GeometryContext & gctx,
ConstructionCache & cacheObj ) const
private

Converts all Rpc readout elements from the R4 format into the legacy Trk format.

Parameters
gctxCurrent geometry context carrying the current alignment
cacheObjMutable reference to the GeoModel constuction cache

Define the dimensions

Hack to assign the proper strip positions for REs having doubletPhi =2 in their Identifier

Resignment in face of the rpc readout geometry. Overwrite all the parameters

Definition at line 312 of file ReadoutGeomCnvAlg.cxx.

312 {
313
314 const std::vector<const MuonGMR4::RpcReadoutElement*> readoutEles = m_detMgr->getAllRpcReadoutElements();
315 ATH_MSG_INFO("Copy "<<readoutEles.size()<<" Rpc readout elements to the legacy system");
316 const RpcIdHelper& idHelper{m_idHelperSvc->rpcIdHelper()};
317 for (const MuonGMR4::RpcReadoutElement* copyMe : readoutEles) {
318 const Identifier reId = copyMe->identify();
319 const MuonGMR4::RpcReadoutElement::parameterBook& pars{copyMe->getParameters()};
320 GeoIntrusivePtr<GeoVFullPhysVol> physVol{};
321 MuonGM::MuonStation* station{nullptr};
322 ATH_CHECK(cloneReadoutVolume(gctx, reId, cacheObj, physVol, station));
323 auto newElement = std::make_unique<MuonGM::RpcReadoutElement>(physVol,
324 m_idHelperSvc->stationNameString(reId),
325 1, 1, false, cacheObj.detMgr.get());
326 newElement->setDoubletPhi(copyMe->doubletPhi());
327 newElement->setDoubletR(copyMe->doubletR());
328 newElement->setDoubletZ(copyMe->doubletZ());
329 newElement->setIdentifier(reId);
330 newElement->setParentMuonStation(station);
331 station->addMuonReadoutElementWithAlTransf(newElement.get(), nullptr, station->nMuonReadoutElements());
332
334 newElement->setLongZsize(2.*pars.halfLength);
335 newElement->setLongSsize(2.*pars.halfWidth);
336 newElement->setLongRsize(2.*pars.halfThickness);
337 newElement->setZsize(2.*pars.halfLength);
338 newElement->setSsize(2.*pars.halfWidth);
339 newElement->setRsize(2.*pars.halfThickness);
340
341 newElement->m_nlayers = copyMe->nGasGaps();
342 newElement->m_phistripwidth = copyMe->stripPhiWidth();
343 newElement->m_etastripwidth = copyMe->stripEtaWidth();
344 newElement->m_phistrippitch = copyMe->stripPhiPitch();
345 newElement->m_etastrippitch = Acts::copySign(1., copyMe->stationEta() -
346 (copyMe->stationEta()==0))*copyMe->stripEtaPitch();
347 newElement->m_phistriplength = copyMe->stripPhiLength();
348 newElement->m_etastriplength = copyMe->stripEtaLength();
349
350 newElement->m_nphistripsperpanel = copyMe->nPhiStrips();
351 newElement->m_netastripsperpanel = copyMe->nEtaStrips();
352 newElement->m_nphistrippanels = copyMe->nPhiPanels();
353 newElement->m_hasDEDontop = true;
354 newElement->m_descratzneg = false;
355
356 std::vector<Identifier> gapIds{};
357 for (unsigned int gasGap = 1; gasGap <= copyMe->nGasGaps(); ++gasGap) {
358 for (int doubPhi = copyMe->doubletPhiMax(); doubPhi >= copyMe->doubletPhi(); --doubPhi) {
359 for (bool measPhi : {false, true}) {
360 if (measPhi && copyMe->nPhiStrips()==0) continue;
361 const int channel = 1;
362 const Identifier gapId = idHelper.channelID(copyMe->identify(),
363 copyMe->doubletZ(),
364 doubPhi, gasGap, measPhi,
365 channel);
366
367 gapIds.push_back(gapId);
368 const Amg::Vector3D locStripPos = amdbTransform(gctx, *copyMe).inverse() * copyMe->stripPosition(gctx, gapId);
369 ATH_MSG_VERBOSE("GasGap "<<m_idHelperSvc->toString(gapId)<<", local strip position: "<<Amg::toString(locStripPos));
370 newElement->m_gasGap_xPos[gasGap -1] = locStripPos.x();
373 const int dbPIdx = copyMe->doubletPhi() == 2 ? 1 : doubPhi;
374 if (measPhi) {
375 newElement->m_first_phistrip_s[dbPIdx -1] = locStripPos.y();
376 newElement->m_phistrip_z = locStripPos.z();
377 } else{
378 newElement->m_first_etastrip_z = locStripPos.z();
379 newElement->m_etastrip_s[dbPIdx-1] = locStripPos.y();
380 }
381 }
382 }
383 }
384 newElement->fillCache();
386 for (const Identifier& gapId : gapIds) {
387 const int surfaceHash = newElement->surfaceHash(gapId);
388 const int layerHash = newElement->layerHash(gapId);
389 const Amg::Transform3D refTrf{copyMe->localToGlobalTransform(gctx, gapId)*
390 (m_idHelperSvc->measuresPhi(gapId) ?
391 Amg::getRotateZ3D(90_degree) :
392 Amg::Transform3D::Identity())};
393 ATH_MSG_VERBOSE("Assign transform: "<<m_idHelperSvc->toString(gapId)<<", "<<Amg::toString(refTrf));
394 newElement->m_surfaceData->m_layerTransforms[surfaceHash] = refTrf;
395 newElement->m_surfaceData->m_layerCenters[layerHash] = refTrf.translation();
396 newElement->m_surfaceData->m_layerNormals[layerHash] = refTrf.linear() * Amg::Vector3D::UnitZ();
397 }
398 ATH_CHECK(dumpAndCompare(gctx, *copyMe, *newElement));
399 cacheObj.detMgr->addRpcReadoutElement(std::move(newElement));
400 }
401 return StatusCode::SUCCESS;
402}
int nMuonReadoutElements() const
void addMuonReadoutElementWithAlTransf(MuonReadoutElement *a, GeoAlignableTransform *ptrsf, int jobIndex)
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Affine3d Transform3D
IdentifierHash layerHash(const UncalibratedMeasurement *meas)
Returns the layer hash from an uncalibrated meaurement.

◆ buildStation()

StatusCode MuonGMR4::ReadoutGeomCnvAlg::buildStation ( const ActsTrk::GeometryContext & gctx,
const Identifier & stationId,
ConstructionCache & cacheObj ) const
private

builds a station object from readout element.

The parent PhysVol of the readoutElement is interpreted as embedding station volume and all children which are not fullPhysical volumes are attached to the copied clone.

Parameters
gctxCurrent geometry context carrying the current alignment
stationIdIdentifier of the station encoding stName, stEta, stPhi
cacheObjMutable reference to the GeoModel constuction cache

Fetch the readout element to get its parent volume

Retrieve the full phyiscal volume

There is one alignable node in front of the

Check whether the alignable node is displaced from the station

Copy the full physical volume of the muon station

Make sure to copy all the children from the original tree that're not FullPhysVols -> represent They represent the passive material inside the station and are needed for the TrackinGeometry building

Skip the full physical volumes as they represent the readout elements

To create the muon station, we need to extract the dimensions --> Recieve the edge points from the shapes

Fetch the transform of the detector element which is AlignableNode x Station x [relative pos in station]

S / R / Z size

S / R / Z size (long)

Add the physical volume to the world

Definition at line 158 of file ReadoutGeomCnvAlg.cxx.

160 {
161 const std::string stName{m_idHelperSvc->stationNameString(stationId)};
162 const int stEta{m_idHelperSvc->stationEta(stationId)};
163 const int stPhi{m_idHelperSvc->stationPhi(stationId)};
164 MuonGM::MuonStation* station = cacheObj.detMgr->getMuonStation(stName, stEta, stPhi);
165 if (station) {
166 ATH_MSG_DEBUG("Station "<<stName<<", stEta: "<<stEta<<", stPhi: "<<stPhi<<" already exists.");
167 return StatusCode::SUCCESS;
168 }
170 const MuonGMR4::MuonReadoutElement* copyMe = m_detMgr->getReadoutElement(stationId);
171
173 const GeoVFullPhysVol* readOutVol = copyMe->getMaterialGeom();
174 // This is the physical volume that contains the readOutVol as a child.
175 PVConstLink parentVolume = readOutVol->getParent();
176
177 const GeoAlignableTransform* alignTrf{copyMe->alignableTransform()};
178
180 GeoIntrusivePtr<const GeoGraphNode> alignNode{*(parentVolume->getParent()->findChildNode(alignTrf) + 1)};
182 GeoIntrusivePtr<const GeoTransform> stationShiftNode{alignNode != parentVolume ?
183 dynamic_pointer_cast<const GeoTransform>(alignNode) : nullptr};
184
185 cacheObj.translatedStations.insert(parentVolume);
187 PVLink copiedStationVol{};
188 if (!stationShiftNode) {
189 copiedStationVol = make_intrusive<GeoFullPhysVol>(parentVolume->getLogVol());
190 } else {
191 auto volToCopy = parentVolume->getLogVol();
192 auto newShape = cacheObj.cacheShape(make_intrusive<GeoShapeShift>(volToCopy->getShape(),
193 stationShiftNode->getDefTransform()));
194 auto newLogVol = make_intrusive<GeoLogVol>(volToCopy->getName(), newShape, volToCopy->getMaterial());
195 copiedStationVol = make_intrusive<GeoFullPhysVol>(cacheObj.cacheVolume(newLogVol));
196 }
197
200 const std::vector<GeoChildNodeWithTrf> children = getChildrenWithRef(parentVolume, false); // we get the list of child nodes attached to the parent volume
201 double minX{1.e9}, maxX{-1.e9}, minY1{1.e9}, maxY1{-1.e9}, minY2{1.e9}, maxY2{-1.e9}, minZ{1.e9}, maxZ{-1.e9};
202 for (const GeoChildNodeWithTrf& child : children) {
203 std::vector<Amg::Vector3D> edges = getPolyShapeEdges(child.volume->getLogVol()->getShape(), //we are getting corner points of the edges
204 readOutVol->getX().inverse() * child.transform); //getX() returns the transformation from readout physical volume ref to parent physical volume ref. We take the inverse and we chain it with child.transform, which is from child ref to parent ref
205 for (const Amg::Vector3D& edge : edges) {
206 minX = std::min(minX, edge.x());
207 maxX = std::max(maxX, edge.x());
208 minZ = std::min(minZ, edge.z());
209 maxZ = std::max(maxZ, edge.z());
210 if (edge.z() < 0) {
211 minY1 = std::min(minY1, edge.y());
212 maxY1 = std::max(maxY1, edge.y());
213 } else {
214 minY2 = std::min(minY2, edge.y());
215 maxY2 = std::max(maxY2, edge.y());
216 }
217 }
219 const GeoVPhysVol &childVolRef = *child.volume;
220 if (typeid(childVolRef) == typeid(GeoFullPhysVol)) {
221 continue;
222 }
223 // Add the beam lines / foams inside the station volume
224 PVLink childVol = const_pointer_cast<GeoVPhysVol>(child.volume);
225 copiedStationVol->add(cacheObj.newIdTag());
226 if (stationShiftNode) {
227 copiedStationVol->add(const_pointer_cast(stationShiftNode));
228 }
229 copiedStationVol->add(cacheObj.makeTransform(child.transform));
230 copiedStationVol->add(cloneVolume(childVol));
231 }
232
235 const double shortS = (maxY1 - minY1);
236 const double longS = (maxY2 - minY2);
237 const double lengthR = (maxX - minX);
238 const double lengthZ = (maxZ - minZ);
239
241 const Amg::Transform3D alignedTransform = amdbTransform(gctx, *copyMe) *
242 ( ( stationShiftNode ? stationShiftNode->getDefTransform() : Amg::Transform3D::Identity())
243 * readOutVol->getDefX()).inverse();
244
245
246 auto newStation = std::make_unique<MuonGM::MuonStation>(stName,
247 shortS, lengthR, lengthZ,
248 longS, lengthR, lengthZ,
249 stEta, stPhi, false);
250 newStation->setPhysVol(copiedStationVol);
252 cacheObj.world->add(cacheObj.newIdTag());
253 auto copyAlignNode = make_intrusive<GeoAlignableTransform>(alignedTransform);
254 newStation->setTransform(copyAlignNode);
255 newStation->setNominalAmdbLRSToGlobal(copyAlignNode->getTransform());
256
257 ATH_MSG_VERBOSE("stName: "<<stName<<", stEta: "<<stEta<<", stPhi: "<<stPhi
258 <<" -- shortS: "<<shortS<<", longS: "<<longS
259 <<", lengthR: "<<lengthR<<", lengthZ: "<<lengthZ
260 <<std::endl<<"AlignableNode: "<<GeoTrf::toString(alignedTransform, true)
261 <<std::endl<<"Station shift: "<<GeoTrf::toString(stationShiftNode ? stationShiftNode->getDefTransform()
262 : Amg::Transform3D::Identity(), true)
263 <<std::endl<<"AmdLRSToGlobal: "<<GeoTrf::toString(newStation->getNominalAmdbLRSToGlobal(), true)
264 <<std::endl<<"Readout transform: "<<GeoTrf::toString(readOutVol->getX(), true));
265 cacheObj.detMgr->addMuonStation(std::move(newStation));
266 cacheObj.world->add(copyAlignNode);
267 cacheObj.world->add(copiedStationVol);
268 return StatusCode::SUCCESS;
269}
const GeoAlignableTransform * alignableTransform() const
Return the alignable transform node of the readout element.
const std::string & stName(StIndex index)
convert StIndex into a string

◆ buildSTGC()

StatusCode MuonGMR4::ReadoutGeomCnvAlg::buildSTGC ( const ActsTrk::GeometryContext & gctx,
ConstructionCache & cacheObj ) const
private

Converts all sTgc readout elements from the R4 format into the legacy Trk format.

Parameters
gctxCurrent geometry context carrying the current alignment
cacheObjMutable reference to the GeoModel constuction cache

Initialize the eta design

Initialize the phi design

To circumvent the yCutout calculations in padCorner function in MuonPadDesign

Definition at line 577 of file ReadoutGeomCnvAlg.cxx.

577 {
578 SubDetAlignment alignItr = gctx.getStore(ActsTrk::DetectorType::sTgc);
579 auto alignStore = alignItr ? static_cast<const sTgcAlignmentStore*>(alignItr->internalAlignment.get()) : nullptr;
580
581 const std::vector<const MuonGMR4::sTgcReadoutElement*> sTgcReadOuts{m_detMgr->getAllsTgcReadoutElements()};
582 ATH_MSG_INFO("Copy "<<sTgcReadOuts.size()<<" sTgc readout elements to the legacy system");
583
584 for (const MuonGMR4::sTgcReadoutElement* copyMe : sTgcReadOuts) {
585 const Identifier reId = copyMe->identify();
586 ATH_MSG_DEBUG("Translate readout element "<<m_idHelperSvc->toStringDetEl(reId)<<".");
587 GeoIntrusivePtr<GeoVFullPhysVol> physVol{cloneNswWedge(gctx, *copyMe, cacheObj)};
588
589 auto newRE = std::make_unique<MuonGM::sTgcReadoutElement>(physVol,
590 m_idHelperSvc->stationNameString(reId).substr(1),
591 copyMe->stationEta(),
592 copyMe->stationPhi(),
593 copyMe->multilayer(),
594 cacheObj.detMgr.get());
595
596 if (alignStore && alignStore->getBLine(reId)) {
597 newRE->setBLinePar(*alignStore->getBLine(reId));
598 }
599 for (unsigned int layer = 1; layer <= copyMe->numLayers(); ++layer) {
601 using ChannelDesign = MuonGM::MuonChannelDesign;
602 const IdentifierHash layerHash = MuonGMR4::sTgcReadoutElement::createHash(layer,channelType::Strip,0);
603
604 const MuonGMR4::StripLayer& stripLayer{copyMe->stripLayer(layerHash)};
605 newRE->m_Xlg[layer -1] = stripLayer.toOrigin() *
606 Amg::getRotateY3D(90._degree) *
607 Amg::getTranslateX3D( layer%2 ? - 0.01 : 0.01 );
608
609 const MuonGMR4::StripDesign& copyEtaDesign{stripLayer.design()};
610 ATH_MSG_VERBOSE("Layer: "<<layer<<" "<<copyEtaDesign);
612 ChannelDesign& etaDesign{newRE->m_etaDesign[layer-1]};
613 etaDesign.type = ChannelDesign::ChannelType::etaStrip;
614 etaDesign.detType = ChannelDesign::DetType::STGC;
615 if (copyEtaDesign.yCutout()) {
616 etaDesign.defineDiamond(copyEtaDesign.shortHalfHeight(),
617 copyEtaDesign.longHalfHeight(),
618 copyEtaDesign.halfWidth(),
619 copyEtaDesign.yCutout());
620 } else {
621 etaDesign.defineTrapezoid(copyEtaDesign.shortHalfHeight(),
622 copyEtaDesign.longHalfHeight(),
623 copyEtaDesign.halfWidth());
624
625 }
626 etaDesign.firstPitch = copyEtaDesign.firstStripPos().x() + 0.5*copyEtaDesign.stripPitch() + copyEtaDesign.halfWidth();
627 etaDesign.inputPitch = copyEtaDesign.stripPitch();
628 etaDesign.inputWidth = copyEtaDesign.stripWidth();
629 etaDesign.nch = copyEtaDesign.numStrips();
630 ATH_MSG_VERBOSE(m_idHelperSvc->toStringDetEl(copyMe->identify())<<", layer: "<<layer<<", eta-design: "<< copyEtaDesign);
631 etaDesign.setFirstPos(copyEtaDesign.firstStripPos().x() + 0.5*copyEtaDesign.stripPitch());
633
634 const MuonGMR4::WireGroupDesign& copyPhiDesign{copyMe->wireDesign(layerHash)};
635
636 ChannelDesign& phiDesign{newRE->m_phiDesign[layer-1]};
637 phiDesign.type = ChannelDesign::ChannelType::phiStrip;
638 phiDesign.detType = ChannelDesign::DetType::STGC;
639 if (copyPhiDesign.yCutout() == 0.) {
640 phiDesign.defineTrapezoid(copyPhiDesign.shortHalfHeight(),
641 copyPhiDesign.longHalfHeight(),
642 copyPhiDesign.halfWidth());
643 } else {
644 phiDesign.defineDiamond(copyPhiDesign.shortHalfHeight(),
645 copyPhiDesign.longHalfHeight(),
646 copyPhiDesign.halfWidth(),
647 copyPhiDesign.yCutout());
648 }
649 phiDesign.inputPitch = copyPhiDesign.stripPitch();
650 phiDesign.inputWidth = copyPhiDesign.stripWidth();
651 ATH_MSG_VERBOSE(m_idHelperSvc->toStringDetEl(copyMe->identify())<<", layer: "<<layer<<", phi-design: "<< copyPhiDesign);
652 phiDesign.setFirstPos(copyPhiDesign.firstStripPos().x()); // Position of 1st wire, accounts for staggering
653 phiDesign.firstPitch = copyPhiDesign.numWiresInGroup(1); // Number of Wires in 1st group, group staggering
654 phiDesign.groupWidth = copyPhiDesign.numWiresInGroup(2); // Number of Wires normal group
655 phiDesign.nGroups = copyPhiDesign.numStrips(); // Number of Wire Groups
656 phiDesign.wireCutout = copyPhiDesign.wireCutout(); // Size of "active" wire region for digits
657 phiDesign.nch = copyPhiDesign.nAllWires();
658 phiDesign.isConvertedFromPhaseII = true;
659
660 const MuonGMR4::PadDesign& copyPadDesign{copyMe->padDesign(layerHash)};
661 MuonGM::MuonPadDesign& padDesign{newRE->m_padDesign[layer-1]};
662 padDesign.Length = copyMe->chamberHeight();
663 padDesign.sWidth = copyMe->sChamberLength();
664 padDesign.lWidth = copyMe->lChamberLength();
665 padDesign.Size = 2.*copyPadDesign.halfWidth();
666 padDesign.ysFrame = copyMe->sFrameWidth();
667 padDesign.ylFrame = copyMe->lFrameWidth();
668 padDesign.thickness = copyMe->thickness();
670 if (copyPadDesign.yCutout()) {
671 padDesign.yCutout = copyPadDesign.halfWidth();
672 }
673 padDesign.setR(copyPadDesign.beamlineRadius());
674 padDesign.sPadWidth = 2.*copyPadDesign.shortHalfHeight();
675 padDesign.lPadWidth = 2.*copyPadDesign.longHalfHeight();
676 padDesign.nPadColumns = copyPadDesign.numPadPhi();
677 padDesign.firstPhiPos = copyPadDesign.firstPadPhiDiv();
678 padDesign.inputPhiPitch = copyPadDesign.anglePadPhi();
679 padDesign.PadPhiShift = copyPadDesign.padPhiShift();
680 padDesign.nPadH = copyPadDesign.numPadEta();
681 padDesign.padEtaMax = copyPadDesign.maxPadEta();
682 padDesign.firstRowPos = copyPadDesign.firstPadHeight();
683 padDesign.inputRowPitch = copyPadDesign.padHeight();
684 padDesign.sectorOpeningAngle = copyPadDesign.sectorAngle();
685 padDesign.isConvertedFromPhaseII = true;
686 }
687 newRE->fillCache();
688 ATH_CHECK(dumpAndCompare(gctx, *copyMe, *newRE));
689 cacheObj.detMgr->addsTgcReadoutElement(std::move(newRE));
690
691 }
692 return StatusCode::SUCCESS;
693}
double beamlineRadius() const
Returns the distance between the gasGap center and the beamline.
int numPadPhi() const
Returns the number of pads in the Phi direction in the given gasGap layer.
int numPadEta() const
Returns the number of pads in the eta direction in the given layer.
double sectorAngle() const
Function gives the angular width of the sector.
double padPhiShift() const
Returns the staggering shift of inner pad edges in the phi direction.
int maxPadEta() const
Returns the maximum number of pads that can be contained in a column of a pad. Used to match the pad ...
double firstPadHeight() const
Returns the height of the pads that are adjacent to the bottom edge of the trapezoid active area.
double anglePadPhi() const
Returns the angular pitch of the pads in the phi direction.
double padHeight() const
Returns the height of all the pads that are not adjacent to the bottom edge of the trapezoid active a...
double firstPadPhiDiv() const
Returns the angle of the first pad outer edge w.r.t. the gasGap center from the beamline.
double yCutout() const
Returns the cutout of the diamond.
double stripWidth() const
Width of a strip.
unsigned int numWiresInGroup(unsigned int groupNum) const
Returns the number of wires in a given group.
double wireCutout() const
Extract the wireCutout for a wireGroup layer.
unsigned int nAllWires() const
Returns the number of all wires.
ReadoutChannelType
ReadoutChannelType to distinguish the available readout channels Pad - pad readout channel Strip - et...
static IdentifierHash createHash(const unsigned gasGap, const unsigned channelType, const unsigned channel, const unsigned wireInGrp=0)
Create a measurement hash from the Identifier fields.
@ sTgc
Micromegas (NSW)
Amg::Transform3D getTranslateX3D(const double X)
: Returns a shift transformation along the x-axis
@ layer
Definition HitInfo.h:79
void setR(double R)
access to cache

◆ buildTgc()

StatusCode MuonGMR4::ReadoutGeomCnvAlg::buildTgc ( const ActsTrk::GeometryContext & gctx,
ConstructionCache & cacheObj ) const
private

Converts all Tgc readout elements from the R4 format into the legacy Trk format.

Parameters
gctxCurrent geometry context carrying the current alignment
cacheObjMutable reference to the GeoModel constuction cache

Define the local gasGap positions

In the sector frame, the gasGap is oriented along the x-axis

Definition at line 405 of file ReadoutGeomCnvAlg.cxx.

405 {
406
407 std::vector<const MuonGMR4::TgcReadoutElement*> tgcReadouts{m_detMgr->getAllTgcReadoutElements()};
408 std::ranges::stable_sort(tgcReadouts,[](const MuonGMR4::TgcReadoutElement* a, const MuonGMR4::TgcReadoutElement* b){
409 return a->stationEta() > b->stationEta();
410 });
411 ATH_MSG_INFO("Copy "<<tgcReadouts.size()<<" Tgc readout elements to the legacy system");
412 const TgcIdHelper& idHelper{m_idHelperSvc->tgcIdHelper()};
413
414 using TgcReadoutParams = MuonGM::TgcReadoutParams;
415 std::map<std::string, std::shared_ptr<TgcReadoutParams>> readoutParMap{};
416
417 for (const MuonGMR4::TgcReadoutElement* copyMe: tgcReadouts) {
418 const Identifier reId = copyMe->identify();
419 GeoIntrusivePtr<GeoVFullPhysVol> physVol{};
420 MuonGM::MuonStation* station{nullptr};
421 ATH_CHECK(cloneReadoutVolume(gctx,reId, cacheObj, physVol, station));
422
423 auto newRE = std::make_unique<MuonGM::TgcReadoutElement>(physVol, m_idHelperSvc->stationNameString(reId),
424 cacheObj.detMgr.get());
425 newRE->setIdentifier(reId);
426 newRE->setParentMuonStation(station);
427 ATH_MSG_DEBUG("Readout element "<<m_idHelperSvc->toString(reId)<<", design: "<<copyMe->chamberDesign());
428 std::shared_ptr<TgcReadoutParams>& readOutPars = readoutParMap[std::format("{:}_{:}", copyMe->chamberDesign(),
429 copyMe->stationEta()> 0? 'A' : 'C')];
430 if (!readOutPars) {
431 using WiregangArray = TgcReadoutParams::WiregangArray;
432 using StripArray = TgcReadoutParams::StripArray;
433 using GasGapIntArray = TgcReadoutParams::GasGapIntArray;
434
435 std::array<WiregangArray, 3> wires{};
436 GasGapIntArray nWireGangs{}, nStrips{};
437 std::vector<StripArray> botMountings(copyMe->nGasGaps()),
438 topMountings(copyMe->nGasGaps());
439
440 double wirePitch{0.};
441 for (unsigned int gasGap =1; gasGap <= copyMe->nGasGaps(); ++gasGap) {
442 const IdentifierHash gangHash = copyMe->constructHash(0, gasGap, false);
443 const IdentifierHash stripHash = copyMe->constructHash(0, gasGap, true);
444 nWireGangs[gasGap -1] = copyMe->numWireGangs(gangHash);
445 nStrips[gasGap -1] = copyMe->numStrips(stripHash);
446 ATH_MSG_VERBOSE("Assigned wire gangs: "<<nWireGangs[gasGap-1]<<", strips: "<<nStrips[gasGap -1]
447 <<" for gas gap "<<gasGap);
448
449 if (nWireGangs[gasGap -1]) {
450 const MuonGMR4::WireGroupDesign& design{copyMe->wireGangLayout(gangHash)};
451 wirePitch = design.stripPitch();
452 WiregangArray& fillMe{wires[gasGap-1]};
453 for (int gang = 1; gang <= design.numStrips(); ++gang) {
454 fillMe[gang -1] = design.numWiresInGroup(gang);
455 }
456 ATH_MSG_VERBOSE("Gang layout: "<<fillMe);
457 }
458 if (nStrips[gasGap -1]) {
459 const MuonGMR4::RadialStripDesign& design{copyMe->stripLayout(stripHash)};
460 const int nCh = nStrips[gasGap -1];
461 for (int strip = 1; strip <= nCh; ++strip) {
462 botMountings[gasGap-1][strip-1] = - design.stripLeftBottom(strip).x();
463 topMountings[gasGap-1][strip-1] = - design.stripLeftTop(strip).x();
464 }
465 botMountings[gasGap-1][nCh] = - design.stripRightBottom(nCh).x();
466 topMountings[gasGap-1][nCh] = - design.stripRightTop(nCh).x();
467 ATH_MSG_VERBOSE("Strip layout\n bottom: "<<botMountings<<"\n top: "<<topMountings);
468 }
469 }
470 readOutPars = std::make_unique<TgcReadoutParams>(copyMe->chamberDesign(),
471 0, wirePitch,
472 idHelper.stationPhiMax(reId),
473 std::move(nWireGangs),
474 std::move(wires[0]),
475 std::move(wires[1]),
476 std::move(wires[2]),
477 0,
478 std::move(botMountings),
479 std::move(topMountings),
480 std::move(nStrips));
481 }
482
484 for (unsigned int gasGap = 1; gasGap <= copyMe->nGasGaps(); ++gasGap) {
485 const IdentifierHash layHash{copyMe->constructHash(0, gasGap, false)};
487 const Amg::Vector3D translation{amdbTransform(gctx, *copyMe).inverse() * copyMe->center(gctx, layHash)};
488 newRE->setPlaneZ(translation.x(), gasGap);
489 }
490 newRE->setRsize(copyMe->moduleHeight());
491 newRE->setSsize(copyMe->moduleWidthS());
492 newRE->setZsize(copyMe->moduleThickness());
493
494 newRE->setLongRsize(copyMe->moduleHeight());
495 newRE->setLongSsize(copyMe->moduleWidthL());
496 newRE->setLongZsize(copyMe->moduleThickness());
497
498 newRE->setReadOutParams(readOutPars);
499 newRE->fillCache();
500 ATH_CHECK(dumpAndCompare(gctx, *copyMe, *newRE));
501 cacheObj.detMgr->addTgcReadoutElement(std::move(newRE));
502
503 }
504 return StatusCode::SUCCESS;
505}
static Double_t a
Amg::Vector2D stripLeftTop(int stripNumber) const
: Returns the intersection of the left strip edge at the top panel's edge
Amg::Vector2D stripRightTop(int stripNumber) const
: Returns the intersecetion fo the right strip edge at the top panel's edge
Amg::Vector2D stripRightBottom(int stripNumber) const
: Returns the intersecton of the strip right edge at the bottom panel's edge
Amg::Vector2D stripLeftBottom(int stripNumber) const
: Returns the intersection of the left strip edge at the bottom panel's edge
static int stationPhiMax(bool endcap)
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
TgcReadoutParams::WiregangArray WiregangArray
TgcReadoutParams::GasGapIntArray GasGapIntArray
TgcReadoutParams::StripArray StripArray

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ checkIdCompability()

StatusCode MuonGMR4::ReadoutGeomCnvAlg::checkIdCompability ( const MuonGMR4::MuonReadoutElement & refEle,
const MuonGM::MuonReadoutElement & testEle ) const
private

Checks whether the Identifier fields of both readout elements are identical.

Parameters
refEleR4 readout element taken as blueprint to build the Trk readout element.
testEleThe constructed Trk readout element that is to be checked

Definition at line 806 of file ReadoutGeomCnvAlg.cxx.

807 {
808
809 if (refEle.identify() != testEle.identify()) {
810 ATH_MSG_FATAL("Two different elements are compared "
811 <<m_idHelperSvc->toString(refEle.identify())<<" vs. "
812 <<m_idHelperSvc->toString(testEle.identify()));
813 return StatusCode::FAILURE;
814 }
815 if (refEle.identHash() != testEle.detectorElementHash()) {
816 ATH_MSG_FATAL("The hashes of the two detector elements "<<m_idHelperSvc->toString(refEle.identify())
817 <<" are completely different "<<refEle.identHash()<<" vs. "<<testEle.detectorElementHash());
818 return StatusCode::FAILURE;
819 }
820 return StatusCode::SUCCESS;
821}
#define ATH_MSG_FATAL(x)
IdentifierHash identHash() const
Returns the hash of the readout element which is identical to the detector element hash provided by t...
Identifier identify() const override final
Return the ATLAS identifier.
IdentifierHash detectorElementHash() const
Returns the IdentifierHash of the detector element.
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.

◆ cloneNswWedge()

GeoIntrusivePtr< GeoVFullPhysVol > MuonGMR4::ReadoutGeomCnvAlg::cloneNswWedge ( const ActsTrk::GeometryContext & gctx,
const MuonGMR4::MuonReadoutElement & nswRE,
ConstructionCache & cacheObj ) const
private

Clones the full phyical volume associated to the NSw readout element.

Parameters
gctxCurrent geometry context carrying the current alignment
nswREReadout element from which the full PhysVol to clone is retrieved
cacheObjMutable reference to the GeoModel constuction cache

Definition at line 508 of file ReadoutGeomCnvAlg.cxx.

510 {
511 GeoIntrusivePtr<const GeoVFullPhysVol> readOutVol{copyMe.getMaterialGeom()};
512 cacheObj.translatedStations.insert(readOutVol->getParent());
513
514 PVLink clonedVol{cloneVolume(const_pointer_cast<GeoVFullPhysVol>(readOutVol))};
515 GeoIntrusivePtr<GeoFullPhysVol> physVol{dynamic_pointer_cast<GeoFullPhysVol>(clonedVol)};
516 cacheObj.world->add(cacheObj.newIdTag());
517 cacheObj.world->add(cacheObj.makeTransform(amdbTransform(gctx, copyMe)));
518 cacheObj.world->add(physVol);
519 return physVol;
520}

◆ cloneReadoutVolume()

StatusCode MuonGMR4::ReadoutGeomCnvAlg::cloneReadoutVolume ( const ActsTrk::GeometryContext & gctx,
const Identifier & stationId,
ConstructionCache & cacheObj,
GeoIntrusivePtr< GeoVFullPhysVol > & clonedPhysVol,
MuonGM::MuonStation *& station ) const
private

Clones the fullPhysical volume of the readoutElement and embeds it into the associated station.

If creations of the needed station fails, failure is returned. The references to the clonedPhysVol & to the station are set if the procedure was successful.

Parameters
gctxCurrent geometry context carrying the current alignment
stationIdIdentifier of the station encoding stName, stEta, stPhi
cacheObjMutable reference to the GeoModel constuction cache
clonedPhysVolMutable reference into which the cloned physical volume is attached
stationMutable reference to the muon station pointer which is filled during the cloning

This is a hack to include the BIL Rpcs into the translation. Recall that the BI-RPCs break the station paradigm Hence, in the new description they have their own alignable transform. However, the legacy geometry tries to sort them into the corresponding Mdt station with the same stName, stEta, stPhi. So quite a lot of gymnastics is now needed to place them accordingly into that frame. getX(Mdt) * delta(Mdt) * X = getX(Rpc) * delta(Rpc) X = [getX(Mdt) * delta(Mdt)]^{-1} * getX(Rpc) * delta(Rpc) The second term is the transform of the transform of the Muon station. The second one needs to be rewritten Y = getX(Rpc) * delta(Rpc) * getX(alignNode -> readoutFrame) X = Y * getX(alignNode -> readoutFrame)^{-1}

Clone the detector element with all of its subvolumes

Definition at line 272 of file ReadoutGeomCnvAlg.cxx.

276 {
277
278 ATH_CHECK(buildStation(gctx, reId, cacheObj));
279 const std::string stName{m_idHelperSvc->stationNameString(reId)};
280 station = cacheObj.detMgr->getMuonStation(stName,
281 m_idHelperSvc->stationEta(reId),
282 m_idHelperSvc->stationPhi(reId));
283
284 PVLink copiedStationVol{station->getPhysVol()};
285 const MuonGMR4::MuonReadoutElement* copyMe = m_detMgr->getReadoutElement(reId);
286 GeoIntrusivePtr<const GeoVFullPhysVol> readOutVol{copyMe->getMaterialGeom()};
287 copiedStationVol->add(cacheObj.newIdTag());
298 const Amg::Transform3D alignNodeToRE{copyMe->alignableTransform()->getDefTransform().inverse() *
299 readOutVol->getParent()->getX() * readOutVol->getX()};
300 const Amg::Transform3D alignedNode{amdbTransform(gctx, *copyMe) * alignNodeToRE.inverse()};
301
302 const Amg::Transform3D stationTrf{copiedStationVol->getX().inverse() * alignedNode};
303
304 copiedStationVol->add(cacheObj.makeTransform(stationTrf*alignNodeToRE));
306 PVLink clonedVol{cloneVolume(const_pointer_cast<GeoVFullPhysVol>(readOutVol))};
307 physVol = dynamic_pointer_cast<GeoVFullPhysVol>(clonedVol);
308 copiedStationVol->add(physVol);
309 return StatusCode::SUCCESS;
310}
StatusCode buildStation(const ActsTrk::GeometryContext &gctx, const Identifier &stationId, ConstructionCache &cacheObj) const
builds a station object from readout element.
PVConstLink getPhysVol() const

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ dumpAndCompare() [1/5]

StatusCode MuonGMR4::ReadoutGeomCnvAlg::dumpAndCompare ( const ActsTrk::GeometryContext & gctx,
const MuonGMR4::MdtReadoutElement & refEle,
const MuonGM::MdtReadoutElement & testEle ) const
private

Compares the R4 readout element with the constructed Trk readout element.

Transforms and position of the sensors are required to be identical in both descriptions

Parameters
gctxCurrent geometry context carrying the current alignment
refEleR4 readout element taken as blueprint to build the Trk readout element.
testEleThe constructed Trk readout element that is to be checked

Definition at line 871 of file ReadoutGeomCnvAlg.cxx.

873 {
874
875 if (!m_checkGeo) {
876 return StatusCode::SUCCESS;
877 }
878 ATH_CHECK(checkIdCompability(refEle, testEle));
879
880 ATH_MSG_VERBOSE("Detector element "<<m_idHelperSvc->toString(refEle.identify())
881 <<std::endl<<GeoTrf::toString(amdbTransform(gctx, refEle))
882 <<std::endl<<GeoTrf::toString(testEle.getMaterialGeom()->getAbsoluteTransform())
883 <<std::endl<<"r-size: "<<testEle.getRsize()<<"/"<<testEle.getLongRsize()
884 <<" s-size: "<<testEle.getSsize()<<"/"<<testEle.getLongSsize()
885 <<" z-size: "<<testEle.getZsize()<<"/"<<testEle.getLongZsize());
886 for (unsigned int lay = 1; lay <= refEle.numLayers(); ++lay){
887 for (unsigned int tube = 1; tube <= refEle.numTubesInLay(); ++tube) {
888 const IdentifierHash tubeHash {refEle.measurementHash(lay,tube)};
889 if (!refEle.isValid(tubeHash)) {
890 ATH_MSG_VERBOSE("SKip layer / tube "<<lay <<","<<tube);
891 continue;
892 }
893 const Amg::Transform3D globToLocal = refEle.globalToLocalTransform(gctx, tubeHash);
894
895 const Amg::Vector3D refPos = refEle.globalTubePos(gctx, tubeHash);
896 const Amg::Vector3D tubePos = testEle.tubePos(lay, tube);
897
898
899 if ( (refPos - tubePos).mag() > Gaudi::Units::micrometer &&
900 (globToLocal*refPos - globToLocal * tubePos).perp() > Gaudi::Units::micrometer) {
901 ATH_MSG_ERROR("Tube positions differ for "<<m_idHelperSvc->toString(refEle.measurementId(tubeHash))
902 <<" reference: "<<GeoTrf::toString(globToLocal*refPos)<<" vs. test: "
903 <<GeoTrf::toString(globToLocal*tubePos) <<" delta: "<<(refPos - tubePos).mag()
904 <<" Transforms "<<std::endl
905 <<" **** "<< GeoTrf::toString(globToLocal.inverse())<<std::endl
906 <<" **** "<< GeoTrf::toString(testEle.transform(lay, tube)));
907 return StatusCode::FAILURE;
908 }
909 ATH_MSG_VERBOSE("Tube positions layer: "<<lay<<", tube: "<<tube
910 <<std::endl<<"reference: "<<GeoTrf::toString(refPos)
911 <<std::endl<<"test: "<<GeoTrf::toString(tubePos)
912 <<std::endl<<testEle.tubeLength(lay, tube)<<"/"<<testEle.getActiveTubeLength(lay, tube)<<"/"
913 <<testEle.getWireLength(lay,tube)<<" vs. "<<refEle.tubeLength(tubeHash)
914 <<"/"<<refEle.activeTubeLength(tubeHash)<<"/"<<refEle.wireLength(tubeHash)
915 <<"/"<<refEle.uncutTubeLength(tubeHash));
916 if (std::abs(testEle.getTubeLengthForCaching(lay,tube) - refEle.uncutTubeLength(tubeHash)) >
917 std::numeric_limits<float>::epsilon() ) {
918 ATH_MSG_FATAL("Different tube length's detected for "<<m_idHelperSvc->toStringDetEl(refEle.identify())
919 << " layer: "<<lay<<", tube: "<<tube<<" -- "<<testEle.getTubeLengthForCaching(lay,tube)<<" (new) vs. "
920 <<refEle.uncutTubeLength(tubeHash)<<" (ref)");
921 return StatusCode::FAILURE;
922 }
923 }
924 }
925
926 return StatusCode::SUCCESS;
927}
Scalar perp() const
perp method - perpendicular length
Scalar mag() const
mag method
#define ATH_MSG_ERROR(x)
unsigned numLayers() const
Returns how many tube layers are inside the multi layer [1;4].
bool isValid(const IdentifierHash &measHash) const
Checks whether the passed meaurement hash corresponds to a valid tube described by the readout elemen...
Amg::Vector3D globalTubePos(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the position of the tube mid point in the ATLAS coordinate frame.
double uncutTubeLength(const IdentifierHash &tubeHash) const
Returns the uncut tube length.
unsigned numTubesInLay() const
Returns the number of tubes in a layer.
static IdentifierHash measurementHash(unsigned layerNumber, unsigned tubeNumber)
Constructs a Measurement hash from layer && tube number.
Identifier measurementId(const IdentifierHash &measHash) const override final
Back conversion of the measurement hash towards a full identifier Tube & layer number are extracted f...
Amg::Transform3D globalToLocalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the global ATLAS coordinate system into the local coordinate system o...
StatusCode checkIdCompability(const MuonGMR4::MuonReadoutElement &refEle, const MuonGM::MuonReadoutElement &testEle) const
Checks whether the Identifier fields of both readout elements are identical.
Gaudi::Property< bool > m_checkGeo
double getTubeLengthForCaching(const int tubeLayer, const int tube) const
double getActiveTubeLength(const int tubeLayer, const int tube) const
Amg::Vector3D tubePos(const Identifier &id) const
Returns the global position of the given tube.
virtual const Amg::Transform3D & transform(const Identifier &id) const override final
Return local to global transform associated with this identifier.
double tubeLength(const int tubeLayer, const int tube) const
double getWireLength(const int tubeLayer, const int tube) const

◆ dumpAndCompare() [2/5]

StatusCode MuonGMR4::ReadoutGeomCnvAlg::dumpAndCompare ( const ActsTrk::GeometryContext & gctx,
const MuonGMR4::MmReadoutElement & refEle,
const MuonGM::MMReadoutElement & testEle ) const
private

Compares the R4 readout element with the constructed Trk readout element.

Transforms and position of the sensors are required to be identical in both descriptions

Parameters
gctxCurrent geometry context carrying the current alignment
refEleR4 readout element taken as blueprint to build the Trk readout element.
testEleThe constructed Trk readout element that is to be checked

Definition at line 823 of file ReadoutGeomCnvAlg.cxx.

825 {
826
827 if (!m_checkGeo) {
828 return StatusCode::SUCCESS;
829 }
830 ATH_CHECK(checkIdCompability(refEle, testEle));
831
832 ATH_MSG_VERBOSE("Compare basic readout transforms"<<std::endl
833 <<GeoTrf::toString(testEle.absTransform(),true)<<std::endl
834 <<GeoTrf::toString(amdbTransform(gctx, refEle), true));
835 const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
836 for (unsigned int gasGap = 1; gasGap <= refEle.nGasGaps(); ++ gasGap) {
837 const Identifier gapId = idHelper.channelID(refEle.identify(), refEle.multilayer(), gasGap, 1);
838
839 const Amg::Transform3D& refTrf{refEle.localToGlobalTransform(gctx, gapId)};
840 const Amg::Transform3D& testTrf{testEle.transform(gapId)};
841 if (!Amg::isIdentity(refTrf.inverse()*testTrf)) {
842 ATH_MSG_FATAL("The layer "<<m_idHelperSvc->toStringGasGap(gapId)<<" does not transform equally"
843 <<GeoTrf::toString(refTrf, true) <<" vs. "<<GeoTrf::toString(testTrf, true));
844 return StatusCode::FAILURE;
845 }
846 const MuonGMR4::StripDesign& stripDesign{refEle.stripLayer(gapId).design()};
847
848 for (int strip = stripDesign.firstStripNumber(); strip <= stripDesign.numStrips(); ++strip) {
849 const Identifier stripId = idHelper.channelID(refEle.identify(), refEle.multilayer(), gasGap, strip);
850 const Amg::Vector3D refStripPos{refEle.stripPosition(gctx, stripId)};
851 const Amg::Vector3D refStripDir{refEle.localToGlobalTransform(gctx, refEle.layerHash(stripId)).linear() * Amg::Vector3D::UnitX()};
852
853 Amg::Vector3D testStripPos{Amg::Vector3D::Zero()};
854 if (!testEle.stripGlobalPosition(stripId, testStripPos)) {
855 ATH_MSG_FATAL("Failed to retrieve strip position "<<m_idHelperSvc->toString(stripId));
856 return StatusCode::FAILURE;
857 }
858 const double dist = refStripDir.dot(refStripPos - testStripPos);
859 if (std::abs(dist) > 10. * Gaudi::Units::micrometer) {
860 ATH_MSG_FATAL("The strip "<<Amg::toString(testStripPos)<<" is not describing the same strip as "
861 <<Amg::toString(refStripPos)<<". Channel "<<m_idHelperSvc->toString(stripId)
862 <<" distance: "<<dist<<" "<<(dist / testEle.m_etaDesign[gasGap -1].inputWidth));
863 return StatusCode::FAILURE;
864 }
865 ATH_MSG_VERBOSE("Channel postion "<<m_idHelperSvc->toString(stripId)<<" match between legacy & new");
866 }
867 }
868 return StatusCode::SUCCESS;
869}
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
const StripLayer & stripLayer(const Identifier &measId) const
unsigned int nGasGaps() const
Returns the number of gas gaps.
int multilayer() const
Returns the multi layer of the element [1-2].
IdentifierHash layerHash(const Identifier &measId) const override final
The layer hash removes the bits from the IdentifierHash corresponding to the measurement's channel nu...
Amg::Vector3D stripPosition(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the position of the strip center.
const Amg::Transform3D & localToGlobalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the local coordinate system of the readout element into the global AT...
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
std::array< MuonChannelDesign, 4 > m_etaDesign
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
bool isIdentity(const Amg::Transform3D &trans)
Checks whether the transformation is the Identity transformation.

◆ dumpAndCompare() [3/5]

StatusCode MuonGMR4::ReadoutGeomCnvAlg::dumpAndCompare ( const ActsTrk::GeometryContext & gctx,
const MuonGMR4::RpcReadoutElement & refEle,
const MuonGM::RpcReadoutElement & testEle ) const
private

Compares the R4 readout element with the constructed Trk readout element.

Transforms and position of the sensors are required to be identical in both descriptions

Parameters
gctxCurrent geometry context carrying the current alignment
refEleR4 readout element taken as blueprint to build the Trk readout element.
testEleThe constructed Trk readout element that is to be checked

Definition at line 928 of file ReadoutGeomCnvAlg.cxx.

930 {
931
932 if (!m_checkGeo) {
933 return StatusCode::SUCCESS;
934 }
935 ATH_CHECK(checkIdCompability(refEle, testEle));
936
937 ATH_MSG_VERBOSE("Compare basic readout transforms"<<std::endl
938 <<" ref: "<<GeoTrf::toString(amdbTransform(gctx, refEle), true)<<std::endl
939 <<" test: "<<GeoTrf::toString(testEle.absTransform(),true)<<std::endl
940 <<"delta: "<<GeoTrf::toString(testEle.absTransform().inverse()*amdbTransform(gctx, refEle), true ));
941 const RpcIdHelper& idHelper{m_idHelperSvc->rpcIdHelper()};
942 for (unsigned int gasGap = 1; gasGap <= refEle.nGasGaps(); ++gasGap) {
943 for (int doubPhi = refEle.doubletPhi(); doubPhi <= refEle.doubletPhiMax(); ++doubPhi) {
944 for (bool measPhi : {false, true}) {
945 if (measPhi && !refEle.nPhiStrips()) continue;
946 for (int strip = 1; strip <= testEle.Nstrips(measPhi); ++strip) {
947 const Identifier stripId = idHelper.channelID(refEle.identify(),
948 refEle.doubletZ(),
949 doubPhi, gasGap, measPhi, strip);
950
951 const Amg::Transform3D refTrans{refEle.localToGlobalTransform(gctx, stripId) *
952 (measPhi ? Amg::getRotateZ3D(90_degree) :
953 Amg::Transform3D::Identity())};
954 const Amg::Transform3D& testTrans{testEle.transform(stripId)};
955 if (strip == 1 && !Amg::isIdentity(refTrans.inverse()*testTrans)) {
956 ATH_MSG_ERROR("Transformation for "<<m_idHelperSvc->toString(stripId)<<" - "<<refEle.identHash()<<std::endl
957 <<" *** ref: "<<GeoTrf::toString(refTrans)<<std::endl
958 <<" *** test: "<<GeoTrf::toString(testTrans)<<std::endl
959 <<" -> delta: "<<GeoTrf::toString(refTrans.inverse()*testTrans));
960 return StatusCode::FAILURE;
961 }
962
963 const Amg::Vector3D refStripPos = refEle.stripPosition(gctx, stripId);
964 const Amg::Vector3D testStripPos = testEle.stripPos(stripId);
965 // The threshold here used to be epsilon for a float.
966 // But this was then giving a failure in aarch64,
967 // with a difference of almost exactly 1e-4.
968 // It turned out that that was coming from GeoDeDuplicator,
969 // where to consider two transforms equivalent,
970 // the translations must match to 1e-4. But if the
971 // difference is almost exactly 1e-4, then small FP
972 // differences can be magnified to just about 1e-4.
973 if ((refStripPos - testStripPos).mag() > 2e-4){
974 ATH_MSG_ERROR("Mismatch in strip positions "<<m_idHelperSvc->toString(stripId)
975 <<" ref: "<<Amg::toString(refStripPos)<<" test: "<<Amg::toString(testStripPos)
976 <<" local coordinates -- ref: "<<Amg::toString(refTrans.inverse()*refStripPos)
977 <<" test: "<<Amg::toString(refTrans.inverse()*testStripPos));
978 return StatusCode::FAILURE;
979 }
980 ATH_MSG_VERBOSE("Agreement between new and old geometry for channel "<<m_idHelperSvc->toString(stripId)
981 <<" strip position "<<Amg::toString(refStripPos)
982 <<", local: "<<Amg::toString(refTrans.inverse()*refStripPos));
983 }
984 }
985 }
986 }
987 return StatusCode::SUCCESS;
988}
Eigen::Affine3d Transform3D
if(febId1==febId2)
unsigned nPhiStrips() const
Number of strips measuring the phi coordinate.
int doubletZ() const
Returns the doublet Z field of the MuonReadoutElement identifier.
int doubletPhi() const
Returns the doublet Phi field of the MuonReadoutElement identifier.
int doubletPhiMax() const
Returns the maximum phi panel.
Amg::Vector3D stripPosition(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the position of the strip center.
unsigned nGasGaps() const
Returns the number of gasgaps described by this ReadOutElement (usally 2 or 3)
int Nstrips(bool measphi) const
returns the number of strips for the phi or eta plane

◆ dumpAndCompare() [4/5]

StatusCode MuonGMR4::ReadoutGeomCnvAlg::dumpAndCompare ( const ActsTrk::GeometryContext & gctx,
const MuonGMR4::sTgcReadoutElement & refEle,
const MuonGM::sTgcReadoutElement & testEle ) const
private

Compares the R4 readout element with the constructed Trk readout element.

Transforms and position of the sensors are required to be identical in both descriptions

Parameters
gctxCurrent geometry context carrying the current alignment
refEleR4 readout element taken as blueprint to build the Trk readout element.
testEleThe constructed Trk readout element that is to be checked

wireGroup center is defined to be half a wire pitch off in R4 compared to R3 convention

Definition at line 1066 of file ReadoutGeomCnvAlg.cxx.

1068 {
1069 if (!m_checkGeo) {
1070 return StatusCode::SUCCESS;
1071 }
1072 ATH_CHECK(checkIdCompability(refEle, testEle));
1073
1074 ATH_MSG_VERBOSE("Compare basic readout transforms"<<std::endl
1075 <<GeoTrf::toString(testEle.absTransform(),true)<<std::endl
1076 <<GeoTrf::toString(amdbTransform(gctx, refEle), true));
1077 const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
1078 for (unsigned int gasGap = 1; gasGap <= refEle.numLayers(); ++gasGap) {
1082 const IdentifierHash layHash = refEle.createHash(gasGap, chType, 1);
1083 const unsigned int numChannel = refEle.numChannels(layHash);
1084 constexpr unsigned firstCh = 1;
1085 for (unsigned int channel = firstCh; channel < numChannel ; ++channel) {
1086 Identifier chID{};
1087 bool isValid = false;
1089 const int etaIndex = refEle.padDesign(layHash).padNumber(channel).first;
1090 const int phiIndex = refEle.padDesign(layHash).padNumber(channel).second;
1091 chID = idHelper.padID(refEle.identify(),
1092 refEle.multilayer(),
1093 gasGap, chType, etaIndex, phiIndex, isValid);
1094 } else {
1095 chID = idHelper.channelID(refEle.identify(),
1096 refEle.multilayer(),
1097 gasGap, chType, channel, isValid);
1098 }
1099
1100 if(!isValid) {
1101 ATH_MSG_WARNING("Invalid Identifier detected: " << m_idHelperSvc->toString(chID));
1102 return StatusCode::FAILURE;
1103 }
1104 const IdentifierHash measHash = refEle.measurementHash(chID);
1105 Amg::Transform3D refTrans{refEle.localToGlobalTransform(gctx, refEle.layerHash(measHash))*
1107 const Amg::Transform3D& testTrans{testEle.transform(chID)};
1108 if (channel == firstCh && (!Amg::doesNotDeform(testTrans.inverse()*refTrans)
1109 || (testTrans.inverse()*refTrans).translation().perp() >
1110 std::numeric_limits<float>::epsilon() ) ) {
1111 ATH_MSG_ERROR(__func__<<"() "<<__LINE__<<" - Transformation for "
1112 <<m_idHelperSvc->toString(chID)<<std::endl
1113 <<" *** ref: "<<GeoTrf::toString(refTrans, true)<<std::endl
1114 <<" *** test: "<<GeoTrf::toString(testTrans, true));
1115 return StatusCode::FAILURE;
1116 }
1117 const Amg::Vector3D refChannelPos = refEle.globalChannelPosition(gctx, measHash);
1118
1120 const Amg::Transform3D& testPadTrans{testEle.transform(chID)};
1121 Amg::Vector3D testChannelPos(Amg::Vector3D::Zero());
1122 testEle.stripGlobalPosition(chID, testChannelPos);
1123
1124 const std::array<Amg::Vector3D,4> refPadCorners = refEle.globalPadCorners(gctx, measHash);
1125 std::array<Amg::Vector3D,4> testPadCorners{make_array<Amg::Vector3D, 4>(Amg::Vector3D::Zero())};
1126 testEle.padGlobalCorners(chID, testPadCorners);
1127 for (unsigned int cornerIdx = 0; cornerIdx < refPadCorners.size(); ++cornerIdx) {
1128 const double padCornerDiff = (refPadCorners[cornerIdx] - testPadCorners[cornerIdx]).mag();
1129 if (padCornerDiff - 25. > 1. * Gaudi::Units::micrometer){
1130 ATH_MSG_ERROR("Mismatch in pad Corner " << cornerIdx << ": " <<m_idHelperSvc->toString(chID)
1131 <<" ref: "<<Amg::toString(refPadCorners[cornerIdx])<<" test: "<<Amg::toString(testPadCorners[cornerIdx])
1132 <<" difference: " << padCornerDiff
1133 <<" local coordinates -- ref: "<<Amg::toString(refTrans.inverse()*refPadCorners[cornerIdx])
1134 <<" test: "<<Amg::toString(testPadTrans.inverse()*testPadCorners[cornerIdx]));
1135 return StatusCode::FAILURE;
1136 }
1137 }
1138 const double padChannelDiff = (refChannelPos - testChannelPos).mag();
1139 if (padChannelDiff - 25. > 1. * Gaudi::Units::micrometer){
1140 ATH_MSG_ERROR("Mismatch in pad positions "<<m_idHelperSvc->toString(chID)
1141 <<" ref: "<<Amg::toString(refChannelPos)<<" test: "<<Amg::toString(testChannelPos)
1142 <<" difference: " << padChannelDiff
1143 <<" local coordinates -- ref: "<<Amg::toString(refTrans.inverse()*refChannelPos)
1144 <<" test: "<<Amg::toString(testPadTrans.inverse()*testChannelPos));
1145 return StatusCode::FAILURE;
1146 }
1147 ATH_MSG_VERBOSE("Agreement between new and old geometry for channel "<<m_idHelperSvc->toString(chID)
1148 <<" channel position "<<Amg::toString(refChannelPos));
1149 }
1151 Amg::Vector3D testChannelPos{Amg::Vector3D::Zero()};
1152 testEle.stripGlobalPosition(chID, testChannelPos);
1153 if ((refChannelPos - testChannelPos).mag() > 1. * Gaudi::Units::micrometer){
1154 ATH_MSG_ERROR("Mismatch in strip positions "<<m_idHelperSvc->toString(chID)
1155 <<" ref: "<<Amg::toString(refChannelPos)<<" test: "<<Amg::toString(testChannelPos)
1156 <<" local coordinates -- ref: "<<Amg::toString(testTrans.inverse()*refChannelPos)
1157 <<" test: "<<Amg::toString(testTrans.inverse()*testChannelPos));
1158 return StatusCode::FAILURE;
1159 }
1160 ATH_MSG_VERBOSE("Agreement between new and old geometry for channel "<<m_idHelperSvc->toString(chID)
1161 <<" channel position "<<Amg::toString(refChannelPos));
1162 } else { // wire
1163 Amg::Vector3D testChannelPos{Amg::Vector3D::Zero()};
1164 testEle.stripGlobalPosition(chID, testChannelPos);
1165 Amg::Vector3D localRefPos {testTrans.inverse()*refChannelPos};
1166 Amg::Vector3D localTestPos{testTrans.inverse()*testChannelPos};
1168 if((std::abs(localRefPos.x() -localTestPos.x()) > 1.* Gaudi::Units::micrometer)
1169 || (std::abs(refChannelPos.z() -testChannelPos.z()) > 15.* Gaudi::Units::micrometer)){
1170 ATH_MSG_ERROR("Mismatch in wire positions "<<m_idHelperSvc->toString(chID)
1171 <<" ref: "<<Amg::toString(refChannelPos)<<" test: "<<Amg::toString(testChannelPos)
1172 <<" local coordinates -- ref: "<<Amg::toString(testTrans.inverse()*refChannelPos)
1173 <<" test: "<<Amg::toString(testTrans.inverse()*testChannelPos)
1174 <<"delta X: "<<std::abs(localRefPos.x() -localTestPos.x())
1175 <<", delta Z: "<<std::abs(localRefPos.z() -localTestPos.z()));
1176 return StatusCode::FAILURE;
1177 }
1178 }
1179 }
1180 }
1181 }
1182 return StatusCode::SUCCESS;
1183}
constexpr std::array< T, N > make_array(const T &def_val)
Helper function to initialize in-place arrays with non-zero values.
Definition ArrayHelper.h:10
#define ATH_MSG_WARNING(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
std::pair< int, int > padNumber(const int SeqChannel) const
Returns the pad (eta,phi) for a given pad number in sequence (1,2,3,...18,19,20......
unsigned numChannels(const IdentifierHash &measHash) const
Returns the number of strips / wires / pads in a given gasGap.
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
const PadDesign & padDesign(const IdentifierHash &measHash) const
Retrieves the readoutElement Layer given the Identifier/Hash.
int multilayer() const
Returns the multilayer of the sTgcReadoutElement.
globalCornerArray globalPadCorners(const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
unsigned numLayers() const
Returns the number of gas gap layers.
IdentifierHash layerHash(const Identifier &measId) const override final
Transforms the Identifier into a layer hash.
Amg::Vector3D globalChannelPosition(const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
Returns the global pad/strip/wireGroup position.
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
bool padGlobalCorners(const Identifier &id, std::array< Amg::Vector3D, 4 > &gcorners) const
pad global corners
Identifier padID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta, int padPhi) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
bool doesNotDeform(const Amg::Transform3D &trans)
Checks whether the linear part of the transformation rotates or stetches any of the basis vectors.
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition EtaPhiLUT.cxx:23

◆ dumpAndCompare() [5/5]

StatusCode MuonGMR4::ReadoutGeomCnvAlg::dumpAndCompare ( const ActsTrk::GeometryContext & gctx,
const MuonGMR4::TgcReadoutElement & refEle,
const MuonGM::TgcReadoutElement & testEle ) const
private

Compares the R4 readout element with the constructed Trk readout element.

Transforms and position of the sensors are required to be identical in both descriptions

Parameters
gctxCurrent geometry context carrying the current alignment
refEleR4 readout element taken as blueprint to build the Trk readout element.
testEleThe constructed Trk readout element that is to be checked

Definition at line 989 of file ReadoutGeomCnvAlg.cxx.

991 {
992
993 if (!m_checkGeo) {
994 return StatusCode::SUCCESS;
995 }
996 ATH_CHECK(checkIdCompability(refEle, testEle));
997
998 const TgcIdHelper& idHelper{m_idHelperSvc->tgcIdHelper()};
999
1000 ATH_MSG_VERBOSE("Detector element "<<m_idHelperSvc->toString(refEle.identify())
1001 <<std::endl<<GeoTrf::toString(amdbTransform(gctx, refEle), true)
1002 <<std::endl<<GeoTrf::toString(testEle.getMaterialGeom()->getAbsoluteTransform(), true)
1003 <<std::endl<<"r-size: "<<testEle.getRsize()<<"/"<<testEle.getLongRsize()
1004 <<" s-size: "<<testEle.getSsize()<<"/"<<testEle.getLongSsize()
1005 <<" z-size: "<<testEle.getZsize()<<"/"<<testEle.getLongZsize());
1006
1007 for (unsigned int gasGap = 1; gasGap <= refEle.nGasGaps(); ++gasGap) {
1008 for (bool isStrip : {false, true}) {
1009 const IdentifierHash layHash = refEle.constructHash(0, gasGap, isStrip);
1010
1011 const Identifier layId = idHelper.channelID(refEle.identify(), gasGap, isStrip, 1);
1012 ATH_MSG_VERBOSE("Test layer "<<m_idHelperSvc->toString(layId)<<", nCh: "<<refEle.numChannels(layHash)<<", layHash: "<<layHash);
1013 if (!refEle.numChannels(layHash)) continue;
1014 const Amg::Transform3D refLayerTrf = refEle.localToGlobalTransform(gctx, refEle.constructHash(0, gasGap, false)) *
1015 (!isStrip ? Amg::Transform3D::Identity()
1016 : Amg::getRotateZ3D(-90._degree));
1017 const Amg::Transform3D& testLayerTrf = testEle.transform(layId);
1018 if (!Amg::isIdentity(refLayerTrf.inverse()* testLayerTrf)) {
1019 ATH_MSG_FATAL("The transformations in "<<m_idHelperSvc->toString(layId)
1020 <<std::endl<<"ref : "<<GeoTrf::toString(refLayerTrf,true)
1021 <<std::endl<<"test: "<<GeoTrf::toString(testLayerTrf,true)
1022 <<" are not identical. ");
1023 return StatusCode::FAILURE;
1024 }
1025 ATH_MSG_VERBOSE("Transformations in "<<m_idHelperSvc->toString(layId)
1026 <<std::endl<<"ref : "<<GeoTrf::toString(refLayerTrf,true)
1027 <<std::endl<<"test: "<<GeoTrf::toString(testLayerTrf,true));
1028
1029 for (unsigned int ch = 1; ch <= refEle.numChannels(layHash); ++ch) {
1030 const IdentifierHash measHash = refEle.constructHash(ch, gasGap, isStrip);
1031 const Identifier measId = refEle.measurementId(measHash);
1032 const Amg::Vector3D refChannel = refEle.channelPosition(gctx, measHash);
1033 const Amg::Vector3D testChannel = testEle.channelPos(measId);
1034 if ((refChannel - testChannel).mag() < std::numeric_limits<float>::epsilon()){
1035 continue;
1036 }
1037 std::stringstream msg{};
1038 msg<<"The channel "<<m_idHelperSvc->toString(measId)
1039 << " is not at the same position "<<Amg::toString(refChannel)
1040 <<" vs. "<<Amg::toString(testChannel)<<". Difference: "
1041 <<(refChannel - testChannel).mag();
1042 if (!isStrip) {
1043 msg<<std::endl<<"*** Test *** - wirePitch: "<<testEle.wirePitch()
1044 <<", tot wires "<<testEle.nWires(gasGap)
1045 <<", wires to reach "<<testEle.nPitchesToGang(gasGap, ch)
1046 <<", wires in gang "<<testEle.nWires(gasGap, ch);
1047 const MuonGMR4::WireGroupDesign& design{refEle.wireGangLayout(gasGap)};
1048 msg<<std::endl<<"*** Ref *** - wirePitch: "<<design.stripPitch()
1049 <<", tot wires "<<testEle.nWires(gasGap)
1050 <<", wires to reach "<<design.numPitchesToGroup(ch)
1051 <<", wires in gang "<<design.numWiresInGroup(ch);
1052 } else {
1053 const Amg::Vector3D locRefPos{refLayerTrf.inverse() * refChannel};
1054 const Amg::Vector3D locTestPos{refLayerTrf.inverse()* testChannel};
1055 msg<<std::endl<<"*** Ref **** - "<<Amg::toString(locRefPos)<<std::endl;
1056 msg<<std::endl<<"*** Test **** - "<<Amg::toString(locTestPos)<<std::endl;
1057 }
1058 ATH_MSG_FATAL(msg.str());
1059 return StatusCode::FAILURE;
1060 }
1061
1062 }
1063 }
1064 return StatusCode::SUCCESS;
1065}
Amg::Vector3D channelPosition(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the center of the measurement channel eta measurement: wire gang center phi measurement: stri...
Identifier measurementId(const IdentifierHash &measHash) const override final
Back conversion of the measurement hash to a full Athena Identifier The behaviour is undefined if a l...
static IdentifierHash constructHash(unsigned measCh, unsigned gasGap, const bool isStrip)
Constructs the Hash out of the Identifier fields (channel, gasGap, isStrip)
const WireGroupDesign & wireGangLayout(const IdentifierHash &layHash) const
Returns access to the wire group design of the given gasGap [1-3] If the gap does not have a wires an...
unsigned numChannels(const IdentifierHash &measHash) const
Returns the number of readout channels.
unsigned nGasGaps() const
Returns the number of gasgaps described by this ReadOutElement (usally 2 or 3)
unsigned int numPitchesToGroup(unsigned int groupNum) const
Returns the number of wire pitches to reach the given group.
Amg::Vector3D channelPos(const Identifier &id) const
Returns the position of the active channel (wireGang or strip)
double nPitchesToGang(int gasGap, int gang) const
Returns the number of wire pitches that have to be travelled to reach gang i.
int nWires(int gasGap) const
Returns the total number of wires in a given gas gap.
double wirePitch() const
Returns the pitch of the wires.
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode MuonGMR4::ReadoutGeomCnvAlg::execute ( const EventContext & ctx) const
override

Prepare the Geometry context

Check that for every detector technology there's an DetectorAlignStore in the geometry context Otherwise create an empty one.

Create the cache and populate it with the geoWolds

Build the chamber technologies

Finally add the passives

Move the passives also onto the new world tree...

Final check that all elements are cached properly

Definition at line 86 of file ReadoutGeomCnvAlg.cxx.

86 {
87 SG::WriteCondHandle writeHandle{m_writeKey, ctx};
88 if (writeHandle.isValid()) {
89 ATH_MSG_DEBUG("The current readout geometry is still valid.");
90 return StatusCode::SUCCESS;
91 }
94 ActsTrk::GeometryContext geoContext{};
95 using TrackingAlignment = ActsTrk::DetectorAlignStore::TrackingAlignStore;
96 for (const SG::ReadCondHandleKey<ActsTrk::DetectorAlignStore>& key : m_alignStoreKeys) {
97 SG::ReadCondHandle readHandle{key, ctx};
98 if (!readHandle.isValid()) {
99 ATH_MSG_FATAL("Failed to retrieve alignment store "<<key.fullKey());
100 return StatusCode::FAILURE;
101 }
102 writeHandle.addDependency(readHandle);
103 if (m_splitTrfCache) {
104 geoContext.setStore(copyDeltas(**readHandle));
105 } else {
106 geoContext.setStore(std::make_unique<ActsTrk::DetectorAlignStore>(**readHandle));
107 }
108 }
111 std::vector<ActsTrk::DetectorType> presentTechs = m_detMgr->getDetectorTypes();
112 for (const ActsTrk::DetectorType detType : presentTechs) {
113 if (geoContext.getStore(detType)) {
114 continue;
115 }
116 ATH_MSG_WARNING("No external detector alignment has been defined for technology "<<ActsTrk::to_string(detType));
117 geoContext.setStore(std::make_unique<ActsTrk::DetectorAlignStore>(detType));
118 }
120 ConstructionCache cacheObj;
121 cacheObj.detMgr = std::make_unique<MuonGM::MuonDetectorManager>();
122 cacheObj.world = createGeoWorld();
123 cacheObj.detMgr->addTreeTop(cacheObj.world);
125 ATH_CHECK(buildMdt(geoContext, cacheObj));
126 ATH_CHECK(buildTgc(geoContext, cacheObj));
127 ATH_CHECK(buildRpc(geoContext, cacheObj));
128 ATH_CHECK(buildSTGC(geoContext, cacheObj));
129 ATH_CHECK(buildMM(geoContext, cacheObj));
131 std::vector<GeoChildNodeWithTrf> treeTops = getChildrenWithRef(m_detMgr->getTreeTop(0), false);
132
134 for (const GeoChildNodeWithTrf& treeTop : treeTops) {
135 if (hasStationVolume(treeTop.volume, cacheObj.translatedStations)) {
136 continue;
137 }
138 ATH_MSG_VERBOSE("Detected passive volume "<<treeTop.nodeName);
139
140 cacheObj.world->add(const_pointer_cast(treeTop.volume));
141 }
142
144 if (m_checkGeo) {
145 const std::vector<const MuonGMR4::MuonReadoutElement*> refEles{m_detMgr->getAllReadoutElements()};
146 for (const MuonGMR4::MuonReadoutElement* refEle : refEles) {
147 ATH_CHECK(checkIdCompability(*refEle, *cacheObj.detMgr->getReadoutElement(refEle->identify())));
148 }
149 }
150 if (m_dumpGeo) {
151 ATH_MSG_DEBUG("Save geometry to SqLite file "<<m_geoDumpName);
152 GeoModelIO::IO::saveToDB(cacheObj.world, m_geoDumpName, 0 , true);
153 }
154
155 ATH_CHECK(writeHandle.record(std::move(cacheObj.detMgr)));
156 return StatusCode::SUCCESS;
157}
void setStore(AlignmentStorePtr store)
Adds the store to the Geometry context.
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
Gaudi::Property< std::string > m_geoDumpName
StatusCode buildMdt(const ActsTrk::GeometryContext &gctx, ConstructionCache &cacheObj) const
Converts all Mdt readout elements from the R4 format into the legacy Trk format.
SG::WriteCondHandleKey< MuonGM::MuonDetectorManager > m_writeKey
Gaudi::Property< bool > m_splitTrfCache
Instantiate a new transform cache to ensure lazy transform population in the event processing.
StatusCode buildRpc(const ActsTrk::GeometryContext &gctx, ConstructionCache &cacheObj) const
Converts all Rpc readout elements from the R4 format into the legacy Trk format.
StatusCode buildTgc(const ActsTrk::GeometryContext &gctx, ConstructionCache &cacheObj) const
Converts all Tgc readout elements from the R4 format into the legacy Trk format.
Gaudi::Property< bool > m_dumpGeo
StatusCode buildSTGC(const ActsTrk::GeometryContext &gctx, ConstructionCache &cacheObj) const
Converts all sTgc readout elements from the R4 format into the legacy Trk format.
StatusCode buildMM(const ActsTrk::GeometryContext &gctx, ConstructionCache &cacheObj) const
Converts all Mm readout elements from the R4 format into the legacy Trk format.
SG::ReadCondHandleKeyArray< ActsTrk::DetectorAlignStore > m_alignStoreKeys
void addDependency(const EventIDRange &range)
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
std::string to_string(const DetectorType &type)
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
std::unique_ptr< ActsTrk::DetectorAlignStore > copyDeltas(const ActsTrk::DetectorAlignStore &inStore)
Copy the alignment deltas from the inStore to a new alignment store.
Cache object holding the constructed detector manager, and the intermediate GeoModel objects needed t...
std::unique_ptr< MuonGM::MuonDetectorManager > detMgr
Pointer to the legacy MuonDetectorManager.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ initialize()

StatusCode MuonGMR4::ReadoutGeomCnvAlg::initialize ( )
override

Definition at line 77 of file ReadoutGeomCnvAlg.cxx.

77 {
78 ATH_CHECK(m_idHelperSvc.retrieve());
79 ATH_CHECK(m_writeKey.initialize());
80 ATH_CHECK(m_alignStoreKeys.initialize());
82 return StatusCode::SUCCESS;
83}
const ServiceHandle< StoreGateSvc > & detStore() const
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ isReEntrant()

virtual bool AthCondAlgorithm::isReEntrant ( ) const
inlineoverridevirtualinherited

Avoid scheduling algorithm multiple times.

With multiple concurrent events, conditions objects often expire simultaneously for all slots. To avoid that the scheduler runs the CondAlg in each slot, we declare it as "non-reentrant". This ensures that the conditions objects are only created once.

In case a particular CondAlg should behave differently, it can override this method again and return true.

See also
ATEAM-836

Definition at line 39 of file AthCondAlgorithm.h.

39{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_alignStoreKeys

SG::ReadCondHandleKeyArray<ActsTrk::DetectorAlignStore> MuonGMR4::ReadoutGeomCnvAlg::m_alignStoreKeys {this, "AlignmentKeys", {}, "Alignment key"}
private

Definition at line 182 of file ReadoutGeomCnvAlg.h.

182{this, "AlignmentKeys", {}, "Alignment key"};

◆ m_checkGeo

Gaudi::Property<bool> MuonGMR4::ReadoutGeomCnvAlg::m_checkGeo {this, "checkGeo", false, "Checks the positions of the sensors"}
private

Definition at line 184 of file ReadoutGeomCnvAlg.h.

184{this, "checkGeo", false, "Checks the positions of the sensors"};

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* MuonGMR4::ReadoutGeomCnvAlg::m_detMgr {nullptr}
private

Definition at line 189 of file ReadoutGeomCnvAlg.h.

189{nullptr};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dumpGeo

Gaudi::Property<bool> MuonGMR4::ReadoutGeomCnvAlg::m_dumpGeo {this, "dumpGeo", false, "Dumps the constructed geometry"}
private

Definition at line 185 of file ReadoutGeomCnvAlg.h.

185{this, "dumpGeo", false, "Dumps the constructed geometry"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_geoDumpName

Gaudi::Property<std::string> MuonGMR4::ReadoutGeomCnvAlg::m_geoDumpName {this,"geoDumpName", "ConvMuonGeoModel.db",}
private

Definition at line 188 of file ReadoutGeomCnvAlg.h.

188{this,"geoDumpName", "ConvMuonGeoModel.db",};

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonGMR4::ReadoutGeomCnvAlg::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 178 of file ReadoutGeomCnvAlg.h.

178{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_splitTrfCache

Gaudi::Property<bool> MuonGMR4::ReadoutGeomCnvAlg::m_splitTrfCache {this, "splitTrfCache", false, ""}
private

Instantiate a new transform cache to ensure lazy transform population in the event processing.

Definition at line 187 of file ReadoutGeomCnvAlg.h.

187{this, "splitTrfCache", false, ""};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeKey

SG::WriteCondHandleKey<MuonGM::MuonDetectorManager> MuonGMR4::ReadoutGeomCnvAlg::m_writeKey {this, "WriteKey", "MuonDetectorManager"}
private

Definition at line 180 of file ReadoutGeomCnvAlg.h.

180{this, "WriteKey", "MuonDetectorManager"};

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