|
ATLAS Offline Software
|
Go to the documentation of this file.
29 return StatusCode::SUCCESS;
31 template <
class ContainerType>
34 const ContainerType*& contToPush)
const {
38 return StatusCode::SUCCESS;
42 contToPush = readHandle.cptr();
43 return StatusCode::SUCCESS;
49 auto translatedSegments = std::make_unique<Trk::SegmentCollection>();
58 ATH_MSG_VERBOSE(
"Translated in total "<<translatedSegments->size()<<
" segments.");
61 ATH_CHECK(writeHandle.record(std::move(translatedSegments)));
62 return StatusCode::SUCCESS;
64 template <
class PrdType>
68 ATH_MSG_ERROR(
"Cannot fetch a prep data object as the container given for "<<
77 for (
const PrdType* prd : *coll) {
78 if (prd->identify() == prdId){
86 template <
class PrdType>
90 std::vector<std::unique_ptr<Trk::RIO_OnTrack>>& convMeasVec)
const {
95 if (!uncalib)
continue;
101 return StatusCode::FAILURE;
103 const Trk::Surface& surf{prd->detectorElement()->surface(prd->identify())};
106 std::unique_ptr<Trk::RIO_OnTrack> rot{};
107 if constexpr(std::is_same_v<PrdType, Muon::MdtPrepData>) {
108 rot = std::unique_ptr<Trk::RIO_OnTrack>{
m_mdtCreator->createRIO_OnTrack(*prd,
112 rot = std::unique_ptr<Trk::RIO_OnTrack>{
m_clusterCreator->createRIO_OnTrack(*prd,
118 return StatusCode::FAILURE;
121 convMeasVec.push_back(std::move(rot));
125 return StatusCode::FAILURE;
127 return StatusCode::SUCCESS;
149 std::vector<std::unique_ptr<Trk::RIO_OnTrack>> rots{};
150 unsigned int nPrec{0};
152 switch (spacePoint->type()) {
184 auto makeCompetingROT = [
this, &measurements](
RotVec& rots) {
188 std::list<const Trk::PrepRawData*> prds{};
189 for (
const std::unique_ptr<Trk::RIO_OnTrack>& rot : rots) {
196 RotVec etaPrds{}, phiPrds{};
197 for (std::unique_ptr<Trk::RIO_OnTrack>& rot : rots) {
200 std::vector<std::unique_ptr<Trk::RIO_OnTrack>>& pushMe{
m_idHelperSvc->measuresPhi(rot->identify())? phiPrds : etaPrds};
201 if (pushMe.size() && pushMe.back()->detectorElement() != rot->detectorElement()){
202 makeCompetingROT(pushMe);
204 pushMe.push_back(std::move(rot));
208 makeCompetingROT(etaPrds);
209 makeCompetingROT(phiPrds);
210 measurements.push_back(std::move(rot));
213 makeCompetingROT(etaPrds);
214 makeCompetingROT(phiPrds);
217 <<
". Do not convert segment due to potential puff.");
218 return StatusCode::SUCCESS;
220 ATH_MSG_DEBUG(
"Fetched in total "<<measurements.size()<<
" measurements. "<<std::endl<<
221 m_printer->print(measurements.stdcont()));
226 segSurf->globalToLocalDirection(
segment.direction(), segDir);
229 static_cast<double>(
segment.nDoF()));
241 auto legacySeg = std::make_unique<Muon::MuonSegment>(
Amg::Vector2D::Zero(),std::move(segDir),
243 std::move(measurements),
fitQuality.release());
247 <<
Amg::toString(legacySeg->globalDirection())<<std::endl<<
m_printer->print(legacySeg->containedMeasurements()));
248 outContainer.
push_back(std::move(legacySeg));
249 return StatusCode::SUCCESS;
const PrdType * fetchPrd(const Identifier &prdId, const Muon::MuonPrepDataContainerT< PrdType > *prdContainer) const
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_keysTgc
ToolHandle< Muon::IMuonCompetingClustersOnTrackCreator > m_compClusterCreator
Placeholder for what will later be the muon segment EDM representation.
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
StatusCode convertMeasurement(const MuonR4::Segment &segment, const CalibratedSpacePoint &spacePoint, const Muon::MuonPrepDataContainerT< PrdType > *prdContainer, RotVec &convMeasVec) const
Identifier identify(const UncalibratedMeasurement *meas)
Returns the associated identifier.
const xAOD::UncalibratedMeasurement * secondaryMeasurement() const
ToolHandle< Muon::IMdtDriftCircleOnTrackCreator > m_mdtCreator
virtual bool type(PrepRawDataType type) const =0
Interface method checking the type.
#define ATH_MSG_VERBOSE(x)
Amg::Transform3D getTransformFromRotTransl(Amg::RotationMatrix3D rot, Amg::Vector3D transl_vec)
std::unique_ptr< CalibratedSpacePoint > MeasType
SG::ReadHandleKeyArray< SegmentContainer > m_readKeys
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_keyRpc
SG::WriteHandleKey< Trk::SegmentCollection > m_writeKey
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< std::unique_ptr< Trk::RIO_OnTrack > > RotVec
Eigen::Affine3d Transform3D
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_keyTgc
Prep data container keys.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Template to hold collections of MuonPrepRawData objects.
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_keyMdt
represents the three-dimensional global direction with respect to a planar surface frame.
Include the GeoPrimitives which need to be put first.
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
StatusCode retrieveContainer(const EventContext &ctx, const SG::ReadHandleKey< ContType > &key, const ContType *&contPtr) const
Loads a container from the StoreGate and returns whether the retrieval is successful.
constexpr int toInt(const ParamDefs p)
StatusCode initialize() override final
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
FitQualityOnSurface fitQuality(const MultiComponentState &, const MeasurementBase &)
Method for determining the chi2 of the multi-component state and the number of degrees of freedom.
This header ties the generic definitions in this package.
StatusCode execute(const EventContext &ctx) const override final
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,...
StatusCode convert(const EventContext &ctx, const MuonR4::Segment &segment, Trk::SegmentCollection &outContainer) const
Convert the R4 segment and fill the converted segment into the SegmentCollection.
#define ATH_MSG_WARNING(x)
The calibrated Space point is created during the calibration process.
const SpacePoint * spacePoint() const
The pointer to the space point out of which this space point has been built.
SG::ReadHandleKey< Muon::MMPrepDataContainer > m_keyMM
const Identifier & identify() const
: Identifier of the primary measurement
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
ToolHandle< Muon::IMuonClusterOnTrackCreator > m_clusterCreator