![]() |
ATLAS Offline Software
|
The SegmentLineFitter is a standalone module to fit a straight line to calibrated muon space points. More...
#include <SegmentLineFitter.h>
Classes | |
| struct | Config |
| Full configuration object. More... | |
| struct | ConfigSwitches |
| Configuration object of the ATLAS implementation. More... | |
Public Types | |
| using | Fitter_t = Acts::Experimental::CompositeSpacePointLineFitter |
| Abrivation of the actual line fitter. More... | |
| using | LinePar_t = Fitter_t::ParamVec_t |
| Abrivation of the fitted line parameters. More... | |
| using | Hit_t = std::unique_ptr< CalibratedSpacePoint > |
| Abrivation of the space point type to use. More... | |
| using | HitVec_t = std::vector< Hit_t > |
| Collection of space points. More... | |
| using | FitPars_t = Fitter_t::FitParameters |
| Abrivation of the fit parameters More... | |
| using | Result_t = Fitter_t::FitResult< HitVec_t > |
| Abrivation of the fit result. More... | |
| using | FitOpts_t = Fitter_t::FitOptions< HitVec_t, ISpacePointCalibrator > |
| Abrivation of the fit options. More... | |
| using | Selector_t = Fitter_t::Selector_t< CalibratedSpacePoint > |
| Abrivation of the hit selector to choose valid hits. More... | |
| using | HitState = CalibratedSpacePoint::State |
| Abrivation of the fit state flag. More... | |
Public Member Functions | |
| SegmentLineFitter (const std::string &name, Config &&config) | |
| Standard constructor. More... | |
| std::unique_ptr< Segment > | fitSegment (const EventContext &ctx, const SegmentSeed *parent, const LinePar_t &startPars, const Amg::Transform3D &localToGlobal, HitVec_t &&calibHits) const |
| Fit a set of measurements to a straight segment line. More... | |
| bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. More... | |
| MsgStream & | msg () const |
| The standard message stream. More... | |
| MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. More... | |
| void | setLevel (MSG::Level lvl) |
| Change the current logging level. More... | |
Private Member Functions | |
| void | centerAlongWire (Result_t &fitResult) const |
| Moves the segment to the average x0 position, if the segment does not contain any measurement. More... | |
| Result_t | callLineFit (const Acts::CalibrationContext &cctx, const Parameters &startPars, const Amg::Transform3D &localToGlobal, HitVec_t &&calibHits) const |
| Calls the underlying line fitter to determine the segment parameters. More... | |
| bool | removeOutliers (const Acts::CalibrationContext &cctx, const SegmentSeed &seed, const Amg::Transform3D &localToGlobal, Result_t &fitResult) const |
| Cleans the fitted segment from the most outlier hit and then attempts to refit the segment. More... | |
| bool | plugHoles (const Acts::CalibrationContext &cctx, const SegmentSeed &seed, const Amg::Transform3D &localToGlobal, Result_t &toRecover) const |
| Recovery of missed hits. More... | |
| void | eraseWrongHits (Result_t &candidate) const |
| Removes all hits from the segment which are obvious outliers. More... | |
| void | cleanStripLayers (const Amg::Vector3D &linePos, const Amg::Vector3D &lineDir, HitVec_t &hits) const |
| Marks duplicate hits on a strip layer as outliers to avoid competing contributions from the same layers in the fit. More... | |
| std::unique_ptr< Segment > | convertToSegment (const Amg::Transform3D &locToGlobTrf, const SegmentSeed *parentSeed, Result_t &&toConvert) const |
| Converts the fit result into a segment object. More... | |
| void | initMessaging () const |
| Initialize our message level and MessageSvc. More... | |
Private Attributes | |
| Fitter_t | m_fitter |
| Actual implementation of the straight line fit More... | |
| ConfigSwitches | m_cfg {} |
| Configuration switches of the ATLAS fitter implementation. More... | |
| Selector_t | m_goodHitSel {} |
| Selector to identify the valid hits. More... | |
| std::string | m_nm |
| Message source name. More... | |
| boost::thread_specific_ptr< MsgStream > | m_msg_tls |
| MsgStream instance (a std::cout like with print-out levels) More... | |
| std::atomic< IMessageSvc * > | m_imsg { nullptr } |
| MessageSvc pointer. More... | |
| std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
| Current logging level. More... | |
| std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
| Messaging initialized (initMessaging) More... | |
The SegmentLineFitter is a standalone module to fit a straight line to calibrated muon space points.
The CompositeSpacePointLineFitter from the ACTS toolkit is used to perform the actual fit to the measurements. The SegmentLineFitter is a wrapper class taking care of relaunching fits of poor quality but with cleaned measurements and also to put back meaurements on the line that have been missed by the initial line fit.
Definition at line 28 of file SegmentLineFitter.h.
| using MuonR4::SegmentFit::SegmentLineFitter::FitOpts_t = Fitter_t::FitOptions<HitVec_t, ISpacePointCalibrator> |
Abrivation of the fit options.
Definition at line 43 of file SegmentLineFitter.h.
| using MuonR4::SegmentFit::SegmentLineFitter::FitPars_t = Fitter_t::FitParameters |
Abrivation of the fit parameters
Definition at line 39 of file SegmentLineFitter.h.
| using MuonR4::SegmentFit::SegmentLineFitter::Fitter_t = Acts::Experimental::CompositeSpacePointLineFitter |
Abrivation of the actual line fitter.
Definition at line 31 of file SegmentLineFitter.h.
| using MuonR4::SegmentFit::SegmentLineFitter::Hit_t = std::unique_ptr<CalibratedSpacePoint> |
Abrivation of the space point type to use.
Definition at line 35 of file SegmentLineFitter.h.
Abrivation of the fit state flag.
Definition at line 47 of file SegmentLineFitter.h.
| using MuonR4::SegmentFit::SegmentLineFitter::HitVec_t = std::vector<Hit_t> |
Collection of space points.
Definition at line 37 of file SegmentLineFitter.h.
| using MuonR4::SegmentFit::SegmentLineFitter::LinePar_t = Fitter_t::ParamVec_t |
Abrivation of the fitted line parameters.
Definition at line 33 of file SegmentLineFitter.h.
| using MuonR4::SegmentFit::SegmentLineFitter::Result_t = Fitter_t::FitResult<HitVec_t> |
Abrivation of the fit result.
Definition at line 41 of file SegmentLineFitter.h.
| using MuonR4::SegmentFit::SegmentLineFitter::Selector_t = Fitter_t::Selector_t<CalibratedSpacePoint> |
Abrivation of the hit selector to choose valid hits.
Definition at line 45 of file SegmentLineFitter.h.
| MuonR4::SegmentFit::SegmentLineFitter::SegmentLineFitter | ( | const std::string & | name, |
| Config && | config | ||
| ) |
Standard constructor.
| name | Name to be printed in the messaging |
| config | Fit configuration parameters |
Definition at line 108 of file SegmentLineFitter.cxx.
|
private |
Calls the underlying line fitter to determine the segment parameters.
| cctx | Calibration context to fetch later the measurement's calib constants from StoreGate (It's a packed EventContext*) |
| startPars | Initial line parameters guess |
| localToGlobal | Transform to align the segment's station inside ATLAS (Mainly neede if the time is fit) |
| calibHits | List of hits that will be fitted |
Check whether a beamspot constraint should be appended
placeholder for a very generous beam spot: 300mm in X,Y (tracking volume), 20000 along Z
Recall that the time is not the same in Acts & Athena
Fit the measurements
Convert back to athena time units
Definition at line 114 of file SegmentLineFitter.cxx.
|
private |
Moves the segment to the average x0 position, if the segment does not contain any measurement.
Definition at line 535 of file SegmentLineFitter.cxx.
|
inlineprivate |
Marks duplicate hits on a strip layer as outliers to avoid competing contributions from the same layers in the fit.
Hits on the same layer are sorted by their chi2 and the worse ones are rejected if they don't provide additional information
| linePos | Position of the latest segment line |
| lineDir | Direction of the latest segment line |
| hits | List of hit measurements to clean |
We need to sort out strip hits on the same layer
Loop over the hits to mark the less compatible hits on the layer as outlier
Both hits measure eta. They've been sorted by lower chi2 -> reject b
Definition at line 304 of file SegmentLineFitter.cxx.
|
private |
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 |
TODO: Add the config retrieval to the composite space point line fitter
Definition at line 195 of file SegmentLineFitter.cxx.
|
private |
Removes all hits from the segment which are obvious outliers.
E.g. tubes which cannot be crossed by the segment.
| candidate | Reference of the segment candidate to prune. |
The segment has never crossed the tube
Definition at line 282 of file SegmentLineFitter.cxx.
| std::unique_ptr< Segment > MuonR4::SegmentFit::SegmentLineFitter::fitSegment | ( | const EventContext & | ctx, |
| const SegmentSeed * | parent, | ||
| const LinePar_t & | startPars, | ||
| const Amg::Transform3D & | localToGlobal, | ||
| HitVec_t && | calibHits | ||
| ) | const |
Fit a set of measurements to a straight segment line.
Badish initial fits are cleaned and then holes are put filled back Returns a nullptr if the fit failed
| ctx | EventContext to access the calibration constants |
| parent | Pointer to the seed from which the hits to fit are taken. The seed gives also access to the parent bucket to recover lost hits |
| startPars | List of parameters serving as an initial guess |
| localToGlobal | Transform to align the segment's station inside ATLAS (Mainly neede if the time is fit) |
| calibHits | List of hits that will be fitted |
Definition at line 163 of file SegmentLineFitter.cxx.
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
|
inlineinherited |
Test the output level.
| lvl | The message level to test against |
| true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
|
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.
| cctx | Calibration context to fetch later the measurement's calib constants from StoreGate (It's a packed EventContext*) |
| seed | Parent seed from which the segment fit is actually triggered The seed is mainly used for visualization purposes |
| localToGlobal | Transform to align the spectrometer sector within ATLAS mainly used for the t0 fit |
| fitResult | Previously achieved fit result to be checked. The measurements on the result and the paramters are updated accordingly |
We've the first estimator of the segment fit
Setup a map to replace space points if they better suite
Loop over all hits in the parent bucket
Hit already used in the segment fit
If the hit is a phi measurement check at least if it can be hit by the segment
Use the pull of the uncalibrated measurement to estimate whether a calibration is actually worth
No extra hit has been found
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 the hole recovery
Definition at line 363 of file SegmentLineFitter.cxx.
|
private |
Cleans the fitted segment from the most outlier hit and then attempts to refit the segment.
The outlier removal is not run if the segment has already a chi2 / nDoF better than <outlierRemovalCut>. Returns false if the recovery lead to the destruction of all nDoF
| cctx | Calibration context to fetch later the measurement's calib constants from StoreGate (It's a packed EventContext*) |
| seed | Parent seed from which the segment fit is actually triggered The seed is mainly used for visualization purposes |
| localToGlobal | Transform to align the spectrometer sector within ATLAS mainly used for the t0 fit |
| fitResult | Previously achieved fit result to be checked. The measurements on the result and the paramters are updated accordingly |
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 ascending chi2
Refit the segment line without the measurement
Definition at line 227 of file SegmentLineFitter.cxx.
|
inherited |
Change the current logging level.
Use this rather than msg().setLevel() for proper operation with MT.
Definition at line 28 of file AthMessaging.cxx.
|
mutableprivateinherited |
Messaging initialized (initMessaging)
Definition at line 141 of file AthMessaging.h.
|
private |
Configuration switches of the ATLAS fitter implementation.
Definition at line 108 of file SegmentLineFitter.h.
|
private |
Actual implementation of the straight line fit
Definition at line 106 of file SegmentLineFitter.h.
|
private |
Selector to identify the valid hits.
Definition at line 110 of file SegmentLineFitter.h.
|
mutableprivateinherited |
MessageSvc pointer.
Definition at line 135 of file AthMessaging.h.
|
mutableprivateinherited |
Current logging level.
Definition at line 138 of file AthMessaging.h.
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
|
privateinherited |
Message source name.
Definition at line 129 of file AthMessaging.h.
1.8.18