5#if defined(FLATTEN) && defined(__GNUC__)
7#pragma GCC optimize "-fno-var-tracking-assignments"
19#include <GaudiKernel/SystemOfUnits.h>
21#include "Acts/Geometry/TrapezoidVolumeBounds.hpp"
22#include "Acts/Geometry/TrackingGeometry.hpp"
23#include "Acts/Geometry/DiamondVolumeBounds.hpp"
24#include "Acts/Surfaces/TrapezoidBounds.hpp"
25#include "Acts/Surfaces/CylinderBounds.hpp"
26#include "Acts/Surfaces/RadialBounds.hpp"
27#include "Acts/Surfaces/CylinderSurface.hpp"
28#include "Acts/Surfaces/DiscSurface.hpp"
30#include "Acts/Visualization/ObjVisualization3D.hpp"
31#include "Acts/Visualization/GeometryView3D.hpp"
32#include "Acts/Definitions/Units.hpp"
38using namespace Acts::UnitLiterals;
42 constexpr double tolerance = 10. *Gaudi::Units::micrometer;
46 std::vector<std::shared_ptr<Acts::Volume>> vols{};
47 std::ranges::transform(sector.
chambers(),std::back_inserter(vols),
48 [&gctx](
const auto& ch){ return ch->boundingVolume(gctx); });
60 return StatusCode::SUCCESS;
62 template <
class EnvelopeType>
63#if defined(FLATTEN) && defined(__GNUC__)
72 const EnvelopeType& chamb,
73 const Acts::Volume& boundVol,
75 const std::string& descr,
82 if (boundVol.volumeBounds().inside(locPos,
tolerance)) {
84 <<
", point "<<descr <<
" is inside of the chamber "<<std::endl<<chamb<<std::endl
86 return StatusCode::SUCCESS;
90 planeTrapezoid.
defineTrapezoid(chamb.halfXShort(), chamb.halfXLong(), chamb.halfY());
91 planeTrapezoid.
setLevel(MSG::VERBOSE);
93 static const Eigen::Rotation2D axisSwap{90. *Gaudi::Units::deg};
94 if (std::abs(locPos.z()) - chamb.halfZ() < -
tolerance &&
96 return StatusCode::SUCCESS;
100 << descr <<
" "<<
Amg::toString(point)<<
" is not part of the chamber volume."
101 <<std::endl<<std::endl<<chamb<<std::endl<<
"Local position "<<
Amg::toString(locPos)
102 <<
", "<<planeTrapezoid
105 return StatusCode::FAILURE;
109 const Acts::TrackingVolume& volume,
111 const std::string& descr,
114 return StatusCode::SUCCESS;
116 const std::vector<Amg::Vector3D> volumeCorners =
cornerPoints(gctx, volume);
119 <<
" is not part of the chamber volume. The corners of the volume are:");
120 for(
const auto& corner : volumeCorners) {
123 return StatusCode::FAILURE;
126 template <
class EnvelopeType>
128 const EnvelopeType& envelope)
const {
129 std::shared_ptr<Acts::Volume> boundVol = envelope.boundingVolume(gctx);
132 if constexpr (std::is_same_v<EnvelopeType, SpectrometerSector>) {
133 if (readOut->msSector() != &envelope) {
135 <<std::endl<<(*readOut->msSector())<<std::endl<<envelope);
136 return StatusCode::FAILURE;
138 }
else if constexpr (std::is_same_v<EnvelopeType, Chamber>) {
139 if (readOut->chamber() != &envelope) {
141 <<std::endl<<(*readOut->chamber())<<std::endl<<envelope);
142 return StatusCode::FAILURE;
145 switch (readOut->detectorType()) {
169 return StatusCode::FAILURE;
173 ATH_MSG_DEBUG(
"All "<<reEles.size()<<
" readout elements are embedded in "<<envelope);
174 return StatusCode::SUCCESS;
179 const auto& bounds = volume.volumeBounds();
180 unsigned int edgeIdx{0};
182 if(bounds.type() == Acts::VolumeBounds::BoundsType::eDiamond){
183 const auto& diamondBounds =
static_cast<const Acts::DiamondVolumeBounds&
>(bounds);
184 using BoundEnum = Acts::DiamondVolumeBounds::BoundValues;
185 std::vector<Amg::Vector3D> edges(12, Amg::Vector3D::Zero());
188 for(
double signX : {-1.,1.}){
189 for(
double signY : {-1., 0., 1.}){
190 for(
double signZ : {-1.,1.}){
192 xCord = diamondBounds.get(BoundEnum::eHalfLengthX2);
194 xCord = diamondBounds.get(BoundEnum::eHalfLengthX1);
195 yCord = diamondBounds.get(BoundEnum::eLengthY1);
198 xCord = diamondBounds.get(BoundEnum::eHalfLengthX3);
199 yCord = diamondBounds.get(BoundEnum::eLengthY2);
205 signZ*diamondBounds.get(BoundEnum::eHalfLengthZ)};
206 edges[edgeIdx] = volume.localToGlobalTransform(gctx.
context())*edge;
216 std::vector<Amg::Vector3D> edges(8, Amg::Vector3D::Zero());
218 for (
const double signX : {-1., 1.}) {
219 for (
const double signY : { -1., 1.}) {
220 for (
const double signZ: {-1., 1.}) {
224 edges[edgeIdx] = volume.localToGlobalTransform(gctx.
context()) * edge;
235 using BoundEnum = Acts::LineBounds::BoundValues;
236 const auto& bounds =
static_cast<const Acts::LineBounds&
>(surface.bounds());
237 unsigned int edgeIdx{0};
240 for (
const double signX : {-1., 1.}) {
241 for (
const double signY : { -1., 1.}) {
242 for (
const double signZ: {-1., 1.}) {
244 signY*bounds.get(BoundEnum::eR),
245 signZ*bounds.get(BoundEnum::eHalfLengthZ)};
246 edges[edgeIdx] = surface.localToGlobalTransform(gctx.
context()) * edge;
256 if(surface.bounds().type() == Acts::SurfaceBounds::BoundsType::eRectangle) {
257 const Acts::RectangleBounds& bounds =
static_cast<const Acts::RectangleBounds&
>(surface.bounds());
258 using BoundEnum = Acts::RectangleBounds::BoundValues;
260 unsigned int edgeIdx{0};
261 for(
const double signX : {-1., 1.}) {
262 for (
const double signY : { -1., 1.}) {
263 const Amg::Vector3D edge{signX < 0 ? bounds.get(BoundEnum::eMinX) : bounds.get(BoundEnum::eMaxX),
264 signY < 0 ? bounds.get(BoundEnum::eMinY) : bounds.get(BoundEnum::eMaxY), 0.};
265 edges[edgeIdx] = surface.localToGlobalTransform(gctx.
context()) * edge;
270 }
else if(surface.bounds().type() == Acts::SurfaceBounds::BoundsType::eTrapezoid) {
271 using BoundEnum = Acts::TrapezoidBounds::BoundValues;
272 const auto& bounds =
static_cast<const Acts::TrapezoidBounds&
>(surface.bounds());
273 unsigned int edgeIdx{0};
276 for (
const double signX : {-1., 1.}) {
277 for (
const double signY : { -1., 1.}) {
279 Amg::Vector3D(signX*bounds.get(signY < 0 ? BoundEnum::eHalfLengthXnegY : BoundEnum::eHalfLengthXposY),
280 signY*bounds.get(BoundEnum::eHalfLengthY), 0.)};
282 edges[edgeIdx] = surface.localToGlobalTransform(gctx.
context()) * edge;
289 ATH_MSG_FATAL(
"The surface bounds are neither a rectangle nor a trapezoid, this is not supported yet");
295#if defined(FLATTEN) && defined(__GNUC__)
304 const std::vector<Amg::Vector3D>& chamberEdges,
305 const Acts::Volume& volume)
const {
309 double minDist = 1._km;
311 minDist = std::min(minDist, (edge - center).
mag());
315 if (std::ranges::none_of(volume.volumeBounds().values(),
316 [minDist](
const double bound){
317 return minDist < 2.5*bound;
323 const Acts::VolumeBounds& volBounds = volume.volumeBounds();
324 const Acts::Transform3& transform = volume.globalToLocalTransform(gctx.
context());
325 for (
unsigned edge1 = 1; edge1 < chamberEdges.size(); ++edge1) {
326 for (
unsigned edge2 = 0; edge2 < edge1; ++edge2) {
328 const double section = stepLength * step;
333 if (volBounds.inside (transform * testPoint)) {
343 std::vector<const MuonReadoutElement*> allRE =
m_detMgr->getAllReadoutElements();
346 ATH_MSG_INFO(
"Fetched "<<chambers.size()<<
" chambers.");
347 std::vector<const Chamber*> chamberVec{chambers.begin(), chambers.end()};
350 return std::ranges::find(chamberVec,
re->chamber()) == chamberVec.end();
352 if (missChamb != allRE.end()) {
353 ATH_MSG_FATAL(
"The chamber "<<(*(*missChamb)->chamber())<<
" is not in the chamber set");
354 return StatusCode::FAILURE;
359 std::vector<std::shared_ptr<Acts::Volume> > chamberBoundsVec;
360 chamberBoundsVec.reserve (chamberVec.size());
361 for (
const Chamber* ch : chamberVec)
362 chamberBoundsVec.push_back (ch->boundingVolume(gctx));
364 std::set<const Chamber*> overlapChambers{};
365 std::stringstream overlapstream{};
366 for (std::size_t chIdx = 0; chIdx< chamberVec.size(); ++chIdx) {
367 const Chamber& chamber{*chamberVec[chIdx]};
368 const Acts::Volume& chamberBounds = *chamberBoundsVec[chIdx];
370 saveEnvelope(gctx, std::format(
"Chamber_{:}{:}{:}{:}{:}",
372 chName(chamber.chamberIndex()),
373 Acts::abs(chamber.stationEta()),
374 chamber.stationEta() > 0 ?
'A' :
'C',
375 chamber.stationPhi()),
376 chamberBounds, chamber.readoutEles());
379 const std::vector<Amg::Vector3D> chambCorners =
cornerPoints(gctx, chamberBounds);
381 std::vector<const Chamber*> overlaps{};
382 for (std::size_t chIdx1 = 0; chIdx1<chamberVec.size(); ++chIdx1) {
383 if (chIdx == chIdx1) {
386 const Chamber* overlapTest{chamberVec[chIdx1]};
387 if (
hasOverlap(gctx, chambCorners, *chamberBoundsVec[chIdx1])) {
388 overlaps.push_back(overlapTest);
391 if (overlaps.empty()) {
394 overlapstream<<
"The chamber "<<chamber<<
" overlaps with "<<std::endl;
395 for (
const Chamber* itOverlaps : overlaps) {
396 overlapstream<<
" *** "<<(*itOverlaps)<<std::endl;
398 overlapstream<<std::endl<<std::endl;
399 overlapChambers.insert(overlaps.begin(), overlaps.end());
400 overlapChambers.insert(chamberVec[chIdx]);
402 if (!overlapChambers.empty()) {
403 Acts::ObjVisualization3D visualHelper{};
405 Acts::GeometryView3D::drawVolume(visualHelper, *
hasOverlap->boundingVolume(gctx), gctx.
context());
414 return overlapChambers.empty() ||
m_ignoreOverlapCh ? StatusCode::SUCCESS : StatusCode::FAILURE;
419 std::vector<const MuonReadoutElement*> allREs =
m_detMgr->getAllReadoutElements();
421 if (!
re->msSector()) {
423 return StatusCode::FAILURE;
428 if (sectorFromDet !=
re->msSector()) {
431 <<
" is not the one attached to the readout geometry \n"<<(*
re->msSector())<<
"\n"<<(*sectorFromDet));
432 return StatusCode::FAILURE;
436 const SectorSet sectors =
m_detMgr->getAllSectors();
441 chName(sector->chamberIndex()),
442 sector->side() >0?
'A' :
'C',
443 sector->stationPhi() ),
444 *sector->boundingVolume(gctx), sector->readoutEles(),
445 chamberVolumes(gctx, *sector));
448 const std::shared_ptr<Acts::Volume> secVolume = sector->boundingVolume(gctx);
450 const std::vector<Amg::Vector3D> edges =
cornerPoints(gctx, *chamber->boundingVolume(gctx));
451 unsigned int edgeCount{0};
454 chamber->readoutEles().front()->identify()));
458 return StatusCode::SUCCESS;
462 std::shared_ptr<const Acts::TrackingGeometry>& trackingGeometry)
const {
466 std::vector<const Acts::TrackingVolume*> volumeVec{};
467 std::vector<const Acts::TrackingVolume*> overlapVolumes{};
468 std::vector<const Acts::Surface*> surfacesVec{};
470 trackingGeometry->visitVolumes([&](
const Acts::TrackingVolume* vol){
472 if(vol->volumeBounds().type() == Acts::VolumeBounds::BoundsType::eCylinder){
473 std::ranges::for_each(vol->surfaces(), [&](
const auto& surf){
474 surfacesVec.push_back(&surf);
480 Acts::ObjVisualization3D visualHelper{};
481 for(
const auto& surf : vol->surfaces()){
482 Acts::GeometryView3D::drawSurface(visualHelper, surf, gctx.
context());
484 std::string volName = vol->volumeName();
485 Acts::GeometryView3D::drawVolume(visualHelper, *vol, gctx.
context());
486 ATH_MSG_DEBUG(
"Save new tracking volume 'MsTrackingVol_"<<volName<<
".obj'");
487 visualHelper.write(std::format(
"MsTrackingVol_{:}.obj", volName));
490 volumeVec.push_back(vol);
497 for(std::size_t vIdx = 0; vIdx < volumeVec.size(); vIdx++){
498 const Acts::TrackingVolume* testVol{volumeVec[vIdx]};
499 std::vector<const Acts::TrackingVolume*> overlaps{};
500 const std::vector<Amg::Vector3D> edges =
cornerPoints(gctx, *testVol);
501 const auto childrenVol = testVol->volumes();
502 const auto innerSurfaces = testVol->surfaces();
504 for(
const auto& surface : innerSurfaces){
506 std::vector<Amg::Vector3D> surfEdges = {};
507 if(
const auto* strawSurf =
dynamic_cast<const Acts::StrawSurface*
>(&surface)){
509 <<
" in volume "<<testVol->volumeName());
512 surfEdges = {edges.begin(), edges.end()};
513 }
else if(
const auto* planeSurf =
dynamic_cast<const Acts::PlaneSurface*
>(&surface)){
515 <<
" in volume "<<testVol->volumeName());
518 surfEdges = {edges.begin(), edges.end()};
521 <<
" is neither a straw nor a plane surface");
522 return StatusCode::FAILURE;
526 for(
const auto& edge : surfEdges){
527 if(!(testVol->inside(gctx.
context(), edge,0.01))){
529 <<
" is outside the parent volume" << testVol->volumeName());
537 for(std::size_t vIdx1 = 0 ; vIdx1 < volumeVec.size(); vIdx1++){
538 bool isChild = std::ranges::find_if(childrenVol,
539 [&](
const Acts::TrackingVolume& tv){
return &tv == volumeVec[vIdx1]; }
540 ) != childrenVol.end();
542 bool isMother = (testVol->motherVolume() == volumeVec[vIdx1]);
544 if(vIdx1 == vIdx || isMother){
549 std::vector<Amg::Vector3D> childEdges =
cornerPoints(gctx,*volumeVec[vIdx1]);
550 for(
const auto& edge : childEdges){
551 if(!(testVol->inside(gctx.
context(), edge, 0.01))){
552 ATH_MSG_FATAL(
"The children volume's " << volumeVec[vIdx1]->volumeName()
554 <<
" is outside the parent volume" << testVol->volumeName());
555 return StatusCode::FAILURE;
561 if(
hasOverlap(gctx, edges, *volumeVec[vIdx1])){
562 overlaps.push_back(volumeVec[vIdx1]);
567 auto [
min,
max] = std::ranges::minmax_element(edges, [&](
const auto& cornerA,
const auto& cornerB){
568 return cornerA.perp() < cornerB.perp();
570 double rmin{
min->perp()};
571 double rmax{
max->perp()};
572 bool hasoverlap{
false};
573 for(
const auto& surf : surfacesVec){
576 ATH_MSG_VERBOSE(
"Checking surface "<<surf->name()<<
" , "<<surf->geometryId());
577 if(
const auto* cylSurf =
dynamic_cast<const Acts::CylinderSurface*
>(surf)){
578 using BoundEnum = Acts::CylinderBounds::BoundValues;
579 const auto& bounds =
static_cast<const Acts::CylinderBounds&
>(cylSurf->bounds());
580 const auto& center = cylSurf->center(gctx.
context());
581 radius = bounds.get(BoundEnum::eR);
582 halfZ = bounds.get(BoundEnum:: eHalfLengthZ);
585 hasoverlap = (radius > rmin && radius < rmax);
587 }
else if(
const auto* discSurf =
dynamic_cast<const Acts::DiscSurface*
>(surf)){
588 using BoundEnum = Acts::RadialBounds::BoundValues;
589 const auto& bounds =
static_cast<const Acts::RadialBounds&
>(discSurf->bounds());
590 const auto& center = discSurf->center(gctx.
context());
591 radius = bounds.get(BoundEnum::eMaxR);
594 if(center.z() >
min->z() && center.z() <
max->z()){
595 hasoverlap = (radius > rmin && radius < rmax);
599 ATH_MSG_FATAL(
"The surface "<< surf->geometryId()<<
", "<< surf->name()
600 <<
" is not a cylinder surface or disc - i dont expect any other type at the moment");
601 return StatusCode::FAILURE;
605 ATH_MSG_FATAL(
"The volume " << testVol->volumeName() <<
"overlaps with the surface "<< surf->name() <<
"with geo id" << surf->geometryId());
610 if(overlaps.empty()){
611 ATH_MSG_DEBUG(
"No overlaps detected for the volume "<<testVol->volumeName());
614 overlapVolumes.push_back(testVol);
615 ATH_MSG_ALWAYS(
"The volume " << testVol->volumeName() <<
" overlaps with: ");
616 for(
const auto& overlap: overlaps){
621 if(overlapVolumes.empty()){
622 ATH_MSG_ALWAYS(
"No overlaps detected in the tracking geometry!!");
624 return overlapVolumes.empty() ||
m_ignoreOverlapCh ? StatusCode::SUCCESS : StatusCode::FAILURE;
628 const std::string& envName,
629 const Acts::Volume& envelopeVol,
630 const std::vector<const MuonGMR4::MuonReadoutElement*>& assocRE,
631 const std::vector<std::shared_ptr<Acts::Volume>>& subVols)
const {
632 Acts::ObjVisualization3D visualHelper{};
634 std::ranges::for_each(
re->getSurfaces(),[&visualHelper, &gctx](
const std::shared_ptr<Acts::Surface>& surface){
635 Acts::GeometryView3D::drawSurface(visualHelper, *surface, gctx.context());
638 std::ranges::for_each(subVols, [&visualHelper, &gctx](
const std::shared_ptr<Acts::Volume>& subVol ){
639 Acts::GeometryView3D::drawVolume(visualHelper,*subVol, gctx.
context(), Amg::Transform3D::Identity(),
640 Acts::s_viewPassive);
642 Acts::GeometryView3D::drawVolume(visualHelper, envelopeVol, gctx.
context());
643 ATH_MSG_DEBUG(
"Save new envelope 'MsTrackTest_"<<envName<<
".obj'");
644 visualHelper.write(std::format(
"MsTrackTest_{:}.obj", envName));
650 std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry =
m_trackingGeometrySvc->trackingGeometry();
656 return StatusCode::SUCCESS;
658 template <
class EnvelopeType>
661 const EnvelopeType& chamber,
662 const Acts::Volume& detVol)
const {
665 for (
unsigned int layer = 1; layer <= mdtMl.
numLayers(); ++layer) {
666 for (
unsigned int tube = 1; tube <= mdtMl.
numTubesInLay(); ++tube) {
680 "bottom of the tube box", measId));
682 "sealing of the tube box", measId));
685 "wall to the previous tube", measId));
687 "wall to the next tube", measId));
690 return StatusCode::SUCCESS;
692 template<
class EnvelopeType>
695 const EnvelopeType& chamber,
696 const Acts::Volume& detVol)
const {
701 for (
unsigned int gasGap = 1 ; gasGap <= rpc.
nGasGaps(); ++gasGap) {
703 for (
bool measPhi : {
false,
true}) {
707 doubletPhi, gasGap, measPhi,
strip);
715 return StatusCode::SUCCESS;
717 template <
class EnevelopeType>
720 const EnevelopeType& chamber,
721 const Acts::Volume& detVol)
const {
722 for (
unsigned int gasGap = 1; gasGap <= tgc.
nGasGaps(); ++gasGap){
723 for (
bool isStrip : {
false}) {
725 const unsigned int nChannel = tgc.
numChannels(layHash);
726 for (
unsigned int channel = 1; channel <= nChannel ; ++channel) {
733 return StatusCode::SUCCESS;
735 template <
class EnevelopeType>
738 const EnevelopeType& chamber,
739 const Acts::Volume& detVol)
const {
742 for(
unsigned int gasGap = 1; gasGap <= mm.nGasGaps(); ++gasGap){
744 unsigned int firstStrip = mm.firstStrip(gasGapHash);
745 for(
unsigned int strip = firstStrip;
strip <= mm.numStrips(gasGapHash); ++
strip){
747 ATH_CHECK(
pointInside(gctx, chamber, detVol, mm.stripPosition(gctx, stripId),
"center", stripId));
748 ATH_CHECK(
pointInside(gctx, chamber, detVol, mm.leftStripEdge(gctx, mm.measurementHash(stripId)),
"left edge", stripId));
749 ATH_CHECK(
pointInside(gctx, chamber, detVol, mm.rightStripEdge(gctx, mm.measurementHash(stripId)),
"right edge", stripId));
753 return StatusCode::SUCCESS;
755 template <
class EnvelopeType>
758 const EnvelopeType& chamber,
759 const Acts::Volume& detVol)
const{
762 for(
unsigned int gasGap = 1; gasGap <= stgc.
numLayers(); ++gasGap){
764 for(
unsigned int nch = 1; nch <= stgc.
nChTypes(); ++nch){
766 const unsigned int nStrips = stgc.
numChannels(gasGapHash);
781 return StatusCode::SUCCESS;
const boost::regex re(r_e)
Scalar mag() const
mag method
constexpr std::array< T, N > make_array(const T &def_val)
Helper function to initialize in-place arrays with non-zero values.
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_ALWAYS(x)
#define ATH_MSG_WARNING(x)
Acts::GeometryContext context() const
const ServiceHandle< StoreGateSvc > & detStore() const
void setLevel(MSG::Level lvl)
Change the current logging level.
This is a "hash" representation of an Identifier.
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
Chamber represent the volume enclosing a muon station.
std::vector< const MuonReadoutElement * > ReadoutSet
Define the list of read out elements of the chamber.
Readout element to describe the Monitored Drift Tube (Mdt) chambers Mdt chambers usually comrpise out...
Amg::Vector3D highVoltPos(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the endpoint of the tube connected to the high voltage in the ATLAS coordinate frame.
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 readOutPos(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the endpoint of the tube where the readout card is mounted in the ATLAS coordinate frame.
const parameterBook & getParameters() const
Get a const reference to the parameter book.
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 innerTubeRadius() const
Returns the inner tube radius.
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...
static IdentifierHash createHash(const int gasGap, const int strip)
std::vector< const Chamber * > MuonChamberSet
std::vector< const SpectrometerSector * > MuonSectorSet
MuonReadoutElement is an abstract class representing the geometry of a muon detector.
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...
Identifier identify() const override final
Return the ATLAS identifier.
unsigned nPhiStrips() const
Number of strips measuring the phi coordinate.
Amg::Vector3D leftStripEdge(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the global posiition of the strip edge at positive local Y.
int doubletZ() const
Returns the doublet Z field of the MuonReadoutElement identifier.
int doubletPhi() const
Returns the doublet Phi field of the MuonReadoutElement identifier.
Amg::Vector3D rightStripEdge(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the global position of the strip edge at negative local Y.
unsigned nEtaStrips() const
Number of strips measuring the eta coordinate.
int doubletPhiMax() const
Returns the maximum phi panel.
const parameterBook & getParameters() const
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)
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
const ChamberSet & chambers() const
Returns the associated chambers with this sector.
GeoModel::TransientConstSharedPtr< Chamber > ChamberPtr
void defineStripLayout(Amg::Vector2D &&posFirst, const double stripPitch, const double stripWidth, const int numStrips, const int numFirst=1)
Defines the layout of the strip detector by specifing the position of the first strip w....
CheckVector2D leftEdge(int stripNumb) const
Returns the left edge of the strip (Global numbering scheme)
void defineTrapezoid(double HalfShortY, double HalfLongY, double HalfHeight)
Defines the edges of the trapezoid.
bool insideTrapezoid(const Amg::Vector2D &extPos) const
Checks whether an external point is inside the trapezoidal area.
CheckVector2D rightEdge(int stripNumb) const
Returns the right edge of the strip (Global numbering scheme)
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)
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 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.
Amg::Vector3D leftStripEdge(const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
int multilayer() const
Returns the multilayer of the sTgcReadoutElement.
unsigned nChTypes() const
Number of Channel Types.
Amg::Vector3D rightStripEdge(const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
unsigned numLayers() const
Returns the number of gas gap layers.
ReadoutChannelType
ReadoutChannelType to distinguish the available readout channels Pad - pad readout channel Strip - et...
Amg::Vector3D globalChannelPosition(const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
Returns the global pad/strip/wireGroup position.
static IdentifierHash createHash(const unsigned gasGap, const unsigned channelType, const unsigned channel, const unsigned wireInGrp=0)
Create a measurement hash from the Identifier fields.
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
std::string to_string(const DetectorType &type)
@ Mm
Maybe not needed in the migration.
@ Tgc
Resitive Plate Chambers.
@ Rpc
Monitored Drift Tubes.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
double halfY(const Acts::VolumeBounds &bounds)
Returns the half-Y length for the parsed volume bounds (Trapezoid/ Cuboid)
SpectrometerSector::ChamberSet ChamberSet
double halfZ(const Acts::VolumeBounds &bounds)
Returns the half-Z length for the parsed volume bounds (Trapezoid/ Cuboid)
double halfXhighY(const Acts::VolumeBounds &bounds)
Returns the half-Y length @ posiive Y for the parsed volume bounds (Trapezoid/ Cuboid)
double halfXlowY(const Acts::VolumeBounds &bounds)
Returns the half-X length @ negative Y for the parsed volume bounds (Trapezoid/ Cuboid)
const std::string & chName(ChIndex index)
convert ChIndex into a string
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.