diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h index acc512b82540eb4835d42487d29c97fc66c92033..d7fb48e2adee86c870ce5c9e505f197fab84b955 100755 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h @@ -10,7 +10,23 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/EventContext.h" + +#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h" + +#include "TrkToolInterfaces/ITrkMaterialProviderTool.h" +#include "TrkToolInterfaces/IResidualPullCalculator.h" +#include "TrkToolInterfaces/IRIO_OnTrackCreator.h" +#include "TrkToolInterfaces/IUpdator.h" + +#include "TrkExInterfaces/IExtrapolator.h" +#include "TrkExInterfaces/IPropagator.h" +#include "TrkExInterfaces/INavigator.h" +#include "TrkExInterfaces/IMultipleScatteringUpdator.h" +#include "TrkExInterfaces/IEnergyLossUpdator.h" +#include "TrkExInterfaces/IMaterialEffectsUpdator.h" + #include "TrkFitterInterfaces/IGlobalTrackFitter.h" + #include "TrkGlobalChi2Fitter/GXFTrajectory.h" #include "TrkMaterialOnTrack/MaterialEffectsOnTrack.h" #include "TrkFitterUtils/FitterStatusCode.h" @@ -27,16 +43,6 @@ class AtlasDetectorID; namespace Trk { class Track; class TransportJacobian; - class IRIO_OnTrackCreator; - class IUpdator; - class IEnergyLossUpdator; - class IMultipleScatteringUpdator; - class IMaterialEffectsUpdator; - class INavigator; - class IPropagator; - class IExtrapolator; - class IResidualPullCalculator; - class ITrackingGeometrySvc; class TrackFitInputPreparator; class IMagneticFieldTool; class MeasuredPerigee; @@ -50,10 +56,8 @@ namespace Trk { class TrackingGeometry; class TrackingVolume; class Volume; - class ITrkMaterialProviderTool; - - class GlobalChi2Fitter: virtual public IGlobalTrackFitter, public AthAlgTool { + class GlobalChi2Fitter: public extends<AthAlgTool, IGlobalTrackFitter> { struct Cache { /* * Currently the information about what type of fit is being passed by the @@ -560,21 +564,21 @@ namespace Trk { Cache & cache ) const; - ToolHandle < IRIO_OnTrackCreator > m_ROTcreator; - ToolHandle < IRIO_OnTrackCreator > m_broadROTcreator; - ToolHandle < IUpdator > m_updator; - ToolHandle < IExtrapolator > m_extrapolator; - ToolHandle < IMultipleScatteringUpdator > m_scattool; - ToolHandle < IEnergyLossUpdator > m_elosstool; - ToolHandle < IMaterialEffectsUpdator > m_matupdator; - ToolHandle < IPropagator > m_propagator; - ToolHandle < INavigator > m_navigator; - ToolHandle < IResidualPullCalculator > m_residualPullCalculator; //!< The residual and pull calculator tool - ToolHandle < Trk::ITrkMaterialProviderTool > m_caloMaterialProvider; - ToolHandle < IMaterialEffectsOnTrackProvider > m_calotool; - ToolHandle < IMaterialEffectsOnTrackProvider > m_calotoolparam; - - ServiceHandle < ITrackingGeometrySvc > m_trackingGeometrySvc; + ToolHandle<IRIO_OnTrackCreator> m_ROTcreator {this, "RotCreatorTool", "", ""}; + ToolHandle<IRIO_OnTrackCreator> m_broadROTcreator {this, "BroadRotCreatorTool", "", ""}; + ToolHandle<IUpdator> m_updator {this, "MeasurementUpdateTool", "", ""}; + ToolHandle<IExtrapolator> m_extrapolator {this, "ExtrapolationTool", "Trk::Extrapolator/CosmicsExtrapolator", ""}; + ToolHandle<IMultipleScatteringUpdator> m_scattool {this, "MultipleScatteringTool", "Trk::MultipleScatteringUpdator/AtlasMultipleScatteringUpdator", ""}; + ToolHandle<IEnergyLossUpdator> m_elosstool {this, "EnergyLossTool", "Trk::EnergyLossUpdator/AtlasEnergyLossUpdator", ""}; + ToolHandle<IMaterialEffectsUpdator> m_matupdator {this, "MaterialUpdateTool", "", ""}; + ToolHandle<IPropagator> m_propagator {this, "PropagatorTool", "Trk::StraightLinePropagator/CosmicsPropagator", ""}; + ToolHandle<INavigator> m_navigator {this, "NavigatorTool", "Trk::Navigator/CosmicsNavigator", ""}; + ToolHandle<IResidualPullCalculator> m_residualPullCalculator {this, "ResidualPullCalculatorTool", "Trk::ResidualPullCalculator/ResidualPullCalculator", ""}; + ToolHandle<Trk::ITrkMaterialProviderTool> m_caloMaterialProvider {this, "CaloMaterialProvider", "Trk::TrkMaterialProviderTool/TrkMaterialProviderTool", ""}; + ToolHandle<IMaterialEffectsOnTrackProvider> m_calotool {this, "MuidTool", "Rec::MuidMaterialEffectsOnTrackProvider/MuidMaterialEffectsOnTrackProvider", ""}; + ToolHandle<IMaterialEffectsOnTrackProvider> m_calotoolparam {this, "MuidToolParam", "", ""}; + + ServiceHandle<ITrackingGeometrySvc> m_trackingGeometrySvc; SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_field_cache_key{ this, @@ -583,36 +587,40 @@ namespace Trk { "Trk::GlobalChi2Fitter field conditions object key" }; - bool m_signedradius; - bool m_calomat, m_extmat; - bool m_fillderivmatrix; - double m_outlcut; - double m_maxoutliers; - bool m_printderivs; - double m_p; // momentum (for estimating multiple scattering) - bool m_straightlineprop; - bool m_extensioncuts; - bool m_sirecal; - bool m_trtrecal; - bool m_kinkfinding; const AtlasDetectorID *m_DetID = nullptr; - bool m_decomposesegments; - bool m_getmaterialfromtrack; - bool m_domeastrackpar; - bool m_storemat; - double m_chi2cut; - double m_scalefactor; - bool m_redoderivs; - bool m_reintoutl; - int m_maxit; - bool m_acceleration; - bool m_numderiv; - int m_miniter; - bool m_fiteloss; - bool m_asymeloss; - int m_fixbrem; - bool m_useCaloTG = false; - bool m_rejectLargeNScat = false; + + Gaudi::Property<bool> m_signedradius {this, "SignedDriftRadius", true}; + Gaudi::Property<bool> m_calomat {this, "MuidMat", false}; + Gaudi::Property<bool> m_extmat {this, "ExtrapolatorMaterial", true}; + Gaudi::Property<bool> m_fillderivmatrix {this, "FillDerivativeMatrix", false}; + Gaudi::Property<bool> m_printderivs {this, "PrintDerivatives", false}; + Gaudi::Property<bool> m_straightlineprop {this, "StraightLine", true}; + Gaudi::Property<bool> m_extensioncuts {this, "TRTExtensionCuts", true}; + Gaudi::Property<bool> m_sirecal {this, "RecalibrateSilicon", false}; + Gaudi::Property<bool> m_trtrecal {this, "RecalibrateTRT", false}; + Gaudi::Property<bool> m_kinkfinding {this, "KinkFinding", false}; + Gaudi::Property<bool> m_decomposesegments {this, "DecomposeSegments", true}; + Gaudi::Property<bool> m_getmaterialfromtrack {this, "GetMaterialFromTrack", true}; + Gaudi::Property<bool> m_domeastrackpar {this, "MeasuredTrackParameters", true}; + Gaudi::Property<bool> m_storemat {this, "StoreMaterialOnTrack", true}; + Gaudi::Property<bool> m_redoderivs {this, "RecalculateDerivatives", false}; + Gaudi::Property<bool> m_reintoutl {this, "ReintegrateOutliers", false}; + Gaudi::Property<bool> m_acceleration {this, "Acceleration", false}; + Gaudi::Property<bool> m_numderiv {this, "NumericalDerivs", false}; + Gaudi::Property<bool> m_fiteloss {this, "FitEnergyLoss", false}; + Gaudi::Property<bool> m_asymeloss {this, "AsymmetricEnergyLoss", true}; + Gaudi::Property<bool> m_useCaloTG {this, "UseCaloTG", false}; + Gaudi::Property<bool> m_rejectLargeNScat {this, "RejectLargeNScat", false}; + + Gaudi::Property<double> m_outlcut {this, "OutlierCut", 5.0}; + Gaudi::Property<double> m_p {this, "Momentum", 0.0}; + Gaudi::Property<double> m_chi2cut {this, "TrackChi2PerNDFCut", 1.e15}; + Gaudi::Property<double> m_scalefactor {this, "TRTTubeHitCut", 2.5}; + + Gaudi::Property<int> m_maxoutliers {this, "MaxOutliers", 10}; + Gaudi::Property<int> m_maxit {this, "MaxIterations", 30}; + Gaudi::Property<int> m_miniter {this, "MinimumIterations", 1}; + Gaudi::Property<int> m_fixbrem {this, "FixBrem", -1}; ParticleMasses m_particleMasses; diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx index f8172519a74522820ec1896a28d4e724510c49d7..24415d469d460b3823d42934377ca3c2e434eb68 100644 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx @@ -23,14 +23,11 @@ #include "TrkGeometry/TrackingVolume.h" #include "TrkGeometry/TrackingGeometry.h" -#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h" - #include "TrkExUtils/TransportJacobian.h" #include "TrkMaterialOnTrack/EnergyLoss.h" #include "TrkMaterialOnTrack/ScatteringAngles.h" #include "TrkMaterialOnTrack/EstimatedBremOnTrack.h" -#include "TrkToolInterfaces/ITrkMaterialProviderTool.h" #include "TrkGeometry/HomogeneousLayerMaterial.h" #include "TrkGeometry/MaterialProperties.h" @@ -45,16 +42,7 @@ #include "TrkVertexOnTrack/VertexOnTrack.h" #include "TrkSegment/TrackSegment.h" -#include "TrkToolInterfaces/IRIO_OnTrackCreator.h" -#include "TrkToolInterfaces/IUpdator.h" -#include "TrkToolInterfaces/IResidualPullCalculator.h" - -#include "TrkExInterfaces/IExtrapolator.h" #include "TrkExInterfaces/IPropagator.h" -#include "TrkExInterfaces/INavigator.h" -#include "TrkExInterfaces/IMultipleScatteringUpdator.h" -#include "TrkExInterfaces/IEnergyLossUpdator.h" -#include "TrkExInterfaces/IMaterialEffectsUpdator.h" #include "MagFieldConditions/AtlasFieldCacheCondObj.h" #include "MagFieldElements/AtlasFieldCache.h" @@ -130,70 +118,10 @@ namespace Trk { const std::string & n, const IInterface * p ): - AthAlgTool(t, n, p), - m_ROTcreator(""), - m_broadROTcreator(""), - m_updator(""), - m_extrapolator("Trk::Extrapolator/CosmicsExtrapolator"), - m_scattool("Trk::MultipleScatteringUpdator/AtlasMultipleScatteringUpdator"), - m_elosstool("Trk::EnergyLossUpdator/AtlasEnergyLossUpdator"), - m_matupdator(""), - m_propagator("Trk::StraightLinePropagator/CosmicsPropagator"), - m_navigator("Trk::Navigator/CosmicsNavigator"), - m_residualPullCalculator("Trk::ResidualPullCalculator/ResidualPullCalculator"), - m_caloMaterialProvider("Trk::TrkMaterialProviderTool/TrkMaterialProviderTool"), - m_calotool("Rec::MuidMaterialEffectsOnTrackProvider/MuidMaterialEffectsOnTrackProvider"), - m_calotoolparam(""), - m_trackingGeometrySvc("", n), - m_DetID(nullptr) + base_class(t, n, p), + m_trackingGeometrySvc("", n) { - declareProperty("ExtrapolationTool", m_extrapolator); - declareProperty("MeasurementUpdateTool", m_updator); - declareProperty("RotCreatorTool", m_ROTcreator); - declareProperty("BroadRotCreatorTool", m_broadROTcreator); - declareProperty("MultipleScatteringTool", m_scattool); - declareProperty("EnergyLossTool", m_elosstool); - declareProperty("MaterialUpdateTool", m_matupdator); - declareProperty("PropagatorTool", m_propagator); - declareProperty("NavigatorTool", m_navigator); - declareProperty("ResidualPullCalculatorTool", m_residualPullCalculator); declareProperty("TrackingGeometrySvc", m_trackingGeometrySvc); - declareProperty("CaloMaterialProvider", m_caloMaterialProvider); - declareProperty("MuidTool", m_calotool); - declareProperty("MuidToolParam", m_calotoolparam); - - declareProperty("DecomposeSegments", m_decomposesegments = true); - declareProperty("StraightLine", m_straightlineprop = true); - declareProperty("OutlierCut", m_outlcut = 5.); - declareProperty("MaxOutliers", m_maxoutliers = 10); - declareProperty("SignedDriftRadius", m_signedradius = true); - declareProperty("Momentum", m_p = 0.); - declareProperty("ExtrapolatorMaterial", m_extmat = true); - declareProperty("MuidMat", m_calomat = false); - declareProperty("FillDerivativeMatrix", m_fillderivmatrix = false); - declareProperty("RecalibrateSilicon", m_sirecal = false); - declareProperty("RecalibrateTRT", m_trtrecal = false); - declareProperty("MaxIterations", m_maxit = 30); - declareProperty("GetMaterialFromTrack", m_getmaterialfromtrack = true); - declareProperty("MeasuredTrackParameters", m_domeastrackpar = true); - declareProperty("StoreMaterialOnTrack", m_storemat = true); - declareProperty("ReintegrateOutliers", m_reintoutl = false); - declareProperty("TrackChi2PerNDFCut", m_chi2cut = 1.e15); - declareProperty("RecalculateDerivatives", m_redoderivs = false); - declareProperty("TRTExtensionCuts", m_extensioncuts = true); - declareProperty("TRTTubeHitCut", m_scalefactor = 2.5); - declareProperty("PrintDerivatives", m_printderivs = false); - declareProperty("Acceleration", m_acceleration = false); - declareProperty("KinkFinding", m_kinkfinding = false); - declareProperty("NumericalDerivs", m_numderiv = false); - declareProperty("FitEnergyLoss", m_fiteloss = false); - declareProperty("AsymmetricEnergyLoss", m_asymeloss = true); - declareProperty("MinimumIterations", m_miniter = 1); - declareProperty("UseCaloTG", m_useCaloTG = false); - declareProperty("FixBrem", m_fixbrem = -1); - declareProperty("RejectLargeNScat", m_rejectLargeNScat = false); - - declareInterface<IGlobalTrackFitter>(this); } StatusCode GlobalChi2Fitter::initialize() { @@ -5509,7 +5437,7 @@ namespace Trk { cache.m_fittercode = FitterStatusCode::OutlierLogicFailure; } - double cut = (finaltrajectory->numberOfSiliconHits() == finaltrajectory->numberOfHits())? 999 : m_chi2cut; + double cut = (finaltrajectory->numberOfSiliconHits() == finaltrajectory->numberOfHits())? 999.0 : m_chi2cut.value(); if ( runOutlier &&