 |
ATLAS Offline Software
|
#include <SegmentExtpTest.h>
|
| virtual | ~SegmentExtpTest ()=default |
| |
| virtual StatusCode | initialize () override final |
| |
| virtual StatusCode | execute (const EventContext &ctx) const override final |
| |
| virtual StatusCode | sysInitialize () override |
| | Override sysInitialize. More...
|
| |
| virtual bool | isClonable () const override |
| | Specify if the algorithm is clonable. More...
|
| |
| virtual unsigned int | cardinality () const override |
| | Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
| |
| virtual StatusCode | sysExecute (const EventContext &ctx) override |
| | Execute an algorithm. More...
|
| |
| virtual const DataObjIDColl & | extraOutputDeps () const override |
| | Return the list of extra output dependencies. More...
|
| |
| 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. More...
|
| |
| const ServiceHandle< StoreGateSvc > & | evtStore () const |
| | The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
|
| |
| const ServiceHandle< StoreGateSvc > & | detStore () const |
| | The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
|
| |
| virtual StatusCode | sysStart () override |
| | Handle START transition. More...
|
| |
| virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| | Return this algorithm's input handles. More...
|
| |
| virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| | Return this algorithm's output handles. More...
|
| |
| Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T, V, H > &t) |
| |
| Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| | Declare a new Gaudi property. More...
|
| |
| Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| | Declare a new Gaudi property. More...
|
| |
| Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
| |
| Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| | Declare a new Gaudi property. More...
|
| |
| Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| | Declare a new Gaudi property. More...
|
| |
| void | updateVHKA (Gaudi::Details::PropertyBase &) |
| |
| MsgStream & | msg () const |
| |
| MsgStream & | msg (const MSG::Level lvl) const |
| |
| bool | msgLvl (const MSG::Level lvl) const |
| |
|
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| | specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
| |
|
| SG::ReadHandleKey< xAOD::MuonSegmentContainer > | m_readKey {this, "SegmentKey", "MuonSegmentsFromR4"} |
| | Declare the data dependency on the standard Mdt+Rpc+Tgc segment container. More...
|
| |
| ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
| | IdHelperSvc to decode the Identifiers. More...
|
| |
| ToolHandle< ActsTrk::IExtrapolationTool > | m_extrapolationTool {this, "ExtrapolationTool" ,"" } |
| | Track extrapolation tool. More...
|
| |
| SG::ReadHandleKey< ActsTrk::GeometryContext > | m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"} |
| | Dependency on the geometry alignment. More...
|
| |
| const MuonGMR4::MuonDetectorManager * | m_detMgr {nullptr} |
| | Detector manager to fetch the sector surfaces. More...
|
| |
| Gaudi::Property< bool > | m_drawEvent {this , "drawEvent", false } |
| | Option to draw every extrapolation asan obj file. More...
|
| |
| DataObjIDColl | m_extendedExtraObjects |
| | Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
|
| |
| StoreGateSvc_t | m_evtStore |
| | Pointer to StoreGate (event store by default) More...
|
| |
| StoreGateSvc_t | m_detStore |
| | Pointer to StoreGate (detector store by default) More...
|
| |
| std::vector< SG::VarHandleKeyArray * > | m_vhka |
| |
| bool | m_varHandleArraysDeclared |
| |
Definition at line 20 of file SegmentExtpTest.h.
◆ StoreGateSvc_t
◆ ~SegmentExtpTest()
| virtual MuonValR4::SegmentExtpTest::~SegmentExtpTest |
( |
| ) |
|
|
virtualdefault |
◆ cardinality()
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| hndl | Object holding the property value. |
| doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| hndl | Object holding the property value. |
| doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| property | Object holding the property value. |
| doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| property | Object holding the property value. |
| doc | Documentation string for the property. |
This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
| StatusCode MuonValR4::SegmentExtpTest::execute |
( |
const EventContext & |
ctx | ) |
const |
|
finaloverridevirtual |
Draw the reference segment as a red line
Draw the true intersection from the extrapolator as blue lines
Definition at line 42 of file SegmentExtpTest.cxx.
47 const auto tgContext = gctx->context();
57 auto lambda = sp.isStraw() ? Amg::intersect<3>(
trf * sp.localPosition(),
58 trf.linear() * sp.sensorDirection(),
59 start.position(tgContext),
69 <<
" geoId: "<<
target.geometryId()<<
", "<<( lambda.value_or(0.) > 0 ?
"forward" :
"backward"));
72 ? Acts::Direction::Forward()
73 : Acts::Direction::Backward(), 100._m);
88 Acts::ObjVisualization3D visualHelper{};
92 Acts::ViewConfig{.color = {220, 0, 0}});
98 std::stringstream sstr{};
101 <<segment->chiSquared() / segment->numberDoF()<<
", nDoF: "<<segment->numberDoF()<<
", "
102 <<segment->nPrecisionHits()<<
", "<<segment->nPhiLayers()<<std::endl;
104 sstr<<
" **** "<<(*meas)<<
", chi2: "<<SeedingAux::chi2Term(locPos,
locDir, *meas)
105 <<
", sign: "<<(meas->isStraw() ?
106 (SeedingAux::strawSign(locPos,
locDir, *meas) == 1 ?
"R" :
"L") :
"-")
109 : Acts::GeometryIdentifier{})
116 if (!meas->spacePoint() ||
120 const auto sp = meas->spacePoint();
123 const auto& bounds = targetSurf.bounds();
125 const auto trf = targetSurf.transform(tgContext).inverse() *
126 sector->
surface().transform(tgContext);
128 lPos = (
trf * SeedingAux::extrapolateToPlane(locPos,
locDir, *meas)).block<2,1>(0,0);
129 if (!bounds.inside(lPos, Acts::BoundaryTolerance::AbsoluteEuclidean(-2._mm))){
131 <<
" is outside the trapezoid "<<bounds
136 const auto cIsect = lineIntersect<3>(meas->localPosition(),
137 meas->sensorDirection(),
139 const auto cIsectPos = cIsect.position();
140 const auto cPos =
trf * cIsectPos;
141 lPos[0] = cPos.perp() * SeedingAux::strawSign(locPos,
locDir, *meas);
143 const auto& lBounds =
static_cast<const Acts::LineBounds&
>(bounds);
144 if (std::abs(cPos.z()) > lBounds.get(Acts::LineBounds::eHalfLengthZ) - 2._cm ||
145 cPos.perp() >lBounds.get(Acts::LineBounds::eR) - 0.2_mm) {
156 <<
", expected: "<<
Amg::toString(lPos)<<
", "<<targetSurf.bounds());
157 retCode = StatusCode::FAILURE;
163 Acts::ViewConfig{.color = {0, 0, 220}}, 6._cm);
170 const Amg::Vector2D dPos = (*extpPars).localPosition() - lPos;
171 if (dPos.mag() > 0.1_mm) {
174 retCode = StatusCode::FAILURE;
177 const double dist = lPos[0];
178 const double extDist = (*extpPars).parameters()[Acts::eBoundLoc0];
179 const double extLocZ = (*extpPars).parameters()[Acts::eBoundLoc1];
182 <<
" straight: "<<dist<<
", extrapolated: "<<extDist
183 <<
"--> "<<(extDist - dist ) / std::sqrt(
cov)
184 <<
", along the tube: "<<lPos[1]<<
", extrapolated: "<<extLocZ);
185 if (std::abs(dist - extDist) / std::sqrt(
cov) > 0.05 ||
186 std::abs(lPos[1] - extLocZ) > 0.1_mm) {
188 <<
", "<<
Amg::toString(lPos)<<
" vs. ("<<extDist<<
", "<<extLocZ<<
")"
189 <<
", deviate R: "<<(std::abs(dist -extDist) / std::sqrt(
cov))
190 <<
", deviate Z: "<<std::abs(lPos[1] - extLocZ));
191 retCode = StatusCode::FAILURE;
196 visualHelper.write(
std::format(
"ExtTpTest_{:}_{:}_{:}.obj",
197 ctx.eventID().event_number(), segment->index(),
◆ extraDeps_update_handler()
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()
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.
◆ filterPassed()
◆ initialize()
| StatusCode MuonValR4::SegmentExtpTest::initialize |
( |
| ) |
|
|
finaloverridevirtual |
◆ inputHandles()
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()
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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.
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
◆ sysExecute()
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.
◆ sysInitialize()
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 InputMakerBase, and HypoBase.
Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detMgr
Detector manager to fetch the sector surfaces.
Definition at line 36 of file SegmentExtpTest.h.
◆ m_detStore
◆ m_drawEvent
| Gaudi::Property<bool> MuonValR4::SegmentExtpTest::m_drawEvent {this , "drawEvent", false } |
|
private |
Option to draw every extrapolation asan obj file.
Definition at line 38 of file SegmentExtpTest.h.
◆ m_evtStore
◆ m_extendedExtraObjects
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_extrapolationTool
◆ m_geoCtxKey
◆ m_idHelperSvc
◆ m_readKey
Declare the data dependency on the standard Mdt+Rpc+Tgc segment container.
Definition at line 28 of file SegmentExtpTest.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
std::string printID(const xAOD::MuonSegment &seg)
Print the chamber ID of a segment, e.g.
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
Track extrapolation tool.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc to decode the Identifiers.
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Eigen::Matrix< double, 2, 1 > Vector2D
Placeholder for what will later be the muon segment EDM representation.
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)
const MeasVec & measurements() const
Returns the associated measurements.
Acts::BoundTrackParameters boundSegmentPars(const MuonGMR4::MuonDetectorManager &detMgr, const xAOD::MuonSegment &segment, std::optional< Acts::BoundMatrix > cov=std::nullopt, Acts::ParticleHypothesis hypot=Acts::ParticleHypothesis::muon())
Returns the segment parameters as boundTrackParameters.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Class describing a MuonSegment.
bool msgLvl(const MSG::Level lvl) const
#define ATH_MSG_VERBOSE(x)
std::pair< Amg::Vector3D, Amg::Vector3D > makeLine(const Parameters &pars)
Returns the parsed parameters into an Eigen line parametrization.
std::string identString() const
Returns a string encoding the chamber index & the sector of the MS sector.
void drawSegmentLine(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewLine, const double standardLength=1.*Gaudi::Units::m)
Draw a segment line inside the obj file.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
const Segment * detailedSegment(const xAOD::MuonSegment &seg)
Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
Dependency on the geometry alignment.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
base class interface providing the bare minimal interface extension.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Gaudi::Property< bool > m_drawEvent
Option to draw every extrapolation asan obj file.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Eigen::Affine3d Transform3D
const Acts::PlaneSurface & surface() const
Returns the associated surface.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition of ATLAS Math & Geometry primitives (Amg)
void drawSegmentMeasurements(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewSensitive)
Draw all uncalibrated measurements associated to the segment.
Eigen::Matrix< double, 3, 1 > Vector3D
const Acts::Surface & muonSurface(const UncalibratedMeasurement *meas)
Returns the associated Acts surface to the measurement.
void drawBoundParameters(const ActsTrk::GeometryContext &gctx, const Acts::BoundTrackParameters &pars, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewLine, const double standardLength=3.*Gaudi::Units::cm)
Draw a line representing the bound track parameters.
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the point B' along the line B that's closest to a second line A.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
virtual StatusCode sysInitialize() override
Override sysInitialize.
float extrapolate(const MuonLayerHough::Maximum &ref, const MuonLayerHough::Maximum &ex, bool doparabolic=false)
const MuonGMR4::MuonDetectorManager * m_detMgr
Detector manager to fetch the sector surfaces.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_readKey
Declare the data dependency on the standard Mdt+Rpc+Tgc segment container.
const SpectrometerSector * getSectorEnvelope(const Identifier &channelId) const
Retrieves the spectrometer envelope enclosing the channel's readout element.