Skip to content
Snippets Groups Projects
Commit 5e4ebdfc authored by Tobias Bockh's avatar Tobias Bockh
Browse files

set xAOD::EventInfo::Error if we get an ACTS propagation error and add...

set xAOD::EventInfo::Error if we get an ACTS propagation error and add coresponding variable to NtupleDumperAlg
parent a6a3a924
No related branches found
No related tags found
No related merge requests found
......@@ -106,6 +106,7 @@ StatusCode NtupleDumperAlg::initialize()
ATH_CHECK(m_preshowerCalibratedContainer.initialize());
ATH_CHECK(m_ecalCalibratedContainer.initialize());
ATH_CHECK(m_eventInfoKey.initialize());
ATH_CHECK(detStore()->retrieve(m_sctHelper, "FaserSCT_ID"));
ATH_CHECK(detStore()->retrieve(m_vetoNuHelper, "VetoNuID"));
......@@ -197,6 +198,7 @@ StatusCode NtupleDumperAlg::initialize()
m_tree->Branch("TrackSegment_pz", &m_trackseg_pz);
//TrackCollection
m_tree->Branch("Track_PropagationError", &m_propagationError, "Track_PropagationError/B");
m_tree->Branch("longTracks", &m_longTracks, "longTracks/I");
m_tree->Branch("Track_Chi2", &m_Chi2);
m_tree->Branch("Track_nDoF", &m_DoF);
......@@ -681,6 +683,14 @@ StatusCode NtupleDumperAlg::execute(const EventContext &ctx) const
}
}
SG::ReadDecorHandle<xAOD::EventInfo,uint32_t> eventInfo (m_eventInfoKey, ctx);
if (eventInfo->errorState(xAOD::EventInfo_v1::SCT) == xAOD::EventInfo::Error) {
m_propagationError = true;
ATH_MSG_DEBUG("NtupleDumper: xAOD::EventInfo::SCT::Error");
} else {
m_propagationError = false;
}
// get geometry context
FaserActsGeometryContext faserGeometryContext = m_trackingGeometryTool->getNominalGeometryContext();
auto gctx = faserGeometryContext.context();
......
......@@ -21,6 +21,8 @@
#include "FaserActsKalmanFilter/IFiducialParticleTool.h"
#include "FaserActsKalmanFilter/ITrackTruthMatchingTool.h"
#include "TrackerSimEvent/FaserSiHitCollection.h"
#include "xAODEventInfo/EventInfo.h"
#include "StoreGate/ReadDecorHandle.h"
#include <vector>
......@@ -84,7 +86,8 @@ private:
SG::ReadHandleKey<xAOD::FaserTriggerData> m_FaserTriggerData { this, "FaserTriggerDataKey", "FaserTriggerData", "ReadHandleKey for xAOD::FaserTriggerData"};
SG::ReadHandleKey<xAOD::WaveformClock> m_ClockWaveformContainer { this, "WaveformClockKey", "WaveformClock", "ReadHandleKey for ClockWaveforms Container"};
ToolHandle<IFaserActsExtrapolationTool> m_extrapolationTool { this, "ExtrapolationTool", "FaserActsExtrapolationTool" };
SG::ReadDecorHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfo"};
ToolHandle<IFaserActsExtrapolationTool> m_extrapolationTool { this, "ExtrapolationTool", "FaserActsExtrapolationTool" };
ToolHandle<IFaserActsTrackingGeometryTool> m_trackingGeometryTool {this, "TrackingGeometryTool", "FaserActsTrackingGeometryTool"};
ToolHandle<ITrackTruthMatchingTool> m_trackTruthMatchingTool {this, "TrackTruthMatchingTool", "TrackTruthMatchingTool"};
ToolHandle<IFiducialParticleTool> m_fiducialParticleTool {this, "FiducialParticleTool", "FiducialParticleTool"};
......@@ -189,6 +192,7 @@ private:
mutable std::vector<double> m_trackseg_pz;
mutable int m_longTracks;
mutable bool m_propagationError;
mutable std::vector<double> m_Chi2;
mutable std::vector<double> m_DoF;
mutable std::vector<double> m_xup;
......
......@@ -2,6 +2,7 @@
#include "StoreGate/ReadHandle.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "StoreGate/WriteDecorHandle.h"
#include "TrackerSpacePoint/FaserSCT_SpacePointCollection.h"
#include "TrackerSpacePoint/FaserSCT_SpacePoint.h"
#include "TrackerIdentifier/FaserSCT_ID.h"
......@@ -28,9 +29,9 @@
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/TrackFitting/GainMatrixSmoother.hpp"
#include "Acts/TrackFitting/GainMatrixUpdater.hpp"
#include "Acts/EventData/Measurement.hpp"
#include "Acts/Propagator/PropagatorError.hpp"
#include "Acts/TrackFinding/CombinatorialKalmanFilterError.hpp"
size_t CKF2::TrajectoryInfo::nClusters {0};
......@@ -49,6 +50,7 @@ StatusCode CKF2::initialize() {
ATH_CHECK(m_kalmanFitterTool1.retrieve());
ATH_CHECK(m_createTrkTrackTool.retrieve());
ATH_CHECK(m_trackCollection.initialize());
ATH_CHECK(m_eventInfoKey.initialize());
if (m_performanceWriter && !m_noDiagnostics) {
ATH_CHECK(m_performanceWriterTool.retrieve());
}
......@@ -78,6 +80,8 @@ StatusCode CKF2::execute() {
const EventContext& ctx = Gaudi::Hive::currentContext();
m_numberOfEvents++;
SG::WriteDecorHandle<xAOD::EventInfo,uint32_t> eventInfo (m_eventInfoKey, ctx);
SG::WriteHandle trackContainer{m_trackCollection, ctx};
std::unique_ptr<TrackCollection> outputTracks = std::make_unique<TrackCollection>();
......@@ -150,6 +154,14 @@ StatusCode CKF2::execute() {
std::list<TrajectoryInfo> allTrajectories;
for (auto &result : results) {
if (not result.ok()) {
// TODO use status bits for different errors
// result.error() == Acts::CombinatorialKalmanFilterError::NoTrackFound
if (result.error() == Acts::PropagatorError::StepCountLimitReached ||
result.error() == Acts::CombinatorialKalmanFilterError::PropagationReachesMaxSteps) {
if (!eventInfo->updateErrorState(xAOD::EventInfo::SCT, xAOD::EventInfo::Error)) {
ATH_MSG_WARNING (" cannot set error state for SCT");
}
}
continue;
}
CKFResult ckfResult = result.value();
......
......@@ -21,6 +21,7 @@
#include "KalmanFitterTool.h"
#include <boost/dynamic_bitset.hpp>
#include "CreateTrkTrackTool.h"
#include "xAODEventInfo/EventInfo.h"
using ConstTrackStateProxy = Acts::detail_lt::TrackStateProxy<IndexSourceLink, 6, true>;
using ClusterSet = boost::dynamic_bitset<>;
......@@ -148,6 +149,7 @@ private:
ToolHandle<CreateTrkTrackTool> m_createTrkTrackTool {this, "CreateTrkTrackTool", "CreateTrkTrackTool"};
Gaudi::Property<bool> m_isMC {this, "isMC", false};
SG::WriteHandleKey<TrackCollection> m_trackCollection { this, "OutputCollection", "CKFTrackCollection", "Output track collection name" };
SG::WriteDecorHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfo"};
};
#endif // FASERACTSKALMANFILTER_CKF2_H
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