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

#include <MuonChamberToolTest.h>

Inheritance diagram for MuonGMR4::MuonChamberToolTest:
Collaboration diagram for MuonGMR4::MuonChamberToolTest:

Public Member Functions

 ~MuonChamberToolTest ()=default
StatusCode execute (const EventContext &ctx) const override
StatusCode initialize () override
bool isReEntrant () const override final
template<class EnevelopeType>
StatusCode testReadoutEle (const ActsTrk::GeometryContext &gctx, const TgcReadoutElement &tgc, const EnevelopeType &chamber, const Acts::Volume &detVol) const
template<class EnevelopeType>
StatusCode testReadoutEle (const ActsTrk::GeometryContext &gctx, const MmReadoutElement &mm, const EnevelopeType &chamber, const Acts::Volume &detVol) const
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

std::array< Amg::Vector3D, 8 > cornerPoints (const Acts::Volume &volume) const
 Returns the 8 edge points from a trapezoidal / cuboid volume.
std::array< Amg::Vector3D, 8 > cornerPoints (const Acts::GeometryContext &gctx, const Acts::StrawSurface &surface) const
std::array< Amg::Vector3D, 4 > cornerPoints (const Acts::GeometryContext &gctx, const Acts::PlaneSurface &) const
void saveEnvelope (const ActsTrk::GeometryContext &gctx, const std::string &envName, const Acts::Volume &envelopeVol, const std::vector< const MuonGMR4::MuonReadoutElement * > &assocRE, const std::vector< std::shared_ptr< Acts::Volume > > &subVolumes={}) const
StatusCode checkChambers (const ActsTrk::GeometryContext &gctx) const
 Check whether the chamber envelopes are consistent.
StatusCode checkEnvelopes (const ActsTrk::GeometryContext &gctx) const
 Check envelopes.
template<class EnvelopeType>
StatusCode allReadoutInEnvelope (const ActsTrk::GeometryContext &ctx, const EnvelopeType &envelope) const
 Checks whether the readout elements of an enevelope are completely embedded into the envelope.
template<class EnvelopeType>
StatusCode pointInside (const EnvelopeType &envelope, const Acts::Volume &boundVol, const Amg::Vector3D &point, const std::string &descr, const Identifier &channelId) const
 Checks whether the point is inside of an envelope object, i.e.
StatusCode pointInside (const Acts::TrackingVolume &volume, const Amg::Vector3D &point, const std::string &descr, const Identifier &chamberId) const
 Checks whether the point is inside a tracking volume.
bool hasOverlap (const std::array< Amg::Vector3D, 8 > &chamberEdges, const Acts::Volume &volume) const
template<class EnvelopeType>
StatusCode testReadoutEle (const ActsTrk::GeometryContext &gctx, const MdtReadoutElement &readOutEle, const EnvelopeType &envelope, const Acts::Volume &boundVol) const
 Checks whether all channels of a given readout element are fully covered by the envelope.
template<class EnvelopeType>
StatusCode testReadoutEle (const ActsTrk::GeometryContext &gctx, const RpcReadoutElement &readOutEle, const EnvelopeType &envelope, const Acts::Volume &boundVol) const
template<class EnvelopeType>
StatusCode testReadoutEle (const ActsTrk::GeometryContext &gctx, const TgcReadoutElement &readOutEle, const EnvelopeType &envelope, const Acts::Volume &boundVol) const
template<class EnvelopeType>
StatusCode testReadoutEle (const ActsTrk::GeometryContext &gctx, const sTgcReadoutElement &readOutEle, const EnvelopeType &envelope, const Acts::Volume &boundVol) const
template<class EnvelopeType>
StatusCode testReadoutEle (const ActsTrk::GeometryContext &gctx, const MmReadoutElement &readOutEle, const EnvelopeType &envelope, const Acts::Volume &boundVol) const
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
SG::ReadHandleKey< ActsTrk::GeometryContextm_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
ServiceHandle< ActsTrk::ITrackingGeometrySvcm_trackingGeometrySvc {this, "TrackingGeometrySvc","ActsTrackingGeometrySvc"}
Gaudi::Property< unsigned > m_overlapSamples {this, "overlapSamples", 100}
 Number of points to scan along the lines between two volume corners to check whether they belong to an another volume.
Gaudi::Property< std::string > m_overlapChambObj {this, "chamberOverlapFile", "OverlapingChambers.obj"}
 Name of the chamber output obj file.
Gaudi::Property< bool > m_ignoreOverlapCh {this, "ignoreChamberOverlap", true}
 The overlap of chamber volumes does not lead to a failure.
Gaudi::Property< bool > m_dumpObjs {this, "dumpVolumes" , false}
 Dump the chambers & sectors as separate obj files.
const 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 29 of file MuonChamberToolTest.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

◆ ~MuonChamberToolTest()

MuonGMR4::MuonChamberToolTest::~MuonChamberToolTest ( )
default

Member Function Documentation

◆ allReadoutInEnvelope()

template<class EnvelopeType>
StatusCode MuonGMR4::MuonChamberToolTest::allReadoutInEnvelope ( const ActsTrk::GeometryContext & ctx,
const EnvelopeType & envelope ) const
private

Checks whether the readout elements of an enevelope are completely embedded into the envelope.

Definition at line 119 of file MuonChamberToolTest.cxx.

120 {
121 std::shared_ptr<Acts::Volume> boundVol = envelope.boundingVolume(gctx);
122 const Chamber::ReadoutSet reEles = envelope.readoutEles();
123 for(const MuonReadoutElement* readOut : reEles) {
124 if constexpr (std::is_same_v<EnvelopeType, SpectrometerSector>) {
125 if (readOut->msSector() != &envelope) {
126 ATH_MSG_FATAL("Mismatch in the sector association "<<m_idHelperSvc->toStringDetEl(readOut->identify())
127 <<std::endl<<(*readOut->msSector())<<std::endl<<envelope);
128 return StatusCode::FAILURE;
129 }
130 } else if constexpr (std::is_same_v<EnvelopeType, Chamber>) {
131 if (readOut->chamber() != &envelope) {
132 ATH_MSG_FATAL("Mismatch in the chamber association "<<m_idHelperSvc->toStringDetEl(readOut->identify())
133 <<std::endl<<(*readOut->chamber())<<std::endl<<envelope);
134 return StatusCode::FAILURE;
135 }
136 }
137 switch (readOut->detectorType()) {
139 const auto* detEle = static_cast<const TgcReadoutElement*>(readOut);
140 ATH_CHECK(testReadoutEle(gctx, *detEle, envelope, *boundVol));
141 break;
143 const auto* detEle = static_cast<const MdtReadoutElement*>(readOut);
144 ATH_CHECK(testReadoutEle(gctx, *detEle, envelope, *boundVol));
145 break;
147 const auto* detEle = static_cast<const RpcReadoutElement*>(readOut);
148 ATH_CHECK(testReadoutEle(gctx, *detEle, envelope, *boundVol));
149 break;
151 const auto* detEle = static_cast<const MmReadoutElement*>(readOut);
152 ATH_CHECK(testReadoutEle(gctx, *detEle, envelope, *boundVol));
153 break;
155 const auto* detEle = static_cast<const sTgcReadoutElement*>(readOut);
156 ATH_CHECK(testReadoutEle(gctx, *detEle, envelope, *boundVol));
157 break;
158 } default: {
159 ATH_MSG_FATAL("Who came up with putting "<<ActsTrk::to_string(readOut->detectorType())
160 <<" into the MS");
161 return StatusCode::FAILURE;
162 }
163 }
164 }
165 ATH_MSG_DEBUG("All "<<reEles.size()<<" readout elements are embedded in "<<envelope);
166 return StatusCode::SUCCESS;
167 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
std::vector< const MuonReadoutElement * > ReadoutSet
Define the list of read out elements of the chamber.
Definition Chamber.h:26
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
StatusCode testReadoutEle(const ActsTrk::GeometryContext &gctx, const MdtReadoutElement &readOutEle, const EnvelopeType &envelope, const Acts::Volume &boundVol) const
Checks whether all channels of a given readout element are fully covered by the envelope.
std::string to_string(const DetectorType &type)
@ Mm
Maybe not needed in the migration.
@ Tgc
Resitive Plate Chambers.
@ sTgc
Micromegas (NSW)
@ Rpc
Monitored Drift Tubes.
@ Mdt
MuonSpectrometer.

◆ 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}

◆ checkChambers()

StatusCode MuonGMR4::MuonChamberToolTest::checkChambers ( const ActsTrk::GeometryContext & gctx) const
private

Check whether the chamber envelopes are consistent.

Check the overlap with other chambers

Definition at line 294 of file MuonChamberToolTest.cxx.

294 {
295
296 std::vector<const MuonReadoutElement*> allRE = m_detMgr->getAllReadoutElements();
298 const ChamberSet chambers = m_detMgr->getAllChambers();
299 ATH_MSG_INFO("Fetched "<<chambers.size()<<" chambers.");
300 std::vector<const Chamber*> chamberVec{chambers.begin(), chambers.end()};
301
302 const auto missChamb = std::ranges::find_if(allRE, [&chamberVec](const MuonGMR4::MuonReadoutElement* re){
303 return std::ranges::find(chamberVec, re->chamber()) == chamberVec.end();
304 });
305 if (missChamb != allRE.end()) {
306 ATH_MSG_FATAL("The chamber "<<(*(*missChamb)->chamber())<<" is not in the chamber set");
307 return StatusCode::FAILURE;
308 }
309
310 std::set<const Chamber*> overlapChambers{};
311 std::stringstream overlapstream{};
312 for (std::size_t chIdx = 0; chIdx< chamberVec.size(); ++chIdx) {
313 const Chamber& chamber{*chamberVec[chIdx]};
314 if (m_dumpObjs) {
315 saveEnvelope(gctx, std::format("Chamber_{:}{:}{:}{:}{:}",
316 ActsTrk::to_string(chamber.detectorType()),
317 chName(chamber.chamberIndex()),
318 Acts::abs(chamber.stationEta()),
319 chamber.stationEta() > 0 ? 'A' : 'C',
320 chamber.stationPhi()),
321 *chamber.boundingVolume(gctx), chamber.readoutEles());
322 }
323 ATH_CHECK(allReadoutInEnvelope(gctx, chamber));
324 const std::array<Amg::Vector3D, 8> chambCorners = cornerPoints(*chamber.boundingVolume(gctx));
326 std::vector<const Chamber*> overlaps{};
327 for (std::size_t chIdx1 = 0; chIdx1<chamberVec.size(); ++chIdx1) {
328 if (chIdx == chIdx1) {
329 continue;
330 }
331 const Chamber* overlapTest{chamberVec[chIdx1]};
332 if (hasOverlap(chambCorners, *(overlapTest->boundingVolume(gctx)))) {
333 overlaps.push_back(overlapTest);
334 }
335 }
336 if (overlaps.empty()) {
337 continue;
338 }
339 overlapstream<<"The chamber "<<chamber<<" overlaps with "<<std::endl;
340 for (const Chamber* itOverlaps : overlaps) {
341 overlapstream<<" *** "<<(*itOverlaps)<<std::endl;
342 }
343 overlapstream<<std::endl<<std::endl;
344 overlapChambers.insert(overlaps.begin(), overlaps.end());
345 overlapChambers.insert(chamberVec[chIdx]);
346 }
347 if (!overlapChambers.empty()) {
348 Acts::ObjVisualization3D visualHelper{};
349 for (const Chamber* hasOverlap: overlapChambers) {
350 Acts::GeometryView3D::drawVolume(visualHelper, *hasOverlap->boundingVolume(gctx), gctx.context());
351 visualHelper.write(m_overlapChambObj.value());
352 }
353 if (m_ignoreOverlapCh) {
354 ATH_MSG_WARNING(overlapstream.str());
355 } else {
356 ATH_MSG_FATAL(overlapstream.str());
357 }
358 }
359 return overlapChambers.empty() || m_ignoreOverlapCh ? StatusCode::SUCCESS : StatusCode::FAILURE;
360 }
const boost::regex re(r_e)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
Acts::GeometryContext context() const
const MuonDetectorManager * m_detMgr
std::array< Amg::Vector3D, 8 > cornerPoints(const Acts::Volume &volume) const
Returns the 8 edge points from a trapezoidal / cuboid volume.
Gaudi::Property< bool > m_ignoreOverlapCh
The overlap of chamber volumes does not lead to a failure.
void saveEnvelope(const ActsTrk::GeometryContext &gctx, const std::string &envName, const Acts::Volume &envelopeVol, const std::vector< const MuonGMR4::MuonReadoutElement * > &assocRE, const std::vector< std::shared_ptr< Acts::Volume > > &subVolumes={}) const
bool hasOverlap(const std::array< Amg::Vector3D, 8 > &chamberEdges, const Acts::Volume &volume) const
Gaudi::Property< bool > m_dumpObjs
Dump the chambers & sectors as separate obj files.
Gaudi::Property< std::string > m_overlapChambObj
Name of the chamber output obj file.
StatusCode allReadoutInEnvelope(const ActsTrk::GeometryContext &ctx, const EnvelopeType &envelope) const
Checks whether the readout elements of an enevelope are completely embedded into the envelope.
SpectrometerSector::ChamberSet ChamberSet
const std::string & chName(ChIndex index)
convert ChIndex into a string
Chamber
Define chamber types and locations.

◆ checkEnvelopes()

StatusCode MuonGMR4::MuonChamberToolTest::checkEnvelopes ( const ActsTrk::GeometryContext & gctx) const
private

Check envelopes.

Definition at line 362 of file MuonChamberToolTest.cxx.

362 {
363
364 std::vector<const MuonReadoutElement*> allREs = m_detMgr->getAllReadoutElements();
365 for (const MuonReadoutElement* re : allREs) {
366 if (!re->msSector()) {
367 ATH_MSG_FATAL("The readout element "<<m_idHelperSvc->toStringDetEl(re->identify())<<" does not have any sector associated ");
368 return StatusCode::FAILURE;
369 }
370 const SpectrometerSector* sectorFromDet = m_detMgr->getSectorEnvelope(re->chamberIndex(),
371 m_idHelperSvc->sector(re->identify()),
372 re->stationEta());
373 if (sectorFromDet != re->msSector()) {
374 ATH_MSG_FATAL("The sector attached to "<<m_idHelperSvc->toStringDetEl(re->identify())
375 <<", chIdx: "<<chName(re->chamberIndex())<<", sector: "<<m_idHelperSvc->sector(re->identify())
376 <<" is not the one attached to the readout geometry \n"<<(*re->msSector())<<"\n"<<(*sectorFromDet));
377 return StatusCode::FAILURE;
378 }
379 }
380 using SectorSet = MuonDetectorManager::MuonSectorSet;
381 const SectorSet sectors = m_detMgr->getAllSectors();
382 ATH_MSG_INFO("Fetched "<<sectors.size()<<" sectors. ");
383 for (const SpectrometerSector* sector : sectors) {
384 if (m_dumpObjs) {
385 saveEnvelope(gctx, std::format("Sector_{:}{:}{:}",
386 chName(sector->chamberIndex()),
387 sector->side() >0? 'A' :'C',
388 sector->stationPhi() ),
389 *sector->boundingVolume(gctx), sector->readoutEles(),
390 chamberVolumes(gctx, *sector));
391 }
392 ATH_CHECK(allReadoutInEnvelope(gctx, *sector));
393 const std::shared_ptr<Acts::Volume> secVolume = sector->boundingVolume(gctx);
394 for (const SpectrometerSector::ChamberPtr& chamber : sector->chambers()){
395 const std::array<Amg::Vector3D, 8> edges = cornerPoints(*chamber->boundingVolume(gctx));
396 unsigned int edgeCount{0};
397 for (const Amg::Vector3D& edge : edges) {
398 ATH_CHECK(pointInside(*sector,*secVolume, edge, std::format("Edge {:}", ++edgeCount),
399 chamber->readoutEles().front()->identify()));
400 }
401 }
402 }
403 return StatusCode::SUCCESS;
404 }
StatusCode pointInside(const EnvelopeType &envelope, const Acts::Volume &boundVol, const Amg::Vector3D &point, const std::string &descr, const Identifier &channelId) const
Checks whether the point is inside of an envelope object, i.e.
GeoModel::TransientConstSharedPtr< Chamber > ChamberPtr
Eigen::Matrix< double, 3, 1 > Vector3D

◆ cornerPoints() [1/3]

std::array< Amg::Vector3D, 4 > MuonGMR4::MuonChamberToolTest::cornerPoints ( const Acts::GeometryContext & gctx,
const Acts::PlaneSurface & surface ) const
private

Account for the stereo angle of the micromega geometry

Definition at line 210 of file MuonChamberToolTest.cxx.

210 {
211 std::array<Amg::Vector3D, 4> edges{make_array<Amg::Vector3D,4>(Amg::Vector3D::Zero())};
212 if(surface.bounds().type() == Acts::SurfaceBounds::BoundsType::eRectangle) { //RPC surfaces are rectangles
213 const Acts::RectangleBounds& bounds = static_cast<const Acts::RectangleBounds&>(surface.bounds());
214 using BoundEnum = Acts::RectangleBounds::BoundValues;
215
216 unsigned int edgeIdx{0};
217 for(const double signX : {-1., 1.}) {
218 for (const double signY : { -1., 1.}) {
219 const Amg::Vector3D edge{signX < 0 ? bounds.get(BoundEnum::eMinX) : bounds.get(BoundEnum::eMaxX),
220 signY < 0 ? bounds.get(BoundEnum::eMinY) : bounds.get(BoundEnum::eMaxY), 0.};
221 edges[edgeIdx] = surface.transform(gctx) * edge;
222 ++edgeIdx;
223 }
224 }
225 return edges;
226 } else if(surface.bounds().type() == Acts::SurfaceBounds::BoundsType::eTrapezoid) {
227 using BoundEnum = Acts::TrapezoidBounds::BoundValues;
228 const auto& bounds = static_cast<const Acts::TrapezoidBounds&>(surface.bounds());
229 unsigned int edgeIdx{0};
230
231 ATH_MSG_VERBOSE("Fetch volume bounds "<<Amg::toString(surface.transform(gctx)));
232 for (const double signX : {-1., 1.}) {
233 for (const double signY : { -1., 1.}) {
234 const Amg::Vector3D edge{Amg::getRotateZ3D(-1.*bounds.get(BoundEnum::eRotationAngle)) *
235 Amg::Vector3D(signX*bounds.get(signY < 0 ? BoundEnum::eHalfLengthXnegY : BoundEnum::eHalfLengthXposY),
236 signY*bounds.get(BoundEnum::eHalfLengthY), 0.)};
237
238 edges[edgeIdx] = surface.transform(gctx) * edge;
239 ++edgeIdx;
240 }
241 }
242
243 return edges;
244 } else {
245 ATH_MSG_FATAL("The surface bounds are neither a rectangle nor a trapezoid, this is not supported yet");
246 return edges;
247 }
248 }
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_VERBOSE(x)
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis

◆ cornerPoints() [2/3]

std::array< Amg::Vector3D, 8 > MuonGMR4::MuonChamberToolTest::cornerPoints ( const Acts::GeometryContext & gctx,
const Acts::StrawSurface & surface ) const
private

Definition at line 189 of file MuonChamberToolTest.cxx.

189 {
190 std::array<Amg::Vector3D, 8> edges{make_array<Amg::Vector3D,8>(Amg::Vector3D::Zero())};
191 using BoundEnum = Acts::LineBounds::BoundValues;
192 const auto& bounds = static_cast<const Acts::LineBounds&>(surface.bounds());
193 unsigned int edgeIdx{0};
194
195 ATH_MSG_VERBOSE("Fetch volume bounds "<<Amg::toString(surface.transform(gctx)));
196 for (const double signX : {-1., 1.}) {
197 for (const double signY : { -1., 1.}) {
198 for (const double signZ: {-1., 1.}) {
199 const Amg::Vector3D edge{signX*bounds.get(BoundEnum::eR),
200 signY*bounds.get(BoundEnum::eR),
201 signZ*bounds.get(BoundEnum::eHalfLengthZ)};
202 edges[edgeIdx] = surface.transform(gctx) * edge;
203 ++edgeIdx;
204 }
205 }
206 }
207 return edges;
208 }

◆ cornerPoints() [3/3]

std::array< Amg::Vector3D, 8 > MuonGMR4::MuonChamberToolTest::cornerPoints ( const Acts::Volume & volume) const
private

Returns the 8 edge points from a trapezoidal / cuboid volume.

Definition at line 169 of file MuonChamberToolTest.cxx.

169 {
170 std::array<Amg::Vector3D, 8> edges{make_array<Amg::Vector3D,8>(Amg::Vector3D::Zero())};
171 unsigned int edgeIdx{0};
172 ATH_MSG_VERBOSE("Fetch volume bounds "<<Amg::toString(volume.transform()));
173 const auto& bounds = volume.volumeBounds();
174 for (const double signX : {-1., 1.}) {
175 for (const double signY : { -1., 1.}) {
176 for (const double signZ: {-1., 1.}) {
177 const Amg::Vector3D edge{signX* (signY>0 ? MuonGMR4::halfXhighY(bounds) : MuonGMR4::halfXlowY(bounds)),
178 signY*MuonGMR4::halfY(bounds),
179 signZ*MuonGMR4::halfZ(bounds)};
180 edges[edgeIdx] = volume.transform() * edge;
181 ATH_MSG_VERBOSE("Local edge "<<Amg::toString(edge)<<", global edge: "<<Amg::toString(edges[edgeIdx]));
182 ++edgeIdx;
183 }
184 }
185 }
186 return edges;
187 }
double halfY(const Acts::VolumeBounds &bounds)
Returns the half-Y length for the parsed volume bounds (Trapezoid/ Cuboid)
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)

◆ 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.

◆ 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::MuonChamberToolTest::execute ( const EventContext & ctx) const
override

Check that all chambers covered by their sector envelopes

Definition at line 425 of file MuonChamberToolTest.cxx.

425 {
426 const ActsTrk::GeometryContext* gctx{nullptr};
427 ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
428 std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry = m_trackingGeometrySvc->trackingGeometry();
430 ATH_CHECK(checkChambers(*gctx));
432
433 return StatusCode::SUCCESS;
434 }
StatusCode checkEnvelopes(const ActsTrk::GeometryContext &gctx) const
Check envelopes.
StatusCode checkChambers(const ActsTrk::GeometryContext &gctx) const
Check whether the chamber envelopes are consistent.
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.

◆ 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

◆ hasOverlap()

bool MuonGMR4::MuonChamberToolTest::hasOverlap ( const std::array< Amg::Vector3D, 8 > & chamberEdges,
const Acts::Volume & volume ) const
private

First check that there's at least a chance that the edges might overlap with the center

The bound values contain the half length's if the minDist is within reach Then continue the check

Definition at line 258 of file MuonChamberToolTest.cxx.

259 {
260
262 const Amg::Vector3D center{volume.center()};
263 double minDist = 1._km;
264 for (const Amg::Vector3D& edge : chamberEdges) {
265 minDist = std::min(minDist, (edge - center).mag());
266 }
269 std::vector<double> boundValues = volume.volumeBounds().values();
270 if (std::ranges::none_of(boundValues, [minDist](const double bound){
271 return minDist < 2.5*bound;
272 })) {
273 return false;
274 }
275 const double stepLength = 1. / m_overlapSamples;
276
277 const Acts::VolumeBounds& volBounds = volume.volumeBounds();
278 const Acts::Transform3& itransform = volume.itransform();
279 for (unsigned edge1 = 1; edge1 < chamberEdges.size(); ++edge1) {
280 for (unsigned edge2 = 0; edge2 < edge1; ++edge2) {
281 for (unsigned step = 0 ; step <= m_overlapSamples; ++step) {
282 const double section = stepLength * step;
283 const Amg::Vector3D testPoint = section* chamberEdges[edge1] + (1. -section) *chamberEdges[edge2];
284 // Using acts::Volume::inside is horribly slow in dbg builds.
285 Acts::Vector3 posInVolFrame = itransform * testPoint;
286 if (volBounds.inside (posInVolFrame)) {
287 return true;
288 }
289 }
290 }
291 }
292 return false;
293 }
Scalar mag() const
mag method
void section(const std::string &sec)
Gaudi::Property< unsigned > m_overlapSamples
Number of points to scan along the lines between two volume corners to check whether they belong to a...

◆ initialize()

StatusCode MuonGMR4::MuonChamberToolTest::initialize ( )
override

Definition at line 50 of file MuonChamberToolTest.cxx.

50 {
51 ATH_CHECK(m_idHelperSvc.retrieve());
52 ATH_CHECK(m_geoCtxKey.initialize());
55 return StatusCode::SUCCESS;
56 }
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()

bool MuonGMR4::MuonChamberToolTest::isReEntrant ( ) const
inlinefinaloverride

Definition at line 37 of file MuonChamberToolTest.h.

37{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.

◆ pointInside() [1/2]

StatusCode MuonGMR4::MuonChamberToolTest::pointInside ( const Acts::TrackingVolume & volume,
const Amg::Vector3D & point,
const std::string & descr,
const Identifier & chamberId ) const
private

Checks whether the point is inside a tracking volume.

Parameters
volumeReference to the tracking volume to check
pointPoint that needs to be inside the volume
descrDescription of the point
chamberIdIdentifier for more information if the point is outside

Definition at line 102 of file MuonChamberToolTest.cxx.

105 {
106 if (volume.inside(point, tolerance)) {
107 return StatusCode::SUCCESS;
108 }
109 const std::array<Amg::Vector3D, 8> volumeCorners = cornerPoints(volume);
110 ATH_MSG_FATAL("In channel "<<m_idHelperSvc->toString(chamberId) <<", the point "
111 << descr <<" "<<Amg::toString(volume.itransform()* point)<<" is not part of the chamber volume. The corners of the volume are:");
112 for(const auto& corner : volumeCorners) {
113 ATH_MSG_FATAL(" "<<Amg::toString(volume.itransform()*corner));
114 }
115 return StatusCode::FAILURE;
116 }
constexpr double tolerance

◆ pointInside() [2/2]

template<class EnvelopeType>
StatusCode MuonGMR4::MuonChamberToolTest::pointInside ( const EnvelopeType & envelope,
const Acts::Volume & boundVol,
const Amg::Vector3D & point,
const std::string & descr,
const Identifier & channelId ) const
private

Checks whether the point is inside of an envelope object, i.e.

the spectrometer sector or the chamber

Parameters
envelopeReference to the envelope to check
boundVolReference to the bounding volume representing the envelope
pointPoint that needs to be inside the volume
descrDescription of the point
channelIdIdentifier for more information if the point is outside

Why does the strip design give a different result than the Acts bounds?

Definition at line 66 of file MuonChamberToolTest.cxx.

70 {
71
72 // Explicitly inline Volume::inside here so that it gets
73 // flattened in debug builds.
74 Acts::Vector3 posInVolFrame((boundVol.transform().inverse()) * point);
75 if (boundVol.volumeBounds().inside(posInVolFrame,tolerance)) {
76 ATH_MSG_VERBOSE("In channel "<<m_idHelperSvc->toString(channelId)
77 <<", point "<<descr <<" is inside of the chamber "<<std::endl<<chamb<<std::endl
78 <<"Local position:" <<Amg::toString(boundVol.itransform() * point));
79 return StatusCode::SUCCESS;
80 }
81 const Amg::Vector3D locPos{boundVol.itransform() * point};
82
83 StripDesign planeTrapezoid{};
84 planeTrapezoid.defineTrapezoid(chamb.halfXShort(), chamb.halfXLong(), chamb.halfY());
85 planeTrapezoid.setLevel(MSG::VERBOSE);
87 static const Eigen::Rotation2D axisSwap{90. *Gaudi::Units::deg};
88 if (std::abs(locPos.z()) - chamb.halfZ() < -tolerance &&
89 planeTrapezoid.insideTrapezoid(axisSwap*locPos.block<2,1>(0,0))) {
90 return StatusCode::SUCCESS;
91 }
92 planeTrapezoid.defineStripLayout(locPos.y() * Amg::Vector2D::UnitX(), 1, 1, 1);
93 ATH_MSG_FATAL("In channel "<<m_idHelperSvc->toString(channelId) <<", the point "
94 << descr <<" "<<Amg::toString(point)<<" is not part of the chamber volume."
95 <<std::endl<<std::endl<<chamb<<std::endl<<"Local position "<<Amg::toString(locPos)
96 <<", "<<planeTrapezoid
97 <<", box left edge: "<<Amg::toString(planeTrapezoid.leftEdge(1).value_or(Amg::Vector2D::Zero()))
98 <<", box right edge "<<Amg::toString(planeTrapezoid.rightEdge(1).value_or(Amg::Vector2D::Zero())));
99 return StatusCode::FAILURE;
100 }

◆ 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 }

◆ saveEnvelope()

void MuonGMR4::MuonChamberToolTest::saveEnvelope ( const ActsTrk::GeometryContext & gctx,
const std::string & envName,
const Acts::Volume & envelopeVol,
const std::vector< const MuonGMR4::MuonReadoutElement * > & assocRE,
const std::vector< std::shared_ptr< Acts::Volume > > & subVolumes = {} ) const
private

Definition at line 405 of file MuonChamberToolTest.cxx.

409 {
410 Acts::ObjVisualization3D visualHelper{};
411 std::ranges::for_each(assocRE, [&visualHelper, &gctx](const MuonReadoutElement* re){
412 std::ranges::for_each(re->getSurfaces(),[&visualHelper, &gctx](const std::shared_ptr<Acts::Surface>& surface){
413 Acts::GeometryView3D::drawSurface(visualHelper, *surface, gctx.context());
414 });
415 });
416 std::ranges::for_each(subVols, [&visualHelper, &gctx](const std::shared_ptr<Acts::Volume>& subVol ){
417 Acts::GeometryView3D::drawVolume(visualHelper,*subVol, gctx.context(), Amg::Transform3D::Identity(),
418 Acts::s_viewPassive);
419 });
420 Acts::GeometryView3D::drawVolume(visualHelper, envelopeVol, gctx.context());
421 ATH_MSG_DEBUG("Save new envelope 'MsTrackTest_"<<envName<<".obj'");
422 visualHelper.write(std::format("MsTrackTest_{:}.obj", envName));
423 }

◆ 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}
#define ATH_MSG_ERROR(x)
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.

◆ testReadoutEle() [1/7]

template<class EnvelopeType>
StatusCode MuonGMR4::MuonChamberToolTest::testReadoutEle ( const ActsTrk::GeometryContext & gctx,
const MdtReadoutElement & readOutEle,
const EnvelopeType & envelope,
const Acts::Volume & boundVol ) const
private

Checks whether all channels of a given readout element are fully covered by the envelope.

Parameters
gctxGeometry context carrying all alignment & global transformations
readOutEleReadout element to test
envelopeReference to the envelope to check
boundVolBounding volume representing the envelope

Definition at line 436 of file MuonChamberToolTest.cxx.

439 {
440 ATH_MSG_VERBOSE("Test whether "<<m_idHelperSvc->toStringDetEl(mdtMl.identify())<<std::endl<<mdtMl.getParameters());
441
442 for (unsigned int layer = 1; layer <= mdtMl.numLayers(); ++layer) {
443 for (unsigned int tube = 1; tube <= mdtMl.numTubesInLay(); ++tube) {
444 const IdentifierHash idHash = mdtMl.measurementHash(layer, tube);
445 if (!mdtMl.isValid(idHash)){
446 continue;
447 }
448 const Amg::Transform3D& locToGlob{mdtMl.localToGlobalTrans(gctx, idHash)};
449 const Identifier measId{mdtMl.measurementId(idHash)};
450
451 ATH_CHECK(pointInside(chamber, detVol, mdtMl.globalTubePos(gctx, idHash), "tube center", measId));
452
453 ATH_CHECK(pointInside(chamber, detVol, mdtMl.readOutPos(gctx, idHash), "tube readout", measId));
454 ATH_CHECK(pointInside(chamber, detVol, mdtMl.highVoltPos(gctx, idHash), "tube HV", measId));
455
456 ATH_CHECK(pointInside(chamber, detVol, locToGlob*(-mdtMl.innerTubeRadius() * Amg::Vector3D::UnitX()),
457 "bottom of the tube box", measId));
458 ATH_CHECK(pointInside(chamber, detVol, locToGlob*(mdtMl.innerTubeRadius() * Amg::Vector3D::UnitX()),
459 "sealing of the tube box", measId));
460
461 ATH_CHECK(pointInside(chamber, detVol, locToGlob*(-mdtMl.innerTubeRadius() * Amg::Vector3D::UnitY()),
462 "wall to the previous tube", measId));
463 ATH_CHECK(pointInside(chamber, detVol, locToGlob*(-mdtMl.innerTubeRadius() * Amg::Vector3D::UnitY()),
464 "wall to the next tube", measId));
465 }
466 }
467 return StatusCode::SUCCESS;
468 }
Eigen::Affine3d Transform3D
@ layer
Definition HitInfo.h:79

◆ testReadoutEle() [2/7]

template<class EnevelopeType>
StatusCode MuonGMR4::MuonChamberToolTest::testReadoutEle ( const ActsTrk::GeometryContext & gctx,
const MmReadoutElement & mm,
const EnevelopeType & chamber,
const Acts::Volume & detVol ) const

Definition at line 512 of file MuonChamberToolTest.cxx.

515 {
516
517 const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
518 for(unsigned int gasGap = 1; gasGap <= mm.nGasGaps(); ++gasGap){
519 IdentifierHash gasGapHash = MmReadoutElement::createHash(gasGap,0);
520 unsigned int firstStrip = mm.firstStrip(gasGapHash);
521 for(unsigned int strip = firstStrip; strip <= mm.numStrips(gasGapHash); ++strip){
522 const Identifier stripId = idHelper.channelID(mm.identify(), mm.multilayer(), gasGap, strip);
523 ATH_CHECK(pointInside(chamber, detVol, mm.stripPosition(gctx, stripId), "center", stripId));
524 ATH_CHECK(pointInside(chamber, detVol, mm.leftStripEdge(gctx, mm.measurementHash(stripId)), "left edge", stripId));
525 ATH_CHECK(pointInside(chamber, detVol, mm.rightStripEdge(gctx, mm.measurementHash(stripId)), "right edge", stripId));
526 }
527 }
528
529 return StatusCode::SUCCESS;
530 }
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
static IdentifierHash createHash(const int gasGap, const int strip)

◆ testReadoutEle() [3/7]

template<class EnvelopeType>
StatusCode MuonGMR4::MuonChamberToolTest::testReadoutEle ( const ActsTrk::GeometryContext & gctx,
const MmReadoutElement & readOutEle,
const EnvelopeType & envelope,
const Acts::Volume & boundVol ) const
private

◆ testReadoutEle() [4/7]

template<class EnvelopeType>
StatusCode MuonGMR4::MuonChamberToolTest::testReadoutEle ( const ActsTrk::GeometryContext & gctx,
const RpcReadoutElement & readOutEle,
const EnvelopeType & envelope,
const Acts::Volume & boundVol ) const
private

Definition at line 470 of file MuonChamberToolTest.cxx.

473 {
474
475 ATH_MSG_VERBOSE("Test whether "<<m_idHelperSvc->toStringDetEl(rpc.identify())<<std::endl<<rpc.getParameters());
476
477 const RpcIdHelper& idHelper{m_idHelperSvc->rpcIdHelper()};
478 for (unsigned int gasGap = 1 ; gasGap <= rpc.nGasGaps(); ++gasGap) {
479 for (int doubletPhi = rpc.doubletPhi(); doubletPhi <= rpc.doubletPhiMax(); ++doubletPhi){
480 for (bool measPhi : {false, true}) {
481 const int nStrips = measPhi ? rpc.nPhiStrips() : rpc.nEtaStrips();
482 for (int strip = 1; strip <= nStrips; ++strip) {
483 const Identifier stripId = idHelper.channelID(rpc.identify(),rpc.doubletZ(),
484 doubletPhi, gasGap, measPhi, strip);
485 ATH_CHECK(pointInside(chamber, detVol, rpc.stripPosition(gctx, stripId), "center", stripId));
486 ATH_CHECK(pointInside(chamber, detVol, rpc.leftStripEdge(gctx, stripId), "right edge", stripId));
487 ATH_CHECK(pointInside(chamber, detVol, rpc.rightStripEdge(gctx, stripId), "left edge", stripId));
488 }
489 }
490 }
491 }
492 return StatusCode::SUCCESS;
493 }
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)

◆ testReadoutEle() [5/7]

template<class EnvelopeType>
StatusCode MuonGMR4::MuonChamberToolTest::testReadoutEle ( const ActsTrk::GeometryContext & gctx,
const sTgcReadoutElement & readOutEle,
const EnvelopeType & envelope,
const Acts::Volume & boundVol ) const
private

Definition at line 532 of file MuonChamberToolTest.cxx.

535 {
536
537 const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
538 for(unsigned int gasGap = 1; gasGap <= stgc.numLayers(); ++gasGap){
539
540 for(unsigned int nch = 1; nch <= stgc.nChTypes(); ++nch){
541 IdentifierHash gasGapHash = sTgcReadoutElement::createHash(gasGap, nch, 0, 0);
542 const unsigned int nStrips = stgc.numChannels(gasGapHash);
544
545 for(unsigned int strip = 1; strip <= nStrips; ++strip){
546 const Identifier stripId = idHelper.channelID(stgc.identify(), stgc.multilayer(), gasGap, nch, strip);
547 ATH_CHECK(pointInside(chamber, detVol, stgc.globalChannelPosition(gctx, stripId), "channel position", stripId));
548
550 ATH_CHECK(pointInside(chamber, detVol, stgc.rightStripEdge(gctx, stgc.measurementHash(stripId)), "channel position", stripId));
551 ATH_CHECK(pointInside(chamber, detVol, stgc.leftStripEdge(gctx, stgc.measurementHash(stripId)), "channel position", stripId));
552 }
553 }
554 }
555 }
556 return StatusCode::SUCCESS;
557
558 }
static IdentifierHash createHash(const unsigned int gasGap, const unsigned int channelType, const unsigned int channel, const unsigned int wireInGrp=0)
Create a measurement hash from the Identifier fields.
ReadoutChannelType
ReadoutChannelType to distinguish the available readout channels Pad - pad readout channel Strip - et...
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const

◆ testReadoutEle() [6/7]

template<class EnvelopeType>
StatusCode MuonGMR4::MuonChamberToolTest::testReadoutEle ( const ActsTrk::GeometryContext & gctx,
const TgcReadoutElement & readOutEle,
const EnvelopeType & envelope,
const Acts::Volume & boundVol ) const
private

◆ testReadoutEle() [7/7]

template<class EnevelopeType>
StatusCode MuonGMR4::MuonChamberToolTest::testReadoutEle ( const ActsTrk::GeometryContext & gctx,
const TgcReadoutElement & tgc,
const EnevelopeType & chamber,
const Acts::Volume & detVol ) const

Definition at line 495 of file MuonChamberToolTest.cxx.

498 {
499 for (unsigned int gasGap = 1; gasGap <= tgc.nGasGaps(); ++gasGap){
500 for (bool isStrip : {false}) {
501 const IdentifierHash layHash = tgc.constructHash(0, gasGap, isStrip);
502 const unsigned int nChannel = tgc.numChannels(layHash);
503 for (unsigned int channel = 1; channel <= nChannel ; ++channel) {
504 const IdentifierHash measHash = tgc.constructHash(channel, gasGap, isStrip);
505 ATH_CHECK(pointInside(chamber, detVol, tgc.channelPosition(gctx, measHash), "center", tgc.measurementId(measHash)));
506 }
507 }
508 }
509 return StatusCode::SUCCESS;
510 }

◆ 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_detMgr

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

Definition at line 136 of file MuonChamberToolTest.h.

136{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_dumpObjs

Gaudi::Property<bool> MuonGMR4::MuonChamberToolTest::m_dumpObjs {this, "dumpVolumes" , false}
private

Dump the chambers & sectors as separate obj files.

Definition at line 135 of file MuonChamberToolTest.h.

135{this, "dumpVolumes" , false};

◆ 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_geoCtxKey

SG::ReadHandleKey<ActsTrk::GeometryContext> MuonGMR4::MuonChamberToolTest::m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
private

Definition at line 124 of file MuonChamberToolTest.h.

124{this, "AlignmentKey", "ActsAlignment", "cond handle key"};

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonGMR4::MuonChamberToolTest::m_idHelperSvc
private
Initial value:
{this, "IdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc"}

Definition at line 121 of file MuonChamberToolTest.h.

121 {this, "IdHelperSvc",
122 "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_ignoreOverlapCh

Gaudi::Property<bool> MuonGMR4::MuonChamberToolTest::m_ignoreOverlapCh {this, "ignoreChamberOverlap", true}
private

The overlap of chamber volumes does not lead to a failure.

In fact, the overlap between the T4 & BIS78 chambers is found to be unavoidable without boolean shapes in the tracking geometry

Definition at line 133 of file MuonChamberToolTest.h.

133{this, "ignoreChamberOverlap", true};

◆ m_overlapChambObj

Gaudi::Property<std::string> MuonGMR4::MuonChamberToolTest::m_overlapChambObj {this, "chamberOverlapFile", "OverlapingChambers.obj"}
private

Name of the chamber output obj file.

Definition at line 130 of file MuonChamberToolTest.h.

130{this, "chamberOverlapFile", "OverlapingChambers.obj"};

◆ m_overlapSamples

Gaudi::Property<unsigned> MuonGMR4::MuonChamberToolTest::m_overlapSamples {this, "overlapSamples", 100}
private

Number of points to scan along the lines between two volume corners to check whether they belong to an another volume.

Definition at line 128 of file MuonChamberToolTest.h.

128{this, "overlapSamples", 100};

◆ m_trackingGeometrySvc

ServiceHandle<ActsTrk::ITrackingGeometrySvc> MuonGMR4::MuonChamberToolTest::m_trackingGeometrySvc {this, "TrackingGeometrySvc","ActsTrackingGeometrySvc"}
private

Definition at line 126 of file MuonChamberToolTest.h.

126{this, "TrackingGeometrySvc","ActsTrackingGeometrySvc"};

◆ 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.


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