14 const std::string&
name, ISvcLocator* pSvcLocator)
35 ATH_MSG_ERROR(
"Use either track finder or track reader, not both.");
36 return StatusCode::FAILURE;
53 ATH_MSG_INFO(
"Applying the following cuts during GNN-based track reconstruction: ");
62 ATH_MSG_INFO(
"Applying the following eta dependant track cuts after GNN-based track reconstruction: ");
81 return StatusCode::SUCCESS;
87 ATH_CHECK(outputTracks.record(std::make_unique<TrackCollection>()));
100 std::vector<std::vector<uint32_t> >
TT;
101 std::vector<std::vector<uint32_t> > clusterTracks;
110 ATH_MSG_ERROR(
"Both GNNTrackFinder and GNNTrackReader are not set");
111 return StatusCode::FAILURE;
118 int trackCounter = -1;
119 std::vector<int> status_codes;
121 for (
auto& trackIndices :
TT) {
126 std::vector<const Trk::SpacePoint*> trackCandidate =
getSpacePoints(trackIndices, spacePoints);
131 getClusters (clusterTracks, allClusters, trackCounter)
144 if (not fitSuccess) {
148 if (passTrackCut <= 0) {
149 outputTracks->push_back(
track.release());
152 status_codes.push_back(passTrackCut);
158 <<
std::count(status_codes.begin(), status_codes.end(), 0)
159 <<
" tracks remains after applying track cuts");
161 ATH_MSG_INFO(
"Event " <<
eventNumber <<
" has " << status_codes.size() <<
" tracks found, all tracks are kept");
164 return StatusCode::SUCCESS;
176 double pt = origPerigee->pT();
178 double eta = std::abs(origPerigee->eta());
180 double d0 = std::abs(origPerigee->parameters()[
Trk::d0]);
182 double z0 = std::abs(origPerigee->parameters()[
Trk::z0]);
189 int nClusters = nPixels +
nStrips;
196 if (nClusters < m_etaDependentCutsSvc->getMinSiHitsAtEta(eta))
200 if (nPixels < m_etaDependentCutsSvc->getMinPixelHitsAtEta(eta))
204 if (pt < m_etaDependentCutsSvc->getMinPtAtEta(eta))
223 const EventContext& ctx,
226 std::vector<const Trk::SpacePoint*> spacePoints;
228 int npixsp(0), nstrip(0), n_overlap(0);
230 spacePoints.push_back(sp);
234 spacePoints.push_back(sp);
238 spacePoints.push_back(sp);
242 <<
" pixel space points, " << nstrip
243 <<
" strips space points" << n_overlap
244 <<
" overlapping spacepoints" << spacePoints.size()
251 const EventContext& ctx,
254 std::vector<const Trk::SpacePoint*> spacePoints;
255 if (not containerKey.
empty()){
259 if (container.isValid()){
261 auto spc = container->begin();
262 auto spce = container->end();
263 for(; spc != spce; ++spc){
265 auto sp = spCollection->
begin();
266 auto spe = spCollection->
end();
267 for(; sp != spe; ++sp) {
269 spacePoints.push_back(spacePoint);
279 const EventContext& ctx,
283 std::vector<const Trk::SpacePoint*> spacePoints;
285 if (not containerKey.
empty()){
289 if (collection.isValid()){
291 spacePoints.push_back(sp);
300 const EventContext& ctx,
303 std::vector<const Trk::PrepRawData*> allClusters;
315 if (!strip_container.
isValid()) {
320 auto pixcollection = pixcontainer->begin();
321 auto pixcollectionEnd = pixcontainer->end();
322 for (; pixcollection != pixcollectionEnd; ++pixcollection) {
323 if ((*pixcollection)->empty()) {
327 auto const* clusterCollection = (*pixcollection);
328 auto thisCluster = clusterCollection->begin();
329 auto clusterEnd = clusterCollection->end();
330 for (; thisCluster != clusterEnd; ++thisCluster) {
332 allClusters.push_back(
cl);
336 auto strip_collection = strip_container->begin();
337 auto strip_collectionEnd = strip_container->end();
338 for (; strip_collection != strip_collectionEnd; ++strip_collection) {
339 if ((*strip_collection)->empty()) {
343 auto const* clusterCollection = (*strip_collection);
344 auto thisCluster = clusterCollection->begin();
345 auto clusterEnd = clusterCollection->end();
346 for (; thisCluster != clusterEnd; ++thisCluster) {
348 allClusters.push_back(
cl);
360 std::vector<uint32_t> trackIndices,
361 std::vector<const Trk::SpacePoint*> allSpacePoints
364 std::vector<const Trk::SpacePoint*> trackCandidate;
365 trackCandidate.reserve(trackIndices.size());
367 std::vector<std::pair<double, const Trk::SpacePoint*> > distanceSortedSPs;
371 for (
auto&
id : trackIndices) {
373 if (
id > allSpacePoints.size()) {
375 <<
id <<
" out of range: " << allSpacePoints.size());
383 distanceSortedSPs.push_back(
393 std::sort(distanceSortedSPs.begin(), distanceSortedSPs.end());
396 for (
size_t i = 0;
i < distanceSortedSPs.size();
i++) {
397 trackCandidate.push_back(distanceSortedSPs[
i].
second);
400 return trackCandidate;
404 std::vector<const Trk::SpacePoint*> spacePoints
406 std::vector<const Trk::PrepRawData*>
clusters;
408 clusters.push_back(sp->clusterList().first);
409 if (sp->clusterList().second !=
nullptr) {
410 clusters.push_back(sp->clusterList().second);
417 std::vector<std::vector<uint32_t>> clusterTracks,
418 std::vector<const Trk::PrepRawData*> allClusters,
421 std::vector<uint32_t> clusterIndices = clusterTracks[
trackNumber];
422 std::vector<const Trk::PrepRawData*>
clusters;
423 clusters.reserve(clusterIndices.size());
424 for (
uint32_t id : clusterIndices) {
425 if (
id > allClusters.size()) {
429 clusters.push_back(allClusters[
id]);
468 const EventContext& ctx,
469 std::vector<const Trk::SpacePoint*>& spacePoints,
470 std::vector<const Trk::PrepRawData*>&
clusters,
482 ATH_MSG_DEBUG(
"Track " << trackCounter <<
" has " << spacePoints.size()
483 <<
" space points, " <<
clusters.size()
484 <<
" clusters, " << nPIX <<
" pixel clusters, "
485 <<
nStrip <<
" strip clusters");
489 ATH_MSG_DEBUG(
"Track " << trackCounter <<
" does not pass prefit cuts, skipping");
490 return std::make_tuple(
false, 999,
nullptr);
495 if (trkParameters ==
nullptr) {
497 return std::make_tuple(
false, 999,
nullptr);
502 if (
track ==
nullptr ||
track->perigeeParameters() ==
nullptr) {
504 <<
" fails the third chi2 fit, skipping");
505 return std::make_tuple(
false, 999,
nullptr);
511 <<
"with pt = " <<
track->perigeeParameters()->pT()
512 <<
" has pT too low, skipping track!");
513 return std::make_tuple(
false, 999,
nullptr);
517 if (std::abs(
track->perigeeParameters()->eta()) >
m_etamax) {
519 << std::abs(
track->perigeeParameters()->eta())
520 <<
" has eta too high, skipping track!");
521 return std::make_tuple(
false, 999,
nullptr);
530 return std::make_tuple(
true, passTrackCut, std::move(
track));
535 const EventContext& ctx,
536 std::vector<const Trk::PrepRawData*>
clusters,
544 std::unique_ptr<Trk::Track>
track =
547 if (
track ==
nullptr ||
track->perigeeParameters() ==
nullptr) {
549 <<
" fails the first chi2 fit, skipping");
556 <<
" fails the first chi2 fit, skipping");
566 if (
track ==
nullptr ||
track->perigeeParameters() ==
nullptr) {
568 <<
" fails the second chi2 fit, skipping");
582 MsgStream& InDet::operator <<
591 std::ostream& InDet::operator <<
614 out<<
"| Location of output tracks | "
616 out<<
"|----------------------------------------------------------------"
617 <<
"----------------------------------------------------|"