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);
413 if (
m_detID->is_pixel(prdToCheck->identify())) {
424 if (
m_detID->is_blayer(prdToCheck->identify()) ) iHasBlayer=
true;
427 if (
m_detID->is_sct(prdToCheck->identify()) ) {
438 iSharedMod += isPixel ? 2 : 1;
441 }
else if ( prd_to_track_map.
isShared( *prdToCheck ) ) {
442 iSharedMod += isSplitPixel ? 0 : isPixel ? 2 : 1;
447 if (
m_detID->is_sct(prdToCheck->identify())){
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));
557 bool isTRT =
m_detID->is_trt(
id);
558 bool isPixel =
m_detID->is_pixel(
id);
559 bool isSCT =
m_detID->is_sct(
id);
573 ATH_MSG_WARNING (
"---> Cluster is not from pixels; should not happen !");
605 if( isoutlier || !(
m_detID->is_indet(
id))) {
641 int numberOfTracksWithThisPrd = std::distance(range.first,range.second);
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) {
1165 if (msgLvl(MSG::VERBOSE)){
1171 float splitProbAvg1 = -2;
1175 float splitProbAvg2 = -2;
1224 const Trk::Track* mostOverlappingTrack(
nullptr);
1225 int mostOverlappingNumberOfHits(0);
1226 int indexOfFirstOverlappingHit(0);
1227 for ( std::multimap<const Trk::Track*,int>::iterator it = tsosDetails.
m_overlappingTracks.begin(),
1230 int numberOfHitsSharedWithThisTrack = std::distance( it, tsosDetails.
m_overlappingTracks.upper_bound(it->first));
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");
1277 if (msgLvl(MSG::DEBUG)){
1280 ATH_MSG_DEBUG (
"Track "<< mostOverlappingTrack <<
" shares " << mostOverlappingNumberOfHits );
1305 const Trk::Track* mostOverlappingTrack(
nullptr);
1306 int mostOverlappingNumberOfHits(0);
1307 int indexOfFirstOverlappingHit(0);
1308 for ( std::multimap<const Trk::Track*,int>::iterator it = tsosDetails.
m_overlappingTracks.begin(),
1311 int numberOfHitsSharedWithThisTrack = std::distance( it, tsosDetails.
m_overlappingTracks.upper_bound(it->first));
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");
1356 if (msgLvl(MSG::DEBUG)){
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);
1515std::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 );
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
An STL vector of pointers that by default owns its pointed-to elements.
bool isIBL(uint32_t robId)
This is an Identifier helper class for both the Pixel and SCT subdetectors.
Define macros for attributes used to control the static checker.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Container to associate Cluster with cluster splitting probabilities.
ProbabilityInfo & setSplitInformation(const PrepRawData *cluster, float prob1, float prob2)
const ProbabilityInfo & splitProbability(const PrepRawData *cluster) const
ProbabilityInfo * getSplitProbability(const PrepRawData *cluster)
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
double chiSquared() const
returns the of the overall track fit
This class is the pure abstract base class for all fittable tracking measurements.
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
bool isUsed(const PrepRawData &prd) const
does this PRD belong to at least one track?
PrepRawDataTrackMapRange onTracks(const PrepRawData &prd)
get the Tracks associated with this PrepRawData.
std::pair< PrepRawDataTrackMap::const_iterator, PrepRawDataTrackMap::const_iterator > ConstPrepRawDataTrackMapRange
bool isShared(const PrepRawData &prd) const
does this PRD belong to more than one track?
virtual bool type(PrepRawDataType type) const
Interface method checking the type.
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
Identifier identify() const
return the identifier -extends MeasurementBase
Contains information about the 'fitter' of this track.
@ Unknown
Track fitter not defined.
void addPatternReco(const TrackInfo &)
A method adding just pattern recognition info without adding the actual properties.
void setPatternRecognitionInfo(const TrackPatternRecoInfo &patternReco)
Method setting the pattern recognition algorithm.
@ InDetAmbiTrackSelectionTool
Added because of compilation problems.
represents the track state (measurement, material, fit parameters and quality) at a surface.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
A summary of the information contained by a track.
int get(const SummaryType &type) const
returns the summary information for the passed SummaryType.
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
const TrackInfo & info() const
Returns a const ref to info of a const tracks.
const Perigee * perigeeParameters() const
return Perigee.
const Trk::TrackSummary * trackSummary() const
Returns a pointer to the const Trk::TrackSummary owned by this const track (could be nullptr)
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
@ PseudoMeasurementOnTrack
DataVector< const Trk::TrackStateOnSurface > TrackStates
ParametersBase< TrackParametersDim, Charged > TrackParameters
@ numberOfSCTHits
number of SCT holes
@ numberOfPixelHits
number of pixel layers on track with absence of hits
@ numberOfSCTHoles
number of Holes in both sides of a SCT module
@ numberOfSCTDeadSensors
number of TRT hits
@ numberOfPixelHoles
number of pixels which have a ganged ambiguity.
@ numberOfPixelDeadSensors
number of pixel hits with broad errors (width/sqrt(12))
@ pixelSplitButTooManyShared3Ptc
@ pixelSplitButTooManyShared2Ptc
@ tooManySharedNonRecoverable
@ firstHitSharedAndPixIBL
@ sharedHitsNotEnoughUniqueHits
@ firstHitSharedAndExtraShared
@ subtrackCreatedWithRecoveredShared
@ sharedIBLSharedWithNoIBLTrack
@ sharedPixelSharedWithDifferentIBLTrack
@ tooManySharedAfterIncreasingShared
@ tooManySharedRecoverable
@ sharedHitsNotEnoughUniqueSiHits
float splitProbability1() const
float splitProbability2() const
bool isTooBigToBeSplit() const
void setSplit(bool split)