Skip to content
Snippets Groups Projects
Commit 34f8d9b9 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'fix-Refitting' into 'master'

Fix issue with the Acts refitting

See merge request atlas/athena!49799
parents 6aad5a8a ca5a88d0
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,7 @@ if "__main__" == __name__:
ConfigFlags.Detector.GeometryMuon = False
ConfigFlags.Detector.GeometryTRT = True
ConfigFlags.Acts.TrackingGeometry.MaterialSource = "geometry-maps.json"
# ConfigFlags.Acts.TrackingGeometry.MaterialSource = "/eos/project-a/acts/public/MaterialMaps/ATLAS/geometry-maps.json"
ConfigFlags.Acts.TrackingGeometry.buildAllAvailableSubDetectors = True
ConfigFlags.Concurrency.NumThreads = 1
ConfigFlags.Concurrency.NumConcurrentEvents = 1
......
......@@ -50,6 +50,7 @@ if "__main__" == __name__:
ConfigFlags.Detector.GeometryMuon = False
ConfigFlags.Detector.GeometryTRT = True
ConfigFlags.Acts.TrackingGeometry.MaterialSource = "material-maps.json"
# ConfigFlags.Acts.TrackingGeometry.MaterialSource = "/eos/project-a/acts/public/MaterialMaps/ATLAS/material-maps.json"
ConfigFlags.Acts.TrackingGeometry.buildAllAvailableSubDetectors = True
ConfigFlags.Concurrency.NumThreads = 10
......
......@@ -62,6 +62,7 @@ if "__main__" == __name__:
ConfigFlags.Detector.GeometryCalo = True
ConfigFlags.Detector.GeometryMuon = False
ConfigFlags.Detector.GeometryTRT = True
ConfigFlags.Acts.TrackingGeometry.buildAllAvailableSubDetectors = True
ConfigFlags.Concurrency.NumThreads = 1
ConfigFlags.Concurrency.NumConcurrentEvents = 1
......
......@@ -23,12 +23,27 @@ void ATLASSourceLinkCalibrator::calibrate(const Acts::GeometryContext& /*gctx*/,
trackState.calibrated().head<1>() = sourceLink.values().head<1>();
trackState.calibratedCovariance().topLeftCorner<1, 1>() = sourceLink.cov().topLeftCorner<1, 1>();
trackState.data().measdim = sourceLink.dim();
} else if (sourceLink.dim() == 2) {
// Create a 1D projection matrix
Acts::ActsMatrix<Acts::MultiTrajectory::MeasurementSizeMax, 1> proj;
proj.setZero();
proj(Acts::eBoundLoc0,Acts::eBoundLoc0) = 1;
trackState.setProjector(proj);
}
else if (sourceLink.dim() == 2)
{
// return Acts::makeMeasurement(sourceLink, sourceLink.values().head<2>(), sourceLink.cov().topLeftCorner<2, 2>(), Acts::eBoundLoc0, Acts::eBoundLoc1);
trackState.calibrated().head<2>() = sourceLink.values().head<2>();
trackState.calibratedCovariance().topLeftCorner<2, 2>() = sourceLink.cov().topLeftCorner<2, 2>();
trackState.data().measdim = sourceLink.dim();
} else {
// Create a 2D projection matrix
Acts::ActsMatrix<Acts::MultiTrajectory::MeasurementSizeMax, 2> proj;
proj.setZero();
proj(Acts::eBoundLoc0, Acts::eBoundLoc0) = 1;
proj(Acts::eBoundLoc1, Acts::eBoundLoc1) = 1;
trackState.setProjector(proj);
}
else
{
throw std::runtime_error("Dim " + std::to_string(sourceLink.dim()) +
" currently not supported.");
}
......
......@@ -20,7 +20,7 @@ Reco_tf.py --conditionsTag all:OFLCOND-MC16-SDR-25 \
--postInclude 'RAWtoESD:../athena/Tracking/Acts/ActsTrkFitting/share/postInclude_ActsRefitting.py' \
--preExec 'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.);from LArROD.LArRODFlags import larRODFlags;larRODFlags.nSamples.set_Value_and_Lock(4);from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet="AODFULL"' \
'HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.overrideMetadata+=["PhysicsList"];' \
'RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup="MC_pp_v7";from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False;' \
'RAWtoESD:from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False;' \
--postExec 'RAWtoESD:from AthenaCommon.ConfigurationShelve import saveToAscii; saveToAscii("config_RAWtoESD_q221_job.txt");ServiceMgr.MessageSvc.defaultLimit = 9999999;' \
'RAWtoESD:include("InDetRecExample/InDetxAODCreator.py"); createTrackParticles("ResolvedTracks","ResolvedTracksTruthCollection","ResolvedTracks_TrackParticle",topSequence); createTrackParticles("ReFitted_Tracks","ResolvedTracksTruthCollection","ReFitted_Tracks_TrackParticle",topSequence); StreamESD.ItemList += ["xAOD::EventInfo#EventInfo", "xAOD::EventAuxInfo#EventInfoAux."]; StreamESD.ItemList += ["xAOD::TrackParticleContainer#ResolvedTracks_TrackParticle"]; StreamESD.ItemList += ["xAOD::TrackParticleAuxContainer#ResolvedTracks_TrackParticleAux."]; StreamESD.ItemList += ["xAOD::TrackParticleContainer#ReFitted_Tracks_TrackParticle"]; StreamESD.ItemList += ["xAOD::TrackParticleAuxContainer#ReFitted_Tracks_TrackParticleAux."];' \
--digiSeedOffset1 '1' \
......
......@@ -26,7 +26,7 @@ class ConfiguredActsRefittingTrackingGeometry( ActsTrackingGeometryTool ) :
ActsTrackingGeometrySvc.CaloVolumeBuilder = CompFactory.ActsCaloTrackingVolumeBuilder()
ActsTrackingGeometrySvc.UseMaterialMap = True
ActsTrackingGeometrySvc.BuildBeamPipe = True
ActsTrackingGeometrySvc.MaterialMapInputFile = "/eos/project-a/acts/public/MaterialMaps/ATLAS-material-maps.json"
ActsTrackingGeometrySvc.MaterialMapInputFile = "/eos/project-a/acts/public/MaterialMaps/ATLAS/material-maps.json"
from AthenaCommon.AppMgr import ServiceMgr
ServiceMgr += ActsTrackingGeometrySvc
......@@ -60,7 +60,8 @@ actsKF = ActsKalmanFitter(name = "ActsKalmanFitter",
ExtrapolationTool = actsExtrapolationTool,
TrackingGeometryTool = actsReFittingTrackingGeometry,
ATLASConverterTool = actsAtlasConverter,
SummaryTool = summary
SummaryTool=summary,
ReverseFilteringPt=1.0
)
ToolSvc+=actsKF
......@@ -69,8 +70,6 @@ actsfitter = ActsReFitterAlg(name = "fitter",
TrackName = "ResolvedTracks"
)
actsfitter.OutputLevel = INFO
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence+=actsfitter
......
......@@ -466,8 +466,8 @@ ActsKalmanFitter::makeTrack(const EventContext& ctx, Acts::GeometryContext& tgCo
}
typePattern.set(Trk::TrackStateOnSurface::Hole);
}
// The state was tagged as an outlier, use filtered parameters
else if (flag[Acts::TrackStateFlag::OutlierFlag] == true){
// The state was tagged as an outlier or was missed in the reverse filtering, use filtered parameters
else if (flag[Acts::TrackStateFlag::OutlierFlag] == true || ( fitOutput.reversed && std::find(fitOutput.passedAgainSurfaces.begin(), fitOutput.passedAgainSurfaces.end(), state.referenceSurface().getSharedPtr().get()) == fitOutput.passedAgainSurfaces.end())){
const Acts::BoundTrackParameters actsParam(state.referenceSurface().getSharedPtr(),
state.filtered(),
state.filteredCovariance());
......@@ -537,7 +537,7 @@ Acts::Result<void> ActsKalmanFitter::gainMatrixUpdate(const Acts::GeometryContex
}
Acts::Result<void> ActsKalmanFitter::gainMatrixSmoother(const Acts::GeometryContext& gctx,
Acts::MultiTrajectory trajectory, size_t entryIndex, Acts::LoggerWrapper logger) {
Acts::MultiTrajectory& trajectory, size_t entryIndex, Acts::LoggerWrapper logger) {
Acts::GainMatrixSmoother smoother;
return smoother(gctx, trajectory, entryIndex, logger);
}
......
......@@ -165,7 +165,7 @@ private:
Acts::MultiTrajectory::TrackStateProxy trackState, Acts::NavigationDirection direction, Acts::LoggerWrapper logger);
static Acts::Result<void> gainMatrixSmoother(const Acts::GeometryContext& gctx,
Acts::MultiTrajectory trajectory, size_t entryIndex, Acts::LoggerWrapper logger);
Acts::MultiTrajectory& trajectory, size_t entryIndex, Acts::LoggerWrapper logger);
// Create a track from the fitter result
std::unique_ptr<Trk::Track> makeTrack(const EventContext& ctx, Acts::GeometryContext& tgContext, TrackFitterResult& fitResult) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment