Loading [MathJax]/extensions/tex2jax.js
 |
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; }
233 std::vector< std::unique_ptr< const std::vector < const TrackStateOnSurface *>,
234 void (*)(
const std::vector<const TrackStateOnSurface *> *) > >
260 (*m_fit_status_out)[
idx] += a_fit_status;
285 virtual std::unique_ptr<Track>
fit(
286 const EventContext& ctx,
291 )
const override final;
293 virtual std::unique_ptr<Track>
fit(
294 const EventContext& ctx,
298 )
const override final;
300 virtual std::unique_ptr<Track>
fit(
301 const EventContext& ctx,
306 )
const override final;
308 virtual std::unique_ptr<Track>
fit(
309 const EventContext& ctx,
314 )
const override final;
316 virtual std::unique_ptr<Track>
fit(
317 const EventContext& ctx,
322 )
const override final;
324 virtual std::unique_ptr<Track>
fit(
325 const EventContext& ctx,
330 )
const override final;
342 const EventContext& ctx,
344 const Track & inputTrack,
350 const EventContext& ctx,
367 const EventContext& ctx,
372 std::vector<MaterialEffectsOnTrack> &
376 const EventContext& ctx,
381 std::vector<MaterialEffectsOnTrack> &
396 bool isoutlier =
false,
479 std::vector<std::pair<const Layer *, const Layer *>> &
layers,
508 std::vector<std::pair<const Layer *, const Layer *>> &
layers,
509 std::vector<std::pair<const Layer *, const Layer *>> & uplayers,
510 const std::vector<std::unique_ptr<GXFTrackState>> &
states,
540 const EventContext& ctx,
548 const EventContext& ctx,
570 const EventContext & ctx,
576 std::unique_ptr<const TrackParameters>
makePerigee(
588 const EventContext &,
595 const EventContext &,
602 const EventContext& ctx,
625 const EventContext& ctx,
630 int & bremno_maxbrempull,
666 const int bremno_maxbrempull,
773 const double oldRedChi2,
774 const double newRedChi2
819 const EventContext& ctx,
849 const EventContext& evtctx
859 const EventContext& ctx,
875 const EventContext& ctx
891 const EventContext &,
941 const EventContext &,
1003 const EventContext & ctx,
1004 const std::vector<std::reference_wrapper<GXFTrackState>> &
states
1030 const std::vector<std::unique_ptr<TrackParameters>> & hc,
1031 std::set<Identifier> & id_set,
1032 std::set<Identifier> & sct_set,
1039 const EventContext& ctx,
1056 const EventContext& ctx,
1083 const EventContext& ctx,
1087 ToolHandle<IRIO_OnTrackCreator>
m_ROTcreator {
this,
"RotCreatorTool",
"",
""};
1089 ToolHandle<IUpdator>
m_updator {
this,
"MeasurementUpdateTool",
"",
""};
1090 ToolHandle<IExtrapolator>
m_extrapolator {
this,
"ExtrapolationTool",
"Trk::Extrapolator/CosmicsExtrapolator",
""};
1091 ToolHandle<IMultipleScatteringUpdator>
m_scattool {
this,
"MultipleScatteringTool",
"Trk::MultipleScatteringUpdator/AtlasMultipleScatteringUpdator",
""};
1092 ToolHandle<IEnergyLossUpdator>
m_elosstool {
this,
"EnergyLossTool",
"Trk::EnergyLossUpdator/AtlasEnergyLossUpdator",
""};
1093 ToolHandle<IMaterialEffectsUpdator>
m_matupdator {
this,
"MaterialUpdateTool",
"",
""};
1095 ToolHandle<INavigator>
m_navigator {
this,
"NavigatorTool",
"Trk::Navigator/CosmicsNavigator",
""};
1096 ToolHandle<IResidualPullCalculator>
m_residualPullCalculator {
this,
"ResidualPullCalculatorTool",
"Trk::ResidualPullCalculator/ResidualPullCalculator",
""};
1097 ToolHandle<Trk::ITrkMaterialProviderTool>
m_caloMaterialProvider {
this,
"CaloMaterialProvider",
"Trk::TrkMaterialProviderTool/TrkMaterialProviderTool",
""};
1098 ToolHandle<IMaterialEffectsOnTrackProvider>
m_calotool {
this,
"MuidTool",
"Rec::MuidMaterialEffectsOnTrackProvider/MuidMaterialEffectsOnTrackProvider",
""};
1099 ToolHandle<IMaterialEffectsOnTrackProvider>
m_calotoolparam {
this,
"MuidToolParam",
"",
""};
1100 ToolHandle<IBoundaryCheckTool>
m_boundaryCheckTool {
this,
"BoundaryCheckTool",
"",
"Boundary checking tool for detector sensitivities" };
1114 const EventContext& ctx,
1128 const EventContext& ctx,
1133 const EventContext& ctx)
const
1140 const EventContext& ctx)
const
1147 return handle.
cptr();
1152 "TrackingGeometryReadKey",
1153 "AtlasTrackingGeometry",
1154 "Key of the TrackingGeometry conditions data."
1159 "AtlasFieldCacheCondObj",
1161 "Trk::GlobalChi2Fitter field conditions object key"
1168 Gaudi::Property<bool>
m_extmat {
this,
"ExtrapolatorMaterial",
true};
1172 Gaudi::Property<bool>
m_sirecal {
this,
"RecalibrateSilicon",
false};
1173 Gaudi::Property<bool>
m_trtrecal {
this,
"RecalibrateTRT",
false};
1178 Gaudi::Property<bool>
m_storemat {
this,
"StoreMaterialOnTrack",
true};
1179 Gaudi::Property<bool>
m_redoderivs {
this,
"RecalculateDerivatives",
false};
1180 Gaudi::Property<bool>
m_reintoutl {
this,
"ReintegrateOutliers",
false};
1182 Gaudi::Property<bool>
m_numderiv {
this,
"NumericalDerivs",
false};
1184 Gaudi::Property<bool>
m_asymeloss {
this,
"AsymmetricEnergyLoss",
true};
1190 Gaudi::Property<double>
m_outlcut {
this,
"OutlierCut", 5.0};
1191 Gaudi::Property<double>
m_p {
this,
"Momentum", 0.0};
1192 Gaudi::Property<double>
m_chi2cut {
this,
"TrackChi2PerNDFCut", 1.e15};
1197 Gaudi::Property<int>
m_maxit {
this,
"MaxIterations", 30};
1198 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::array< std::atomic< unsigned int >, S_MAX_VALUE > * m_fit_status_out
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.
void fillResidualsAndErrors(const EventContext &ctx, const Cache &cache, GXFTrajectory &trajectory, const int it, Amg::VectorX &b, int &bremno_maxbrempull, GXFTrackState *&state_maxbrempull) const
bool tryToWeightAfromMaterial(Cache &cache, GXFTrajectory &trajectory, Amg::SymMatrixX &a, const bool doDeriv, const int it, const double oldRedChi2, const double newRedChi2) const
Gaudi::Property< double > m_outlcut
std::array< std::atomic< unsigned int >, S_MAX_VALUE > m_fit_status ATLAS_THREAD_SAFE
bool ensureValidEntranceMuonSpectrometer(const EventContext &ctx, Cache &cache) const
Gaudi::Property< bool > m_numderiv
ToolHandle< IMaterialEffectsOnTrackProvider > m_calotool
ToolHandle< IMaterialEffectsUpdator > m_matupdator
Gaudi::Property< bool > m_holeSearch
FitterStatusCode runIteration(const EventContext &ctx, Cache &cache, GXFTrajectory &trajectory, const int it, Amg::SymMatrixX &a, Amg::VectorX &b, Amg::SymMatrixX &lu, bool &doDeriv) const
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
std::array< unsigned int, S_MAX_VALUE > m_fit_status
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
void fillFirstLastMeasurement(Cache &cache, GXFTrajectory &trajectory) const
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
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
void updateSystemWithMaxBremPull(GXFTrajectory &trajectory, const int bremno_maxbrempull, GXFTrackState *state_maxbrempull, Amg::SymMatrixX &a) const
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 compensatePhiWeights(Cache &cache, GXFTrajectory &trajectory, Amg::SymMatrixX &a) 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
void tryToConverge(const Cache &cache, GXFTrajectory &trajectory, const int it) const
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
void fillBfromMeasurements(const Cache &cache, GXFTrajectory &trajectory, Amg::VectorX &b) const
FitterStatusCode updateFitParameters(GXFTrajectory &, const Amg::VectorX &, const Amg::SymMatrixX &) const
Method to update peregee parameters, scattering angles, and brems.
Gaudi::Property< bool > m_sirecal
virtual StatusCode finalize() override
virtual StatusCode initialize() override
void fillAfromMeasurements(const Cache &cache, GXFTrajectory &trajectory, Amg::SymMatrixX &a) const
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
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
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()
bool ensureValidEntranceCalo(const EventContext &ctx, Cache &cache) const
std::variant< std::unique_ptr< const TrackParameters >, FitterStatusCode > updateEnergyLoss(const Surface &, const GXFMaterialEffects &, const TrackParameters &, double, int) const
unsigned int m_pixel_hole
void fillAfromScatterers(GXFTrajectory &trajectory, Amg::SymMatrixX &a) const
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
void fillDerivatives(GXFTrajectory &traj) const
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainer
const_pointer_type cptr()
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > SymMatrixX