10#include <unordered_set>
16 ISvcLocator* pSvcLocator)
43 (!m_pixelDetElStatus.empty() && !VALIDATE_STATUS_ARRAY_ACTIVATED)}));
45 (!m_stripDetElStatus.empty() && !VALIDATE_STATUS_ARRAY_ACTIVATED)}));
51 ATH_MSG_ERROR(
"Use either track finder or track reader, not both.");
52 return StatusCode::FAILURE;
64 return StatusCode::SUCCESS;
83 uint32_t runNumber = ctx.eventID().run_number();
84 uint32_t eventNumber = ctx.eventID().event_number();
86 std::vector<const Trk::SpacePoint*> spacePoints;
88 auto getSpacepointData =
90 if (not containerKey.empty()) {
94 if (container.isValid()) {
95 for (
auto spCollection : *container.cptr()) {
111 ATH_MSG_DEBUG(
"Found " << pixelClusters->size() <<
" pixel clusters");
112 ATH_MSG_DEBUG(
"Found " << stripClusters->size() <<
" strip clusters");
113 ATH_MSG_DEBUG(
"Found " << spacePoints.size() <<
" space points");
115 std::vector<std::vector<uint32_t>> gnnTrackCandidates;
121 ATH_MSG_ERROR(
"Both GNNTrackFinder and GNNTrackReader are not set");
122 return StatusCode::FAILURE;
125 ATH_MSG_DEBUG(
"Obtained " << gnnTrackCandidates.size() <<
" Tracks");
132 if (not data.isInitialized())
136 data.inputseeds() = 0;
137 data.goodseeds() = 0;
138 data.inittracks() = 0;
139 data.findtracks() = 0;
144 data.setCosmicTrack(0);
145 data.setPixContainer(pixelClusters.
cptr());
146 data.setSctContainer(stripClusters.
cptr());
157 if (fieldCondObj ==
nullptr) {
159 "InDet::SiTrackMaker_xk::getTracks: Failed to retrieve "
160 "AtlasFieldCacheCondObj with key "
162 return StatusCode::FAILURE;
166 int num_extended_tracks = 0;
168 for (
auto& trackIndices : gnnTrackCandidates) {
170 std::vector<const Trk::PrepRawData*> clusters;
171 std::vector<const Trk::SpacePoint*> trackCandidate;
172 trackCandidate.reserve(trackIndices.size());
174 for (
auto&
id : trackIndices) {
176 if (
id > spacePoints.size()) {
182 trackCandidate.push_back(
sp);
183 clusters.push_back(
sp->clusterList().first);
204 if (trkParameters ==
nullptr) {
212 bool outlier_removal =
false;
214 ctx, clusters, *trkParameters, outlier_removal, matEffects);
215 if (track !=
nullptr && track->perigeeParameters() !=
nullptr) {
218 track =
m_trackFitter->fit(ctx, clusters, *track->perigeeParameters(),
219 outlier_removal, matEffects);
223 if (track ==
nullptr)
226 bool is_extension_successful =
false;
230 std::vector<const InDetDD::SiDetectorElement*> trackRoad;
232 trackRoad, roadMakerData);
233 if (!trackRoad.empty()) {
234 std::vector<const InDet::SiDetElementBoundaryLink_xk*> DEL;
237 data.tools().setBremNoise(
false,
false);
238 data.tracks().erase(data.tracks().begin(), data.tracks().end());
239 data.statistic().fill(
false);
243 std::vector<const InDet::SiCluster*> Cl;
246 bool Q = data.trajectory().initialize(
true,
true, pixelClusters.
cptr(),
247 stripClusters.
cptr(),
Tp, Cl, DEL,
253 bool do_smooth =
true;
254 if (data.trajectory().forwardExtension(do_smooth, itmax, ctx)) {
256 if (data.trajectory().backwardSmoother(
false, ctx)) {
258 data.trajectory().sortStep();
261 info.setPatternRecognitionInfo(
267 std::make_unique<Trk::TrackStates>(
268 data.trajectory().convertToSimpleTrackStateOnSurface(ctx)),
269 data.trajectory().convertToFitQuality());
271 auto extended_track =
273 if (extended_track !=
nullptr &&
274 extended_track->trackSummary() !=
nullptr) {
275 num_extended_tracks++;
276 is_extension_successful =
true;
277 outputTracks->push_back(extended_track.release());
284 if (!is_extension_successful) {
285 track =
m_trackFitter->fit(ctx, clusters, *track->perigeeParameters(),
287 if (track !=
nullptr && track->trackSummary() !=
nullptr) {
288 outputTracks->push_back(track.release());
293 data.tracks().erase(data.tracks().begin(), data.tracks().end());
294 ATH_MSG_DEBUG(
"Run " << runNumber <<
", Event " << eventNumber <<
" has "
295 << outputTracks->size() <<
" tracks stored, with "
296 << num_extended_tracks <<
" extended.");
297 return StatusCode::SUCCESS;
305 const std::vector<const Trk::SpacePoint*>& Sp,
306 std::vector<const InDet::SiCluster*>& Sc,
308 std::reference_wrapper<std::vector<const InDetDD::SiDetectorElement*>>>
310 Sc.reserve(Sp.size());
323 p = s->clusterList().second;
333 std::vector<const InDet::SiCluster*>::iterator cluster = Sc.begin(),
335 endClusters = Sc.end();
340 DE->get().reserve(Sc.size());
342 for (; cluster != endClusters; ++cluster) {
346 nextCluster = cluster;
348 for (; nextCluster != endClusters; ++nextCluster) {
349 if (de == (*nextCluster)->detectorElement()) {
354 DE->get().push_back(de);
365 std::vector<const InDetDD::SiDetectorElement*>& DE,
366 std::vector<const InDet::SiDetElementBoundaryLink_xk*>& DEL,
367 const EventContext& ctx)
const {
368 const InDet::SiDetElementBoundaryLinks_xk* boundaryPixel{
nullptr};
369 const InDet::SiDetElementBoundaryLinks_xk* boundaryStrip{
nullptr};
373 boundaryPixel = *boundaryPixelHandle;
374 if (boundaryPixel ==
nullptr) {
380 boundaryStrip = *boundaryStripHandle;
381 if (boundaryStrip ==
nullptr) {
385 DEL.reserve(DE.size());
388 if (d->isPixel() && boundaryPixel && id < boundaryPixel->
size())
389 DEL.push_back(&(*boundaryPixel)[
id]);
390 else if (d->isSCT() && boundaryStrip && id < boundaryStrip->
size())
391 DEL.push_back(&(*boundaryStrip)[
id]);
404 if (fieldCondObj ==
nullptr) {
406 "InDet::SiCombinatorialTrackFinder_xk::initializeCombinatorialData: "
407 "Failed to retrieve AtlasFieldCacheCondObj with key " +
409 throw(std::runtime_error(
msg));
411 data.setFieldCondObj(fieldCondObj);
426 data.setPixelDetectorElementStatus(pixelDetElStatus.
cptr());
431 data.setSCTDetectorElementStatus(stripDetElStatus.
cptr());
435 data.setITkGeometry(
true);
437 data.setFastTracking(
false);
443 data.setCosmicTrack(0);
445 data.setNclusminb(std::max(3, data.nclusmin() - 1));
450 data.tools().setHolesClusters(data.nholesmax(), data.dholesmax(),
453 data.tools().setAssociation(0);
454 data.setSimpleTrack(
false);
461 data.tools().setXi2pTmin(data.xi2max(), data.xi2maxNoAdd(), data.xi2maxlink(),
465 data.trajectory().setParameters();
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
#define VALIDATE_STATUS_ARRAY_ACTIVATED
size_t size() const
Number of registered mappings.
An algorithm that can be simultaneously executed in multiple threads.
void getInitializedCache(MagField::AtlasFieldCache &cache) const
get B field cache for evaluation as a function of 2-d or 3-d position.
This is a "hash" representation of an Identifier.
Class to hold geometrical description of a silicon detector element.
StringProperty m_fieldmode
DoubleProperty m_xi2maxNoAdd
void initializeCombinatorialData(const EventContext &ctx, SiCombinatorialTrackFinderData_xk &data) const
ToolHandle< Trk::IBoundaryCheckTool > m_boundaryCheckTool
ToolHandle< IGNNTrackReaderTool > m_gnnTrackReader
virtual StatusCode execute(const EventContext &ctx) const override
ToolHandle< IGNNTrackFinder > m_gnnTrackFinder
SG::ReadCondHandleKey< InDet::SiDetElementBoundaryLinks_xk > m_boundaryPixelKey
ToolHandle< InDet::ISiDetElementsRoadMaker > m_roadmaker
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_stripDetElStatus
Optional read handle to get status data to test whether a Strip detector element is good.
PublicToolHandle< Trk::IPatternParametersPropagator > m_proptool
SG::ReadHandleKey< InDet::SCT_ClusterContainer > m_stripClusterKey
DoubleProperty m_xi2maxlink
PublicToolHandle< Trk::IRIO_OnTrackCreator > m_riocreator
void getTrackQualityCuts(SiCombinatorialTrackFinderData_xk &data) const
void detectorElementLinks(std::vector< const InDetDD::SiDetectorElement * > &DE, std::vector< const InDet::SiDetElementBoundaryLink_xk * > &DEL, const EventContext &ctx) const
ToolHandle< ISeedFitter > m_seedFitter
GNN-based track finding tool that produces track candidates.
DoubleProperty m_xi2multitracks
DoubleProperty m_pTminBrem
SG::ReadCondHandleKey< InDet::SiDetElementBoundaryLinks_xk > m_boundaryStripKey
ToolHandle< Trk::ITrackFitter > m_trackFitter
Track Fitter.
IntegerProperty m_nwclusmin
SG::ReadHandleKey< InDet::PixelClusterContainer > m_pixelClusterKey
IntegerProperty m_dholesmax
IntegerProperty m_nclusmin
IntegerProperty m_doMultiTracksProd
static bool spacePointsToClusters(const std::vector< const Trk::SpacePoint * > &, std::vector< const InDet::SiCluster * > &, std::optional< std::reference_wrapper< std::vector< const InDetDD::SiDetectorElement * > > >=std::nullopt)
IntegerProperty m_nholesmax
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
Trk::MagneticFieldProperties m_fieldprop
Magnetic field properties.
ToolHandle< IInDetConditionsTool > m_stripCondSummaryTool
PublicToolHandle< Trk::IPatternParametersUpdator > m_updatortool
SG::ReadHandleKey< SpacePointContainer > m_SpacePointsStripKey
GNNSeedingTrackMaker(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< SpacePointContainer > m_SpacePointsPixelKey
virtual StatusCode initialize() override
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatus
Optional read handle to get status data to test whether a pixel detector element is good.
SG::WriteHandleKey< TrackCollection > m_outputTracksKey
ToolHandle< IInDetConditionsTool > m_pixelCondSummaryTool
InDet::SiCombinatorialTrackFinderData_xk holds event dependent data used by SiCombinatorialTrackFinde...
InDet::SiDetElementRoadMakerData_xk holds event dependent data used by SiDetElementRoadMaker_xk.
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h).
Property holding a SG store/key/clid from which a ReadHandle is made.
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
magnetic field properties to steer the behavior of the extrapolation
Contains information about the 'fitter' of this track.
@ SiSPSeededFinder
Tracks from SiSPSeedFinder.
@ SiSPSeededFinderSimple
for tracks processed by the trigger version of the SiSPSeededFinder
@ FastField
call the fast field access method of the FieldSvc
@ NoField
Field is set to 0., 0., 0.,.
@ FullField
Field is set to be realistic, but within a given Volume.
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
ParametersBase< TrackParametersDim, Charged > TrackParameters