31 const IInterface* p) :
49 return StatusCode::SUCCESS;
56 return StatusCode::SUCCESS;
65 int subtrackId )
const
68 bool TrkCouldBeAccepted =
true;
72 int numTRT_Unused = 0;
74 int numWeightedShared = 0;
75 bool thishasblayer =
false;
76 bool hassharedblayer =
false;
77 bool hassharedpixel =
false;
78 bool firstisshared =
true;
92 if (expected > nCutTRT) nCutTRT = expected;
97 ATH_MSG_DEBUG (
"Study new Track "<< ptrTrack<<
"\t , it has "<<tsos->
size()<<
"\t track states");
98 ATH_MSG_DEBUG (
"trackId "<< trackId <<
", subtrackId "<<subtrackId);
102 if (ispatterntrack) {
103 ATH_MSG_DEBUG (
"==> this is a pattern track, outliers are good hits (reintegration) !");
105 ATH_MSG_DEBUG (
"==> this is a refitted track, so we can use the chi2 ! ");
109 int nPixelDeadSensor = -1;
110 int nSCTDeadSensor = -1;
125 if (nPixelDeadSensor == -1) nPixelDeadSensor = 0;
126 if (nSCTDeadSensor == -1) nSCTDeadSensor = 0;
127 ATH_MSG_VERBOSE (
"---> Number of dead si sensors: " << nPixelDeadSensor + nSCTDeadSensor);
143 std::vector<int> tsosType;
144 tsosType.resize(tsos->
size());
149 for (
int index = 0 ; iTsos != iTsosEnd ; ++iTsos, ++
index) {
152 tsosType[
index] = OtherTsos;
159 ATH_MSG_VERBOSE (
"-> No measurement on TSOS, it is another type, to be copied over");
160 tsosType[
index] = OtherTsos;
172 ATH_MSG_WARNING (
"-> Measurement is not a pseudo measurment, not yet supported, try to copy !");
174 tsosType[
index] = OtherTsos;
184 bool isTRT =
m_detID->is_trt(
id);
185 bool isPixel =
m_detID->is_pixel(
id);
186 bool isBlayer = isPixel ?
m_detID->is_blayer(
id) :
false;
190 if (isBlayer && (!isoutlier || ispatterntrack)) thishasblayer =
true;
193 if ( isPixel && !thishasblayer && npixholes>0 &&
194 ( ( npixel==1 && !isoutlier ) ||
195 ( ispatterntrack && npixel==0 && isoutlier) ) ) {
196 ATH_MSG_VERBOSE (
"-> Special case, problematic single pixel hit on track, reject it !");
197 tsosType[
index] = RejectedHit;
199 TrkCouldBeAccepted =
false;
205 if ( (isoutlier && !ispatterntrack) || !(
m_detID->is_indet(
id)) ) {
206 ATH_MSG_VERBOSE (
"-> Prd is outlier on a fitter track (or not InDet), copy it over");
216 ATH_MSG_VERBOSE (
"-> Prd is outlier on a pattern track and is unused, copy it over");
219 tsosType[
index] = UnusedHit;
221 if (isTRT) numTRT_Unused++;
224 if (numShared == 0) firstisshared =
false;
226 lastbutonerot = lastrot;
228 lastrotindex =
index;
238 if ( isoutlier && ispatterntrack ) {
239 ATH_MSG_VERBOSE (
"-> Shared Prd is outlier on a pattern track, we do not want to reintegrate it, so reject it ");
240 tsosType[
index] = RejectedHit;
242 TrkCouldBeAccepted =
false;
249 tsosType[
index] = RejectedHit;
251 TrkCouldBeAccepted =
false;
260 int numberOfTracksWithThisPrd = std::distance(range.first,range.second);
266 (!isPixel || npixholes<=0) ) {
274 ATH_MSG_WARNING (
"-----> cast to Pixel cluster failed, should not happen !");
276 TrkCouldBeAccepted =
false;
283 ATH_MSG_VERBOSE (
"-----> Pixel cluster is split, reject shared hit !!!");
284 tsosType[
index] = RejectedHit;
286 TrkCouldBeAccepted =
false;
294 ATH_MSG_VERBOSE (
"-----> Pixel cluster is not compatible with being shared (splitProb = "
296 tsosType[
index] = RejectedHit;
298 TrkCouldBeAccepted =
false;
304 ATH_MSG_VERBOSE (
"---> Shared hit, but good track, let's enter hit in the list and try to keep it !");
305 tsosType[
index] = SharedHit;
307 numWeightedShared += (isPixel ? 2 : 1);
312 if (isBlayer) hassharedblayer =
true;
313 else hassharedpixel =
true;
316 lastbutonerot = lastrot;
318 lastrotindex =
index;
325 tsosType[
index] = RejectedHit;
327 TrkCouldBeAccepted =
false;
331 int totalSiHits = numUnused + nPixelDeadSensor + nSCTDeadSensor;
334 if (ispatterntrack &&
336 (lastrot && lastbutonerot) &&
338 ATH_MSG_DEBUG (
"Special cut on distance, reject last hit on track !");
339 tsosType[lastrotindex] = RejectedHit;
342 TrkCouldBeAccepted =
false;
346 if (ispatterntrack &&
349 ATH_MSG_DEBUG (
"Special cut on too many holes, reject last hit on track !");
350 tsosType[lastrotindex] = RejectedHit;
353 TrkCouldBeAccepted =
false;
359 if ( !ispatterntrack ) {
360 double trackchi2 = 0.;
365 if ( numShared > 0 && !ispatterntrack && trackchi2 > 3 ) {
366 ATH_MSG_DEBUG (
"Shared hits, we have a bad chi2 track, mark it as bad !");
368 TrkCouldBeAccepted =
false;
374 if ( numTRT_Unused < nCutTRT) {
377 TrkCouldBeAccepted =
false;
385 if ( TrkCouldBeAccepted &&
386 ( !hassharedblayer || npixholes<=1 ) &&
388 ( ( totalSiHits >=
m_minHits && numShared == 0 ) ||
391 ATH_MSG_DEBUG (
"=> Suggest to keep track with "<<numShared<<
" shared hits !");
392 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
true);
395 }
else if ( numTRT_Unused >= nCutTRT &&
401 ATH_MSG_DEBUG (
"=> Cosmics, accept input track even with shared hits");
402 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
true);
413 ATH_MSG_VERBOSE (
"Trying to recover track, allow for some shared hits is possible.");
416 std::vector<const Trk::TrackStateOnSurface*> newTSOS;
425 for (
int index = 0 ; iTsos != iTsosEnd ; ++iTsos,++
index ) {
428 if (tsosType[
index] == RejectedHit) {
431 }
else if (tsosType[
index] != SharedHit ) {
433 newTSOS.push_back(*iTsos);
456 int numberOfTracksWithThisPrd = std::distance(range.first,range.second);
462 bool otherhasblayer =
false;
463 if ( numberOfTracksWithThisPrd == 1 ) {
465 std::vector< const Trk::PrepRawData* > prdsToCheck =
m_assoTool->getPrdsOnTrack(prd_to_track_map,*(range.first->second));
467 if (prd_to_track_map.
isShared(*prd))
469 if (
m_detID->is_pixel(prd->identify())) {
471 if (
m_detID->is_blayer(prd->identify())) otherhasblayer=
true;
479 (!isPixel || !hassharedblayer || npixholes <= 0) &&
480 ( iShared <
m_maxShared || (isPixel && !firstisshared) ) &&
481 (!isPixel || thishasblayer == otherhasblayer ) &&
482 (!isPixel || npixel >= othernpixel ) ) {
484 ATH_MSG_VERBOSE (
"---> Accepted hit shared with " << numberOfTracksWithThisPrd <<
" tracks !");
485 newTSOS.push_back(*iTsos);
489 cntIns += (isPixel ? 2 : 1);
492 ATH_MSG_VERBOSE (
"---> Reject hit shared with " << numberOfTracksWithThisPrd <<
" tracks !");
498 if ( numUnused+nPixelDeadSensor+nSCTDeadSensor <
m_minHits || newTSOS.size() <= 3 ) {
499 ATH_MSG_DEBUG (
"=> Too few hits, reject track with shared hits");
500 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
false);
504 if ( newTSOS.size() == tsos->
size() ) {
506 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
true);
512 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
false);
516 info.addPatternRecoAndProperties(ptrTrack->
info());
519 info.addPatternReco(newInfo);
522 ATH_MSG_DEBUG (
"=> Successfully created subtrack with shared hits recovered !");
523 return std::make_tuple(newTrack,
false);
529 return std::make_tuple(
static_cast<Trk::Track *
>(
nullptr),
false);
545 auto vecTsos = std::make_unique<Trk::TrackStates>();
550 vecTsos->push_back(newTsos);
554 info.addPatternRecoAndProperties(track->info());
557 info.addPatternReco(newInfo);
#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.
This is an Identifier helper class for both the Pixel and SCT subdetectors.
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.
Container to associate Cluster with cluster splitting probabilities.
const ProbabilityInfo & splitProbability(const PrepRawData *cluster) const
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.
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?
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
Class to handle pseudo-measurements in fitters and on track objects.
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
virtual const Amg::Vector3D & globalPosition() const override=0
Interface method to get the global Position.
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 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
DataVector< const Trk::TrackStateOnSurface > TrackStates
ParametersBase< TrackParametersDim, Charged > TrackParameters
@ 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))
float splitProbability1() const