ATLAS Offline Software
|
Algorithm to handle segment fits
More...
#include <SegmentFittingAlg.h>
Public Types | |
using | HitVec = SegmentFitResult::HitVec |
Public Member Functions | |
virtual | ~SegmentFittingAlg () |
virtual StatusCode | initialize () override |
virtual StatusCode | execute (const EventContext &ctx) const override |
AthReentrantAlgorithm (const std::string &name, ISvcLocator *pSvcLocator) | |
Constructor with parameters: More... | |
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 > &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 |
Protected Member Functions | |
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
remove all handles from I/O resolution More... | |
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. More... | |
Private Types | |
using | Parameters = SegmentFit::Parameters |
typedef ServiceHandle< StoreGateSvc > | StoreGateSvc_t |
Private Member Functions | |
template<class ContainerType > | |
StatusCode | retrieveContainer (const EventContext &ctx, const SG::ReadHandleKey< ContainerType > &key, const ContainerType *&contToPush) const |
Helper method to fetch data from StoreGate. More... | |
SegmentFitResult | fitSegmentHits (const EventContext &ctx, const ActsGeometryContext &gctx, const Parameters &startPars, SegmentFitResult::HitVec &&calibHits) const |
Executes the segment fit with start parameters. More... | |
std::vector< std::unique_ptr< Segment > > | fitSegmentSeed (const EventContext &ctx, const ActsGeometryContext &gctx, const SegmentSeed *seed) const |
bool | removeOutliers (const EventContext &ctx, const ActsGeometryContext &gctx, const SegmentSeed &seed, SegmentFitResult &fitResult) const |
Spot hits with large discrepancy from the estimated parameters and remove them from the list. More... | |
bool | plugHoles (const EventContext &ctx, const ActsGeometryContext &gctx, const SegmentSeed &seed, SegmentFitResult &toRecover) const |
Recovery of missed hits. More... | |
void | eraseWrongHits (const ActsGeometryContext &gctx, SegmentFitResult &candidate) const |
Removes all hits from the segment which are obvious outliers. More... | |
void | resolveAmbiguities (const ActsGeometryContext &gctx, std::vector< std::unique_ptr< Segment >> &segmentCandidates) const |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
specialization for handling Gaudi::Property<SG::VarHandleKey> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
specialization for handling Gaudi::Property<SG::VarHandleBase> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More... | |
Static Private Member Functions | |
static std::unique_ptr< Segment > | convertToSegment (const Amg::Transform3D &locToGlobTrf, const SegmentSeed *parentSeed, SegmentFitResult &&toConvert) |
Converts the fit result into a segment object. More... | |
Private Attributes | |
SG::ReadHandleKey< SegmentSeedContainer > | m_seedKey {this, "ReadKey", "MuonHoughStationSegmentSeeds"} |
ReadHandle of the seeds. More... | |
SG::WriteHandleKey< SegmentContainer > | m_outSegments {this, "MuonSegmentContainer", "R4MuonSegments"} |
SG::ReadHandleKey< ActsGeometryContext > | m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"} |
ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
IdHelperSvc. More... | |
ToolHandle< ISpacePointCalibrator > | m_calibTool {this, "Calibrator", "" } |
Handle to the space point calibrator. More... | |
ToolHandle< MuonValR4::IPatternVisualizationTool > | m_visionTool {this, "VisualizationTool", ""} |
Pattern visualization tool. More... | |
Gaudi::Property< bool > | m_useMinuit {this, "useMinuit", false} |
Toggle the fitter. More... | |
Gaudi::Property< bool > | m_doT0Fit {this, "fitSegmentT0", true} |
Gaudi::Property< bool > | m_doBeamspotConstraint {this, "doBeamspotConstraint", false} |
Add beamline constraint. More... | |
Gaudi::Property< double > | m_beamSpotR {this, "BeamSpotRadius", 30.* Gaudi::Units::cm} |
Gaudi::Property< double > | m_beamSpotL {this, "BeamSpotLength", 20. * Gaudi::Units::m} |
Gaudi::Property< double > | m_seedHitChi2 {this, "ResoSeedHitAssoc", 5. } |
Two mdt seeds are the same if their defining parameters match wihin. More... | |
Gaudi::Property< bool > | m_recalibSeed {this, "SeedRecalibrate", false} |
Toggle seed recalibration. More... | |
Gaudi::Property< bool > | m_refineSeed {this, "SeedRefine", false} |
Toggle seed refit. More... | |
Gaudi::Property< double > | m_outlierRemovalCut {this, "OutlierRemoval", 5.} |
Cut on the segment chi2 / nDoF to launch the outlier removal. More... | |
Gaudi::Property< double > | m_recoveryPull {this, "RecoveryPull", 5.} |
std::unique_ptr< SegmentAmbiSolver > | m_ambiSolver {} |
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 |
Algorithm to handle segment fits
This is currently a placeholder to test ideas!
Definition at line 31 of file SegmentFittingAlg.h.
Definition at line 38 of file SegmentFittingAlg.h.
|
private |
Definition at line 41 of file SegmentFittingAlg.h.
|
privateinherited |
Definition at line 388 of file AthCommonDataStore.h.
|
virtualdefault |
AthReentrantAlgorithm::AthReentrantAlgorithm |
|
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.
Override this to return 0 for reentrant algorithms.
Definition at line 55 of file AthReentrantAlgorithm.cxx.
|
staticprivate |
Converts the fit result into a segment object.
locToGlobTrf | Local to global transform to translate the segment parameters into global parameters |
parentSeed | Segment seed from which the segment was built |
toConvert | Fitted segment that needs conversion |
Definition at line 325 of file SegmentFittingAlg.cxx.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>
Definition at line 199 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
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.
|
inlineinherited |
Declare a new Gaudi property.
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.
|
inlineinherited |
Definition at line 259 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
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.
|
inlineinherited |
Declare a new Gaudi property.
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.
|
inlineinherited |
Definition at line 145 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc/DetectorStore
Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 95 of file AthCommonDataStore.h.
|
private |
Removes all hits from the segment which are obvious outliers.
E.g. tubes which cannot be crossed by the segment.
gctx | Geometry context needed to calculate the nominal time of arrival, if the time fit is activated |
candidate | Reference of the segment candidate to prune. |
The segment has never crossed the tube
Definition at line 529 of file SegmentFittingAlg.cxx.
|
inlineinherited |
The standard StoreGateSvc
(event store) Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 85 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc
(event store) Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 90 of file AthCommonDataStore.h.
|
overridevirtual |
Definition at line 74 of file SegmentFittingAlg.cxx.
|
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
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 79 of file AthReentrantAlgorithm.cxx.
|
inlinevirtualinherited |
Definition at line 135 of file AthReentrantAlgorithm.h.
|
private |
Executes the segment fit with start parameters.
The returned fit result indicates whether the fit was a success and all relevant output parameters
ctx: Event context needed to access the calibration constants of the hits
gctx: Geometry context needed to place the segment globally within ATLAS to calculate the nominal time of arrival
startPars: Segment parameters preestimated from the SegmentSeed (either hough pattern or two drift circle seed)
calibHits: Vector of strip & mdt hits to consider for the fit
Add beamspot if neccessary
placeholder for a very generous beam spot: 300mm in X,Y (tracking volume), 20000 along Z
Configure the minimizer
Assumption that the particle travels at the speed of light
Execute fit
Definition at line 145 of file SegmentFittingAlg.cxx.
|
private |
At very high inclanation angles, the muon may traverse 3 hits in the same layer (E.g. BEE)
Draw the pattern with all possible seeds
Draw the prefit
Definition at line 268 of file SegmentFittingAlg.cxx.
|
overridevirtual |
Definition at line 63 of file SegmentFittingAlg.cxx.
|
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.
|
overridevirtualinherited |
Specify if the algorithm is clonable.
Reentrant algorithms are clonable.
Reimplemented in Simulation::BeamEffectsAlg, InDet::SiTrackerSpacePointFinder, InDet::SCT_Clusterization, InDet::SiSPSeededTrackFinder, SCTRawDataProvider, InDet::GNNSeedingTrackMaker, SCT_PrepDataToxAOD, RoIBResultToxAOD, SCT_CablingCondAlgFromCoraCool, SCT_ReadCalibDataTestAlg, SCT_CablingCondAlgFromText, InDet::SiSPGNNTrackMaker, SCT_ReadCalibChipDataTestAlg, SCT_TestCablingAlg, SCT_ConfigurationConditionsTestAlg, ITkPixelCablingAlg, ITkStripCablingAlg, SCTEventFlagWriter, SCT_ConditionsSummaryTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_TdaqEnabledTestAlg, SCT_SiliconConditionsTestAlg, SCTSiLorentzAngleTestAlg, SCT_ByteStreamErrorsTestAlg, SCT_ConditionsParameterTestAlg, SCT_FlaggedConditionTestAlg, SCT_StripVetoTestAlg, SCT_RawDataToxAOD, and SCTSiPropertiesTestAlg.
Definition at line 44 of file AthReentrantAlgorithm.cxx.
|
inlineinherited |
Definition at line 24 of file AthCommonMsg.h.
|
inlineinherited |
Definition at line 27 of file AthCommonMsg.h.
|
inlineinherited |
Definition at line 30 of file AthCommonMsg.h.
|
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.
|
private |
Recovery of missed hits.
Hits in the space point bucket that are maximally <RecoveryPull> away from the fitted segment are put onto the segment candidate and the candidate is refitted. If the refitted candidate has a chi2/nDoF < <OutlierRemoval> the canidate is automatically choosen otherwise, its chi needs to be better.
ctx | EventContext needed for calibration of the hits |
gctx | Geometry context needed if the beamspot constaint will be packed onto the segment |
seed | Segment seed from the pattern recognition to access the underlying bucket |
toRecover | Fit result with parameters & hits to recover. |
We've the first estimator of the segment fit
Setup a map to replace space points if they better suite
Hit is already used in the segment fit
Remove the beamspot constraint measurement
Nothing has been recovered. Just bail out
If the chi2 is less than 5, no outlier rejection is launched. So also accept any recovered segment below that threshold
Next check whether the recovery made measurements marked as outlier feasable for the hole recovery
Finally remove all hits from the calib measurements which are obvious outliers
Definition at line 409 of file SegmentFittingAlg.cxx.
|
private |
Spot hits with large discrepancy from the estimated parameters and remove them from the list.
ctx | EventContext needed for hit calibration |
gctx | Geometry context needed if the beamspot constaint will be packed onto the segment |
fitResult | Data structure carrying the fit parameters & calibrated hits |
If no degree of freedom is in the segment fit then try to plug the holes
Remove a priori the beamspot constaint as it never should pose any problem and another one will be added anyway in the next iteration
Next sort the measurements by chi2
Declare the hit with the largest chi2 as outlier.
Remove the last measurement as it has the largest discrepancy
Definition at line 348 of file SegmentFittingAlg.cxx.
|
inlineprotectedinherited |
Definition at line 380 of file AthCommonDataStore.h.
|
inlineprotectedinherited |
remove all handles from I/O resolution
Definition at line 364 of file AthCommonDataStore.h.
|
private |
Definition at line 558 of file SegmentFittingAlg.cxx.
|
private |
Helper method to fetch data from StoreGate.
If the key is empty, a nullptr is assigned to the container ptr Failure is returned in cases, of non-empty keys and failed retrieval
Definition at line 131 of file SegmentFittingAlg.cxx.
|
inlinevirtualinherited |
Definition at line 139 of file AthReentrantAlgorithm.h.
|
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 67 of file AthReentrantAlgorithm.cxx.
|
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 InputMakerBase, and HypoBase.
Definition at line 96 of file AthReentrantAlgorithm.cxx.
|
overridevirtualinherited |
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
|
inlineinherited |
Definition at line 308 of file AthCommonDataStore.h.
|
private |
Definition at line 139 of file SegmentFittingAlg.h.
|
private |
Definition at line 124 of file SegmentFittingAlg.h.
|
private |
Definition at line 123 of file SegmentFittingAlg.h.
|
private |
Handle to the space point calibrator.
Definition at line 113 of file SegmentFittingAlg.h.
|
privateinherited |
Pointer to StoreGate (detector store by default)
Definition at line 393 of file AthCommonDataStore.h.
|
private |
Add beamline constraint.
Definition at line 122 of file SegmentFittingAlg.h.
|
private |
Definition at line 120 of file SegmentFittingAlg.h.
|
privateinherited |
Pointer to StoreGate (event store by default)
Definition at line 390 of file AthCommonDataStore.h.
|
privateinherited |
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 153 of file AthReentrantAlgorithm.h.
|
private |
Definition at line 109 of file SegmentFittingAlg.h.
|
private |
IdHelperSvc.
Definition at line 111 of file SegmentFittingAlg.h.
|
private |
Cut on the segment chi2 / nDoF to launch the outlier removal.
Definition at line 136 of file SegmentFittingAlg.h.
|
private |
Definition at line 107 of file SegmentFittingAlg.h.
|
private |
Toggle seed recalibration.
The two seed circles are recalibrated using the initial seed
Definition at line 131 of file SegmentFittingAlg.h.
|
private |
Definition at line 137 of file SegmentFittingAlg.h.
|
private |
Toggle seed refit.
The segment seed is fastly refitted using the collected seed drift circles
Definition at line 134 of file SegmentFittingAlg.h.
|
private |
Two mdt seeds are the same if their defining parameters match wihin.
Definition at line 128 of file SegmentFittingAlg.h.
|
private |
ReadHandle of the seeds.
Definition at line 105 of file SegmentFittingAlg.h.
|
private |
Toggle the fitter.
Definition at line 118 of file SegmentFittingAlg.h.
|
privateinherited |
Definition at line 399 of file AthCommonDataStore.h.
|
privateinherited |
Definition at line 398 of file AthCommonDataStore.h.
|
private |
Pattern visualization tool.
Definition at line 115 of file SegmentFittingAlg.h.