59 return StatusCode::SUCCESS;
63 return StatusCode::SUCCESS;
86 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
true);
107 if (expected > nCutTRT) nCutTRT = expected;
112 ATH_MSG_DEBUG (
"Study new Track "<< ptrTrack<<
"\t , it has "<<tsos->
size()<<
"\t track states");
122 fillTrackDetails( ptrTrack, splitProbContainer, prd_to_track_map, trackHitDetails, tsosDetails);
127 decideWhichHitsToKeep( ptrTrack,
score, splitProbContainer, prd_to_track_map, trackHitDetails, tsosDetails, &cache, trackId );
155 bool passBasicCuts(
true);
157 passBasicCuts =
false;
163 passBasicCuts =
false;
169 passBasicCuts =
false;
174 if( !passBasicCuts ) {
176 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
false);
203 bool noSharedHits( trackHitDetails.
m_numShared == 0 );
221 ( noSharedHits || (passSharedModulesCut && passScoreCut) ) ) {
233 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
true);
238 else if ( passScoreCut ) {
242 ATH_MSG_DEBUG (
"=> Cosmics, accept input track even with shared hits");
246 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
true);
265 std::vector<const Trk::TrackStateOnSurface*> newTSOS;
271 for (
int index = 0 ; iTsos != iTsosEnd ; ++iTsos,++
index ) {
282 newTSOS.push_back(*iTsos);
289 if ( newTSOS.size() <= 3 ) {
291 ATH_MSG_DEBUG (
"reject track; Too few hits, reject track with shared hits");
295 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
false);
299 if ( newTSOS.size() == tsos->
size() ) {
306 ATH_MSG_DEBUG (
"reject track; maybe track was mark as rejected, but we recoverd it so no rejection");
310 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
true);
320 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
false);
324 info.addPatternRecoAndProperties(ptrTrack->
info());
327 info.addPatternReco(newInfo);
330 ATH_MSG_DEBUG (
"=> Successfully created subtrack with shared hits recovered !");
335 return std::make_tuple(newTrack,
false);
345 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
false);
360 bool& maxOtherHasIBL,
367 ATH_MSG_WARNING(
"Calling checkOtherTracksValidity with a hit that is not shared!");
382 bool otherwillFailMinHits =
false;
383 bool otherwillFailSCTuniqueHits =
false;
391 bool iHasBlayer =
false;
399 for (
auto track = currentHitsSharedTracks.first;
track != currentHitsSharedTracks.second; ++
track ){
409 std::vector< const Trk::PrepRawData* > prdsToCheck =
m_assoTool->getPrdsOnTrack(prd_to_track_map, *(
track->second));
412 bool isSplitPixel(
false);
438 iSharedMod += isPixel ? 2 : 1;
441 }
else if ( prd_to_track_map.
isShared( *prdToCheck ) ) {
442 iSharedMod += isSplitPixel ? 0 : isPixel ? 2 : 1;
453 ATH_MSG_VERBOSE(
"Track " <<
track->second <<
" will has " << iNotShared <<
" unique hits and " << iSctUnique <<
" unique SCT hits.");
456 if ( iNotShared < ent->m_minNotShared ) otherwillFailMinHits =
true;
458 if ( iSCT > iSctUnique && iSctUnique <
m_minUniqueSCTHits ) otherwillFailSCTuniqueHits =
true;
462 if ( iSharedMod > maxiShared){
463 maxiShared = iSharedMod;
464 maxOtherNPixel = iPixel;
465 maxOtherHasIBL = iHasBlayer;
468 return !( otherwillFailMinHits || otherwillFailSCTuniqueHits );
482 ATH_MSG_DEBUG (
"Study new Track "<< ptrTrack<<
"\t , it has "<<tsos->
size()<<
"\t track states");
504 ATH_MSG_WARNING(
"Did not find track summary. Some cuts will be less efficienct!");
522 for (
int index = 0 ; iTsos != iTsosEnd ; ++iTsos, ++
index) {
542 ATH_MSG_WARNING ( Form(
"---> Measurement is not a pseudo measurment, not yet supported! %2d",
index));
573 ATH_MSG_WARNING (
"---> Cluster is not from pixels; should not happen !");
647 Trk::PRDtoTrackMap::PrepRawDataTrackMap::const_iterator mapIt =
range.first;
648 Trk::PRDtoTrackMap::PrepRawDataTrackMap::const_iterator mapItEnd =
range.second;
650 for ( ;mapIt!=mapItEnd; ++mapIt) {
655 ATH_MSG_VERBOSE (
"-----> Mark this hits as shared -- Try and recover later!");
693 bool recoverSharedHits(
true);
702 recoverSharedHits =
false;
779 ATH_MSG_DEBUG( Form(
"---> Prd is outlier on a fitted track and is unused, %d",
index) );
814 if (indexPreviousMeasurement > 0 ) {
815 ATH_MSG_VERBOSE (
"--> Previous Measurement was at : " << indexPreviousMeasurement
816 <<
" and was a: " << tsosDetails.
m_type[indexPreviousMeasurement]
817 <<
" with splitprob1 " << tsosDetails.
m_splitProb1[indexPreviousMeasurement]
818 <<
" and splitprob2 " << tsosDetails.
m_splitProb2[indexPreviousMeasurement]);
825 if ( indexPreviousMeasurement >= 0 &&
831 bool sharedbetweenthesametracks =
false;
832 auto previousHitsSharedTracks = tsosDetails.
m_tracksSharingHit.equal_range(indexPreviousMeasurement);
834 for (
auto iteratorP = previousHitsSharedTracks.first;
835 iteratorP != previousHitsSharedTracks.second; ++iteratorP) {
836 for (
auto iteratorC = currentHitsSharedTracks.first;
837 iteratorC != currentHitsSharedTracks.second; ++iteratorC) {
838 if ( iteratorC->second == iteratorP->second){
839 sharedbetweenthesametracks =
true;
843 if (sharedbetweenthesametracks)
break;
845 if (sharedbetweenthesametracks){
869 ATH_MSG_VERBOSE (
"---> Pixel cluster is split, but must be called shared to stay on this track!");
873 ATH_MSG_VERBOSE (
"---> Pixel split but shared between too many tracks -- will be removed from the track!!!");
895 ATH_MSG_VERBOSE (
"---> Pixel cluster is split, but must be called shared to stay on this track!");
899 ATH_MSG_VERBOSE (
"---> Pixel split but shared between too many tracks -- will be removed from the track!!!");
909 ATH_MSG_VERBOSE(
"---> Pixel cluster is not compatible with being shared (splitProb1 = "
917 ATH_MSG_DEBUG (
"reject track; Too many hits shared - we have to remove at least one PRD");
928 ATH_MSG_ERROR(
"A hit is not shared but is where only shared hits should be");
933 ATH_MSG_VERBOSE (
"---> Shared hit, but good track, let's enter hit in the list and try to keep it !");
938 ATH_MSG_DEBUG (
"reject track; Too many hits shared - we have to remove at least one PRD");
945 ATH_MSG_ERROR(
"Reached end of TSOS loop without a decision." );
966 prd_to_track_map, trackHitDetails, tsosDetails);
979 prd_to_track_map, trackHitDetails, tsosDetails);
1005 double trackchi2 = 0;
1012 ATH_MSG_DEBUG (
"Shared hits, we have a bad chi2 track, mark it as bad !");
1034 int newNumWeightedShared = 0;
1035 bool firstMeasurement(
true);
1051 int maxiShared = -1;
1052 int maxOtherNPixel = 0;
1053 bool maxOtherHasIBL =
false;
1055 splitProbContainer, prd_to_track_map, maxiShared, maxOtherNPixel,
1056 maxOtherHasIBL, ent);
1058 if (!otherPassMinUniqueHits) {
1059 ATH_MSG_DEBUG (
"reject track; Tracks shared hits does not leave enough unique hits on accepted track");
1075 if( (tsosDetails.
m_detType[
index] % 10 == 1) && firstMeasurement ) {
1076 ATH_MSG_DEBUG (
"reject track; Tracks shared hits pushes accepted track above shared module limit");
1085 ATH_MSG_DEBUG (
"reject track; Tracks shared hits pushes accepted track above shared module limit");
1110 ATH_MSG_VERBOSE (
"---> Remove shared IBL as MaxShared accepted does not have an IBL hit");
1119 ATH_MSG_VERBOSE (
"---> Only allow shared pixel if candidate and accepted have same IBL hit content");
1129 newNumWeightedShared += (tsosDetails.
m_detType[
index]%10== 1 ? 2 : 1);
1134 newNumWeightedShared -= (tsosDetails.
m_detType[
index]%10== 1 ? 2 : 1);
1145 if (firstMeasurement) {
1171 float splitProbAvg1 = -2;
1175 float splitProbAvg2 = -2;
1224 const Trk::Track* mostOverlappingTrack(
nullptr);
1225 int mostOverlappingNumberOfHits(0);
1226 int indexOfFirstOverlappingHit(0);
1231 ATH_MSG_DEBUG(
it->first <<
" shares " << numberOfHitsSharedWithThisTrack <<
" hits with this track " );
1232 if (mostOverlappingNumberOfHits < numberOfHitsSharedWithThisTrack){
1233 mostOverlappingNumberOfHits = numberOfHitsSharedWithThisTrack;
1234 mostOverlappingTrack =
it->first;
1235 indexOfFirstOverlappingHit =
it->second;
1239 if(!mostOverlappingTrack) {
return false; }
1242 if(mostOverlappingNumberOfHits < 2) {
return false; }
1243 if(mostOverlappingNumberOfHits < trackHitDetails.
m_numShared) {
return false; }
1250 if (tpPair.first && tpPair.second) {
1269 ATH_MSG_DEBUG (
"Possible photon conversion - for pattern track");
1280 ATH_MSG_DEBUG (
"Track "<< mostOverlappingTrack <<
" shares " << mostOverlappingNumberOfHits );
1305 const Trk::Track* mostOverlappingTrack(
nullptr);
1306 int mostOverlappingNumberOfHits(0);
1307 int indexOfFirstOverlappingHit(0);
1312 ATH_MSG_DEBUG(
it->first <<
" shares " << numberOfHitsSharedWithThisTrack <<
" hits with this track " );
1313 if (mostOverlappingNumberOfHits < numberOfHitsSharedWithThisTrack){
1314 mostOverlappingNumberOfHits = numberOfHitsSharedWithThisTrack;
1315 mostOverlappingTrack =
it->first;
1316 indexOfFirstOverlappingHit =
it->second;
1320 if(!mostOverlappingTrack) {
return false; }
1323 if(mostOverlappingNumberOfHits < 2) {
return false; }
1324 if(mostOverlappingNumberOfHits < trackHitDetails.
m_numShared) {
return false; }
1331 if (tpPair.first && tpPair.second) {
1348 ATH_MSG_DEBUG (
"Possible boosted decay - for pattern track");
1359 ATH_MSG_DEBUG (
"Track "<< mostOverlappingTrack <<
" shares " << mostOverlappingNumberOfHits );
1381 int noUpdatedPixels = 0;
1423 std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsosit=tsos.begin();
1425 for (;tsosit!=tsos.end();++tsosit){
1433 auto vecTsos = std::make_unique<Trk::TrackStates>();
1438 vecTsos->push_back(newTsos);
1442 info.addPatternRecoAndProperties(
track->info());
1445 info.addPatternReco(newInfo);
1515 std::pair<const Trk::TrackParameters*, const Trk::TrackParameters*>
1519 int splitSharedPix )
const
1522 auto returnPair = std::make_pair<const Trk::TrackParameters*,const Trk::TrackParameters*>(0,0);
1530 auto firstTsos = track1tsos->
begin();
1532 const auto *firstMeas = (*firstTsos)->measurementOnTrack();
1545 if ( !prd_to_track_map.
isUsed(*(firstRot->prepRawData()))){
1556 auto iTsos = track2tsos->
begin();
1557 auto iTsosEnd = track2tsos->
end();
1558 int measurementsBeforeShared = 0;
1559 for (; iTsos != iTsosEnd ; ++iTsos) {
1562 if (measurementsBeforeShared > 1 + splitSharedPix ){
1563 ATH_MSG_DEBUG(
"Too many hits to before shared hit -- unlikely they are from the same thing");
1568 const auto *meas = (*iTsos)->measurementOnTrack();
1580 if (rot->
prepRawData() != firstRot->prepRawData()){
1581 ++measurementsBeforeShared;
1585 if (!(*iTsos)->trackParameters()){
1590 returnPair.second = (*iTsos)->trackParameters();
1591 ATH_MSG_DEBUG(
"Success! track parameters for accepted track " << returnPair.second );
1600 if (!(*firstTsos)->trackParameters()){
1605 returnPair.first = (*firstTsos)->trackParameters();
1608 ATH_MSG_DEBUG(
"Success! track parameters for both tracks " << returnPair.first<<
" " << returnPair.second );