8 #include "GaudiKernel/RenounceToolInputsVisitor.h"
9 #include "GaudiKernel/ToolVisitor.h"
16 m_etaBounds{0.8, 1.6, 2.5, 4.0},
17 m_stat(m_etaBounds) {}
37 auto visitor = [
this](
const IAlgTool*
tool) {
38 const AlgTool* alg_tool =
dynamic_cast<const AlgTool*
>(
tool);
39 for (Gaudi::DataHandle* handle : alg_tool->inputHandles()) {
41 << handle->objKey() <<
endmsg;
43 for (
const auto& elm : alg_tool->inputDataObjs()) {
45 <<
" input object " <<
tool->name() <<
" . " << elm.key() <<
endmsg;
49 ToolVisitor::visit(
tools(), visitor);
53 auto logger = RenounceToolInputsVisitor::createLogger(
54 [
this](
const std::string_view& tool_name,
const std::string_view&
key) {
56 <<
" Renounce " << tool_name <<
" . " <<
key <<
endmsg;
64 ToolVisitor::visit(
tools(), visitor);
67 return StatusCode::SUCCESS;
72 const EventContext& ctx)
const {
76 if (!splitProbContainerIn.
isValid()) {
77 ATH_MSG_ERROR(
"Failed to get input cluster split probability container "
81 std::unique_ptr<Trk::ClusterSplitProbabilityContainer> newSplitProbContainer(
83 ? std::make_unique<Trk::ClusterSplitProbabilityContainer>(
84 *splitProbContainerIn)
85 : std::make_unique<Trk::ClusterSplitProbabilityContainer>());
87 splitProbContainerHandle;
89 splitProbContainerHandle =
92 if (splitProbContainerHandle.
record(std::move(newSplitProbContainer))
95 "Failed to record output cluster split probability container "
99 return {splitProbContainerHandle.
ptr(),
104 return {newSplitProbContainer.release(),
119 int subtrackId)
const {
120 std::unique_ptr<Trk::Track> newTrack;
140 ATH_MSG_DEBUG(
"New track " << newTrack.get() <<
" successfully fitted from "
149 return newTrack.release();
154 std::vector<std::unique_ptr<const Trk::Track> >& trackDustbin,
157 std::unique_ptr<Trk::Track> atrack(in_track);
161 bool passBasicSelections =
m_scoringTool->passBasicSelections(*atrack);
162 if(passBasicSelections){
167 bool recheckBasicSel =
false;
182 trackScoreTrackMap.emplace(
185 trackScoreTrackMap.emplace(-
score,
TrackPtr(atrack.release(), fitted));
191 ATH_MSG_DEBUG(
"Track score is zero, try to recover it via brem fit");
206 trackDustbin.push_back(std::move(atrack));
213 m_observerTool->addSubTrack(newTrackId, parentTrackId, *bremTrack);
219 passBasicSelections =
m_scoringTool->passBasicSelections(*bremTrack);
220 if(passBasicSelections){
225 bool recheckBasicSel =
false;
232 trackDustbin.push_back(std::move(atrack));
236 << bremTrack.get() <<
") has score " <<
score);
242 m_observerTool->addSubTrack(newTrackId, parentTrackId, *bremTrack);
243 trackScoreTrackMap.emplace(
246 trackScoreTrackMap.emplace(-
score,
247 TrackPtr(bremTrack.release(), fitted));
251 ATH_MSG_DEBUG(
"Brem refit gave still track score zero, reject it");
258 stat.incrementCounterByRegion(
270 trackDustbin.push_back(std::move(atrack));
279 par =
track->trackParameters()->front();
283 <<
") has no Track Parameters ! No refit !");
293 std::unique_ptr<Trk::Track> newTrack{};
313 newTrack->info().addPatternReco(originalInfo);
317 return newTrack.release();