|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef GLOBALCHI2FITTER_H
6 #define GLOBALCHI2FITTER_H
11 #include "GaudiKernel/ToolHandle.h"
12 #include "GaudiKernel/EventContext.h"
144 class IMagneticFieldTool;
146 class PrepRawDataComparisonFunction;
147 class MeasurementBaseComparisonFunction;
148 class MaterialEffectsOnTrack;
152 class MagneticFieldProperties;
153 class TrackingVolume;
156 class GlobalChi2Fitter:
public extends<AthCheckedComponent<AthAlgTool>, IGlobalTrackFitter> {
160 std::optional<std::vector<std::unique_ptr<TrackParameters>>>
m_preholes;
198 for (
const T *elm : *
ptr) {
delete elm; }
231 int m_iterations = 0;
237 std::vector< std::unique_ptr< const std::vector < const TrackStateOnSurface *>,
238 void (*)(
const std::vector<const TrackStateOnSurface *> *) > >
264 (*m_fit_status_out)[
idx] += a_fit_status;
289 virtual std::unique_ptr<Track>
fit(
290 const EventContext& ctx,
295 )
const override final;
297 virtual std::unique_ptr<Track>
fit(
298 const EventContext& ctx,
302 )
const override final;
304 virtual std::unique_ptr<Track>
fit(
305 const EventContext& ctx,
310 )
const override final;
312 virtual std::unique_ptr<Track>
fit(
313 const EventContext& ctx,
318 )
const override final;
320 virtual std::unique_ptr<Track>
fit(
321 const EventContext& ctx,
326 )
const override final;
328 virtual std::unique_ptr<Track>
fit(
329 const EventContext& ctx,
334 )
const override final;
346 const EventContext& ctx,
348 const Track & inputTrack,
354 const EventContext& ctx,
371 const EventContext& ctx,
376 std::vector<MaterialEffectsOnTrack> &
380 const EventContext& ctx,
385 std::vector<MaterialEffectsOnTrack> &
400 bool isoutlier =
false,
483 std::vector<std::pair<const Layer *, const Layer *>> &
layers,
512 std::vector<std::pair<const Layer *, const Layer *>> &
layers,
513 std::vector<std::pair<const Layer *, const Layer *>> & uplayers,
514 const std::vector<std::unique_ptr<GXFTrackState>> &
states,
544 const EventContext& ctx,
552 const EventContext& ctx,
574 const EventContext & ctx,
580 std::unique_ptr<const TrackParameters>
makePerigee(
592 const EventContext &,
599 const EventContext &,
606 const EventContext& ctx,
613 const EventContext& ctx,
625 bool onlybrem =
false
629 const EventContext& ctx,
653 const EventContext& evtctx
663 const EventContext& ctx,
679 const EventContext& ctx
695 const EventContext &,
745 const EventContext &,
807 const EventContext & ctx,
808 const std::vector<std::reference_wrapper<GXFTrackState>> &
states
834 const std::vector<std::unique_ptr<TrackParameters>> & hc,
835 std::set<Identifier> & id_set,
836 std::set<Identifier> & sct_set,
843 const EventContext& ctx,
860 const EventContext& ctx,
887 const EventContext& ctx,
891 ToolHandle<IRIO_OnTrackCreator>
m_ROTcreator {
this,
"RotCreatorTool",
"",
""};
893 ToolHandle<IUpdator>
m_updator {
this,
"MeasurementUpdateTool",
"",
""};
894 ToolHandle<IExtrapolator>
m_extrapolator {
this,
"ExtrapolationTool",
"Trk::Extrapolator/CosmicsExtrapolator",
""};
895 ToolHandle<IMultipleScatteringUpdator>
m_scattool {
this,
"MultipleScatteringTool",
"Trk::MultipleScatteringUpdator/AtlasMultipleScatteringUpdator",
""};
896 ToolHandle<IEnergyLossUpdator>
m_elosstool {
this,
"EnergyLossTool",
"Trk::EnergyLossUpdator/AtlasEnergyLossUpdator",
""};
897 ToolHandle<IMaterialEffectsUpdator>
m_matupdator {
this,
"MaterialUpdateTool",
"",
""};
899 ToolHandle<INavigator>
m_navigator {
this,
"NavigatorTool",
"Trk::Navigator/CosmicsNavigator",
""};
900 ToolHandle<IResidualPullCalculator>
m_residualPullCalculator {
this,
"ResidualPullCalculatorTool",
"Trk::ResidualPullCalculator/ResidualPullCalculator",
""};
901 ToolHandle<Trk::ITrkMaterialProviderTool>
m_caloMaterialProvider {
this,
"CaloMaterialProvider",
"Trk::TrkMaterialProviderTool/TrkMaterialProviderTool",
""};
902 ToolHandle<IMaterialEffectsOnTrackProvider>
m_calotool {
this,
"MuidTool",
"Rec::MuidMaterialEffectsOnTrackProvider/MuidMaterialEffectsOnTrackProvider",
""};
903 ToolHandle<IMaterialEffectsOnTrackProvider>
m_calotoolparam {
this,
"MuidToolParam",
"",
""};
904 ToolHandle<IBoundaryCheckTool>
m_boundaryCheckTool {
this,
"BoundaryCheckTool",
"",
"Boundary checking tool for detector sensitivities" };
908 const EventContext& ctx)
const
915 const EventContext& ctx)
const
922 return handle.
cptr();
927 "TrackingGeometryReadKey",
928 "AtlasTrackingGeometry",
929 "Key of the TrackingGeometry conditions data."
934 "AtlasFieldCacheCondObj",
936 "Trk::GlobalChi2Fitter field conditions object key"
942 Gaudi::Property<bool>
m_calomat {
this,
"MuidMat",
false};
943 Gaudi::Property<bool>
m_extmat {
this,
"ExtrapolatorMaterial",
true};
947 Gaudi::Property<bool>
m_sirecal {
this,
"RecalibrateSilicon",
false};
948 Gaudi::Property<bool>
m_trtrecal {
this,
"RecalibrateTRT",
false};
953 Gaudi::Property<bool>
m_storemat {
this,
"StoreMaterialOnTrack",
true};
954 Gaudi::Property<bool>
m_redoderivs {
this,
"RecalculateDerivatives",
false};
955 Gaudi::Property<bool>
m_reintoutl {
this,
"ReintegrateOutliers",
false};
957 Gaudi::Property<bool>
m_numderiv {
this,
"NumericalDerivs",
false};
958 Gaudi::Property<bool>
m_fiteloss {
this,
"FitEnergyLoss",
false};
959 Gaudi::Property<bool>
m_asymeloss {
this,
"AsymmetricEnergyLoss",
true};
965 Gaudi::Property<double>
m_outlcut {
this,
"OutlierCut", 5.0};
966 Gaudi::Property<double>
m_p {
this,
"Momentum", 0.0};
967 Gaudi::Property<double>
m_chi2cut {
this,
"TrackChi2PerNDFCut", 1.e15};
972 Gaudi::Property<int>
m_maxit {
this,
"MaxIterations", 30};
973 Gaudi::Property<int>
m_miniter {
this,
"MinimumIterations", 1};
std::unique_ptr< const TrackParameters > makePerigee(Cache &, const TrackParameters &, const ParticleHypothesis) const
const TrackingVolume * m_msEntrance
const ShapeFitter * fitter
void makeProtoState(Cache &, GXFTrajectory &, const TrackStateOnSurface *, int index=-1) const
Gaudi::Property< bool > m_kinkfinding
const TrackingGeometry * retrieveTrackingGeometry(const EventContext &ctx) const
Gaudi::Property< bool > m_createSummary
std::vector< std::unique_ptr< const std::vector< const TrackStateOnSurface * >, void(*)(const std::vector< const TrackStateOnSurface * > *) > > m_matTempStore
Gaudi::Property< bool > m_reintoutl
std::vector< const PrepRawData * > PrepRawDataSet
vector of clusters and drift circles
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
ToolHandle< INavigator > m_navigator
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Gaudi::Property< double > m_outlcut
Gaudi::Property< bool > m_numderiv
FitterStatusCode runIteration(const EventContext &ctx, Cache &, GXFTrajectory &, int, Amg::SymMatrixX &, Amg::VectorX &, Amg::SymMatrixX &, bool &) const
ToolHandle< IMaterialEffectsOnTrackProvider > m_calotool
ToolHandle< IMaterialEffectsUpdator > m_matupdator
Gaudi::Property< bool > m_holeSearch
GlobalChi2Fitter(const std::string &, const std::string &, const IInterface *)
bool isMuonTrack(const Track &) const
Track * myfit_helper(Cache &, GXFTrajectory &, const TrackParameters &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis matEffects=nonInteracting) const
Gaudi::Property< bool > m_redoderivs
std::optional< std::vector< std::unique_ptr< TrackParameters > > > m_preholes
Gaudi::Property< bool > m_straightlineprop
Gaudi::Property< bool > m_extmat
virtual void setMinIterations(int)
PropagationResult calculateTrackParametersPropagate(const EventContext &, const TrackParameters &, const GXFTrackState &, PropDirection, const MagneticFieldProperties &, bool, bool) const
Propagate onto a track state, collecting new track parameters, and optionally the Jacobian and possib...
ToolHandle< IRIO_OnTrackCreator > m_ROTcreator
ToolHandle< IExtrapolator > m_extrapolator
Track * myfit(const EventContext &ctx, Cache &, GXFTrajectory &, const TrackParameters &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis matEffects=nonInteracting) const
Gaudi::Property< bool > m_decomposesegments
Gaudi::Property< bool > m_signedradius
ToolHandle< IPropagator > m_propagator
void runTrackCleanerTRT(Cache &, GXFTrajectory &, Amg::SymMatrixX &, Amg::VectorX &, Amg::SymMatrixX &, bool, bool, int, const EventContext &ctx) const
void addMaterialUpdateTrajectory(Cache &cache, GXFTrajectory &track, int offset, std::vector< std::pair< const Layer *, const Layer * >> &layers, const TrackParameters *ref1, const TrackParameters *ref2, ParticleHypothesis mat) const
Given layer information, probe those layers for scatterers and add them to a track.
Internal representation of the track, used in the track fit.
std::optional< TransportJacobian > m_jacobian
unsigned int m_pixel_dead
std::vector< std::unique_ptr< TrackParameters > > holesearchExtrapolation(const EventContext &ctx, const TrackParameters &src, const GXFTrackState &dst, PropDirection propdir) const
Helper method which performs an extrapolation with additional logic for hole search.
std::vector< int > m_lastmeasurement
ToolHandle< IRIO_OnTrackCreator > m_broadROTcreator
std::unique_ptr< const TrackParameters > makeTrackFindPerigeeParameters(const EventContext &, Cache &, GXFTrajectory &, const ParticleHypothesis) const
Gaudi::Property< int > m_maxoutliers
std::vector< const Trk::Layer * > m_posdiscs
SG::ReadCondHandleKey< TrackingGeometry > m_trackingGeometryReadKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_field_cache_key
ToolHandle< IBoundaryCheckTool > m_boundaryCheckTool
Gaudi::Property< double > m_minphfcut
FitterStatusCode calculateTrackParameters(const EventContext &ctx, GXFTrajectory &, bool) const
Gaudi::Property< int > m_fixbrem
std::array< unsigned int, __S_MAX_VALUE > m_fit_status
bool RunOutlierRemoval
switch to toggle quality processing after fit
Cache & operator=(const Cache &)=delete
void initFieldCache(const EventContext &ctx, Cache &cache) const
Initialize a field cache inside a fit cache object.
static void objVectorDeleter(const std::vector< const T * > *ptr)
std::unique_ptr< const TrackParameters > m_parameters
Gaudi::Property< int > m_maxit
Gaudi::Property< bool > m_storemat
std::vector< const Trk::Layer * > m_barrelcylinders
std::vector< int > m_firstmeasurement
ToolHandle< IResidualPullCalculator > m_residualPullCalculator
std::vector< std::reference_wrapper< GXFTrackState > > holeSearchStates(GXFTrajectory &trajectory) const
Extracts a collection of track states which are important for hole search.
static void addMaterialGetLayers(Cache &cache, std::vector< std::pair< const Layer *, const Layer * >> &layers, std::vector< std::pair< const Layer *, const Layer * >> &uplayers, const std::vector< std::unique_ptr< GXFTrackState >> &states, GXFTrackState &first, GXFTrackState &last, const TrackParameters *refpar, bool hasmat)
Collect all possible layers that a given track could have passed through.
static void makeTrackFillDerivativeMatrix(Cache &, GXFTrajectory &)
Gaudi::Property< bool > m_getmaterialfromtrack
ToolHandle< Trk::ITrkMaterialProviderTool > m_caloMaterialProvider
unsigned int m_sct_double_hole
const TrackingVolume * m_caloEntrance
const TrackingGeometry * m_trackingGeometry
void fillDerivatives(GXFTrajectory &traj, bool onlybrem=false) const
Gaudi::Property< bool > m_asymeloss
ToolHandle< IEnergyLossUpdator > m_elosstool
Cache(const GlobalChi2Fitter *fitter)
Track * mainCombinationStrategy(const EventContext &ctx, Cache &, const Track &, const Track &, GXFTrajectory &, std::vector< MaterialEffectsOnTrack > &) const
MagField::AtlasFieldCache m_field_cache
virtual int iterationsOfLastFit() const
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< bool > m_domeastrackpar
const AtlasDetectorID * m_DetID
PropagationResult calculateTrackParametersPropagateHelper(const EventContext &, const TrackParameters &, const GXFTrackState &, PropDirection, const MagneticFieldProperties &, bool, bool) const
Helper method that encapsulates calls to the propagator tool in the calculateTrackParameters() method...
virtual Track * alignmentFit(AlignmentCache &, const Track &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis matEffects=Trk::nonInteracting) const override
static std::optional< std::pair< Amg::Vector3D, double > > addMaterialFindIntersectionDisc(Cache &cache, const DiscSurface &surface, const TrackParameters ¶m1, const TrackParameters ¶m2, const ParticleHypothesis mat)
Find the intersection of a set of track parameters onto a disc surface.
void throwFailedToGetTrackingGeomtry() const
Status codes for track fitters.
std::vector< const Trk::Layer * > m_negdiscs
Gaudi::Property< bool > m_fiteloss
std::optional< GlobalChi2Fitter::TrackHoleCount > holeSearchProcess(const EventContext &ctx, const std::vector< std::reference_wrapper< GXFTrackState >> &states) const
Conduct a hole search between a list of states, possibly reusing existing information.
static bool correctAngles(double &, double &)
class that is similar to MaterialEffectsOnTrack, but has 'set' methods for more flexibility during tr...
static std::optional< std::pair< Amg::Vector3D, double > > addMaterialFindIntersectionCyl(Cache &cache, const CylinderSurface &surface, const TrackParameters ¶m1, const TrackParameters ¶m2, const ParticleHypothesis mat)
Find the intersection of a set of track parameters onto a cylindrical surface.
Gaudi::Property< bool > m_extensioncuts
void holeSearchHelper(const std::vector< std::unique_ptr< TrackParameters >> &hc, std::set< Identifier > &id_set, std::set< Identifier > &sct_set, TrackHoleCount &rv, bool count_holes, bool count_dead) const
Helper method for the hole search that does the actual counting of holes and dead modules.
const TrackingGeometry * trackingGeometry(Cache &cache, const EventContext &ctx) const
ToolHandle< IMaterialEffectsOnTrackProvider > m_calotoolparam
Gaudi::Property< int > m_miniter
void calculateTrackErrors(GXFTrajectory &, Amg::SymMatrixX &, bool) const
std::unique_ptr< GXFTrackState > makeTrackFindPerigee(const EventContext &, Cache &, GXFTrajectory &, const ParticleHypothesis) const
Amg::SymMatrixX m_fullcovmat
void incrementFitStatus(enum FitterStatusType status)
Gaudi::Property< bool > m_fillderivmatrix
ToolHandle< IMultipleScatteringUpdator > m_scattool
std::unique_ptr< Track > makeTrack(const EventContext &ctx, Cache &, GXFTrajectory &, const ParticleHypothesis) const
bool processTrkVolume(Cache &, const Trk::TrackingVolume *tvol) const
std::optional< TransportJacobian > numericalDerivatives(const EventContext &ctx, const TrackParameters *, const Surface &, PropDirection, const MagneticFieldProperties &) const
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
Gaudi::Property< bool > m_acceleration
Ensure that the ATLAS eigen extensions are properly loaded.
void addMaterial(const EventContext &ctx, Cache &, GXFTrajectory &, const TrackParameters *, ParticleHypothesis) const
represents the track state (measurement, material, fit parameters and quality) at a surface.
void updatePixelROTs(GXFTrajectory &, Amg::SymMatrixX &, Amg::VectorX &, const EventContext &evtctx) const
Update the Pixel ROT using the current trajectory/local track parameters.
std::vector< double > m_phiweight
FitterStatusCode m_fittercode
GXFTrajectory * runTrackCleanerSilicon(const EventContext &ctx, Cache &, GXFTrajectory &, Amg::SymMatrixX &, Amg::SymMatrixX &, Amg::VectorX &, bool) const
Gaudi::Property< double > m_chi2cut
Gaudi::Property< bool > m_sirecal
virtual StatusCode finalize() override
virtual StatusCode initialize() override
bool m_getmaterialfromtrack
Track * backupCombinationStrategy(const EventContext &ctx, Cache &, const Track &, const Track &, GXFTrajectory &, std::vector< MaterialEffectsOnTrack > &) const
void makeProtoStateFromMeasurement(Cache &, GXFTrajectory &, const MeasurementBase *, const TrackParameters *trackpar=nullptr, bool isoutlier=false, int index=-1) const
Gaudi::Property< double > m_p
FitterStatusCode updateFitParameters(GXFTrajectory &, Amg::VectorX &, const Amg::SymMatrixX &) const
Gaudi::Property< int > m_maxitPixelROT
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Track * fitIm(const EventContext &ctx, Cache &cache, const Track &inputTrack, const RunOutlierRemoval runOutlier, const ParticleHypothesis matEffects) const
Gaudi::Property< double > m_scalefactor
std::array< std::atomic< unsigned int >, __S_MAX_VALUE > m_fit_status ATLAS_THREAD_SAFE
ToolHandle< IUpdator > m_updator
void addIDMaterialFast(const EventContext &ctx, Cache &cache, GXFTrajectory &track, const TrackParameters *parameters, ParticleHypothesis part) const
A faster strategy for adding scatter material to tracks, works only for inner detector tracks.
virtual std::unique_ptr< Track > fit(const EventContext &ctx, const PrepRawDataSet &, const TrackParameters &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis matEffects=nonInteracting) const override final
Gaudi::Property< bool > m_calomat
Gaudi::Property< bool > m_rejectLargeNScat
Gaudi::Property< bool > m_trtrecal
virtual ~ GlobalChi2Fitter()
std::array< std::atomic< unsigned int >, __S_MAX_VALUE > * m_fit_status_out
std::variant< std::unique_ptr< const TrackParameters >, FitterStatusCode > updateEnergyLoss(const Surface &, const GXFMaterialEffects &, const TrackParameters &, double, int) const
unsigned int m_pixel_hole
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
static void calculateDerivatives(GXFTrajectory &)
Gaudi::Property< bool > m_useCaloTG
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainer
const_pointer_type cptr()
void fillResiduals(const EventContext &ctx, Cache &, GXFTrajectory &, int, Amg::SymMatrixX &, Amg::VectorX &, Amg::SymMatrixX &, bool &) const
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > SymMatrixX