ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
InDet::InDetAmbiTrackSelectionTool Class Reference

#include <InDetAmbiTrackSelectionTool.h>

Inheritance diagram for InDet::InDetAmbiTrackSelectionTool:
Collaboration diagram for InDet::InDetAmbiTrackSelectionTool:

Public Member Functions

 InDetAmbiTrackSelectionTool (const std::string &, const std::string &, const IInterface *)
 
virtual ~InDetAmbiTrackSelectionTool ()=default
 default destructor More...
 
virtual StatusCode initialize () override
 standard Athena-Algorithm method More...
 
virtual StatusCode finalize () override
 standard Athena-Algorithm method More...
 
virtual std::tuple< Trk::Track *, bool > getCleanedOutTrack (const Trk::Track *track, const Trk::TrackScore score, Trk::ClusterSplitProbabilityContainer &splitProbContainer, Trk::PRDtoTrackMap &prd_to_track_map, int trackId=-1, int subtrackId=-1) const override
 

Private Member Functions

Trk::TrackcreateSubTrack (const std::vector< const Trk::TrackStateOnSurface * > &tsos, const Trk::Track *track) const
 method to create a new track from a vector of TSOS's More...
 

Private Attributes

PublicToolHandle< ITrtDriftCircleCutToolm_selectortool {this, "DriftCircleCutTool", "InDet::InDetTrtDriftCircleCutTool"}
 TRT minimum number of drift circles tool- returns allowed minimum number of TRT drift circles. More...
 
ToolHandle< Trk::IPRDtoTrackMapToolm_assoTool {this, "AssociationTool", "Trk::PRDtoTrackMapTool" }
 
const SiliconIDm_detID {nullptr}
 atlas id helper More...
 
IntegerProperty m_minHits {this, "minHits", 5}
 some cut values More...
 
IntegerProperty m_minTRT_Hits {this, "minTRTHits", 0}
 
int m_maxShared {0}
 
IntegerProperty m_maxSharedModules {this, "maxShared", 1}
 
IntegerProperty m_maxTracksPerPRD {this, "maxTracksPerSharedPRD", 2}
 
IntegerProperty m_minNotShared {this, "minNotShared", 6}
 
FloatProperty m_minScoreShareTracks {this, "minScoreShareTracks", 0.0}
 
BooleanProperty m_cosmics {this, "Cosmics", false}
 
BooleanProperty m_parameterization {this, "UseParameterization", true}
 
BooleanProperty m_doPixelClusterSplitting {this, "doPixelSplitting", false}
 
FloatProperty m_sharedProbCut {this, "sharedProbCut", 0.02}
 
IntegerProperty m_maxSplitSize {this, "MaximalSplitSize", 49, "A.S.: remove that when solved properly by updating the SplitProb info with isExcluded. A.S.: to be removed once EDM is updated"}
 

Detailed Description

This tool cross checks the hits on a track with the hits already stored in a PRD_AssociationTool. Shared hits are allowed to some extent und under certain conditions (e.g. the track score is high enough), additional shared hits are removed if necessary. This tool does not delete any tracks. If the client is going to discard tracks entered into this tool, the tracks have to be deleted by this client.

Author
Martin Siebel Marti.nosp@m.n.Si.nosp@m.ebel@.nosp@m.CERN.nosp@m..ch

Definition at line 46 of file InDetAmbiTrackSelectionTool.h.

Constructor & Destructor Documentation

◆ InDetAmbiTrackSelectionTool()

InDet::InDetAmbiTrackSelectionTool::InDetAmbiTrackSelectionTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 29 of file InDetAmbiTrackSelectionTool.cxx.

31  :
32  base_class(t, n, p)
33 {
34  // compute the number of shared hits from the number of max shared modules
36 }

◆ ~InDetAmbiTrackSelectionTool()

virtual InDet::InDetAmbiTrackSelectionTool::~InDetAmbiTrackSelectionTool ( )
virtualdefault

default destructor

Member Function Documentation

◆ createSubTrack()

Trk::Track * InDet::InDetAmbiTrackSelectionTool::createSubTrack ( const std::vector< const Trk::TrackStateOnSurface * > &  tsos,
const Trk::Track track 
) const
private

method to create a new track from a vector of TSOS's

Definition at line 534 of file InDetAmbiTrackSelectionTool.cxx.

535 {
536  int nmeas=0;
537  for (const Trk::TrackStateOnSurface* tsosIt : tsos) {
538  if (tsosIt->type(Trk::TrackStateOnSurface::Measurement)) nmeas++;
539  }
540  if (nmeas<3) {
541  ATH_MSG_DEBUG ("Less than 3 measurements, reject track !");
542  return nullptr;
543  }
544 
545  auto vecTsos = std::make_unique<Trk::TrackStates>();
546 
547  // loop over TSOS, copy TSOS and push into vector
548  for (const Trk::TrackStateOnSurface* tsosIt : tsos) {
549  const Trk::TrackStateOnSurface* newTsos = new Trk::TrackStateOnSurface(*tsosIt);
550  vecTsos->push_back(newTsos);
551  }
552 
554  info.addPatternRecoAndProperties(track->info());
555  Trk::TrackInfo newInfo;
557  info.addPatternReco(newInfo);
558 
559  Trk::Track* newTrack = new Trk::Track(info, std::move(vecTsos),nullptr);
560 
561  return newTrack;
562 
563 }

◆ finalize()

StatusCode InDet::InDetAmbiTrackSelectionTool::finalize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 54 of file InDetAmbiTrackSelectionTool.cxx.

55 {
56  return StatusCode::SUCCESS;
57 }

◆ getCleanedOutTrack()

std::tuple< Trk::Track *, bool > InDet::InDetAmbiTrackSelectionTool::getCleanedOutTrack ( const Trk::Track track,
const Trk::TrackScore  score,
Trk::ClusterSplitProbabilityContainer splitProbContainer,
Trk::PRDtoTrackMap prd_to_track_map,
int  trackId = -1,
int  subtrackId = -1 
) const
overridevirtual

Definition at line 60 of file InDetAmbiTrackSelectionTool.cxx.

66 {
67  // flag if the track is ok (true) or needs cleaning (false)
68  bool TrkCouldBeAccepted = true;
69 
70  // some counters used in the logic
71  int numUnused = 0;
72  int numTRT_Unused = 0;
73  int numShared = 0;
74  int numWeightedShared = 0;
75  bool thishasblayer = false;
76  bool hassharedblayer = false;
77  bool hassharedpixel = false;
78  bool firstisshared = true; // logic is that it is set to false if we find a first hit unshared
79 
80  // let's remember the last 2 ROTs on the track
81  const Trk::RIO_OnTrack* lastrot = nullptr;
82  const Trk::RIO_OnTrack* lastbutonerot = nullptr;
83  int lastrotindex = 0;
84 
85  // cut on TRT hits, might use eta dependent cuts here
86  int nCutTRT = m_minTRT_Hits;
87  if (m_parameterization) {
88  const DataVector<const Trk::TrackParameters>* vpar = ptrTrack->trackParameters();
89  const Trk::TrackParameters* par = (*vpar)[0];
90  // ME bugfix
91  int expected = m_selectortool->minNumberDCs(par);
92  if (expected > nCutTRT) nCutTRT = expected;
93  }
94 
95  // get all TSOS the track
96  const Trk::TrackStates* tsos = ptrTrack->trackStateOnSurfaces();
97  ATH_MSG_DEBUG ("Study new Track "<< ptrTrack<<"\t , it has "<<tsos->size()<<"\t track states");
98  ATH_MSG_DEBUG ("trackId "<< trackId <<", subtrackId "<<subtrackId);
99 
100  // is this a track from the pattern or a fitted track ?
101  bool ispatterntrack = (ptrTrack->info().trackFitter()==Trk::TrackInfo::Unknown);
102  if (ispatterntrack) {
103  ATH_MSG_DEBUG ("==> this is a pattern track, outliers are good hits (reintegration) !");
104  } else {
105  ATH_MSG_DEBUG ("==> this is a refitted track, so we can use the chi2 ! ");
106  }
107 
108  // some pre-processing of the summary information, if available, needed for special cuts
109  int nPixelDeadSensor = -1;
110  int nSCTDeadSensor = -1;
111  int npixel = 0;
112  int npixholes = 0;
113  int nsctholes = 0;
114  const Trk::TrackSummary* trkSummary=ptrTrack->trackSummary();
115  if (trkSummary) {
116  ATH_MSG_VERBOSE ("---> Found summary information");
117  nPixelDeadSensor = trkSummary->get(Trk::numberOfPixelDeadSensors);
118  nSCTDeadSensor = trkSummary->get(Trk::numberOfSCTDeadSensors);
119  npixel = trkSummary->get(Trk::numberOfPixelHits);
120  npixholes = trkSummary->get(Trk::numberOfPixelHoles);
121  nsctholes = trkSummary->get(Trk::numberOfSCTHoles);
122  }
123  // set nDeadSensors to 0 in case trkSummary wasn't called with HoleSearch
124  // (i.e. number of deadSensors not available)
125  if (nPixelDeadSensor == -1) nPixelDeadSensor = 0;
126  if (nSCTDeadSensor == -1) nSCTDeadSensor = 0;
127  ATH_MSG_VERBOSE ("---> Number of dead si sensors: " << nPixelDeadSensor + nSCTDeadSensor);
128 
129  // possible classification of TSOS
130  enum TsosTypes {
131  // A measurement not yet used in any other track
132  UnusedHit = 1,
133  // A measurement shared with another track
134  SharedHit = 2,
135  // A hit that needs to be removed from the track
136  RejectedHit = 3,
137  // an outlier, to be copied in case
138  Outlier = 4,
139  // other TSOS types to be copied in case
140  OtherTsos = 5
141  };
142  // create an array of types for each TSOS
143  std::vector<int> tsosType;
144  tsosType.resize(tsos->size());
145 
146  // loop over TSOS
147  Trk::TrackStates::const_iterator iTsos = tsos->begin();
148  Trk::TrackStates::const_iterator iTsosEnd = tsos->end();
149  for (int index = 0 ; iTsos != iTsosEnd ; ++iTsos, ++index) {
150 
151  // init array
152  tsosType[index] = OtherTsos;
153 
154  // get measurment from TSOS
155  const Trk::MeasurementBase* meas = (*iTsos)->measurementOnTrack();
156 
157  // if we do not have a measurement, we should just mark it
158  if (!meas) {
159  ATH_MSG_VERBOSE ("-> No measurement on TSOS, it is another type, to be copied over");
160  tsosType[index] = OtherTsos;
161  continue;
162  }
163 
164  // ok, let try to get the ROT then
165  const Trk::RIO_OnTrack* rot = dynamic_cast <const Trk::RIO_OnTrack*> (meas);
166  if (!rot) {
167  // could be a Pseudo-Measurement ?
168  const Trk::PseudoMeasurementOnTrack* pseudo = dynamic_cast <const Trk::PseudoMeasurementOnTrack*> (meas);
169  if (pseudo){
170  ATH_MSG_VERBOSE ("-> Copy pseudo measurement");
171  } else {
172  ATH_MSG_WARNING ("-> Measurement is not a pseudo measurment, not yet supported, try to copy !");
173  }
174  tsosType[index] = OtherTsos;
175  continue;
176  }
177 
178  //
179  // we have a TSOS with a measurement, keep analysing it
180  //
181 
182  // let's get some information about the measurement
183  const Identifier& id = rot->identify();
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;
187  bool isoutlier = (*iTsos)->type(Trk::TrackStateOnSurface::Outlier);
188 
189  // do we have some b-layer hit here (sorting of TSOS is inside out)
190  if (isBlayer && (!isoutlier || ispatterntrack)) thishasblayer = true; // we may reintegrate outliers from pattern
191 
192  // special cut to remove problematic combinations in the pixels
193  if ( isPixel && !thishasblayer && npixholes>0 && // a pixel hit, no b-layer, we do have pixel holes
194  ( ( npixel==1 && !isoutlier ) || // one pixel on track, it is not an additional outlier
195  ( ispatterntrack && npixel==0 && isoutlier) ) ) { // pattern track, no pixels, but an outlier (we may reintegrate it)
196  ATH_MSG_VERBOSE ("-> Special case, problematic single pixel hit on track, reject it !");
197  tsosType[index] = RejectedHit;
198  // mark track as bad !
199  TrkCouldBeAccepted = false;
200  continue;
201  }
202 
203  // do we have an outlier (an not a pattern track) ?
204  // if ( (isoutlier && !ispatterntrack) || !(m_detID->is_indet(id)) ) {
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");
207  tsosType[index] = Outlier;
208  continue;
209  }
210 
211  // let's check if this is a shared hit (even if it is an outlier on a pattern track) ?
212  if (!prd_to_track_map.isUsed(*(rot->prepRawData()))) {
213  if ( !isoutlier ) {
214  ATH_MSG_VERBOSE ("-> Prd is unused, copy it over");
215  } else {
216  ATH_MSG_VERBOSE ("-> Prd is outlier on a pattern track and is unused, copy it over");
217  }
218 
219  tsosType[index] = UnusedHit;
220  // increase some counters
221  if (isTRT) numTRT_Unused++;
222  else numUnused++;
223  // remember if first hit is shared, we need that later
224  if (numShared == 0) firstisshared = false;
225  // remember the last 2 ROTs
226  lastbutonerot = lastrot;
227  lastrot = rot;
228  lastrotindex = index;
229 
230  continue;
231  }
232 
233  //
234  // ok, we have a shared hit
235  //
236 
237  // do we have an outlier and a pattern track, but the hit is shared, so reject it (we reintegrate it otherwise)
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;
241  // mark track as bad !
242  TrkCouldBeAccepted = false;
243  continue;
244  }
245 
246  // first check if it is a shared TRT hit, this is not allowed
247  if (isTRT) {
248  ATH_MSG_VERBOSE ("-> Share TRT hit, drop it !");
249  tsosType[index] = RejectedHit;
250  // mark track as bad !
251  TrkCouldBeAccepted = false;
252  continue;
253  }
254 
255  /* consider hit to be a shared one, if
256  - not too many tracks share this hit already
257  - the score of the track is high enough to allow for shared hits
258  */
260  int numberOfTracksWithThisPrd = std::distance(range.first,range.second);
261  ATH_MSG_VERBOSE ("---> number of tracks with this share Prd: " << numberOfTracksWithThisPrd << " maxtracks: " << m_maxTracksPerPRD);
262 
263  // see if we try keeping it as a shared hit ?
264  if ( numberOfTracksWithThisPrd < m_maxTracksPerPRD && // we do not allow to share with to many tracks
265  score > m_minScoreShareTracks && // score needs to be good
266  (!isPixel || npixholes<=0) ) { // we do not share pixels if there are holes in pixels
267 
268  // special treatment of share split pixel clusters...
269  if (m_doPixelClusterSplitting && isPixel) {
270  // get pixel cluster
271  const InDet::PixelCluster* clus = dynamic_cast <const InDet::PixelCluster*> (rot->prepRawData());
272 
273  if ( !clus ) {
274  ATH_MSG_WARNING ("-----> cast to Pixel cluster failed, should not happen !");
275  // mark track as bad !
276  TrkCouldBeAccepted = false; // we have to remove at least one PRD
277  continue;
278  } else {
279 
280  // split clusters are not allowed to be shared at all, unless
281  const Trk::ClusterSplitProbabilityContainer::ProbabilityInfo &splitProb = splitProbContainer.splitProbability(clus);
282  if ( splitProb.isSplit() ) {
283  ATH_MSG_VERBOSE ("-----> Pixel cluster is split, reject shared hit !!!");
284  tsosType[index] = RejectedHit;
285  // mark track as bad !
286  TrkCouldBeAccepted = false; // we have to remove at least one PRD
287  continue;
288  }
289 
290  // is cluster compatible with being a shared cluster ?
291  // A.S.: also a hack for the max size: allows large clusters that are exluded from the splitter to be shared
292  // needs isExcluded() flag in the future
293  if (splitProb.splitProbability1() < m_sharedProbCut && clus->rdoList().size() <= size_t(m_maxSplitSize) ) {
294  ATH_MSG_VERBOSE ("-----> Pixel cluster is not compatible with being shared (splitProb = "
295  << splitProb.splitProbability1() << ") , reject shared hit !!!");
296  tsosType[index] = RejectedHit;
297  // mark track as bad !
298  TrkCouldBeAccepted = false; // we have to remove at least one PRD
299  continue;
300  }
301  }
302  }
303 
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;
306  numShared++; // increase counter
307  numWeightedShared += (isPixel ? 2 : 1); // increase counter
308 
309  // some additional bookkeeping, we need this later
310  if (isPixel) {
311  // ME: bugfix, either shared blayer or shared pixel
312  if (isBlayer) hassharedblayer = true;
313  else hassharedpixel = true;
314  }
315  // remember the last 2 ROTs
316  lastbutonerot = lastrot;
317  lastrot = rot;
318  lastrotindex = index;
319 
320  continue;
321  }
322 
323  // ok, we failed to keep the share hit, let's reject it.
324  ATH_MSG_VERBOSE ("---> Share hit and bad track, reject it !");
325  tsosType[index] = RejectedHit;
326  // mark track as bad !
327  TrkCouldBeAccepted = false; // we have to remove at least one PRD
328  }
329 
330  // total number of hits with dead modules
331  int totalSiHits = numUnused + nPixelDeadSensor + nSCTDeadSensor;
332 
333  // special cut, do not allow the last hit to be to far away or after to many holes
334  if (ispatterntrack && // pattern track and
335  totalSiHits > m_minHits && // we have enough hits on the track
336  (lastrot && lastbutonerot) && // has enough ROTs
337  (lastrot->globalPosition()-lastbutonerot->globalPosition()).mag()>1000*CLHEP::mm) { // distance cut
338  ATH_MSG_DEBUG ("Special cut on distance, reject last hit on track !");
339  tsosType[lastrotindex] = RejectedHit;
340  numUnused--; // update counter
341  // mark track as bad !
342  TrkCouldBeAccepted = false;
343  }
344 
345  // special cut, do not allow the last hit to be after to many holes
346  if (ispatterntrack && // pattern track and
347  totalSiHits > m_minHits && // we have enough hits on the track
348  nsctholes>3 ) { // too many holes cut
349  ATH_MSG_DEBUG ("Special cut on too many holes, reject last hit on track !");
350  tsosType[lastrotindex] = RejectedHit;
351  numUnused--; // update counter
352  // mark track as bad !
353  TrkCouldBeAccepted = false;
354  }
355 
356 
357 
358  // get chi2/NDF, if track is fitted
359  if ( !ispatterntrack ) {
360  double trackchi2 = 0.;
361  if (ptrTrack->fitQuality() && ptrTrack->fitQuality()->numberDoF()>0 )
362  trackchi2 = ptrTrack->fitQuality()->chiSquared()/ptrTrack->fitQuality()->numberDoF();
363 
364  // if we have share hits and this is a bad track, we reject it
365  if ( numShared > 0 && !ispatterntrack && trackchi2 > 3 ) {
366  ATH_MSG_DEBUG ("Shared hits, we have a bad chi2 track, mark it as bad !");
367  // mark track as bad !
368  TrkCouldBeAccepted = false;
369  }
370  }
371 
372 
373  // numTRT cut, special for back tracking
374  if ( numTRT_Unused < nCutTRT) {
375  ATH_MSG_DEBUG ("Track fails TRT hit cut, mark it as bad !");
376  // mark track as bad !
377  TrkCouldBeAccepted = false;
378  }
379 
380  //
381  // now see what to do with the track
382  //
383 
384  // best case, we like this track and it passes this complex if statement
385  if ( TrkCouldBeAccepted && // we did not mark the track as bad before
386  ( !hassharedblayer || npixholes<=1 ) && // if blayer, at most 1 pixel hole
387  !hassharedpixel && // no shared pixel hits
388  ( ( totalSiHits >= m_minHits && numShared == 0 ) || // no shared and enough hits OR
389  ( totalSiHits >= m_minNotShared && numWeightedShared <= m_maxShared && // shared hits and enough unique hits and shared hits with good quality
391  ATH_MSG_DEBUG ("=> Suggest to keep track with "<<numShared<<" shared hits !");
392  return std::make_tuple(static_cast<Trk::Track *>(nullptr),true); // keep input track
393 
394  // ok, failed that one, can we recover the track ?
395  } else if ( numTRT_Unused >= nCutTRT && // TRT track or no TRT at all (back tracking)
396  ( totalSiHits >= m_minHits || // we have enough hits OR
397  ( totalSiHits >= m_minNotShared && // shared hits and enough unique hits and shared hits with good quality
399  // catch, if this is cosmics, accept the incoming track
400  if (m_cosmics) {
401  ATH_MSG_DEBUG ("=> Cosmics, accept input track even with shared hits");
402  return std::make_tuple(static_cast<Trk::Track *>(nullptr),true); // keep input track;
403  }
404 
405  // if ( numShared == 0 && TrkCouldBeAccepted ) {
406  // ATH_MSG_DEBUG ("=> Nothing to recover from, drop track !");
407  // return std::make_tuple(static_cast<Trk::Track *>(nullptr),false); // reject input track;
408  // }
409 
410  // Track is potentially ok, create a stripped down version from the unused hits and the allowed shared hits
411  // join shared to unused hits, if requirements are met
412 
413  ATH_MSG_VERBOSE ("Trying to recover track, allow for some shared hits is possible.");
414 
415  // new TSOS vector
416  std::vector<const Trk::TrackStateOnSurface*> newTSOS;
417 
418  // counter for the weighted number of added shared hits
419  int cntIns = 0;
420 
421  // loop over all TSOS (and types) and copy the good ones over
422  Trk::TrackStates::const_iterator iTsos = tsos->begin();
423  Trk::TrackStates::const_iterator iTsosEnd = tsos->end();
424 
425  for (int index = 0 ; iTsos != iTsosEnd ; ++iTsos,++index ) {
426 
427  // remove rejected hits
428  if (tsosType[index] == RejectedHit) {
429  ATH_MSG_VERBOSE ("-> Dropping rejected hit");
430 
431  } else if (tsosType[index] != SharedHit ) {
432  ATH_MSG_VERBOSE ("-> Copy good TSOS");
433  newTSOS.push_back(*iTsos);
434 
435  } else if (cntIns >= m_maxShared) {
436  ATH_MSG_VERBOSE ("-> Too many share hits, dropping outer hit(s)");
437 
438  } else {
439  ATH_MSG_VERBOSE ("-> Try to recover a shared hit");
440 
441  // get measurment from TSOS
442  const Trk::MeasurementBase* meas = (*iTsos)->measurementOnTrack();
443  // get ROT from this TSOS
444  const Trk::RIO_OnTrack* rot = dynamic_cast <const Trk::RIO_OnTrack*> (meas);
445 
446  if (!rot) {
447  ATH_MSG_WARNING ("Cast to RIO_OnTrack failed, should never happen !");
448  continue;
449  }
450 
451  // is it a pixel cluster ?
452  bool isPixel = m_detID->is_pixel(rot->identify());
453 
454  // find out how many tracks use this hit already
456  int numberOfTracksWithThisPrd = std::distance(range.first,range.second);
457  ATH_MSG_VERBOSE ("---> number of tracks with this shared Prd: " << numberOfTracksWithThisPrd << " maxtracks: " << m_maxTracksPerPRD);
458 
459  // check if this newly shared hit would exceed the shared hits limit of the already accepted track (**)
460  int iShared = 0;
461  int othernpixel = 0;
462  bool otherhasblayer = false;
463  if ( numberOfTracksWithThisPrd == 1 ) {
464  // @TODO is it ensured that the prds of all tracks have been registered already ?
465  std::vector< const Trk::PrepRawData* > prdsToCheck = m_assoTool->getPrdsOnTrack(prd_to_track_map,*(range.first->second));
466  for (const Trk::PrepRawData* prd : prdsToCheck) {
467  if (prd_to_track_map.isShared(*prd))
468  ++iShared;
469  if (m_detID->is_pixel(prd->identify())) {
470  othernpixel++;
471  if (m_detID->is_blayer(prd->identify())) otherhasblayer=true;
472  }
473  }
474  }
475 
476  // now decide what to do, can we keep the shared hit
477  if ( numberOfTracksWithThisPrd < m_maxTracksPerPRD && // number of tracks sharing hit
478  score > m_minScoreShareTracks && // score cut
479  (!isPixel || !hassharedblayer || npixholes <= 0) && // shared b-layer only if no pixel holes
480  ( iShared < m_maxShared || (isPixel && !firstisshared) ) && // do not allow other accepted track to exceed the shared limit, if first pixel hit is shared
481  (!isPixel || thishasblayer == otherhasblayer ) && // only allow shared pixel if both have blayer or both not
482  (!isPixel || npixel >= othernpixel ) ) { // only allow shared pixel if new track as at least as many pixel hits
483 
484  ATH_MSG_VERBOSE ("---> Accepted hit shared with " << numberOfTracksWithThisPrd << " tracks !");
485  newTSOS.push_back(*iTsos);
486  numUnused++; // update counter
487 
488  // update shared hit counter
489  cntIns += (isPixel ? 2 : 1);
490 
491  } else {
492  ATH_MSG_VERBOSE ("---> Reject hit shared with " << numberOfTracksWithThisPrd << " tracks !");
493  }
494  }
495  }
496 
497  // this still may happen per (**) see above.
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); // reject input track;
501  }
502 
503  // check that this is not the input track
504  if ( newTSOS.size() == tsos->size() ) {
505  ATH_MSG_DEBUG ("=> Recovered input track, accept it !");
506  return std::make_tuple(static_cast<Trk::Track *>(nullptr),true); // keep input track;
507  } else {
508  // ok, done, create subtrack
509  Trk::Track* newTrack = createSubTrack(newTSOS,ptrTrack);
510  if (!newTrack) {
511  ATH_MSG_DEBUG ("=> Failed to create subtrack");
512  return std::make_tuple(static_cast<Trk::Track *>(nullptr),false); // reject input track;
513  }
514 
516  info.addPatternRecoAndProperties(ptrTrack->info());
517  Trk::TrackInfo newInfo;
519  info.addPatternReco(newInfo);
520  newTrack->info().addPatternReco(ptrTrack->info());
521 
522  ATH_MSG_DEBUG ("=> Successfully created subtrack with shared hits recovered !");
523  return std::make_tuple(newTrack,false); // new cleaned track, reject input track ;
524  }
525  } else {
526  ATH_MSG_DEBUG ("=> Track is recommended to be dropped");
527  }
528 
529  return std::make_tuple(static_cast<Trk::Track *>(nullptr),false); // reject input track;
530 }

◆ initialize()

StatusCode InDet::InDetAmbiTrackSelectionTool::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 40 of file InDetAmbiTrackSelectionTool.cxx.

41 {
42  // Get segment selector tool
43  //
44  ATH_CHECK(m_selectortool.retrieve(DisableTool{!m_parameterization}));
45  ATH_CHECK(detStore()->retrieve(m_detID, "SiliconID" ));
46  ATH_MSG_DEBUG( "initialize() successful" );
47 
48  ATH_CHECK(m_assoTool.retrieve() );
49  return StatusCode::SUCCESS;
50 }

Member Data Documentation

◆ m_assoTool

ToolHandle<Trk::IPRDtoTrackMapTool> InDet::InDetAmbiTrackSelectionTool::m_assoTool {this, "AssociationTool", "Trk::PRDtoTrackMapTool" }
private

Definition at line 74 of file InDetAmbiTrackSelectionTool.h.

◆ m_cosmics

BooleanProperty InDet::InDetAmbiTrackSelectionTool::m_cosmics {this, "Cosmics", false}
private

Definition at line 88 of file InDetAmbiTrackSelectionTool.h.

◆ m_detID

const SiliconID* InDet::InDetAmbiTrackSelectionTool::m_detID {nullptr}
private

atlas id helper

Definition at line 78 of file InDetAmbiTrackSelectionTool.h.

◆ m_doPixelClusterSplitting

BooleanProperty InDet::InDetAmbiTrackSelectionTool::m_doPixelClusterSplitting {this, "doPixelSplitting", false}
private

Definition at line 90 of file InDetAmbiTrackSelectionTool.h.

◆ m_maxShared

int InDet::InDetAmbiTrackSelectionTool::m_maxShared {0}
private

Definition at line 83 of file InDetAmbiTrackSelectionTool.h.

◆ m_maxSharedModules

IntegerProperty InDet::InDetAmbiTrackSelectionTool::m_maxSharedModules {this, "maxShared", 1}
private

Definition at line 84 of file InDetAmbiTrackSelectionTool.h.

◆ m_maxSplitSize

IntegerProperty InDet::InDetAmbiTrackSelectionTool::m_maxSplitSize {this, "MaximalSplitSize", 49, "A.S.: remove that when solved properly by updating the SplitProb info with isExcluded. A.S.: to be removed once EDM is updated"}
private

Definition at line 92 of file InDetAmbiTrackSelectionTool.h.

◆ m_maxTracksPerPRD

IntegerProperty InDet::InDetAmbiTrackSelectionTool::m_maxTracksPerPRD {this, "maxTracksPerSharedPRD", 2}
private

Definition at line 85 of file InDetAmbiTrackSelectionTool.h.

◆ m_minHits

IntegerProperty InDet::InDetAmbiTrackSelectionTool::m_minHits {this, "minHits", 5}
private

some cut values

Definition at line 81 of file InDetAmbiTrackSelectionTool.h.

◆ m_minNotShared

IntegerProperty InDet::InDetAmbiTrackSelectionTool::m_minNotShared {this, "minNotShared", 6}
private

Definition at line 86 of file InDetAmbiTrackSelectionTool.h.

◆ m_minScoreShareTracks

FloatProperty InDet::InDetAmbiTrackSelectionTool::m_minScoreShareTracks {this, "minScoreShareTracks", 0.0}
private

Definition at line 87 of file InDetAmbiTrackSelectionTool.h.

◆ m_minTRT_Hits

IntegerProperty InDet::InDetAmbiTrackSelectionTool::m_minTRT_Hits {this, "minTRTHits", 0}
private

Definition at line 82 of file InDetAmbiTrackSelectionTool.h.

◆ m_parameterization

BooleanProperty InDet::InDetAmbiTrackSelectionTool::m_parameterization {this, "UseParameterization", true}
private

Definition at line 89 of file InDetAmbiTrackSelectionTool.h.

◆ m_selectortool

PublicToolHandle<ITrtDriftCircleCutTool> InDet::InDetAmbiTrackSelectionTool::m_selectortool {this, "DriftCircleCutTool", "InDet::InDetTrtDriftCircleCutTool"}
private

TRT minimum number of drift circles tool- returns allowed minimum number of TRT drift circles.

Definition at line 71 of file InDetAmbiTrackSelectionTool.h.

◆ m_sharedProbCut

FloatProperty InDet::InDetAmbiTrackSelectionTool::m_sharedProbCut {this, "sharedProbCut", 0.02}
private

Definition at line 91 of file InDetAmbiTrackSelectionTool.h.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
InDet::InDetAmbiTrackSelectionTool::m_minScoreShareTracks
FloatProperty m_minScoreShareTracks
Definition: InDetAmbiTrackSelectionTool.h:87
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
Trk::numberOfPixelHits
@ numberOfPixelHits
number of pixel layers on track with absence of hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:57
xAOD::numWeightedShared
@ numWeightedShared
Definition: TrackingPrimitives.h:541
xAOD::numUnused
@ numUnused
Definition: TrackingPrimitives.h:535
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
InDet::InDetAmbiTrackSelectionTool::createSubTrack
Trk::Track * createSubTrack(const std::vector< const Trk::TrackStateOnSurface * > &tsos, const Trk::Track *track) const
method to create a new track from a vector of TSOS's
Definition: InDetAmbiTrackSelectionTool.cxx:534
InDet::InDetAmbiTrackSelectionTool::m_maxTracksPerPRD
IntegerProperty m_maxTracksPerPRD
Definition: InDetAmbiTrackSelectionTool.h:85
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo::isSplit
bool isSplit() const
Definition: ClusterSplitProbabilityContainer.h:27
Trk::PRDtoTrackMap::onTracks
PrepRawDataTrackMapRange onTracks(const PrepRawData &prd)
get the Tracks associated with this PrepRawData.
InDet::InDetAmbiTrackSelectionTool::m_parameterization
BooleanProperty m_parameterization
Definition: InDetAmbiTrackSelectionTool.h:89
index
Definition: index.py:1
Trk::numberOfSCTDeadSensors
@ numberOfSCTDeadSensors
number of TRT hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:76
Trk::Track::info
const TrackInfo & info() const
Returns a const ref to info of a const tracks.
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo
Definition: ClusterSplitProbabilityContainer.h:22
Trk::RIO_OnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override=0
Interface method to get the global Position.
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
InDet::InDetAmbiTrackSelectionTool::m_doPixelClusterSplitting
BooleanProperty m_doPixelClusterSplitting
Definition: InDetAmbiTrackSelectionTool.h:90
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:782
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::TrackInfo::InDetAmbiTrackSelectionTool
@ InDetAmbiTrackSelectionTool
Added because of compilation problems.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:159
Trk::numberOfSCTHoles
@ numberOfSCTHoles
number of Holes in both sides of a SCT module
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:73
InDet::InDetAmbiTrackSelectionTool::m_minTRT_Hits
IntegerProperty m_minTRT_Hits
Definition: InDetAmbiTrackSelectionTool.h:82
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
SiliconID::is_blayer
bool is_blayer(const Identifier &id) const
Test for pixle b-layer - generic, i.e. works for EITHER pixel or sct id.
Definition: SiliconID.h:169
Trk::PseudoMeasurementOnTrack
Class to handle pseudo-measurements in fitters and on track objects.
Definition: PseudoMeasurementOnTrack.h:44
Trk::TrackInfo::addPatternReco
void addPatternReco(const TrackInfo &)
A method adding just pattern recognition info without adding the actual properties.
InDet::InDetAmbiTrackSelectionTool::m_cosmics
BooleanProperty m_cosmics
Definition: InDetAmbiTrackSelectionTool.h:88
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
InDet::InDetAmbiTrackSelectionTool::m_assoTool
ToolHandle< Trk::IPRDtoTrackMapTool > m_assoTool
Definition: InDetAmbiTrackSelectionTool.h:75
xAOD::totalSiHits
@ totalSiHits
Definition: TrackingPrimitives.h:525
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::numberOfPixelDeadSensors
@ numberOfPixelDeadSensors
number of pixel hits with broad errors (width/sqrt(12))
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:65
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::ParametersBase
Definition: ParametersBase.h:55
InDet::InDetAmbiTrackSelectionTool::m_selectortool
PublicToolHandle< ITrtDriftCircleCutTool > m_selectortool
TRT minimum number of drift circles tool- returns allowed minimum number of TRT drift circles.
Definition: InDetAmbiTrackSelectionTool.h:72
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Trk::PRDtoTrackMap::isUsed
bool isUsed(const PrepRawData &prd) const
does this PRD belong to at least one track?
min
#define min(a, b)
Definition: cfImp.cxx:40
Trk::numberOfPixelHoles
@ numberOfPixelHoles
number of pixels which have a ganged ambiguity.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:59
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk::MeasurementBase
Definition: MeasurementBase.h:58
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
AtlasDetectorID::is_indet
bool is_indet(Identifier id) const
Definition: AtlasDetectorID.h:683
Trk::RIO_OnTrack::prepRawData
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
xAOD::score
@ score
Definition: TrackingPrimitives.h:513
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
DeMoScan.index
string index
Definition: DeMoScan.py:364
InDet::InDetAmbiTrackSelectionTool::m_minNotShared
IntegerProperty m_minNotShared
Definition: InDetAmbiTrackSelectionTool.h:86
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
InDet::InDetAmbiTrackSelectionTool::m_maxShared
int m_maxShared
Definition: InDetAmbiTrackSelectionTool.h:83
xAOD::numTRT_Unused
@ numTRT_Unused
Definition: TrackingPrimitives.h:536
InDet::InDetAmbiTrackSelectionTool::m_sharedProbCut
FloatProperty m_sharedProbCut
Definition: InDetAmbiTrackSelectionTool.h:91
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo::splitProbability1
float splitProbability1() const
Definition: ClusterSplitProbabilityContainer.h:24
Trk::ClusterSplitProbabilityContainer::splitProbability
const ProbabilityInfo & splitProbability(const PrepRawData *cluster) const
Definition: ClusterSplitProbabilityContainer.h:35
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::TrackInfo::setPatternRecognitionInfo
void setPatternRecognitionInfo(const TrackPatternRecoInfo &patternReco)
Method setting the pattern recognition algorithm.
Trk::TrackSummary::get
int get(const SummaryType &type) const
returns the summary information for the passed SummaryType.
InDet::InDetAmbiTrackSelectionTool::m_maxSplitSize
IntegerProperty m_maxSplitSize
Definition: InDetAmbiTrackSelectionTool.h:92
xAOD::numShared
@ numShared
Definition: TrackingPrimitives.h:523
OfflineHitType::Outlier
@ Outlier
InDet::InDetAmbiTrackSelectionTool::m_minHits
IntegerProperty m_minHits
some cut values
Definition: InDetAmbiTrackSelectionTool.h:81
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
Trk::PRDtoTrackMap::isShared
bool isShared(const PrepRawData &prd) const
does this PRD belong to more than one track?
InDet::InDetAmbiTrackSelectionTool::m_maxSharedModules
IntegerProperty m_maxSharedModules
Definition: InDetAmbiTrackSelectionTool.h:84
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
Trk::PRDtoTrackMap::ConstPrepRawDataTrackMapRange
std::pair< PrepRawDataTrackMap::const_iterator, PrepRawDataTrackMap::const_iterator > ConstPrepRawDataTrackMapRange
Definition: PRDtoTrackMap.h:44
InDet::InDetAmbiTrackSelectionTool::m_detID
const SiliconID * m_detID
atlas id helper
Definition: InDetAmbiTrackSelectionTool.h:78
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Trk::TrackInfo::Unknown
@ Unknown
Track fitter not defined.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:41
Identifier
Definition: IdentifierFieldParser.cxx:14