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()) {
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");
130 if (not
data.isInitialized())
134 data.inputseeds() = 0;
135 data.goodseeds() = 0;
136 data.inittracks() = 0;
137 data.findtracks() = 0;
142 data.setCosmicTrack(0);
143 data.setPixContainer(pixelClusters.
cptr());
144 data.setSctContainer(stripClusters.
cptr());
155 if (fieldCondObj ==
nullptr) {
157 "InDet::SiTrackMaker_xk::getTracks: Failed to retrieve "
158 "AtlasFieldCacheCondObj with key "
160 return StatusCode::FAILURE;
164 int num_extended_tracks = 0;
166 for (
auto& trackIndices : gnnTrackCandidates) {
168 std::vector<const Trk::PrepRawData*> clusters;
169 std::vector<const Trk::SpacePoint*> trackCandidate;
170 trackCandidate.reserve(trackIndices.size());
172 for (
auto&
id : trackIndices) {
174 if (
id > spacePoints.size()) {
180 trackCandidate.push_back(
sp);
181 clusters.push_back(
sp->clusterList().first);
202 if (trkParameters ==
nullptr) {
210 bool outlier_removal =
false;
212 ctx, clusters, *trkParameters, outlier_removal, matEffects);
213 if (track !=
nullptr && track->perigeeParameters() !=
nullptr) {
216 track =
m_trackFitter->fit(ctx, clusters, *track->perigeeParameters(),
217 outlier_removal, matEffects);
221 if (track ==
nullptr)
224 bool is_extension_successful =
false;
228 std::vector<const InDetDD::SiDetectorElement*> trackRoad;
230 trackRoad, roadMakerData);
231 if (!trackRoad.empty()) {
232 std::vector<const InDet::SiDetElementBoundaryLink_xk*> DEL;
235 data.tools().setBremNoise(
false,
false);
236 data.tracks().erase(
data.tracks().begin(),
data.tracks().end());
237 data.statistic().fill(
false);
241 std::vector<const InDet::SiCluster*> Cl;
244 bool Q =
data.trajectory().initialize(
true,
true, pixelClusters.
cptr(),
245 stripClusters.
cptr(),
Tp, Cl, DEL,
251 bool do_smooth =
true;
252 if (
data.trajectory().forwardExtension(do_smooth, itmax, ctx)) {
254 if (
data.trajectory().backwardSmoother(
false, ctx)) {
256 data.trajectory().sortStep();
259 info.setPatternRecognitionInfo(
265 std::make_unique<Trk::TrackStates>(
266 data.trajectory().convertToSimpleTrackStateOnSurface(ctx)),
267 data.trajectory().convertToFitQuality());
269 auto extended_track =
271 if (extended_track !=
nullptr &&
272 extended_track->trackSummary() !=
nullptr) {
273 num_extended_tracks++;
274 is_extension_successful =
true;
275 outputTracks->push_back(extended_track.release());
282 if (!is_extension_successful) {
283 track =
m_trackFitter->fit(ctx, clusters, *track->perigeeParameters(),
285 if (track !=
nullptr && track->trackSummary() !=
nullptr) {
286 outputTracks->push_back(track.release());
291 data.tracks().erase(
data.tracks().begin(),
data.tracks().end());
292 ATH_MSG_DEBUG(
"Run " << runNumber <<
", Event " << eventNumber <<
" has "
293 << outputTracks->size() <<
" tracks stored, with "
294 << num_extended_tracks <<
" extended.");
295 return StatusCode::SUCCESS;
303 const std::vector<const Trk::SpacePoint*>& Sp,
304 std::vector<const InDet::SiCluster*>& Sc,
306 std::reference_wrapper<std::vector<const InDetDD::SiDetectorElement*>>>
308 Sc.reserve(Sp.size());
321 p = s->clusterList().second;
331 std::vector<const InDet::SiCluster*>::iterator cluster = Sc.begin(),
333 endClusters = Sc.end();
338 DE->get().reserve(Sc.size());
340 for (; cluster != endClusters; ++cluster) {
344 nextCluster = cluster;
346 for (; nextCluster != endClusters; ++nextCluster) {
347 if (de == (*nextCluster)->detectorElement()) {
352 DE->get().push_back(de);
363 std::vector<const InDetDD::SiDetectorElement*>& DE,
364 std::vector<const InDet::SiDetElementBoundaryLink_xk*>& DEL,
365 const EventContext& ctx)
const {
366 const InDet::SiDetElementBoundaryLinks_xk* boundaryPixel{
nullptr};
367 const InDet::SiDetElementBoundaryLinks_xk* boundaryStrip{
nullptr};
371 boundaryPixel = *boundaryPixelHandle;
372 if (boundaryPixel ==
nullptr) {
378 boundaryStrip = *boundaryStripHandle;
379 if (boundaryStrip ==
nullptr) {
383 DEL.reserve(DE.size());
386 if (d->isPixel() && boundaryPixel && id < boundaryPixel->size())
387 DEL.push_back(&(*boundaryPixel)[
id]);
388 else if (d->isSCT() && boundaryStrip && id < boundaryStrip->size())
389 DEL.push_back(&(*boundaryStrip)[
id]);
402 if (fieldCondObj ==
nullptr) {
404 "InDet::SiCombinatorialTrackFinder_xk::initializeCombinatorialData: "
405 "Failed to retrieve AtlasFieldCacheCondObj with key " +
407 throw(std::runtime_error(
msg));
409 data.setFieldCondObj(fieldCondObj);
424 data.setPixelDetectorElementStatus(pixelDetElStatus.
cptr());
429 data.setSCTDetectorElementStatus(stripDetElStatus.
cptr());
433 data.setITkGeometry(
true);
435 data.setFastTracking(
false);
441 data.setCosmicTrack(0);
443 data.setNclusminb(std::max(3,
data.nclusmin() - 1));
448 data.tools().setHolesClusters(
data.nholesmax(),
data.dholesmax(),
451 data.tools().setAssociation(0);
452 data.setSimpleTrack(
false);
459 data.tools().setXi2pTmin(
data.xi2max(),
data.xi2maxNoAdd(),
data.xi2maxlink(),
463 data.trajectory().setParameters();
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
#define VALIDATE_STATUS_ARRAY_ACTIVATED
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