46 {
47
49 SG::ReadHandle<TrackCollection> tracks (
m_trackName, ctx);
50
51 if (!tracks.isValid()){
53 return StatusCode::SUCCESS;
54 } else {
56 }
57
58
59 std::vector<std::unique_ptr<Trk::Track> > new_tracks;
60 new_tracks.reserve((*tracks).size());
61
62
64
65
67
69 const Trk::Track* trackPtr = *
track;
71
73
75 const Trk::MeasurementBase* mesh = tsos->measurementOnTrack();
76 if (mesh == nullptr) continue;
77 const Trk::RIO_OnTrack* hit = dynamic_cast <const Trk::RIO_OnTrack*>(mesh);
78 if (hit == nullptr) continue;
79
82 }
83
84 auto newtrack =
m_actsFitter->fit(ctx, PrepRawDataSet , *trkPar_perigee );
85
86 if (newtrack) {
87 if (
msgLvl(MSG::VERBOSE)) {
88 msg(MSG::VERBOSE) <<
"ATLAS param : " <<
endmsg;
89 msg(MSG::VERBOSE) << *((**track).perigeeParameters()) <<
endmsg;
90 msg(MSG::VERBOSE) << *((**track).perigeeParameters()->covariance()) <<
endmsg;
91 msg(MSG::VERBOSE) <<
"ACTS param : " <<
endmsg;
92 msg(MSG::VERBOSE) << *(newtrack->perigeeParameters()) <<
endmsg;
93 msg(MSG::VERBOSE) << *(newtrack->perigeeParameters()->covariance()) <<
endmsg;
94
95 msg(MSG::VERBOSE) <<
"ATLAS INFO : " <<
endmsg;
96 msg(MSG::VERBOSE) << *((**track).trackSummary()) <<
endmsg;
97 msg(MSG::VERBOSE) <<
"ACTS INFO : " <<
endmsg;
98 msg(MSG::VERBOSE) << *(newtrack->trackSummary()) <<
endmsg;
99 msg(MSG::VERBOSE) <<
"==========================" <<
endmsg;
100 }
101 new_tracks.push_back(std::move(newtrack));
102 }
103 else if (
msgLvl(MSG::DEBUG)) {
104 msg(MSG::DEBUG) <<
"The Acts Refitting (KF or GSF) has returned a nullptr. Below is information on the offending track." <<
endmsg;
105 msg(MSG::DEBUG) <<
"ATLAS param : " <<
endmsg;
106 msg(MSG::DEBUG) << *((**track).perigeeParameters()) <<
endmsg;
107 msg(MSG::DEBUG) << *((**track).perigeeParameters()->covariance()) <<
endmsg;
108
109 msg(MSG::DEBUG) <<
"ATLAS INFO : " <<
endmsg;
110 msg(MSG::DEBUG) << *((**track).trackSummary()) <<
endmsg;
111 msg(MSG::DEBUG) <<
"==========================" <<
endmsg;
112 }
113 }
114
115 else {
117
118 if (newtrack) {
119 if (
msgLvl(MSG::VERBOSE)) {
120 msg(MSG::VERBOSE) <<
"ATLAS param : " <<
endmsg;
121 msg(MSG::VERBOSE) << *((**track).perigeeParameters()) <<
endmsg;
122 msg(MSG::VERBOSE) << *((**track).perigeeParameters()->covariance()) <<
endmsg;
123 msg(MSG::VERBOSE) <<
"ACTS param : " <<
endmsg;
124 msg(MSG::VERBOSE) << *(newtrack->perigeeParameters()) <<
endmsg;
125 msg(MSG::VERBOSE) << *(newtrack->perigeeParameters()->covariance()) <<
endmsg;
126
127 msg(MSG::VERBOSE) <<
"ATLAS INFO : " <<
endmsg;
128 msg(MSG::VERBOSE) << *((**track).trackSummary()) <<
endmsg;
129 msg(MSG::VERBOSE) <<
"ACTS INFO : " <<
endmsg;
130 msg(MSG::VERBOSE) << *(newtrack->trackSummary()) <<
endmsg;
131 msg(MSG::VERBOSE) <<
"==========================" <<
endmsg;
132 }
133 new_tracks.push_back(std::move(newtrack));
134 }
135 else if (
msgLvl(MSG::DEBUG)) {
136 msg(MSG::DEBUG) <<
"The Acts Refitting (KF or GSF) has returned a nullptr. Below is information on the offending track." <<
endmsg;
137 msg(MSG::DEBUG) <<
"ATLAS param : " <<
endmsg;
138 msg(MSG::DEBUG) << *((**track).perigeeParameters()) <<
endmsg;
139 msg(MSG::DEBUG) << *((**track).perigeeParameters()->covariance()) <<
endmsg;
140
141 msg(MSG::DEBUG) <<
"ATLAS INFO : " <<
endmsg;
142 msg(MSG::DEBUG) << *((**track).trackSummary()) <<
endmsg;
143 msg(MSG::DEBUG) <<
"==========================" <<
endmsg;
144 }
145 }
146
147 }
148
149
150 std::unique_ptr<TrackCollection> new_track_collection = std::make_unique<TrackCollection>();
151
152 new_track_collection->reserve(new_tracks.size());
153 for(std::unique_ptr<Trk::Track> &new_track : new_tracks ) {
154 new_track_collection->push_back(std::move(new_track));
155 }
156
159 return StatusCode::SUCCESS;
160}
#define ATH_CHECK
Evaluate an expression and check for errors.
ToolHandle< Trk::ITrackFitter > m_actsFitter
Gaudi::Property< bool > m_doReFitFromPRD
SG::WriteHandleKey< TrackCollection > m_newTrackName
SG::ReadHandleKey< TrackCollection > m_trackName
bool msgLvl(const MSG::Level lvl) const
DataModel_detail::const_iterator< DataVector > const_iterator
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
const Perigee * perigeeParameters() const
return Perigee.
ParametersBase< TrackParametersDim, Charged > TrackParameters
std::vector< const PrepRawData * > PrepRawDataSet
vector of clusters and drift circles