11#include <GaudiKernel/IMessageSvc.h>
22#include "Acts/Surfaces/detail/LineHelper.hpp"
26 inline std::vector<std::shared_ptr<unsigned>> matchCountVec(
unsigned n) {
27 std::vector<std::shared_ptr<unsigned>>
out{};
29 for (
unsigned p = 0;
p <
n ;++
p) {
30 out.emplace_back(std::make_shared<unsigned>(0));
39 template<
class MeasType>
50 const MeasType& meas) {
52 if constexpr(std::is_same_v<MeasType, xAOD::MdtDriftCircle>) {
60 template <
typename PrdType>
61 double sensorHalfLength(
const PrdType& prd) {
62 const auto*
re = prd.readoutElement();
63 if constexpr(std::is_same_v<PrdType, xAOD::MdtDriftCircle>) {
64 return 0.5 *
re->activeTubeLength(prd.measurementHash());
65 }
else if constexpr(std::is_same_v<PrdType, xAOD::RpcMeasurement>) {
66 return 0.5*(prd.measuresPhi() ?
re->stripPhiLength() :
re->stripEtaLength());
67 }
else if constexpr(std::is_same_v<PrdType, xAOD::TgcStrip>) {
68 return 0.5 *
re->sensorLayout(prd.layerHash())->design(prd.measuresPhi()).stripLength(prd.channelNumber());
69 }
else if constexpr(std::is_same_v<PrdType, xAOD::MMCluster>) {
70 return 0.5*
re->stripLayer(prd.layerHash()).design().stripLength(prd.channelNumber());
71 }
else if constexpr(std::is_same_v<PrdType, xAOD::sTgcMeasurement>) {
72 return 0.5*
re->stripLayer(prd.layerHash()).design().stripLength(prd.channelNumber());
81 const CovIdx covIdx) {
82 if (
m.numDimensions() == 2) {
83 const unsigned i = (covIdx != CovIdx::etaCov);
84 return m.localCovariance<2>()(i,i);
86 return m.localCovariance<1>()[0];
97 return static_cast<int>(
techIdx) <
static_cast<int>(other.techIdx);
99 if (
stIdx != other.stIdx) {
100 return static_cast<int>(
stIdx) <
static_cast<int>(other.stIdx);
102 return eta < other.eta;
111 std::lock_guard guard{
m_mutex};
118 if (
sp.measuresEta() &&
sp.measuresPhi()) {
121 stats.measEta +=
sp.measuresEta();
122 stats.measPhi +=
sp.measuresPhi();
127 using KeyVal = std::pair<FieldKey, StatField>;
128 std::vector<KeyVal> sortedstats{};
129 sortedstats.reserve(
m_map.size());
131 for (
const auto & [key, stats] :
m_map){
132 sortedstats.emplace_back(std::make_pair(key, stats));
134 std::stable_sort(sortedstats.begin(), sortedstats.end(), [](
const KeyVal&
a,
const KeyVal&b) {
135 return a.second.allHits() > b.second.allHits();
137 msg<<MSG::ALWAYS<<
"###########################################################################"<<
endmsg;
138 for (
const auto & [key, stats] : sortedstats) {
141 <<
" "<<std::abs(key.eta)<<(key.eta < 0 ?
"A" :
"C")
142 <<
" "<<std::setw(8)<<stats.measEtaPhi
143 <<
" "<<std::setw(8)<<stats.measEta
144 <<
" "<<std::setw(8)<<stats.measPhi<<
endmsg;
146 msg<<MSG::ALWAYS<<
"###########################################################################"<<
endmsg;
154 m_statCounter->dumpStatisics(msgStream());
156 return StatusCode::SUCCESS;
168 m_statCounter = std::make_unique<SpacePointStatistics>(
m_idHelperSvc.get());
170 return StatusCode::SUCCESS;
176 if (etaHits.empty() || phiHits.empty()) {
181 return ((1.*etaHits.size()) / ((1.*
re->numChannels(etaHits[0]->measurementHash())))) <
m_maxOccTgcEta &&
182 ((1.*phiHits.size()) / ((1.*
re->numChannels(phiHits[0]->measurementHash())))) <
m_maxOccTgcPhi;
187 if (etaHits.empty() || phiHits.empty()) {
201template <
typename PrdType>
205 std::vector<SpacePoint>& outColl)
const {
206 if (prdsToFill.empty()) {
209 const PrdType* refMeas = prdsToFill.front();
210 bool allSpArePhi{
false};
212 const Amg::Transform3D toSectorTrans = toChamberTransform(gctx, sectorTrans, *refMeas);
214 Amg::Vector3D sensorDir{Amg::Vector3D::Zero()}, toNextSen{Amg::Vector3D::Zero()};
216 if constexpr(std::is_same_v<PrdType, xAOD::RpcMeasurement> ||
217 std::is_same_v<PrdType, xAOD::TgcStrip>) {
218 allSpArePhi = refMeas->measuresPhi();
219 const auto& stripLayout = refMeas->readoutElement()->sensorLayout(refMeas->layerHash());
220 const auto& design = stripLayout->design(allSpArePhi);
221 sensorDir = toSectorTrans.linear() * stripLayout->to3D(design.stripDir(), allSpArePhi);
222 toNextSen = toSectorTrans.linear() * stripLayout->to3D(design.stripNormal(), allSpArePhi);
225 }
else if constexpr (std::is_same_v<PrdType, xAOD::sTgcMeasurement>){
226 allSpArePhi = refMeas->channelType() == xAOD::sTgcMeasurement::sTgcChannelTypes::Wire;
227 const auto& stripLayout = refMeas->readoutElement()->stripLayer(refMeas->measurementHash());
228 const auto& design = stripLayout.design(allSpArePhi);
229 sensorDir = toSectorTrans.linear() * stripLayout.to3D(design.stripDir(), allSpArePhi);
230 toNextSen = toSectorTrans.linear() * stripLayout.to3D(design.stripNormal(), allSpArePhi);
232 sensorDir = toSectorTrans.linear().col(
Amg::y);
233 toNextSen = toSectorTrans.linear().col(
Amg::x);
235 outColl.reserve(outColl.size() + prdsToFill.size());
236 for (
const PrdType* prd: prdsToFill) {
237 SpacePoint& newSp = outColl.emplace_back(prd);
238 if constexpr (std::is_same_v<PrdType, xAOD::TgcStrip>) {
240 const auto& stripLayout = refMeas->readoutElement()->sensorLayout(refMeas->layerHash());
242 toNextSen = toSectorTrans.linear() * stripLayout->to3D(radialDesign.stripNormal(prd->channelNumber()), allSpArePhi);
243 sensorDir = toSectorTrans.linear() * stripLayout->to3D(radialDesign.stripDir(prd->channelNumber()), allSpArePhi);
246 newSp.
setPosition(toSectorTrans * prd->localMeasurementPos());
248 auto cov = Acts::filledArray<double,3>(0.);
249 if (prd->numDimensions() == 2) {
250 cov[Acts::toUnderlying(CovIdx::etaCov)] = prd->template localCovariance<2>()(0,0);
251 cov[Acts::toUnderlying(CovIdx::phiCov)] = prd->template localCovariance<2>()(1,1);
254 auto covIdx{Acts::toUnderlying(CovIdx::etaCov)},
255 lenIdx{Acts::toUnderlying(CovIdx::phiCov)};
259 cov[covIdx] = prd->template localCovariance<1>()[0];
260 cov[lenIdx] = Acts::square(sensorHalfLength(*prd));
267template <
typename ContType>
270 std::vector<EtaPhi2DHits<typename ContType::const_value_type>> hitsPerGasGap{};
271 for (
const auto& prd : viewer) {
273 <<
", hash: "<<prd->identifierHash());
275 unsigned gapIdx = prd->gasGap() -1;
276 if constexpr (std::is_same_v<ContType, xAOD::RpcMeasurementContainer>) {
277 gapIdx = prd->readoutElement()->createHash(0, prd->gasGap(), prd->doubletPhi(),
false);
279 if (hitsPerGasGap.size() <= gapIdx) {
280 hitsPerGasGap.resize(gapIdx + 1);
283 if constexpr(std::is_same_v<ContType, xAOD::sTgcMeasContainer>) {
286 }
else if constexpr(!std::is_same_v<ContType, xAOD::MMClusterContainer>) {
288 measPhi = prd->measuresPhi();
291 if (prd->numDimensions() == 2) {
292 hitsPerGasGap[gapIdx][2].push_back(prd);
296 auto& toPush = hitsPerGasGap[gapIdx][measPhi];
297 if (toPush.capacity() == toPush.size()) {
300 toPush.push_back(prd);
302 return hitsPerGasGap;
305template <
typename ContType>
309 const ContType* measurementCont{
nullptr};
311 if (!measurementCont || measurementCont->empty()){
313 return StatusCode::SUCCESS;
322 const Amg::Transform3D sectorTrans = viewer.
at(0)->readoutElement()->msSector()->globalToLocalTransform(*gctx);
324 if constexpr( std::is_same_v<ContType, xAOD::MdtDriftCircleContainer>) {
326 for (
const auto& prd : viewer) {
327 Amg::Transform3D toChamberTrans{toChamberTransform(*gctx, sectorTrans, *prd)};
329 sp.setPosition(toChamberTrans*prd->localMeasurementPos());
330 sp.setDirection(toChamberTrans.linear().col(
Amg::z),
331 toChamberTrans.linear().col(
Amg::y));
332 std::array<double, 3> cov{Acts::filledArray<double,3>(0.)};
333 cov[Acts::toUnderlying(CovIdx::etaCov)] = prd->driftRadiusCov();
334 cov[Acts::toUnderlying(CovIdx::phiCov)] = Acts::square(sensorHalfLength(*prd));
338 sp.setCovariance(std::move(cov));
344 <<
" 1D and "<<two2DHits.size()<<
" 2D hits in chamber "
356 std::vector<std::shared_ptr<unsigned>> etaCounts{matchCountVec(etaHits.size())},
357 phiCounts{matchCountVec(phiHits.size())};
359 pointsInChamb.
etaHits.reserve(pointsInChamb.
etaHits.size() + etaHits.size()*phiHits.size());
361 const auto& firstEta{etaHits.front()};
362 const Amg::Transform3D toSectorTrans = toChamberTransform(*gctx, sectorTrans, *firstEta);
364 Amg::Vector3D toNextDir{Amg::Vector3D::Zero()}, sensorDir{Amg::Vector3D::Zero()};
365 if constexpr (std::is_same_v<xAOD::RpcMeasurementContainer, ContType> ||
366 std::is_same_v<xAOD::TgcStripContainer, ContType>) {
367 const auto& stripLayout = firstEta->readoutElement()->sensorLayout(firstEta->layerHash());
368 const auto& design = stripLayout->design();
369 sensorDir = toSectorTrans.linear() * stripLayout->to3D(design.stripDir(),
false);
370 toNextDir = toSectorTrans.linear() * stripLayout->to3D(design.stripNormal(),
false);
371 }
else if constexpr (std::is_same_v<xAOD::sTgcMeasContainer, ContType>){
372 const auto& stripLayout = firstEta->readoutElement()->stripLayer(firstEta->measurementHash());
373 const auto& design = stripLayout.design(
false);
374 sensorDir = toSectorTrans.linear() * stripLayout.to3D(design.stripDir(),
false);
375 toNextDir = toSectorTrans.linear() * stripLayout.to3D(design.stripNormal(),
false);
378 return StatusCode::FAILURE;
381 using namespace Acts::detail::LineHelper;
382 for (
unsigned etaP = 0; etaP < etaHits.size(); ++etaP) {
384 for (
unsigned phiP = 0; phiP < phiHits.size(); ++ phiP) {
386 if constexpr(std::is_same_v<xAOD::TgcStripContainer, ContType>) {
387 if (!(etaHits[etaP]->bcBitMap() & phiHits[phiP]->bcBitMap())){
390 const auto& stripLay = phiHits[phiP]->readoutElement()->sensorLayout(phiHits[phiP]->layerHash());
392 toNextDir = toSectorTrans.linear() * stripLay->to3D(radialDesign.stripDir(phiHits[phiP]->channelNumber()),
true);
395 SpacePoint& newSp = pointsInChamb.
etaHits.emplace_back(etaHits[etaP], phiHits[phiP]);
398 auto spIsect = lineIntersect(toSectorTrans*etaHits[etaP]->localMeasurementPos(), sensorDir,
399 toSectorTrans*phiHits[phiP]->localMeasurementPos(), toNextDir);
402 auto cov = Acts::filledArray<double, 3>(0.);
403 cov[Acts::toUnderlying(CovIdx::etaCov)] = etaHits[etaP]->template localCovariance<1>()[0];
404 cov[Acts::toUnderlying(CovIdx::phiCov)] = phiHits[phiP]->template localCovariance<1>()[0];
406 if constexpr(std::is_same_v<xAOD::TgcStripContainer, ContType>) {
407 const auto& stripLay = phiHits[phiP]->readoutElement()->sensorLayout(phiHits[phiP]->layerHash());
409 const Amg::Vector2D planePos = stripLay->to2D(toSectorTrans.inverse()*spIsect.position(),
true);
410 cov[Acts::toUnderlying(CovIdx::phiCov)] =
411 Acts::square(radialDesign.stripPitch(phiHits[phiP]->channelNumber(), planePos)) / 12.;
420 }
while (viewer.
next());
421 return StatusCode::SUCCESS;
431 if (!measurementCont || measurementCont->
empty()){
433 return StatusCode::SUCCESS;
438 using namespace Acts::detail::LineHelper;
441 const Amg::Transform3D sectorTrans = viewer.
at(0)->readoutElement()->msSector()->globalToLocalTransform(*gctx);
442 ATH_MSG_DEBUG(__func__<<
"() "<<__LINE__<<
" - Fill space points for multiplet "<<
m_idHelperSvc->toStringDetEl(viewer.
at(0)->identify()));
444 auto& [etaHits, phiHits, two2DHits] = HitColls;
445 std::array<std::vector<std::shared_ptr<unsigned>>, 3> instanceCounts{matchCountVec(etaHits.size()),
446 matchCountVec(phiHits.size()),
447 matchCountVec(two2DHits.size())};
461 auto combineMe = [&](
const std::size_t collIdxA,
462 const std::size_t collIdxB,
465 std::vector<char> combinedFlagsA{}, combinedFlagsB{};
466 std::ranges::transform(instanceCounts[collIdxA], std::back_inserter(combinedFlagsA),
467 [](
const std::shared_ptr<unsigned>& countPtr){
468 return (*countPtr) == 0;
470 std::ranges::transform(instanceCounts[collIdxB], std::back_inserter(combinedFlagsB),
471 [](
const std::shared_ptr<unsigned>& countPtr){
472 return (*countPtr) == 0;
475 const auto& collA = HitColls[collIdxA];
476 const auto& collB = HitColls[collIdxB];
479 if(collA.empty() || collB.empty()) {
480 ATH_MSG_DEBUG(__func__<<
"() "<<__LINE__<<
" - Skipping combination: both collections empty");
486 const Amg::Transform3D toSectorTrans = toChamberTransform(*gctx, sectorTrans, *firstHit);
488 for(std::size_t idxA = 0; idxA < collA.size(); ++idxA) {
490 if(!combinedFlagsA[idxA]) {
492 <<
" has been used in previous iteration");
495 for(std::size_t idxB = 0; idxB < collB.size(); ++idxB) {
496 if(!combinedFlagsB[idxB] || !combFunc(collA[idxA], collB[idxB])){
498 <<
" has been used in previous iteration. Or is incompatible with "
503 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
" - Combine sTgc measurements "
505 <<
m_idHelperSvc->toString(collB[idxB]->identify())<<
"with local positions"
506 <<
Amg::toString(collA[idxA]->localMeasurementPos()) <<
" and "
508 <<
" to new space point");
510 SpacePoint& newSp = pointsInChamb.
etaHits.emplace_back(collB[idxB], collA[idxA]);
511 auto crossPoint = lineIntersect<3>(collA[idxA]->localMeasurementPos(),
512 Amg::Vector3D::UnitX(),
513 collB[idxB]->localMeasurementPos(),
514 Amg::Vector3D::UnitY());
516 newSp.
setPosition(toSectorTrans*crossPoint.position());
517 newSp.
setDirection(Amg::Vector3D::UnitX(), Amg::Vector3D::UnitY());
518 auto cov = Acts::filledArray<double, 3>(0.);
519 cov[Acts::toUnderlying(CovIdx::phiCov)] = covElement(*collA[idxA], CovIdx::phiCov);
520 cov[Acts::toUnderlying(CovIdx::etaCov)] = covElement(*collB[idxB], CovIdx::etaCov);
522 newSp.
setInstanceCounts(instanceCounts[collIdxB][idxB], instanceCounts[collIdxA][idxA]);
534 strip->localMeasurementPos().block<2,1>(0,0))){
540 const Acts::Surface& surf = readoutElement->
surface(
strip->layerHash());
541 return surf.insideBounds(crossPoint.block<2,1>(0,0));
550 double padHeight = padDesign.
padHeight();
553 return std::abs(
strip->localMeasurementPos().x() - padCenter.x()) < 0.5*padHeight;
562 auto [
min,
max] = std::ranges::minmax_element(localPadCorners.begin(), localPadCorners.end(),
564 return a.y() < b.y();
571 for(std::size_t collIdx = 0; collIdx < HitColls.size(); ++collIdx){
572 const auto& hits = HitColls[collIdx];
573 std::vector<const xAOD::sTgcMeasurement*> unusedHits{};
574 unusedHits.reserve(hits.size());
576 for(std::size_t idx = 0; idx < hits.size(); ++idx){
577 if((*instanceCounts[collIdx][idx]) == 0){
578 unusedHits.push_back(hits[idx]);
584 }
while (viewer.
next());
585 return StatusCode::SUCCESS;
596 std::unique_ptr<SpacePointContainer> outContainer = std::make_unique<SpacePointContainer>();
598 for (
auto &[chamber, hitsPerChamber] : preSortedContainer){
599 ATH_MSG_DEBUG(
"Fill space points for chamber "<<chamber->identString() <<
" with "<<hitsPerChamber.etaHits.size()
600 <<
" primary and "<<hitsPerChamber.phiHits.size()<<
" phi space points.");
605 return StatusCode::SUCCESS;
611 splittedHits.emplace_back();
613 m_statCounter->addToStat(hitsPerChamber.etaHits);
614 m_statCounter->addToStat(hitsPerChamber.phiHits);
618 splittedHits.erase(
std::remove_if(splittedHits.begin(), splittedHits.end(),
620 return bucket.size() <= 1;
621 }), splittedHits.end());
628 if (
msgLvl(MSG::VERBOSE)){
629 std::stringstream spStr{};
630 for (
const std::shared_ptr<SpacePoint>&
sp : bucket){
631 spStr<<
"SpacePoint: PrimaryMeas: " <<(*sp)<<std::endl;
633 ATH_MSG_VERBOSE(
"Created a bucket, printing all spacepoints..."<<std::endl<<spStr.str());
636 finalContainer.
push_back(std::make_unique<SpacePointBucket>(std::move(bucket)));
643 auto phiPoint = std::make_shared<SpacePoint>(std::move(
sp));
644 const double dY = std::sqrt(phiPoint->covariance()[Acts::toUnderlying(CovIdx::etaCov)]);
645 const double minY = phiPoint->localPosition().y() - dY;
646 const double maxY = phiPoint->localPosition().y() + dY;
650 if (! (maxY < bucket.coveredMin() || bucket.coveredMax() < minY) ) {
651 bucket.emplace_back(phiPoint);
657 const double firstSpPos,
665 if (sortedPoints.empty() || sortedPoints.back().empty()) {
678 overlap.back()->localPosition().y());
683 for (
const std::shared_ptr<SpacePoint>& pointInBucket : overlap | std::views::reverse) {
684 const double overlapPos = pointInBucket->localPosition().y() +
685 std::sqrt(pointInBucket->covariance()[Acts::toUnderlying(CovIdx::etaCov)]);
687 newContainer.insert(newContainer.begin(), pointInBucket);
698 if (spacePoints.empty())
return;
701 std::ranges::sort(spacePoints,
703 return a.localPosition().y() < b.localPosition().y();
706 double firstPointPos = spacePoints.front().localPosition().y();
711 if (
splitBucket(toSort, firstPointPos, splittedHits)){
713 firstPointPos = splittedHits.back().empty() ? toSort.localPosition().y() : splittedHits.back().front()->localPosition().y();
714 ATH_MSG_VERBOSE(
"New bucket: id " << splittedHits.back().bucketId() <<
" Coverage: " << firstPointPos);
716 std::shared_ptr<SpacePoint> spacePoint = std::make_shared<SpacePoint>(std::move(toSort));
717 splittedHits.back().emplace_back(spacePoint);
721 lastBucket.back()->localPosition().y());
const boost::regex re(r_e)
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
bool msgLvl(const MSG::Level lvl) const
value_type push_back(value_type pElem)
Add an element to the end of the collection.
bool empty() const noexcept
Returns true if the collection is empty.
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...
const Acts::Surface & surface() const override final
Returns the surface associated with the readout element.
double padHeight() const
Returns the height of all the pads that are not adjacent to the bottom edge of the trapezoid active a...
const PadDesign & padDesign(const IdentifierHash &measHash) const
Retrieves the readoutElement Layer given the Identifier/Hash.
localCornerArray localPadCorners(const IdentifierHash &measHash) const
bool isEtaZero(const IdentifierHash &measurementHash, const Amg::Vector2D &localPosition) const
: The muon space point bucket represents a collection of points that will bre processed together in t...
void setCoveredRange(double min, double max)
set the range in the precision plane covered by the bucket
void populateChamberLocations()
populate the chamber location list.
void setBucketId(unsigned int id)
sets the Identifier of the MuonSpacePointBucket in context of the associated muonChamber
SpacePointStatistics(const Muon::IMuonIdHelperSvc *idHelperSvc)
Standard constructor.
const Muon::IMuonIdHelperSvc * m_idHelperSvc
void addToStat(const std::vector< SpacePoint > &spacePoints)
Adds the vector of space points to the overall statistics.
void dumpStatisics(MsgStream &msg) const
Print the statistics table of the built space points per category into the log-file / console.
Gaudi::Property< double > m_maxOccRpcEta
Gaudi::Property< double > m_maxOccTgcEta
Gaudi::Property< double > m_maxOccTgcPhi
Gaudi::Property< double > m_spacePointWindow
Gaudi::Property< bool > m_doStat
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::vector< EtaPhi2DHits< T > > EtaPhi2DHitsVec
SG::ReadHandleKey< xAOD::TgcStripContainer > m_tgcKey
void newBucket(const SpacePoint &refSp, SpacePointBucketVec &sortedPoints) const
Closes the current processed bucket and creates a new one.
void distributePhiPoints(std::vector< SpacePoint > &&spacePoints, SpacePointBucketVec &splittedContainer) const
Distributs the vector phi space points into the buckets.
Gaudi::Property< double > m_maxOccRpcPhi
Gaudi::Property< double > m_maxBucketLength
SG::ReadHandleKey< xAOD::MMClusterContainer > m_mmKey
bool passOccupancy2D(const PrdVec_t< PrdType > &etaHits, const PrdVec_t< PrdType > &phiHits) const
: Check whether the occupancy cuts of hits in a gasGap are surpassed.
bool splitBucket(const SpacePoint &spacePoint, const double firstSpPos, const SpacePointBucketVec &sortedPoints) const
Returns whether the space point is beyond the bucket boundary.
std::vector< SpacePointBucket > SpacePointBucketVec
Abrivation of a MuonSapcePoint bucket vector.
void fillUncombinedSpacePoints(const ActsTrk::GeometryContext &gctx, const Amg::Transform3D §orTrans, const PrdVec_t< const PrdType * > &prdsToFill, std::vector< SpacePoint > &outColl) const
Transform the uncombined space prd measurements to space points.
SG::WriteHandleKey< SpacePointContainer > m_writeKey
StatusCode loadContainerAndSort(const EventContext &ctx, const SG::ReadHandleKey< ContType > &key, PreSortedSpacePointMap &fillContainer) const
Retrieve an uncalibrated measurement container <ContType> and fill the hits into the presorted space ...
SG::ReadHandleKey< xAOD::RpcMeasurementContainer > m_rpcKey
Gaudi::Property< double > m_spacePointOverlap
StatusCode execute(const EventContext &ctx) const override
std::vector< Prd_t > PrdVec_t
void distributePrimaryPoints(std::vector< SpacePoint > &&spacePoints, SpacePointBucketVec &splittedContainer) const
Distributes the vector of primary eta or eta + phi space points and fills them into the buckets.
StatusCode initialize() override
SG::ReadHandleKey< xAOD::sTgcMeasContainer > m_stgcKey
void distributePointsAndStore(SpacePointsPerChamber &&hitsPerChamber, SpacePointContainer &finalContainer) const
Distribute the premade spacepoints per chamber into their individual SpacePoint buckets.
EtaPhi2DHitsVec< typename ContType::const_value_type > splitHitsPerGasGap(xAOD::ChamberViewer< ContType > &viewer) const
Splits the chamber hits of the viewer per gas gap.
StatusCode finalize() override
########################################## SpacePointMakerAlg #######################################...
std::unordered_map< const MuonGMR4::SpectrometerSector *, SpacePointsPerChamber > PreSortedSpacePointMap
Container abrivation of the presorted space point container per MuonChambers.
Gaudi::Property< unsigned > m_capacityBucket
SG::ReadHandleKey< xAOD::MdtDriftCircleContainer > m_mdtKey
The SpacePointPerLayerSorter sort two given space points by their layer Identifier.
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
void setDirection(const Amg::Vector3D &sensorDir, const Amg::Vector3D &toNextSensor)
Setter for the direction of the measurement channel in the sector frame.
void setInstanceCounts(std::shared_ptr< unsigned > etaCounts, std::shared_ptr< unsigned > phiCounts)
Set the number of space points built with the same eta / phi prd.
void setCovariance(Cov_t &&cov)
const Amg::Vector3D & localPosition() const
void setPosition(const Amg::Vector3D &pos)
bool measuresEta() const
: Does the space point contain an eta measurement
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Property holding a SG store/key/clid from which a ReadHandle is made.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
const_ref at(const std::size_t idx) const
Returns the i-the measurement from the current chamber.
std::size_t size() const noexcept
Returns how many hits are in the current chamber.
bool next()
Loads the hits from the next chamber.
const MuonGMR4::sTgcReadoutElement * readoutElement() const override final
Retrieve the associated sTgcReadoutElement.
IdentifierHash measurementHash() const override final
Returns the hash of the measurement channel w.r.t ReadoutElement.
Amg::Vector3D localMeasurementPos() const override final
Returns the local measurement position as 3-vector.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
This header ties the generic definitions in this package.
DataVector< SpacePointBucket > SpacePointContainer
Abrivation of the space point container type.
const std::string & stName(StIndex index)
convert StIndex into a string
const std::string & technologyName(TechnologyIndex index)
convert LayerIndex into a string
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)
void stable_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > end)
Specialization of stable_sort for DataVector/List.
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.
MdtTwinDriftCircle_v1 MdtTwinDriftCircle
sTgcMeasContainer_v1 sTgcMeasContainer
sTgcMeasurement_v1 sTgcMeasurement
Helper struct to define the counting categories.
bool operator<(const FieldKey &other) const
################################################################ SpacePointStatistics ###############...
Helper struct to count the space-points in each detector category.
unsigned measEtaPhi
Number of space points measuring eta & phi.
unsigned measEta
Number of space points measuring eta only.
unsigned measPhi
Number of space points measuring phi only.
unsigned allHits() const
Helper method returning the sum of the three space point type counts.
: Helper struct to collect the space point per muon chamber, which are later sorted into the space po...
std::vector< SpacePoint > etaHits
Vector of all hits that contain an eta measurement including the ones which are combined with phi mea...
std::vector< SpacePoint > phiHits
Vector of all space points that are built from single phi hits.