30 return StatusCode::SUCCESS;
36 auto translatedPatterns = std::make_unique<MuonPatternCombinationCollection>();
37 auto translatedHough = std::make_unique<Muon::HoughDataPerSectorVec>();
53 return StatusCode::SUCCESS;
77 const Amg::Transform3D& localToGlobal = seed->msSector()->localToGlobalTrans(*gctx);
79 std::unordered_set<Identifier> channelsInMax{};
81 channelsInMax.insert(hit->identify());
82 if (hit->secondaryMeasurement()) {
86 std::vector<const Trk::PrepRawData*> trkHits{};
87 trkHits.reserve(channelsInMax.size());
92 trkHits.push_back(
fetchPrd(chId, mdtPrds));
95 trkHits.push_back(
fetchPrd(chId, rpcPrds));
98 trkHits.push_back(
fetchPrd(chId, tgcPrds));
101 trkHits.push_back(
fetchPrd(chId, mmPrds));
103 case techIdx_t::STGC:
104 trkHits.push_back(
fetchPrd(chId, stgcPrds));
107 ATH_MSG_WARNING(
"Cscs are not part of the new paradigms. Where are they now coming from? "
111 if (std::find(trkHits.begin(), trkHits.end(),
nullptr) != trkHits.end()){
113 return StatusCode::FAILURE;
124 std::vector<Muon::MuonPatternChamberIntersect> chamberData{std::move(chamberIsect)};
126 auto patternCombi = std::make_unique<Muon::MuonPatternCombination>(
nullptr, std::move(chamberData));
127 patternContainer.
push_back(std::move(patternCombi));
130 return StatusCode::SUCCESS;
135 if (houghDataSec.
vec.empty()) {
136 constexpr unsigned int nSectors = 16;
137 houghDataSec.
vec.resize(nSectors);
138 for (
unsigned int i = 0; i < nSectors; ++i) {
139 houghDataSec.
vec[i].sector = i + 1;
143 const Identifier chId = intersect.prepRawDataVec()[0]->identify();
144 const DetIdx_t regionIndex =
m_idHelperSvc->regionIndex(chId);
150 auto convertedMax = std::make_unique<LegacyMax>();
152 convertedMax->theta = intersect.intersectDirection().theta();
154 std::unique_ptr<MuonHough::Hit> hit{};
163 hit = std::make_unique<MuonHough::Hit>(0,
barrel ? gp.perp() : gp.z(),
164 barrel ? gp.z() : gp.perp(),
165 barrel ? gp.z() : gp.perp(),
167 convertedMax->hits.emplace_back(std::move(hit));
169 houghDataSec.
vec[sector-1].maxVec[
sectorLayerHash].push_back(std::move(convertedMax));
173 template <
class PrdType>
177 ATH_MSG_ERROR(
"Cannot fetch a prep data object as the container given for "<<
186 for (
const PrdType* prd : *coll) {
187 if (prd->identify() == prdId){
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
DataVector< Muon::MuonPatternCombination > MuonPatternCombinationCollection
This typedef represents a collection of MuonPatternCombination objects.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
MuonLayerHough & hough(int sector, DetRegIdx region, LayIdx layer)
access precision transform
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
const PrdType * fetchPrd(const Identifier &prdId, const Muon::MuonPrepDataContainerT< PrdType > *prdContainer) const
void convertMaximum(const Muon::MuonPatternChamberIntersect &intersect, Muon::HoughDataPerSectorVec &houghDataSec) const
: Converts the maximum back into the HoughDataPersector
SG::WriteHandleKey<::MuonPatternCombinationCollection > m_combiKey
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_keysTgc
StatusCode initialize() override final
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_keyMdt
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_keyRpc
SG::ReadHandleKey< Muon::MMPrepDataContainer > m_keyMM
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_keyTgc
Prep data container keys.
SG::ReadHandleKeyArray< SegmentSeedContainer > m_readKeys
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
StatusCode execute(const EventContext &ctx) const override final
StatusCode convertSeed(const EventContext &ctx, const SegmentSeedContainer &seedContainer, ::MuonPatternCombinationCollection &patternContainer, Muon::HoughDataPerSectorVec &houghDataSec) const
Converts each segment seed first into a PatternCombination - serving as input for the legacy segment ...
SG::WriteHandleKey< Muon::HoughDataPerSectorVec > m_dataPerSecKey
Representation of a segment seed (a fully processed hough maximum) produced by the hough transform.
Class to represent measurements from the Monitored Drift Tubes.
Class representing clusters in the muon system.
This class holds information needed for the Moore and MoMu pattern recognition for a muon chamber.
Template to hold collections of MuonPrepRawData objects.
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.
An intersection with a Surface is given by.
const Amg::Vector3D & direction() const
Method to retrieve the direction at the Intersection.
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
double angle(const Amg::Vector3D &v1, const Amg::Vector3D &v2)
calculates the opening angle between two vectors
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
This header ties the generic definitions in this package.
DataVector< SegmentSeed > SegmentSeedContainer
const SpacePoint * HoughHitType
TechnologyIndex
enum to classify the different layers in the muon spectrometer
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
unsigned int sectorLayerHash(DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
create a hash out of region and layer
LayerIndex
enum to classify the different layers in the muon spectrometer
MuonPrepDataContainerT< RpcPrepData > RpcPrepDataContainer
MuonPrepDataContainer< MuonPrepDataCollection< PrdType > > MuonPrepDataContainerT
MuonPrepDataContainerT< TgcPrepData > TgcPrepDataContainer
MuonPrepDataContainerT< MdtPrepData > MdtPrepDataContainer
MuonPrepDataContainerT< sTgcPrepData > sTgcPrepDataContainer
MuonPrepDataContainerT< MMPrepData > MMPrepDataContainer
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
struct representing the maximum in the hough space
std::vector< HoughDataPerSec > vec
MuonHough::MuonDetectorHough detectorHoughTransforms