ATLAS Offline Software
InDetDenseEnvAmbiTrackSelectionTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // InDetDenseEnvAmbiTrackSelectionTool.cxx, (c) ATLAS Detector software
7 // Anthony Morley based on the orginal tool by Markus Elsing
8 // Oct 2020 - Clean-up for rel22 - Gabriel Facini
10 
12 
23 #include "TrkSurfaces/Surface.h"
24 #include "TrkTrack/TrackInfo.h"
28 
29 #include "TString.h"
30 
31 //================ Constructor =================================================
32 
34  const std::string& n,
35  const IInterface* p )
36 :
37 base_class(t,n,p){}
38 
39 //================ Initialisation =================================================
40 
42 {
44 
45  // Get segment selector tool
46  ATH_CHECK(m_selectortool.retrieve(DisableTool{!m_parameterization}));
47 
48  ATH_CHECK(detStore()->retrieve(m_detID, "SiliconID"));
49 
50  if(!m_etaDependentCutsSvc.name().empty()) ATH_CHECK(m_etaDependentCutsSvc.retrieve());
51 
52  ATH_CHECK(m_assoTool.retrieve());
53 
54  ATH_CHECK(m_observerTool.retrieve(DisableTool{m_observerTool.empty()}));
55 
58 
59  return StatusCode::SUCCESS;
60 }
61 
63  return StatusCode::SUCCESS;
64 }
65 
66 
67 // @TODO move cluster "map" creation to separate algorithm
69 {
70  }
71 
72 
73 //============================================================================================
75  const Trk::TrackScore score,
76  Trk::ClusterSplitProbabilityContainer &splitProbContainer,
77  Trk::PRDtoTrackMap &prd_to_track_map,
78  int trackId,
79  int subtrackId) const
80 {
81 
82  CacheEntry cache;
83 
84  if (m_skipAmbiInROI && inHadronicROI(ptrTrack)){
85  ATH_MSG_DEBUG("skipping ambiguity resolution for track in hadronic ROI with m_minPtBjetROI = "<<m_minPtBjetROI<<", m_phiWidth = "<<m_phiWidth<<", m_etaWidth = "<<m_etaWidth);
86  return std::make_tuple(static_cast<Trk::Track *>(nullptr),true); // keep input track
87  }
88  // compute the number of shared hits from the number of max shared modules
89  // reset every track as could be changed for tracks within an ROI
90  // ROI matching is done within decideWhichHitsToKeep. Note mulitple ROI types
91  double trackEta = ptrTrack->trackParameters()->front()->eta();
92  int maxSharedModules = m_etaDependentCutsSvc.name().empty() ?
94  cache.m_maxSharedModules = 2*maxSharedModules+1; // see header for meaning
95  cache.m_minNotShared = m_etaDependentCutsSvc.name().empty() ?
96  int(m_minNotSharedHits) : m_etaDependentCutsSvc->getMinSiNotSharedAtEta(trackEta);
97  cache.m_minSiHits = m_etaDependentCutsSvc.name().empty() ?
99 
100  // cut on TRT hits, might use eta dependent cuts here
101  int nCutTRT = m_minTRT_Hits;
102  if (m_parameterization) {
104  const Trk::TrackParameters* par = (*vpar)[0];
105  // ME bugfix TODO ... how old is this comment??
106  int expected = m_selectortool->minNumberDCs(par);
107  if (expected > nCutTRT) nCutTRT = expected;
108  }
109 
110  // get all TSOS the track
111  const Trk::TrackStates* tsos = ptrTrack->trackStateOnSurfaces();
112  ATH_MSG_DEBUG ("Study new Track "<< ptrTrack<<"\t , it has "<<tsos->size()<<"\t track states");
113 
114  //Create structs to hold track information
115  //Values in here are used to decide if a track is kept or not
116  TrackHitDetails trackHitDetails;
117 
118  ATH_MSG_DEBUG ("Filling in TrackDetails");
119  TSoS_Details tsosDetails(tsos->size());
120 
121  // Fill structs with information
122  fillTrackDetails( ptrTrack, splitProbContainer, prd_to_track_map, trackHitDetails, tsosDetails);
123 
124  //Decide which hits to keep
125  //This is a major function which checks the usage of each hit on the candidate track
126  ATH_MSG_DEBUG ("decideWhichHitsToKeep");
127  decideWhichHitsToKeep( ptrTrack, score, splitProbContainer, prd_to_track_map, trackHitDetails, tsosDetails, &cache, trackId );
128 
129  ATH_MSG_DEBUG ("decideWhichHitsToKeep " << trackHitDetails.m_trkCouldBeAccepted );
130 
131  //
132  // now see what to do with the track
133  //
134 
135  ATH_MSG_DEBUG ("totalSiHits " << trackHitDetails.totalSiHits());
136  ATH_MSG_DEBUG ("totalUniqueSiHits " << trackHitDetails.totalUniqueSiHits());
137  ATH_MSG_DEBUG ("score " << score );
138 
139 
140  //------------------------------------------------------------------------------------//
141  //
142  // All tracks must pass a minimum set of criteria
143  //
144  // 1. Needs a minimum number of hits on track
145  // This cut is also implmeneted in the scoring tool and usually the same values are set.
146  // A track which fails to have the minimum number of hits, gets a score of 0
147  // and will not make it this far. Might not be true for all versions of scoring tools.
148  // The cut here maintains an explicit threshold
149  //
150  // 2. Needs enough TRT hits. This is an important cut for back-tracking
151  //
152  // 3. Needs to have enough unique hits (not shared with an accepted track)
153  //
154  //------------------------------------------------------------------------------------//
155  bool passBasicCuts(true);
156  if( trackHitDetails.totalSiHits() < m_minHits ) {
157  passBasicCuts = false;
158  if (m_observerTool.isEnabled()) {
160  }
161  }
162  if( trackHitDetails.m_numTRT_Unused < nCutTRT ) {
163  passBasicCuts = false;
164  if (m_observerTool.isEnabled()) {
166  }
167  }
168  if( trackHitDetails.totalUniqueSiHits() < cache.m_minNotShared ) {
169  passBasicCuts = false;
170  if (m_observerTool.isEnabled()) {
172  }
173  }
174  if( !passBasicCuts ) {
175  ATH_MSG_DEBUG ("reject track; failed basic cuts");
176  return std::make_tuple(static_cast<Trk::Track *>(nullptr),false); // reject input track
177  }
178  //------------------------------------------------------------------------------------//
179 
180 
181  //------------------------------------------------------------------------------------//
182  //
183  // Decide to keep track or not based on more complex criteria
184  // 1. Check if track passes some criteria, including decision from decideWhichHitsToKeep
185  // If it passes, put the track into the output collection
186  // 2. Those which fail are tested on a second set of criteria
187  // If it passes, strip off "RejectedHits" (decided in decideWhichHitsToKeep)
188  // and build new subtrack from all non-shared hits and the
189  // set of shared hits which pass some cuts.
190  // If 1. new track would have same hit content, save the original track
191  // 2. if the new subtrack has less hits, and more than the min, created
192  // subtrack and reject the original
193  // 3. if the new subtrack is below min hit cuts, junk it
194  // 3. Those which fail are rejected with no chance for recovery
195  //
196  //------------------------------------------------------------------------------------//
197 
198  //------------------------------------------------------------------------------------//
199  // Set some booleans for the up coming if/else statement
200 
201  // no shared hit at all
202  // if shared hits, have additional requirements to check (3)
203  bool noSharedHits( trackHitDetails.m_numShared == 0 );
204 
205  // set 2 bools for criteria placed on tracks with shared hits each criteria
206  // 1/2 - too many shared modules?
207  bool passSharedModulesCut( trackHitDetails.m_numWeightedShared < cache.m_maxSharedModules );
208 
209  // 2/2 - good quality?
210  // Note, all tracks with a score of 0 are already removed
211  bool passScoreCut( score > m_minScoreShareTracks );
212  //------------------------------------------------------------------------------------//
213 
214 
215  //------------------------------------------------------------------------------------//
216  // Execute logic outlined above
217  //
218  // BEST CASE, we like this track and it passes this if statement
219  // if have shared hits, not too many shared, and score ("quality") (note unique hits checked above)
220  if( trackHitDetails.m_trkCouldBeAccepted &&
221  ( noSharedHits || (passSharedModulesCut && passScoreCut) ) ) {
222  ATH_MSG_DEBUG ("=> Suggest to keep track with "<<trackHitDetails.m_numShared<<" shared hits !");
223 
224 
225  // Change pixel hits property for shared hits as this track will be accepted into the final track colection
226  if (!trackHitDetails.m_isPatternTrack){
227  setPixelClusterSplitInformation( tsosDetails, splitProbContainer );
228  }
229 
230  if (m_observerTool.isEnabled()){
232  }
233  return std::make_tuple(static_cast<Trk::Track *>(nullptr),true); // keep input track
234 
235  }
236  // Track failed to be accepted as is.
237  // Can we recover the track?
238  else if ( passScoreCut ) {
239 
240  // catch, if this is cosmics, accept the incoming track
241  if (m_cosmics) {
242  ATH_MSG_DEBUG ("=> Cosmics, accept input track even with shared hits");
243  if (m_observerTool.isEnabled()){
245  }
246  return std::make_tuple(static_cast<Trk::Track *>(nullptr),true); // keep input track
247  }
248 
249  //
250  // Track is potentially ok, create a stripped down version
251  // from all hits not rejected
252  //
253 
254  ATH_MSG_VERBOSE ("Trying to recover track...gathering hits.");
255 
256  // decision on hits are already made
257  // check the cleaning cuts and see if any of the rejected hits can be added back in
258  // otherwise, go with what we have
259  //
260  // A candidate below the total hit cut will never make it this far.
261  // We are only extend tracks here if ever decide to override rejected hit decisions
262 
263  // loop over all TSOS (and types) and copy the good
264  // ones over to new TSOS vector
265  std::vector<const Trk::TrackStateOnSurface*> newTSOS;
266 
267  // iterators for looping
268  Trk::TrackStates::const_iterator iTsos = tsos->begin();
269  Trk::TrackStates::const_iterator iTsosEnd = tsos->end();
270 
271  for (int index = 0 ; iTsos != iTsosEnd ; ++iTsos,++index ) {
272 
273  // remove rejected hits
274  if( tsosDetails.m_type[index] == RejectedHitOverUse ||
275  tsosDetails.m_type[index] == RejectedHitInvalid ||
276  tsosDetails.m_type[index] == RejectedHit ) {
277  ATH_MSG_VERBOSE ("-> Dropping rejected hit");
278  continue;
279  }
280 
281  ATH_MSG_VERBOSE ("-> Copy good TSOS");
282  newTSOS.push_back(*iTsos);
283 
284  } // loop over TSOS
285 
286 
287  // newTSOS size would be hits on new track...how can the limit be 3? Is this backtracking?
288  // Missing something? What configuration is relying on this cut? TODO
289  if ( newTSOS.size() <= 3 ) {
290  ATH_MSG_VERBOSE ("newTSOS.size(): "<<newTSOS.size() );
291  ATH_MSG_DEBUG ("reject track; Too few hits, reject track with shared hits");
292  if (m_observerTool.isEnabled()){
294  }
295  return std::make_tuple(static_cast<Trk::Track *>(nullptr),false); // reject input track
296  }
297 
298  // check that this is not the input track
299  if ( newTSOS.size() == tsos->size() ) {
300  ATH_MSG_DEBUG ("=> Recovered input track, accept it !");
301 
302  // Change pixel hits property for shared hits as this is track will be accepeted into the final track colection
303  if (!trackHitDetails.m_isPatternTrack){
304  setPixelClusterSplitInformation( tsosDetails, splitProbContainer );
305  }
306  ATH_MSG_DEBUG ("reject track; maybe track was mark as rejected, but we recoverd it so no rejection");
307  if (m_observerTool.isEnabled()){
309  }
310  return std::make_tuple(static_cast<Trk::Track *>(nullptr),true); // keep input track
311  } else {
312  // ok, done, create subtrack
313  Trk::Track* newTrack = createSubTrack(newTSOS,ptrTrack);
314  if (!newTrack) {
315  ATH_MSG_DEBUG ("=> Failed to create subtrack");
316  ATH_MSG_DEBUG ("reject track; Failed to create subtrack");
317  if (m_observerTool.isEnabled()){
319  }
320  return std::make_tuple(static_cast<Trk::Track *>(nullptr),false); // reject input track
321  }
322 
324  info.addPatternRecoAndProperties(ptrTrack->info());
325  Trk::TrackInfo newInfo;
327  info.addPatternReco(newInfo);
328  newTrack->info().addPatternReco(ptrTrack->info());
329 
330  ATH_MSG_DEBUG ("=> Successfully created subtrack with shared hits recovered !");
331  if (m_observerTool.isEnabled()) {
333  m_observerTool->addSubTrack(subtrackId, trackId, *newTrack);
334  }
335  return std::make_tuple(newTrack,false); // create new, cleaned track and reject input track
336  }
337  }
338 
339  // if made it this far, junk the track
340  ATH_MSG_DEBUG ("=> Track is recommended to be dropped");
341  ATH_MSG_DEBUG ("reject track; other");
342  if (m_observerTool.isEnabled()){
344  }
345  return std::make_tuple(static_cast<Trk::Track *>(nullptr),false); // reject input track
346 
347 }
348 
349 
350 //
351 // Check if a shared hit invalidates any accepted track, if so, return false
352 // otherwise return true
353 // ONLY Shared hits are expected. We assume the decision to split has already been made
355  int index,
356  Trk::ClusterSplitProbabilityContainer &splitProbContainer,
357  Trk::PRDtoTrackMap &prd_to_track_map,
358  int& maxiShared,
359  int& maxOtherNPixel,
360  bool& maxOtherHasIBL,
361  CacheEntry* ent) const
362 {
363 
364  // Hits here are only shared hits.
365  // Assumption: the decision to split has been done outside this function
366  if( tsosDetails.m_type[index] != SharedHit ) {
367  ATH_MSG_WARNING("Calling checkOtherTracksValidity with a hit that is not shared!");
368  return true;
369  }
370 
371  // needed?
372  const Trk::RIO_OnTrack* rot = tsosDetails.m_RIO[index];
373 
374  // get list of tracks that use this hit already
375  int numberOfTracksWithThisPrd = tsosDetails.m_hitIsShared[index];
376  ATH_MSG_VERBOSE ("---> number of tracks with this shared Prd: " << numberOfTracksWithThisPrd << " maxtracks: " << m_maxTracksPerPRD);
377 
378  // check if adding one more shared hit would push any accepted track
379  // -over the limit of shared hits
380  // -under the limit of unique hits
381  maxiShared = -1;
382  bool otherwillFailMinHits = false;
383  bool otherwillFailSCTuniqueHits = false;
384 
385  //Setup counters
386  int iSharedMod = 0; //Number of Shared modules on the accepted track (will include this hit)
387  int iNotShared = 0; //Number of unshared hits on the accepted track
388  int iSctUnique = 0; //Number of unique SCT hits on the accepted track
389  int iPixel = 0; //Number of pixel hits on the accepted track
390  int iSCT = 0; //Number of SCT hits on the accepted track
391  bool iHasBlayer = false; // Does the accepted track have a b-layer hit
392 
393  // loop over all tracks that have this hit and make sure none fail
394  // - requirement on unique hits
395  // - requirement on shared modules
396  // - requirement on unique sct hits
397  // send back some information about the most overlapping track
398  auto currentHitsSharedTracks = tsosDetails.m_tracksSharingHit.equal_range(index);
399  for ( auto track = currentHitsSharedTracks.first; track != currentHitsSharedTracks.second; ++track ){
400 
401  //Count up the hit properties of the track you are inspecting
402  iSharedMod = 0;
403  iNotShared = 0;
404  iSctUnique = 0;
405  iPixel = 0;
406  iHasBlayer = false;
407  iSCT = 0;
408 
409  std::vector< const Trk::PrepRawData* > prdsToCheck = m_assoTool->getPrdsOnTrack(prd_to_track_map, *(track->second));
410  for (const Trk::PrepRawData* prdToCheck : prdsToCheck) {
411  bool isPixel(false);
412  bool isSplitPixel(false);
413  if (m_detID->is_pixel(prdToCheck->identify())) {
414  isPixel = true;
415  if (prdToCheck->type(Trk::PrepRawDataType::PixelCluster)){
416  const InDet::PixelCluster* constPixelCluster = static_cast<const InDet::PixelCluster*> ( prdToCheck );
417  const Trk::ClusterSplitProbabilityContainer::ProbabilityInfo &splitProb = splitProbContainer.splitProbability(constPixelCluster);
418  if ( splitProb.isSplit() ) {
419  isSplitPixel = true;
420  }
421  }
422 
423  ++iPixel;
424  if (m_detID->is_blayer(prdToCheck->identify()) ) iHasBlayer=true;
425  }
426 
427  if ( m_detID->is_sct(prdToCheck->identify()) ) {
428  ++iSCT;
429  }
430 
431  //
432  // count for general cases considering current flags (i.e. if split can be shared)
433  // hit which are overused, are rejected and should not be in this part of the code
434  // if hit is new one to be shared, count it as shared
435  // - the new cluster to be shared is not a split cluster (that is why we are here)
436  // - this will count correctly if a split hit can also be shared
437  if ( rot->prepRawData() == prdToCheck ) {
438  iSharedMod += isPixel ? 2 : 1;
439  // else if hit is not the new hit to be shared, then see if it is already shared
440  // - if so, count considering if it is split or not
441  } else if ( prd_to_track_map.isShared( *prdToCheck ) ) {
442  iSharedMod += isSplitPixel ? 0 : isPixel ? 2 : 1;
443  // else
444  // - not a shared cluster
445  } else {
446  ++iNotShared;
447  if (m_detID->is_sct(prdToCheck->identify())){
448  ++iSctUnique;
449  }
450  }
451  } // loop over PRDs
452 
453  ATH_MSG_VERBOSE( "Track " << track->second << " will has " << iNotShared << " unique hits and " << iSctUnique << " unique SCT hits.");
454  // You are sharing too many hits reject the new track
455  // TODO does not include dead modules! Can we get that from the track summary?
456  if ( iNotShared < ent->m_minNotShared ) otherwillFailMinHits = true;
457  // You are sharing SCT hits and don't have enough to share -reject hit.
458  if ( iSCT > iSctUnique && iSctUnique < m_minUniqueSCTHits ) otherwillFailSCTuniqueHits = true;
459  } // loop over tracks
460 
461  // Update details for the track with the most shared hits
462  if ( iSharedMod > maxiShared){
463  maxiShared = iSharedMod;
464  maxOtherNPixel = iPixel;
465  maxOtherHasIBL = iHasBlayer;
466  }
467 
468  return !( otherwillFailMinHits || otherwillFailSCTuniqueHits );
469 }
470 
471 
472 
474  Trk::ClusterSplitProbabilityContainer &splitProbContainer,
475  const Trk::PRDtoTrackMap &prd_to_track_map,
476  TrackHitDetails& trackHitDetails,
477  TSoS_Details& tsosDetails) const
478 {
479 
480  // get all TSOS the track
481  const Trk::TrackStates* tsos = ptrTrack->trackStateOnSurfaces();
482  ATH_MSG_DEBUG ("Study new Track "<< ptrTrack<<"\t , it has "<<tsos->size()<<"\t track states");
483 
484 
485  // is this a track from the pattern or a fitted track ?
486  trackHitDetails.m_isPatternTrack = (ptrTrack->info().trackFitter()==Trk::TrackInfo::Unknown);
487  if (trackHitDetails.m_isPatternTrack) {
488  ATH_MSG_DEBUG ("-> this is a pattern track, outliers are good hits (reintegration) ! " << ptrTrack->perigeeParameters() );
489  } else {
490  ATH_MSG_DEBUG ("-> this is a refitted track, so we can use the chi2 ! " << ptrTrack->perigeeParameters());
491  }
492 
493  // some pre-processing of the summary information, if available, needed for special cuts
494  const Trk::TrackSummary* trkSummary=ptrTrack->trackSummary();
495  if (trkSummary) {
496  ATH_MSG_VERBOSE ("--> Found summary information");
497  trackHitDetails.m_numPixelDeadSensor = trkSummary->get(Trk::numberOfPixelDeadSensors);
498  trackHitDetails.m_numSCTDeadSensor = trkSummary->get(Trk::numberOfSCTDeadSensors);
499  trackHitDetails.m_numPixelHits = trkSummary->get(Trk::numberOfPixelHits);
500  trackHitDetails.m_numPixelHoles = trkSummary->get(Trk::numberOfPixelHoles);
501  trackHitDetails.m_numSCTHoles = trkSummary->get(Trk::numberOfSCTHoles);
502  trackHitDetails.m_numSCTHits = trkSummary->get(Trk::numberOfSCTHits);
503  } else {
504  ATH_MSG_WARNING("Did not find track summary. Some cuts will be less efficienct!");
505  }
506 
507 
508  // set nDeadSensors to 0 in case trkSummary wasn't called with HoleSearch
509  // (i.e. number of deadSensors not available)
510  if (trackHitDetails.m_numPixelDeadSensor == -1) trackHitDetails.m_numPixelDeadSensor = 0;
511  if (trackHitDetails.m_numSCTDeadSensor == -1) trackHitDetails.m_numSCTDeadSensor = 0;
512  ATH_MSG_VERBOSE ("--- Number of dead si sensors: " << trackHitDetails.m_numPixelDeadSensor + trackHitDetails.m_numSCTDeadSensor);
513 
514 
515  //
516  // loop over TSOS and save information about each
517  // label each TSOS as Outlier, UnusedHit, SharedHit or RejectedHit (only for errors here)
518  // labels are used refined in decideWhichHitsToKeep
519  ATH_MSG_VERBOSE ("--> Looping over TSOS's");
520  Trk::TrackStates::const_iterator iTsos = tsos->begin();
521  Trk::TrackStates::const_iterator iTsosEnd = tsos->end();
522  for (int index = 0 ; iTsos != iTsosEnd ; ++iTsos, ++index) {
523 
524  // get measurment from TSOS
525  const Trk::MeasurementBase* meas = (*iTsos)->measurementOnTrack();
526 
527  // if we do not have a measurement, we should just mark it
528  if (!meas) {
529  ATH_MSG_VERBOSE ( Form("---> No measurement on TSOS, it is another type, %2d",index) );
530  tsosDetails.m_type[index] = OtherTsos;
531  continue;
532  }
533 
534  // ok, let try to get the ROT then
535 
537  // could be a Pseudo-Measurement ?
539  ATH_MSG_VERBOSE ( Form("---> Pseudo measurement, %2d",index) );
540  ++trackHitDetails.m_numPseudo; // increase counter
541  } else {
542  ATH_MSG_WARNING ( Form("---> Measurement is not a pseudo measurment, not yet supported! %2d",index));
543  }
544  tsosDetails.m_type[index] = OtherTsos;
545  continue;
546  }
547  const Trk::RIO_OnTrack* rot = static_cast <const Trk::RIO_OnTrack*> (meas);
548  //Store RIO into vector for later use
549  tsosDetails.m_RIO[index] = rot;
550 
551  //
552  // we have a TSOS with a measurement, keep analysing it
553  //
554 
555  // let's get some information about the measurement
556  const Identifier& id = rot->identify();
557  bool isTRT = m_detID->is_trt(id);
558  bool isPixel = m_detID->is_pixel(id);
559  bool isSCT = m_detID->is_sct(id);
560  bool isIBL = isPixel ? m_detID->is_blayer(id) : false; // checks layer 0
561  bool isoutlier = (*iTsos)->type(Trk::TrackStateOnSurface::Outlier);
562 
563  tsosDetails.m_detType[index] = isTRT * 3 + isSCT * 2 + isPixel * 1 + isIBL * 10;
564 
565  // Do we have a IBL hit on the track?
566  if ( isIBL && (!isoutlier || trackHitDetails.m_isPatternTrack ) ) {
567  trackHitDetails.m_thisHasIBLHit = true; // we may reintegrate outliers from pattern
568  }
569 
570  // Add splitting information about the cluster
571  if (isPixel) {
573  ATH_MSG_WARNING ("---> Cluster is not from pixels; should not happen !");
574  tsosDetails.m_type[index] = RejectedHit;
575  continue;
576  } else {
577  // get pixel cluster
578  const InDet::PixelCluster* clus = static_cast <const InDet::PixelCluster*> (rot->prepRawData());
579  const Trk::ClusterSplitProbabilityContainer::ProbabilityInfo &splitProb = splitProbContainer.splitProbability(clus);
580  if ( !splitProb.isTooBigToBeSplit() ) {
581  tsosDetails.m_splitProb1[index] = splitProb.splitProbability1();
582  tsosDetails.m_splitProb2[index] = splitProb.splitProbability2();
583  } else {
584  // cluster too big to split are default to 3 particle cluster
585  // rigorously checked?
586  tsosDetails.m_splitProb1[index] = m_sharedProbCut - 0.01f;
587  tsosDetails.m_splitProb2[index] = m_sharedProbCut2 + 0.01f;
588  }
589  }
590  } // isPixel
591 
592 
593  //
594  // define each hit
595  // continue once definition set
596  //
597 
598  // is this cluster used on an accepted track?
599  bool isUsed = prd_to_track_map.isUsed(*(rot->prepRawData()));
600 
601  // assign outlier label using isoutlier bool above
602  // or if not inDet (does this even happen? Historical criteria)
603  // further criteria on keeping a hit or not is done in decideWhichHitsToKeep
604  // NOTE outliers can be shared but cannot save both in tsosDetails
605  if( isoutlier || !(m_detID->is_indet(id))) {
606  ATH_MSG_VERBOSE ( Form("---> Prd is outlier, %d", index) );
607  tsosDetails.m_type[index] = Outlier;
608  // if it is used, we need to send that information to the rest of the code
609  // in decideWhichHitsToKeep we reject any outlier used on another track
610  // if that logic was to change, and the number of tracks was needed, this would
611  // need to change
612  if(isUsed) { tsosDetails.m_hitIsShared[index] = 1; }
613  continue;
614  }
615 
616 
617  if (!isUsed) {
618  ATH_MSG_VERBOSE ( Form("---> Prd is unused, %d", index) );
619  tsosDetails.m_type[index] = UnusedHit;
620  continue;
621  }
622 
623  //
624  // we have a shared hit
625  //
626 
627 
628  // check if it is a shared TRT hit, this is not allowed
629  if (isTRT) {
630  ATH_MSG_VERBOSE ( Form("---> Share TRT hit, drop it !, %d", index) );
631  tsosDetails.m_type[index] = RejectedHit;
632  continue;
633  }
634 
635  /* Allow a hit to be a shared one, if
636  - not too many tracks share this hit already
637  - the score of the track is high enough to allow for shared hits
638  store information here but make decisions in decideWhichHitsToKeep
639  */
641  int numberOfTracksWithThisPrd = std::distance(range.first,range.second);
642  ATH_MSG_VERBOSE ( Form("---> Number of tracks with this share Prd %d: %2d maxtracks: %2d",index, numberOfTracksWithThisPrd, m_maxTracksPerPRD.value()) );
643  tsosDetails.m_hitIsShared[index] = numberOfTracksWithThisPrd;
644 
645 
646  // get iterators for range
647  Trk::PRDtoTrackMap::PrepRawDataTrackMap::const_iterator mapIt = range.first;
648  Trk::PRDtoTrackMap::PrepRawDataTrackMap::const_iterator mapItEnd = range.second;
649  // simple for loop instead of fancier remove_if above
650  for ( ;mapIt!=mapItEnd; ++mapIt) {
651  tsosDetails.m_overlappingTracks.insert( std::pair<const Trk::Track*, int >(mapIt->second, index) );
652  tsosDetails.m_tracksSharingHit.insert(std::pair< int, const Trk::Track* >(index, mapIt->second ) );
653  }
654 
655  ATH_MSG_VERBOSE ("-----> Mark this hits as shared -- Try and recover later!");
656  ATH_MSG_VERBOSE ("------ Index: "<< index << " Type: " << tsosDetails.m_detType[index] << " splitprob1 " << tsosDetails.m_splitProb1[index]);
657  tsosDetails.m_type[index] = SharedHit;
658  } // End loop over TSOS's
659 
660  }
661 
662 //==========================================================================================
663 //
664 // look at cluster properties and how often they are used to determine if can stay on track
665 //
667  const Trk::TrackScore score,
668  Trk::ClusterSplitProbabilityContainer &splitProbContainer,
669  Trk::PRDtoTrackMap &prd_to_track_map,
670  TrackHitDetails& trackHitDetails,
671  TSoS_Details& tsosDetails,
672  CacheEntry* ent,
673  int trackId) const
674 {
675 
676  // Can the track automatically be accepted without further checks
677  trackHitDetails.m_trkCouldBeAccepted = true;
678 
679  // Does this track fall into an hadronic ROI?
680  trackHitDetails.m_passHadronicROI = false;
681  if( m_useHClusSeed && inHadronicROI(ptrTrack) ) {
682  trackHitDetails.m_passHadronicROI = true;
683  }
684 
685 
686  //------------------------------------------------------------------//
687  // Should a shared hit be called shared or is it compatible with multiple clusters?
688  // this flag controls if the additional information is conisdered and shared hits on this track
689  // are "recovered" from the shared state to the split state
690  //
691  // First criteria are checked which would NOT allow recovery
692  // Then override criteria are checked
693  bool recoverSharedHits(true);
694  // reasons NOT to consider the information
695  // not above pT for splitting
696  if( ptrTrack->trackParameters()->front()->pT() < m_minPtSplit ) { recoverSharedHits = false; }
697  // score too low
698  if(score <= m_minScoreShareTracks) { recoverSharedHits = false; }
699  // the following 2 cuts use information from the track summary stored in the details struct
700  // not enough SiHits
701  if(trackHitDetails.m_numPixelHits+trackHitDetails.m_numSCTHits < m_minSiHitsToAllowSplitting) {
702  recoverSharedHits = false;
703  }
704  // too many holes
705  if(trackHitDetails.m_numPixelHoles>1) { recoverSharedHits = false; }
706 
707 
708 
709  //------------------------------------------------------------------//
710  //
711  // loop over all measurements, make decisions, increment counters
712  //
713  for (unsigned int index(0); index < tsosDetails.m_nTSoS; ++index ){
714  //Skip all non-measurement TSOS's
715  if (tsosDetails.m_type[index] == OtherTsos) { continue; }
716 
717  // in fillTrackDetails, if an error, cluster could be rejected
718  // also shared TRT hits are rejected there
719  if (tsosDetails.m_type[index] == RejectedHit) { // only generic rejects at that point
720  trackHitDetails.m_trkCouldBeAccepted = false; // we have to remove at least one PRD
721  if (m_observerTool.isEnabled()){
723  }
724  continue;
725  }
726 
727  // Keep all unused hits
728  if (tsosDetails.m_type[index] == UnusedHit ){
729  if ( tsosDetails.m_detType[index] == 3 ) {
730  ++trackHitDetails.m_numTRT_Unused;
731  } else {
732  ++trackHitDetails.m_numUnused;
733  if ( tsosDetails.m_detType[index] == 2 ) { ++trackHitDetails.m_numSCT_Unused; }
734  }
735  continue;
736  }
737 
738  //===================================================================//
739  //
740  // OUTLIERS - not type Outlier is given to both Shared and UnShared hits. Sort it out here
741  // Note in fillTrackDetails, for outliers we saved "1" in m_hitIsShared for any used hit,
742  // even if the true value is higher. As we will reject them here, it does not matter
743  // how many it is shared with
744  // if a pattern track
745  // - used : reject the hit
746  // - unused : call it unused and move on (reintegration of pattern outliers)
747  // if fitted track
748  // - used : reject the hit
749  // - unused : keep it but do not call it an unused hit (not counted towards total SiHit count)
750  //
751  if( tsosDetails.m_type[index] == Outlier ) {
752 
753  // if on another track, get it off of this one
754  // for an outlier, we need to check m_hitIsShared to see if it used
755  if( tsosDetails.m_hitIsShared[index]>0 ) { // hit is used on another track
756  ATH_MSG_VERBOSE( Form("---> Prd is outlier and shared, reject it. %d", index) );
757  rejectHit(trackHitDetails, tsosDetails, index);
758  if (m_observerTool.isEnabled()){
760  }
761  continue;
762  }
763 
764  if(trackHitDetails.m_isPatternTrack) {
765 
766  // For pattern tracks:
767  // if used : reject it --> see above
768  // if unused : reintegrate it and send to track fit
769  ATH_MSG_VERBOSE ( Form("---> Prd is outlier on a pattern track and is unused, %d", index) );
770  // change to unused hit, increment counter
771  tsosDetails.m_type[index] = UnusedHit; // change name so m_numUnused matches types on track
772  ++trackHitDetails.m_numUnused;
773  if( tsosDetails.m_detType[index]%10 == 2 ) { ++trackHitDetails.m_numSCT_Unused; }
774  continue;
775  }
776  else { // is outlier on fitted track and ...
777  // used : reject the hit --> see above
778  // unused: send it through, but do not count it towards the hit content
779  ATH_MSG_DEBUG( Form("---> Prd is outlier on a fitted track and is unused, %d", index) );
780  continue;
781  } // m_isPatternTrack or not
782  } // isOutlier or not
783  //===================================================================//
784 
785  // cleaning cut: fitted track with 1 pixel hit without an IBL hit
786  /* hurts conversion performance, slighly better perf in min-bias without it
787  * but high pT jets can use this in the core
788  if(!trackHitDetails.m_isPatternTrack && // fitted track
789  trackHitDetails.m_numPixelHits==1 && // 1 pixel hit
790  !trackHitDetails.m_thisHasIBLHit && // no IBL hits
791  tsosDetails.m_detType[index]%10 == 1 && // index is the pixel hit
792  !(tsosDetails.m_type[index]==Outlier)) { // and it is not an outlier)
793  ATH_MSG_VERBOSE ("-> Special case, problematic single pixel hit on fitted track, reject it !");
794  TrkCouldBeAccepted = false; // we have to remove at least one PRD
795  tsosDetails.m_type[index] = RejectedHit;
796  continue;
797  }
798  */
799 
800  // At this point, only hits labeled shared from fillTrackDetails
801  if( tsosDetails.m_type[index] != SharedHit ) {
802  ATH_MSG_ERROR("A NON-Shared hit is being treated as one!");
803  }
804 
805  //===================================================================//
806  // Try and recover shared hits if
807  // - pixel cluster splitting flag is turned on
808  // - track passes criteria for cluster splitting
809  // - is a pixel hit
810  if ( m_doPixelClusterSplitting && recoverSharedHits && tsosDetails.m_detType[index]%10 == 1 ) {
811 
812  //Find the index of the previous measurement on track
813  int indexPreviousMeasurement = tsosDetails.findIndexOfPreviousMeasurement(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]);
819  }
820 
821  // If the previous measurement is a shared pixel and the current pixel
822  // - wants to be shared
823  // - and is compatible with being from multiple clusters
824  // allow the previous measurement to be shared with up to m_maxTracksPerPRD tracks without penalty
825  if ( indexPreviousMeasurement >= 0 &&
826  tsosDetails.m_type[indexPreviousMeasurement] == SharedHit &&
827  tsosDetails.m_hitIsShared[indexPreviousMeasurement] < m_maxTracksPerPRD &&
828  clusCanBeSplit(tsosDetails.m_splitProb1[index],tsosDetails.m_splitProb2[index]) ) {
829 
830  // Check if the previous shared hit shared on the same track as this one
831  bool sharedbetweenthesametracks = false;
832  auto previousHitsSharedTracks = tsosDetails.m_tracksSharingHit.equal_range(indexPreviousMeasurement);
833  auto currentHitsSharedTracks = tsosDetails.m_tracksSharingHit.equal_range(index);
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;
840  break;
841  }
842  }
843  if (sharedbetweenthesametracks) break;
844  }
845  if (sharedbetweenthesametracks){
846  sharedToSplitPix(trackHitDetails, tsosDetails, indexPreviousMeasurement);
847  }
848  }
849 
850  //
851  // Check the number network.
852  // - check if the particle is compatible with 2 particles
853  // - else check if particle is compatible with >= 3 particles
854  // - else it is a 1 particle cluster
855  // Is a 2 particle cluster?
856  if ( isTwoPartClus(tsosDetails.m_splitProb1[index],tsosDetails.m_splitProb2[index]) ) {
857 
858  // can be split, but how many accepted tracks use the hit?
859  // okay to share
860  if (tsosDetails.m_hitIsShared[index] < m_maxPixTwoPartCluster) {
861  ATH_MSG_VERBOSE ("---> Pixel cluster is to be split shared with another track: Split Prob1 " << tsosDetails.m_splitProb1[index] );
862  tsosDetails.m_type[index] = SplitSharedHit;
863  ++trackHitDetails.m_numSplitSharedPix;
864  continue;
865  } else if(m_shareSplitHits && tsosDetails.m_hitIsShared[index] == m_maxPixTwoPartCluster) {
866  // if we allow split hits to also be shared
867  // - the first m_maxPixTwoPartCluster cluster get to use it without penalty
868  // - the m_maxPixTwoPartCluster+1 cluster gets called shared
869  ATH_MSG_VERBOSE ("---> Pixel cluster is split, but must be called shared to stay on this track!");
870  addSharedHit(trackHitDetails, tsosDetails, index);
871  continue;
872  } else {
873  ATH_MSG_VERBOSE ("---> Pixel split but shared between too many tracks -- will be removed from the track!!!");
874  rejectHitOverUse(trackHitDetails, tsosDetails, index);
875  if (m_observerTool.isEnabled()){
877  }
878  continue;
879  }
880 
881  // Is a 3+ particle cluster?
882  } else if ( isMultiPartClus(tsosDetails.m_splitProb2[index]) ) {
883 
884  // can be split, but how many accepted tracks use the hit?
885  // okay to share
886  if (tsosDetails.m_hitIsShared[index] < m_maxPixMultiCluster ){
887  ATH_MSG_VERBOSE ("---> Pixel cluster is to be split shared with another track: Split Prob2 " << tsosDetails.m_splitProb2[index] );
888  tsosDetails.m_type[index] = SplitSharedHit;
889  ++trackHitDetails.m_numSplitSharedPix;
890  continue;
891  } else if(m_shareSplitHits && tsosDetails.m_hitIsShared[index] == m_maxPixMultiCluster) {
892  // if we allow split hits to also be shared
893  // - the first m_maxPixMultiCluster cluster get to use it without penalty
894  // - the m_maxPixMultiCluster+1 cluster gets called shared
895  ATH_MSG_VERBOSE ("---> Pixel cluster is split, but must be called shared to stay on this track!");
896  addSharedHit(trackHitDetails, tsosDetails, index);
897  continue;
898  } else {
899  ATH_MSG_VERBOSE ("---> Pixel split but shared between too many tracks -- will be removed from the track!!!");
900  rejectHitOverUse(trackHitDetails, tsosDetails, index);
901  if (m_observerTool.isEnabled()){
903  }
904  continue;
905  }
906 
907  } // end of checking number network output
908 
909  ATH_MSG_VERBOSE("---> Pixel cluster is not compatible with being shared (splitProb1 = "
910  << tsosDetails.m_splitProb1[index] << "), (splitProb2 = "
911  << tsosDetails.m_splitProb2[index] << ") , reject shared hit !!!");
912  if ( tsosDetails.m_hitIsShared[index] < m_maxPixOnePartCluster ) {
913  // this is a shared cluster
914  addSharedHit(trackHitDetails, tsosDetails, index);
915  continue;
916  } else {
917  ATH_MSG_DEBUG ("reject track; Too many hits shared - we have to remove at least one PRD");
918  rejectHitOverUse(trackHitDetails, tsosDetails, index);
919  if (m_observerTool.isEnabled()){
921  }
922  continue;
923  }
924  }// End Attempt to recover shared hits
925  //===================================================================//
926 
927  if( tsosDetails.m_hitIsShared[index] == 0 ) {
928  ATH_MSG_ERROR("A hit is not shared but is where only shared hits should be");
929  }
930 
931  //For all other shared hits
932  if ( tsosDetails.m_hitIsShared[index] < m_maxTracksPerPRD ){ // we do not allow to share with too many tracks
933  ATH_MSG_VERBOSE ("---> Shared hit, but good track, let's enter hit in the list and try to keep it !");
934  ATH_MSG_VERBOSE ("----- Index: "<< index << " Type: " << tsosDetails.m_detType[index] << " splitprob1 " << tsosDetails.m_splitProb1[index]);
935  addSharedHit(trackHitDetails, tsosDetails, index);
936  continue;
937  } else {
938  ATH_MSG_DEBUG ("reject track; Too many hits shared - we have to remove at least one PRD");
939  rejectHitOverUse(trackHitDetails, tsosDetails, index);
940  if (m_observerTool.isEnabled()){
942  }
943  continue;
944  }
945  ATH_MSG_ERROR("Reached end of TSOS loop without a decision." );
946  } // loop over TSOS
947  //------------------------------------------------------------------//
948 
949  //------------------------------------------------------------------//
950  //
951  // COUNTERS have been set above. From here on, if change the state
952  // of any hit, must also adjust counters
953  //
954  //------------------------------------------------------------------//
955 
956  //------------------------------------------------------------------//
957  // Check if the pair is compatible with being a light particle decay
958  // This focuses on conversions
959  // The track in question must
960  // - have an overlapping hit with an accepted track
961  // - those two track have a small separation
962  //
963  trackHitDetails.m_passConversionSel = false; // make sure off to start
964  if (m_doPairSelection && !tsosDetails.m_overlappingTracks.empty()) {
965  trackHitDetails.m_passConversionSel = performConversionCheck(ptrTrack,
966  prd_to_track_map, trackHitDetails, tsosDetails);
967  }
968  //------------------------------------------------------------------//
969 
970  //------------------------------------------------------------------//
971  // Also check if the pair is compatible with being a boosted hadronic topology.
972  // This branch focuses on high-pt taus and b-jets in particular
973  // Same conditions as above.
974  // Do not process any track already modified by the conversion check
975  //
976  if (m_useHClusSeed && !trackHitDetails.m_passConversionSel && trackHitDetails.m_passHadronicROI &&
977  m_doPairSelection && !tsosDetails.m_overlappingTracks.empty()) {
978  trackHitDetails.m_passConversionSel = performHadDecayCheck(ptrTrack,
979  prd_to_track_map, trackHitDetails, tsosDetails);
980  }
981 
982  //------------------------------------------------------------------//
983  //
984  // Three cuts which can pull shared hits off of the track (no order)
985  // 1. min unique SCT hits to share hits
986  // 2. min chi2/ndf to share hits
987  //
988  // We shared SCT hits when we don't really have enough to share
989  // Reject SCT shared hits on the track
990  if ( trackHitDetails.m_numSCT_Unused != trackHitDetails.m_numSCTHits && // have shared SCT
991  trackHitDetails.m_numSCT_Unused < m_minUniqueSCTHits ){
992  for (unsigned int index( 0 ); index > tsosDetails.m_nTSoS; ++index ){
993  if ( tsosDetails.m_detType[index]==2 && tsosDetails.m_type[index] == SharedHit){
994  rejectSharedHit(trackHitDetails, tsosDetails, index);
995  if (m_observerTool.isEnabled()){
997  }
998  }
999  }
1000  }
1001 
1002  // Cut on chi2/NDF if shared hits on track
1003  // if fail cuts, remove all shared hits and reject track
1004  if ( !trackHitDetails.m_isPatternTrack && trackHitDetails.m_numShared > 0) {
1005  double trackchi2 = 0;
1006  if (ptrTrack->fitQuality() && ptrTrack->fitQuality()->numberDoF()>0 ) {
1007  trackchi2 = ptrTrack->fitQuality()->chiSquared()/ptrTrack->fitQuality()->numberDoF();
1008  }
1009 
1010  // if track fails cut for shared hits, remove the shared hits
1011  if ( trackchi2 > m_minTrackChi2ForSharedHits ) {
1012  ATH_MSG_DEBUG ("Shared hits, we have a bad chi2 track, mark it as bad !");
1013  // remove shared hits and see if track survives
1014  for (unsigned int index( 0 ); index > tsosDetails.m_nTSoS; ++index ){
1015  if ( tsosDetails.m_type[index] != SharedHit ) { continue; }
1016  rejectSharedHit(trackHitDetails, tsosDetails, index);
1017  if (m_observerTool.isEnabled()){
1019  }
1020  }
1021  } // fails cut
1022  } // is not a pattern track and has shared hits
1023 
1024  //------------------------------------------------------------------//
1025 
1026 
1027  //------------------------------------------------------------------//
1028  // Check accepted tracks with the surviving list of shared hits
1029  // Remove shared hits which push track over shared module cut
1030  // Set flags
1031  //
1032  // add up weighted count of shared hits on track, start removing
1033  // hits after counter is above cut. This preferences inner hits
1034  int newNumWeightedShared = 0; // tmp counter
1035  bool firstMeasurement(true);
1036  trackHitDetails.m_firstPixIsShared = false;
1037  // was already set in fillTrackDetails, but set again depending if blayer was rejected or not
1038  trackHitDetails.m_thisHasIBLHit = false;
1039  for (unsigned int index(0); index <tsosDetails.m_nTSoS; ++index ){
1040 
1041  // don't count rejected hits when setting flags
1042  if (tsosDetails.m_type[index] == RejectedHitOverUse ||
1043  tsosDetails.m_type[index] == RejectedHitInvalid ||
1044  tsosDetails.m_type[index] == RejectedHit ){ continue; }
1045 
1046  // Any track which is still labeled as SharedHit has to be checked
1047  // against the accepted tracks. Accepted track should not be pushed
1048  // above cuts imposed here, some historic cuts remain
1049  if (tsosDetails.m_type[index] == SharedHit) {
1050 
1051  int maxiShared = -1;
1052  int maxOtherNPixel = 0;
1053  bool maxOtherHasIBL = false;
1054  bool otherPassMinUniqueHits = checkOtherTracksValidity( tsosDetails, index,
1055  splitProbContainer, prd_to_track_map, maxiShared, maxOtherNPixel,
1056  maxOtherHasIBL, ent);
1057 
1058  if (!otherPassMinUniqueHits) {
1059  ATH_MSG_DEBUG ("reject track; Tracks shared hits does not leave enough unique hits on accepted track");
1060  rejectSharedHitInvalid(trackHitDetails, tsosDetails, index);
1061  if (m_observerTool.isEnabled()){
1063  }
1064  continue;
1065  }
1066 
1067  //
1068  // do not allow other accepted track to exceed the shared limit...
1069  // ...IF first pixel hit is shared (historic cut)
1070  // NOTE: here "pixel" includes IBL
1071  // tightening cut by dropping shared hit clause impacts performance in high pT jet cores
1072  if( maxiShared >= ent->m_maxSharedModules ){
1073 
1074  // if this is the first hit (it is shared), and a pixel, reject
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");
1077  rejectSharedHitInvalid(trackHitDetails, tsosDetails, index);
1078  if (m_observerTool.isEnabled()){
1080  }
1081  continue;
1082  }
1083  // if first pixel was shared (and this is not that hit)
1084  if( trackHitDetails.m_firstPixIsShared ) {
1085  ATH_MSG_DEBUG ("reject track; Tracks shared hits pushes accepted track above shared module limit");
1086  rejectSharedHitInvalid(trackHitDetails, tsosDetails, index);
1087  if (m_observerTool.isEnabled()){
1089  }
1090  continue;
1091  }
1092 
1093  // unlinked (no truth particle) tracks tend to have low hit counts
1094  // don't let track that look like this touch accepted tracks (new)
1095  if( trackHitDetails.totalPixelHits() < m_minPixHitAccepted ) {
1096  rejectSharedHitInvalid(trackHitDetails, tsosDetails, index);
1097  if (m_observerTool.isEnabled()){
1099  }
1100  continue;
1101  }
1102 
1103  } // accepted track exceeds shared module cuts
1104 
1105 
1106  //
1107  // only allow shared pixel if both have IBL or both not (historic cut)
1108  // if this is IBL hit, and other does not have IBL hit, remove shared IBL hit
1109  if( tsosDetails.m_detType[index] == 11 && !maxOtherHasIBL ) {
1110  ATH_MSG_VERBOSE ("---> Remove shared IBL as MaxShared accepted does not have an IBL hit");
1111  rejectSharedHit(trackHitDetails, tsosDetails, index);
1112  if (m_observerTool.isEnabled()){
1114  }
1115  continue;
1116  }
1117  // if this is pixel hit, and candidate does not match IBL content of MaxShared accepted, remove shared hit
1118  if(tsosDetails.m_detType[index] == 1 && (trackHitDetails.m_thisHasIBLHit != maxOtherHasIBL) ) {
1119  ATH_MSG_VERBOSE ("---> Only allow shared pixel if candidate and accepted have same IBL hit content");
1120  rejectSharedHit(trackHitDetails, tsosDetails, index);
1121  if (m_observerTool.isEnabled()){
1123  }
1124  continue;
1125  }
1126 
1127  // number of shared modules to be added to new sub-track
1128  // add shared hit to temporary counter
1129  newNumWeightedShared += (tsosDetails.m_detType[index]%10== 1 ? 2 : 1); // increase counter
1130  // should remain below the threshold
1131  if (newNumWeightedShared >= ent->m_maxSharedModules) {
1132  ATH_MSG_VERBOSE ("-> Too many share hits, dropping outer hit(s) "
1133  << newNumWeightedShared << "\t" << ent->m_maxSharedModules);
1134  newNumWeightedShared -= (tsosDetails.m_detType[index]%10== 1 ? 2 : 1); // decrease counter
1135  rejectSharedHit(trackHitDetails, tsosDetails, index);
1136  if (m_observerTool.isEnabled()){
1138  }
1139  continue;
1140  }
1141 
1142  //------------------------------------------//
1143  // if still shared and not rejected by above, set flags
1144  if( tsosDetails.m_detType[index] % 10 == 1 ) {
1145  if (firstMeasurement) {
1146  trackHitDetails.m_firstPixIsShared = true;
1147  }
1148  if (tsosDetails.m_detType[index] == 11 ){ // Blayer
1149  trackHitDetails.m_hasSharedIBLHit = true;
1150  } else if ( tsosDetails.m_detType[index] == 1 ){
1151  trackHitDetails.m_hasSharedPixel = true; // historic definition
1152  }
1153  } // pixel hit
1154 
1155  } // if shared
1156 
1157  if (tsosDetails.m_detType[index] == 11 ){ // Blayer
1158  trackHitDetails.m_thisHasIBLHit = true;
1159  }
1160  if (firstMeasurement && tsosDetails.m_type[index] != OtherTsos){ firstMeasurement = false; }
1161 
1162  } // loop over TSOS
1163  //------------------------------------------------------------------//
1164 
1165  if (msgLvl(MSG::VERBOSE)){
1166  trackHitDetails.dumpInfo();
1167  }
1168 
1169  if (m_observerTool.isEnabled()){
1170  // calculate average split probabilities
1171  float splitProbAvg1 = -2;
1172  if (!tsosDetails.m_splitProb1.empty()){
1173  splitProbAvg1 = std::accumulate(tsosDetails.m_splitProb1.begin(), tsosDetails.m_splitProb1.end(), 0.0) / tsosDetails.m_splitProb1.size();
1174  }
1175  float splitProbAvg2 = -2;
1176  if (!tsosDetails.m_splitProb2.empty()){
1177  splitProbAvg2 = std::accumulate(tsosDetails.m_splitProb2.begin(), tsosDetails.m_splitProb2.end(), 0.0) / tsosDetails.m_splitProb2.size();
1178  }
1179  m_observerTool->updateHolesSharedHits(trackId,
1180  trackHitDetails.m_numPixelHoles,
1181  trackHitDetails.m_numSCTHoles,
1182  trackHitDetails.m_numSplitSharedPix,
1183  trackHitDetails.m_numSplitSharedSCT,
1184  -2,
1185  -2,
1186  trackHitDetails.m_numShared,
1187  trackHitDetails.m_isPatternTrack,
1188  trackHitDetails.totalSiHits(),
1189  trackHitDetails.m_passHadronicROI,
1190  trackHitDetails.m_thisHasIBLHit,
1191  trackHitDetails.m_hasSharedIBLHit,
1192  trackHitDetails.m_hasSharedPixel,
1193  trackHitDetails.m_firstPixIsShared,
1194  trackHitDetails.m_numPixelDeadSensor,
1195  trackHitDetails.m_numSCTDeadSensor,
1196  trackHitDetails.m_numPixelHits,
1197  trackHitDetails.m_numSCTHits,
1198  trackHitDetails.m_numUnused,
1199  trackHitDetails.m_numTRT_Unused,
1200  trackHitDetails.m_numSCT_Unused,
1201  trackHitDetails.m_numPseudo,
1202  splitProbAvg1,
1203  splitProbAvg2,
1204  trackHitDetails.m_numWeightedShared);
1205  }
1206 
1207  } // decideWhichHitsToKeep
1208 
1209 //==========================================================================================
1210 
1211 // GOAL: Do not kill conversions in the ambi
1213  Trk::PRDtoTrackMap &prd_to_track_map,
1214  TrackHitDetails& trackHitDetails,
1215  TSoS_Details& tsosDetails) const
1216 {
1217  ATH_MSG_DEBUG(" Conversion Check ");
1218 
1219  // We need to have a good number of unshared SCT hits
1220  if ( trackHitDetails.m_numSCT_Unused < m_minUniqueSCTHits ) { return false; }
1221  if ( trackHitDetails.m_numPixelHoles + trackHitDetails.m_numSCTHoles >= 2) { return false; }
1222 
1223  //Find the accepted track that shares the most hits our proposed track
1224  const Trk::Track* mostOverlappingTrack(nullptr);
1225  int mostOverlappingNumberOfHits(0);
1226  int indexOfFirstOverlappingHit(0);
1228  end = tsosDetails.m_overlappingTracks.end(); it != end;
1229  it = tsosDetails.m_overlappingTracks.upper_bound(it->first) ) {
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;
1236  }
1237  } // loop over overlapping tracks
1238 
1239  if(!mostOverlappingTrack) { return false; }
1240 
1241  // criteria applied for fitted and pattern tracks
1242  if(mostOverlappingNumberOfHits < 2) { return false; }
1243  if(mostOverlappingNumberOfHits < trackHitDetails.m_numShared) { return false; }
1244 
1245 
1246  //If an overlapping track if found get the track parameters on the first shared surface
1247  auto tpPair = getOverlapTrackParameters(indexOfFirstOverlappingHit, ptrTrack, mostOverlappingTrack, prd_to_track_map, trackHitDetails.m_numSplitSharedPix );
1248 
1249  // If found track parameters at first overlapping track, check separation
1250  if (tpPair.first && tpPair.second) {
1251  // Check a series of criteria to see if track is a compatible with a photon conversion
1252  // Check if both tracks are above threshold
1253  if(tpPair.first->pT() <= m_minPairTrackPt || tpPair.second->pT() <= m_minPairTrackPt) {
1254  return false;
1255  }
1256  //Check if it is in a ROI, if requested
1257  if(m_useEmClusSeed) {
1258  if(!isEmCaloCompatible( *tpPair.first )) { return false; }
1259  }
1260  ATH_MSG_DEBUG ("Possible photon conversion");
1261  }
1262  // for pattern tracks, cannot get the track parameters at a hit position
1263  // Need an alternate way to find conversion, try to use the accepted track
1264  // Main point is to not kill the pattern track
1265  else if ( trackHitDetails.m_isPatternTrack ) {
1266  if(m_useEmClusSeed && tpPair.second ) {
1267  if(!isEmCaloCompatible( *tpPair.second )) { return false; }
1268  }
1269  ATH_MSG_DEBUG ("Possible photon conversion - for pattern track");
1270  }
1271  // if cannot find track parameters, and not a pattern track, then failed
1272  else {
1273  return false;
1274  }
1275 
1276  ATH_MSG_DEBUG ("Number of unused SCT hits: " << trackHitDetails.m_numSCT_Unused);
1277  if (msgLvl(MSG::DEBUG)){
1278  trackHitDetails.dumpInfo();
1279  }
1280  ATH_MSG_DEBUG ("Track "<< mostOverlappingTrack << " shares " << mostOverlappingNumberOfHits );
1281 
1282  updateSharedForCollimated(trackHitDetails, tsosDetails);
1283 
1284  return true;
1285 } // performConversionCheck
1286 
1287 
1288 // GOAL: Do not kill light particle decays in dense jets in the ambi.
1289 // Based on conversion logic, but tuned towards later decays
1290 // Heavily borrows from performConversionCheck, but
1291 // separate implementation to for allow future fine-tuning
1292 // distinct from the conversion version.
1294  Trk::PRDtoTrackMap &prd_to_track_map,
1295  TrackHitDetails& trackHitDetails,
1296  TSoS_Details& tsosDetails) const
1297 {
1298  ATH_MSG_DEBUG(" Hadron decay Check ");
1299 
1300  // We need to have a good number of unshared SCT hits
1301  if ( trackHitDetails.m_numSCT_Unused < m_minUniqueSCTHits ) { return false; }
1302  if ( trackHitDetails.m_numPixelHoles + trackHitDetails.m_numSCTHoles >= 2) { return false; }
1303 
1304  //Find the accepted track that shares the most hits our proposed track
1305  const Trk::Track* mostOverlappingTrack(nullptr);
1306  int mostOverlappingNumberOfHits(0);
1307  int indexOfFirstOverlappingHit(0);
1309  end = tsosDetails.m_overlappingTracks.end(); it != end;
1310  it = tsosDetails.m_overlappingTracks.upper_bound(it->first) ) {
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;
1317  }
1318  } // loop over overlapping tracks
1319 
1320  if(!mostOverlappingTrack) { return false; }
1321 
1322  // criteria applied for fitted and pattern tracks
1323  if(mostOverlappingNumberOfHits < 2) { return false; }
1324  if(mostOverlappingNumberOfHits < trackHitDetails.m_numShared) { return false; }
1325 
1326 
1327  //If an overlapping track if found get the track parameters on the first shared surface
1328  auto tpPair = getOverlapTrackParameters(indexOfFirstOverlappingHit, ptrTrack, mostOverlappingTrack, prd_to_track_map, trackHitDetails.m_numSplitSharedPix );
1329 
1330  // If found track parameters at first overlapping track, check separation
1331  if (tpPair.first && tpPair.second) {
1332  // Check a series of criteria to see if track is a compatible with a boosted decay
1333  // Check if both tracks are above threshold
1334  if(tpPair.first->pT() <= m_minPairTrackPt || tpPair.second->pT() <= m_minPairTrackPt) {
1335  return false;
1336  }
1337  //Check if it is in a ROI, if requested
1338  if(m_useHClusSeed) {
1339  if(!isHadCaloCompatible( *tpPair.first )) { return false; }
1340  }
1341  ATH_MSG_DEBUG ("Possible boosted decay");
1342  }
1343  // for pattern tracks, cannot get the track parameters at a hit position
1344  else if ( trackHitDetails.m_isPatternTrack ) {
1345  if(m_useHClusSeed && tpPair.second ) {
1346  if(!isHadCaloCompatible( *tpPair.second )) { return false; }
1347  }
1348  ATH_MSG_DEBUG ("Possible boosted decay - for pattern track");
1349  }
1350  // if cannot find track parameters, and not a pattern track, then failed
1351  else {
1352  return false;
1353  }
1354 
1355  ATH_MSG_DEBUG ("Number of unused SCT hits: " << trackHitDetails.m_numSCT_Unused);
1356  if (msgLvl(MSG::DEBUG)){
1357  trackHitDetails.dumpInfo();
1358  }
1359  ATH_MSG_DEBUG ("Track "<< mostOverlappingTrack << " shares " << mostOverlappingNumberOfHits );
1360 
1361  updateSharedForCollimated(trackHitDetails, tsosDetails);
1362 
1363  return true;
1364 }
1365 
1367  TSoS_Details& tsosDetails) const{
1368  //Change all shared SCT to SplitSharedHit
1369  ATH_MSG_VERBOSE ("Updating SCT hit information");
1370 
1371  trackHitDetails.m_numSplitSharedPix = 0; // reset counter
1372  trackHitDetails.m_numSplitSharedSCT = 0; // reset counter
1373  trackHitDetails.m_numShared = 0; // reset counter
1374  trackHitDetails.m_numSCT_Shared = 0; // reset counter
1375  trackHitDetails.m_numWeightedShared = 0; // reset counter
1376 
1377  trackHitDetails.m_hasSharedIBLHit = false; // reset flag
1378  trackHitDetails.m_hasSharedPixel = false; // reset flag
1379 
1380  //Update counts but only allow 1 pixel hit to be updated free of charge
1381  int noUpdatedPixels = 0;
1382 
1383  for (unsigned int index(0); index < tsosDetails.m_nTSoS; ++index ){
1384  // Dont change blayer only pixel hits -- all other shared hits become splitshared
1385  if ( noUpdatedPixels < 1 && tsosDetails.m_detType[index]==1 && tsosDetails.m_type[index] == SharedHit ){
1386  ++noUpdatedPixels;
1387  tsosDetails.m_type[index] = SplitSharedHit;
1388  }
1389 
1390  if ( tsosDetails.m_detType[index]==1 && tsosDetails.m_type[index] == SplitSharedHit ){
1391  ++trackHitDetails.m_numSplitSharedPix;
1392  }
1393 
1394  if ( tsosDetails.m_detType[index]==2 && tsosDetails.m_type[index] == SharedHit ){
1395  tsosDetails.m_type[index] = SplitSharedHit;
1396  }
1397 
1398  if ( tsosDetails.m_detType[index]==2 && tsosDetails.m_type[index] == SplitSharedHit ){
1399  ++trackHitDetails.m_numSplitSharedSCT;
1400  }
1401 
1402  // only change shared hits
1403  // m_numUnused and m_numSCT_Unused are not changed from this
1404  if (tsosDetails.m_type[index] != SharedHit){ continue; }
1405 
1406  increaseSharedHitCounters( trackHitDetails,
1407  (tsosDetails.m_detType[index]%10 == 1),
1408  (tsosDetails.m_detType[index]%10 == 2) );
1409 
1410  // set flags
1411  if (tsosDetails.m_detType[index] == 11){
1412  trackHitDetails.m_hasSharedIBLHit = true;
1413  } else if ( tsosDetails.m_detType[index] == 1 ){
1414  trackHitDetails.m_hasSharedPixel = true;
1415  }
1416 
1417  } // loop over TSOS
1418 }
1419 
1420 //==========================================================================================
1421 Trk::Track* InDet::InDetDenseEnvAmbiTrackSelectionTool::createSubTrack( const std::vector<const Trk::TrackStateOnSurface*>& tsos, const Trk::Track* track ) const
1422 {
1423  std::vector<const Trk::TrackStateOnSurface*>::const_iterator tsosit=tsos.begin();
1424  int nmeas=0;
1425  for (;tsosit!=tsos.end();++tsosit){
1426  if ((**tsosit).type(Trk::TrackStateOnSurface::Measurement)) ++nmeas;
1427  }
1428  if (nmeas<3) {
1429  ATH_MSG_DEBUG ("Less than 3 measurements, reject track !");
1430  return nullptr;
1431  }
1432 
1433  auto vecTsos = std::make_unique<Trk::TrackStates>();
1434 
1435  // loop over TSOS, copy TSOS and push into vector
1436  for (const Trk::TrackStateOnSurface* iTsos : tsos) {
1437  const Trk::TrackStateOnSurface* newTsos = new Trk::TrackStateOnSurface(*iTsos);
1438  vecTsos->push_back(newTsos);
1439  }
1440 
1442  info.addPatternRecoAndProperties(track->info());
1443  Trk::TrackInfo newInfo;
1445  info.addPatternReco(newInfo);
1446 
1447  Trk::Track* newTrack = new Trk::Track(info, std::move(vecTsos),nullptr);
1448 
1449  return newTrack;
1450 
1451 }
1452 
1453 //==========================================================================================
1455  Trk::ClusterSplitProbabilityContainer &splitProbContainer) const
1456 {
1457 
1458  for (unsigned int index(0); index < tsosDetails.m_nTSoS; ++index ){
1459  //Only consider split shared hits
1460  if (tsosDetails.m_type[index] != SplitSharedHit)
1461  continue;
1462 
1463  // And the hit is a pixel hit
1464  if (tsosDetails.m_detType[index]%10 == 1){
1465  if (const auto * pThisPrd(tsosDetails.m_RIO[index]->prepRawData());pThisPrd->type(Trk::PrepRawDataType::PixelCluster)){
1466  const InDet::PixelCluster* pixelCluster = static_cast<const InDet::PixelCluster*> ( pThisPrd );
1468  if (!splitProb) {
1469  splitProb = &(splitProbContainer.setSplitInformation(pixelCluster,0.f,0.f));
1470  }
1471  splitProb->setSplit(true);
1472  } else {
1473  ATH_MSG_WARNING("Cast of a pixel cluster failed????");
1474  }
1475  }
1476  }
1477 }
1478 
1479 
1480 //==========================================================================================
1482 {
1483 
1484  if ( !ptrTrack->trackParameters()->front() ){ return false; }
1485  // above pT for ROI?
1486  if ( ptrTrack->trackParameters()->front()->pT() < m_minPtBjetROI ) { return false; }
1487 
1488  return isHadCaloCompatible(*ptrTrack->trackParameters()->front());
1489 }
1490 
1492 {
1494  if (!calo.isValid()) {
1495  ATH_MSG_ERROR("Failed to get Had Calo cluster collection " << m_inputHadClusterContainerName );
1496  return false;
1497  }
1498 
1499  return calo->hasMatchingROI(Tp.momentum().phi(), Tp.eta(), 0. /* ignore r of Tp*/, Tp.position().z(), m_phiWidth, m_etaWidth);
1500 }
1501 
1502 //==========================================================================================
1504 {
1506  if (!calo.isValid()) {
1507  ATH_MSG_ERROR("Failed to get EM cluster container " << m_inputEmClusterContainerName);
1508  return false;
1509  }
1510  return calo->hasMatchingROI(Tp.momentum().phi(), Tp.momentum().eta(), Tp.position().perp(), Tp.position().z(), m_phiWidthEm, m_etaWidthEm);
1511 }
1512 
1513 
1514 
1515 std::pair<const Trk::TrackParameters*, const Trk::TrackParameters*>
1517  const Trk::Track* track2,
1518  const Trk::PRDtoTrackMap &prd_to_track_map,
1519  int splitSharedPix ) const
1520 {
1521 
1522  auto returnPair = std::make_pair<const Trk::TrackParameters*,const Trk::TrackParameters*>(0,0);
1523 
1524  //
1525  // Get the TSOS in question from the candidate track since we know which one it is (index)
1526  // Do some basic checks
1527  //
1528  const Trk::TrackStates* track1tsos = track1->trackStateOnSurfaces();
1529 
1530  auto firstTsos = track1tsos->begin();
1531  firstTsos += index;
1532  const auto *firstMeas = (*firstTsos)->measurementOnTrack();
1533 
1534  if (!firstMeas){
1535  ATH_MSG_ERROR("This is not a measurement!");
1536  return returnPair;
1537  }
1538 
1539  if (not firstMeas->type(Trk::MeasurementBaseType::RIO_OnTrack)) {
1540  ATH_MSG_DEBUG("This measurement is not a ROT");
1541  return returnPair;
1542  }
1543 
1544  const auto *firstRot = static_cast <const Trk::RIO_OnTrack*> (firstMeas);
1545  if ( !prd_to_track_map.isUsed(*(firstRot->prepRawData()))){
1546  ATH_MSG_ERROR("This hist is not shared");
1547  return returnPair;
1548  }
1549 
1550 
1551  //
1552  // now, get TSOS from 2nd track which is the one already accepted
1553  // we know it was fitted so this should be possible
1554  const Trk::TrackStates* track2tsos = track2->trackStateOnSurfaces();
1555 
1556  auto iTsos = track2tsos->begin();
1557  auto iTsosEnd = track2tsos->end();
1558  int measurementsBeforeShared = 0;
1559  for (; iTsos != iTsosEnd ; ++iTsos) {
1560 
1561  // only compare to number of split hits? Why not shared also for NN inefficienicies
1562  if (measurementsBeforeShared > 1 + splitSharedPix ){
1563  ATH_MSG_DEBUG("Too many hits to before shared hit -- unlikely they are from the same thing");
1564  return returnPair;
1565  }
1566 
1567  // get measurment from TSOS
1568  const auto *meas = (*iTsos)->measurementOnTrack();
1569 
1570  // if we do not have a measurement, we should just mark it
1571  if (!meas) {
1572  continue;
1573  }
1574 
1575 
1576  if (not meas->type(Trk::MeasurementBaseType::RIO_OnTrack)) {
1577  continue;
1578  }
1579  const Trk::RIO_OnTrack* rot = static_cast <const Trk::RIO_OnTrack*> (meas);
1580  if (rot->prepRawData() != firstRot->prepRawData()){
1581  ++measurementsBeforeShared;
1582  continue;
1583  }
1584 
1585  if (!(*iTsos)->trackParameters()){
1586  ATH_MSG_DEBUG("There are no TrackParameters on this TSOS");
1587  return returnPair;
1588  }
1589 
1590  returnPair.second = (*iTsos)->trackParameters();
1591  ATH_MSG_DEBUG("Success! track parameters for accepted track " << returnPair.second );
1592  break;
1593  }
1594 
1595 
1596  //
1597  // Now let's see if we have TPs for the candidate track
1598  //
1599 
1600  if (!(*firstTsos)->trackParameters()){
1601  ATH_MSG_DEBUG("There are no TrackParameters on this TSOS");
1602  return returnPair;
1603  }
1604 
1605  returnPair.first = (*firstTsos)->trackParameters();
1606 
1607 
1608  ATH_MSG_DEBUG("Success! track parameters for both tracks " << returnPair.first<< " " << returnPair.second );
1609 
1610  return returnPair;
1611 
1612 }
1613 
1614 
1615 //============================================================================================
1616 //
1617 inline bool InDet::InDetDenseEnvAmbiTrackSelectionTool::clusCanBeSplit(float splitProb1, float splitProb2) const
1618 {
1619  return ( isTwoPartClus(splitProb1, splitProb2) || isMultiPartClus(splitProb2) );
1620 }
1621 inline bool InDet::InDetDenseEnvAmbiTrackSelectionTool::isTwoPartClus(float splitProb1, float splitProb2) const
1622 {
1623  return ( (splitProb1 >= m_sharedProbCut) && (splitProb2 < m_sharedProbCut2) );
1624 }
1626 {
1627  return ( splitProb2 >= m_sharedProbCut2 );
1628 }
1629 //============================================================================================
1630 //
1631 //============================================================================================
1633  TSoS_Details& tsosDetails, int index) {
1634  trackHitDetails.m_trkCouldBeAccepted = false; // we have to remove at least one PRD
1635  tsosDetails.m_type[index] = RejectedHitOverUse;
1636 }
1638  TSoS_Details& tsosDetails, int index) {
1639  trackHitDetails.m_trkCouldBeAccepted = false; // we have to remove at least one PRD
1640  tsosDetails.m_type[index] = RejectedHit;
1641 }
1642 // used after counters have been set
1644  TSoS_Details& tsosDetails, int index) {
1645  rejectHit(trackHitDetails, tsosDetails, index); // reject
1646  decreaseSharedHitCounters( trackHitDetails,
1647  (tsosDetails.m_detType[index]%10 == 1),
1648  (tsosDetails.m_detType[index]%10 == 2) );
1649 }
1650 // used after counters have been set
1652  TSoS_Details& tsosDetails, int index) {
1653  trackHitDetails.m_trkCouldBeAccepted = false;
1654  tsosDetails.m_type[index] = RejectedHitInvalid; // do not use rejectHit function since use this flag
1655  decreaseSharedHitCounters( trackHitDetails,
1656  (tsosDetails.m_detType[index]%10 == 1),
1657  (tsosDetails.m_detType[index]%10 == 2) );
1658 }
1659 // used after counters have been set
1661  TSoS_Details& tsosDetails, int index) {
1662  // from shared
1663  decreaseSharedHitCounters( trackHitDetails, true, false ); // isPix=true
1664  // to split
1665  tsosDetails.m_type[index] = SplitSharedHit;
1666  trackHitDetails.m_numSplitSharedPix++;
1667 }
1669  TSoS_Details& tsosDetails, int index) {
1670  tsosDetails.m_type[index] = SharedHit;
1671  increaseSharedHitCounters( trackHitDetails, (tsosDetails.m_detType[index]%10 == 1), (tsosDetails.m_detType[index]%10 == 2) );
1672 }
1674  trackHitDetails.m_numShared++; // increase counter
1675  trackHitDetails.m_numWeightedShared += (isPix ? 2 : 1); // increase counter
1676  // protect from TRT hits (needed?)
1677  if( isSCT ) { trackHitDetails.m_numSCT_Shared++; }
1678  }
1680  trackHitDetails.m_numShared--; // decrease counter
1681  trackHitDetails.m_numWeightedShared -= (isPix ? 2 : 1); // increase counter
1682  // protect from TRT hits (needed?)
1683  if( isSCT ) { trackHitDetails.m_numSCT_Shared--; }
1684  }
1685 //============================================================================================
grepfile.info
info
Definition: grepfile.py:38
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numSplitSharedPix
int m_numSplitSharedPix
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:138
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
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
InDet::InDetDenseEnvAmbiTrackSelectionTool::InDetDenseEnvAmbiTrackSelectionTool
InDetDenseEnvAmbiTrackSelectionTool(const std::string &, const std::string &, const IInterface *)
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:33
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numSCTHits
int m_numSCTHits
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:130
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_maxPixMultiCluster
IntegerProperty m_maxPixMultiCluster
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:460
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_minPairTrackPt
FloatProperty m_minPairTrackPt
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:481
InDet::InDetDenseEnvAmbiTrackSelectionTool::performConversionCheck
bool performConversionCheck(const Trk::Track *ptrTrack, Trk::PRDtoTrackMap &prd_to_track_map, TrackHitDetails &trackHitDetails, TSoS_Details &tsosDetails) const
Specific logic for identifing conversions with the goal of passing those tracks through to the final ...
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1212
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numSCT_Unused
int m_numSCT_Unused
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:135
TrkDetElementBase.h
xAOD::acceptedTrack
@ acceptedTrack
Definition: TrackingPrimitives.h:472
xAOD::subtrackCreatedWithRecoveredShared
@ subtrackCreatedWithRecoveredShared
Definition: TrackingPrimitives.h:508
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
InDet::InDetDenseEnvAmbiTrackSelectionTool::newEvent
static void newEvent(CacheEntry *ent)
Fill hadronic & EM cluster map.
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:68
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_maxTracksPerPRD
IntegerProperty m_maxTracksPerPRD
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:446
InDet::InDetDenseEnvAmbiTrackSelectionTool::RejectedHit
@ RejectedHit
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:106
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::Track::fitQuality
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_detID
const SiliconID * m_detID
atlas id helper
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:434
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_etaWidthEm
FloatProperty m_etaWidthEm
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:475
MeasurementBase.h
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_trkCouldBeAccepted
bool m_trkCouldBeAccepted
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:123
xAOD::TSOSOutlierShared
@ TSOSOutlierShared
Definition: TrackingPrimitives.h:488
xAOD::sharedPixelSharedWithDifferentIBLTrack
@ sharedPixelSharedWithDifferentIBLTrack
Definition: TrackingPrimitives.h:500
InDet::InDetDenseEnvAmbiTrackSelectionTool::getCleanedOutTrack
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, int subtrackId) const override
Decide what to do with a candidate track.
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:74
Surface.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
InDet::InDetDenseEnvAmbiTrackSelectionTool::TSoS_Details::m_detType
std::vector< int > m_detType
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:255
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo::isSplit
bool isSplit() const
Definition: ClusterSplitProbabilityContainer.h:27
xAOD::tooManySharedNonRecoverable
@ tooManySharedNonRecoverable
Definition: TrackingPrimitives.h:492
Trk::PRDtoTrackMap::onTracks
PrepRawDataTrackMapRange onTracks(const PrepRawData &prd)
get the Tracks associated with this PrepRawData.
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
InDet::InDetDenseEnvAmbiTrackSelectionTool::clusCanBeSplit
bool clusCanBeSplit(float splitProb1, float splitProb2) const
Simple helper functions to tell is cluster is split.
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1617
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_cosmics
BooleanProperty m_cosmics
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:449
Trk::ClusterSplitProbabilityContainer::setSplitInformation
ProbabilityInfo & setSplitInformation(const PrepRawData *cluster, float prob1, float prob2)
Definition: ClusterSplitProbabilityContainer.h:45
AtlasDetectorID::is_sct
bool is_sct(Identifier id) const
Definition: AtlasDetectorID.h:770
PixelCluster.h
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
InDet::InDetDenseEnvAmbiTrackSelectionTool::rejectHit
static void rejectHit(TrackHitDetails &trackHitDetails, TSoS_Details &tsosDetails, int index)
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1637
Trk::PRDtoTrackMap
Definition: PRDtoTrackMap.h:17
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
InDet::InDetDenseEnvAmbiTrackSelectionTool::SharedHit
@ SharedHit
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:97
InDet::InDetDenseEnvAmbiTrackSelectionTool::updateSharedForCollimated
void updateSharedForCollimated(TrackHitDetails &trackHitDetails, TSoS_Details &tsosDetails) const
Handle update of the shared hit counts if either a conversion or a dense hadronic decay was identifie...
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1366
Trk::numberOfSCTDeadSensors
@ numberOfSCTDeadSensors
number of TRT hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:76
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo
Definition: ClusterSplitProbabilityContainer.h:22
Trk::Track::info
const TrackInfo & info() const
Returns a const ref to info of a const tracks.
InDet::InDetDenseEnvAmbiTrackSelectionTool::rejectSharedHit
static void rejectSharedHit(TrackHitDetails &trackHitDetails, TSoS_Details &tsosDetails, int index)
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1643
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numUnused
int m_numUnused
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:133
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numSCTDeadSensor
int m_numSCTDeadSensor
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:126
initialize
void initialize()
Definition: run_EoverP.cxx:894
InDet::InDetDenseEnvAmbiTrackSelectionTool::isEmCaloCompatible
bool isEmCaloCompatible(const Trk::TrackParameters &Tp) const
Check if the cluster is compatible with a EM cluster.
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1503
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_phiWidthEm
FloatProperty m_phiWidthEm
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:474
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_selectortool
PublicToolHandle< ITrtDriftCircleCutTool > m_selectortool
TRT minimum number of drift circles tool- returns allowed minimum number of TRT drift circles.
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:428
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
InDet::InDetDenseEnvAmbiTrackSelectionTool::fillTrackDetails
void fillTrackDetails(const Trk::Track *ptrTrack, Trk::ClusterSplitProbabilityContainer &splitProbContainer, const Trk::PRDtoTrackMap &prd_to_track_map, TrackHitDetails &trackHitDetails, TSoS_Details &tsosDetails) const
Fill the two structs TrackHitDetails & TSoS_Details full of information.
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:473
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_sharedProbCut
FloatProperty m_sharedProbCut
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:452
skel.it
it
Definition: skel.GENtoEVGEN.py:396
InDet::InDetDenseEnvAmbiTrackSelectionTool::Outlier
@ Outlier
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:108
xAOD::tooFewHits
@ tooFewHits
Definition: TrackingPrimitives.h:506
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_hasSharedPixel
bool m_hasSharedPixel
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:119
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_passHadronicROI
bool m_passHadronicROI
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:121
ROIPhiRZContainer::hasMatchingROI
bool hasMatchingROI(float phi, double eta, double r, double z, float roi_phi_width, double roi_eta_width) const
Test whether there is a matching ROI for the given phi and r,z corrected eta.
Definition: ROIPhiRZContainer.h:55
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_skipAmbiInROI
BooleanProperty m_skipAmbiInROI
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:466
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:115
InDet::InDetDenseEnvAmbiTrackSelectionTool::RejectedHitOverUse
@ RejectedHitOverUse
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:100
xAOD::sharedHitsNotEnoughUniqueHits
@ sharedHitsNotEnoughUniqueHits
Definition: TrackingPrimitives.h:495
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::PrepRawData::type
virtual bool type(PrepRawDataType type) const =0
Interface method checking the type.
xAOD::pixelSplitButTooManyShared3Ptc
@ pixelSplitButTooManyShared3Ptc
Definition: TrackingPrimitives.h:490
xAOD::tooManySharedRecoverable
@ tooManySharedRecoverable
Definition: TrackingPrimitives.h:491
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:782
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::notEnoughUniqueSiHits
@ notEnoughUniqueSiHits
Definition: TrackingPrimitives.h:505
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
InDet::InDetDenseEnvAmbiTrackSelectionTool::sharedToSplitPix
static void sharedToSplitPix(TrackHitDetails &trackHitDetails, TSoS_Details &tsosDetails, int index)
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1660
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numSplitSharedSCT
int m_numSplitSharedSCT
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:139
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_minPtSplit
FloatProperty m_minPtSplit
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:467
Trk::TrackInfo::InDetAmbiTrackSelectionTool
@ InDetAmbiTrackSelectionTool
Added because of compilation problems.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:159
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_doPairSelection
BooleanProperty m_doPairSelection
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:480
SCT_Cluster.h
InDet::InDetDenseEnvAmbiTrackSelectionTool::CacheEntry::m_minSiHits
int m_minSiHits
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:307
Trk::numberOfSCTHoles
@ numberOfSCTHoles
number of Holes in both sides of a SCT module
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:73
InDet::InDetDenseEnvAmbiTrackSelectionTool::CacheEntry::m_minNotShared
int m_minNotShared
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:305
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numShared
int m_numShared
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:140
PrepRawData.h
InDet::InDetDenseEnvAmbiTrackSelectionTool::isHadCaloCompatible
bool isHadCaloCompatible(const Trk::TrackParameters &Tp) const
Check if the cluster is compatible with a hadronic cluster.
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1491
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_sharedProbCut2
FloatProperty m_sharedProbCut2
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:453
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_isPatternTrack
bool m_isPatternTrack
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:116
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_useEmClusSeed
BooleanProperty m_useEmClusSeed
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:473
InDet::InDetDenseEnvAmbiTrackSelectionTool::getOverlapTrackParameters
std::pair< const Trk::TrackParameters *, const Trk::TrackParameters * > getOverlapTrackParameters(int n, const Trk::Track *track1, const Trk::Track *track2, const Trk::PRDtoTrackMap &prd_to_track_map, int splitSharedPix) const
Returns the Trackparameters of the two tracks on the n'th TrackStateOnSurface of the first track.
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1516
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
InDet::InDetDenseEnvAmbiTrackSelectionTool::setPixelClusterSplitInformation
void setPixelClusterSplitInformation(TSoS_Details &tsosDetails, Trk::ClusterSplitProbabilityContainer &clusterSplitProbMap) const
Update the pixel clusters split information.
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1454
InDet::InDetDenseEnvAmbiTrackSelectionTool::decreaseSharedHitCounters
static void decreaseSharedHitCounters(TrackHitDetails &trackHitDetails, bool isPix, bool isSCT)
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1679
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numTRT_Unused
int m_numTRT_Unused
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:134
Trk::ClusterSplitProbabilityContainer::getSplitProbability
ProbabilityInfo * getSplitProbability(const PrepRawData *cluster)
Definition: ClusterSplitProbabilityContainer.h:40
xAOD::notEnoughTRTHits
@ notEnoughTRTHits
Definition: TrackingPrimitives.h:504
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
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::totalSiHits
int totalSiHits() const
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:175
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numPixelHits
int m_numPixelHits
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:127
xAOD::firstHitSharedAndExtraShared
@ firstHitSharedAndExtraShared
Definition: TrackingPrimitives.h:497
Trk::TrackInfo::addPatternReco
void addPatternReco(const TrackInfo &)
A method adding just pattern recognition info without adding the actual properties.
InDet::InDetDenseEnvAmbiTrackSelectionTool::CacheEntry::m_maxSharedModules
int m_maxSharedModules
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:301
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_doPixelClusterSplitting
BooleanProperty m_doPixelClusterSplitting
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:451
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_hasSharedIBLHit
bool m_hasSharedIBLHit
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:118
InDet::InDetDenseEnvAmbiTrackSelectionTool::TSoS_Details::m_overlappingTracks
std::multimap< const Trk::Track *, int, lessTrkTrack > m_overlappingTracks
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:260
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_minNotSharedHits
IntegerProperty m_minNotSharedHits
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:447
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::pixelSplitButTooManyShared2Ptc
@ pixelSplitButTooManyShared2Ptc
Definition: TrackingPrimitives.h:489
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_inputEmClusterContainerName
SG::ReadHandleKey< ROIPhiRZContainer > m_inputEmClusterContainerName
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:477
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numWeightedShared
int m_numWeightedShared
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:142
xAOD::tooManySharedAfterIncreasingShared
@ tooManySharedAfterIncreasingShared
Definition: TrackingPrimitives.h:501
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::numberOfSCTHits
@ numberOfSCTHits
number of SCT holes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:71
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numPixelHoles
int m_numPixelHoles
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:128
InDet::InDetDenseEnvAmbiTrackSelectionTool::TSoS_Details::m_type
std::vector< int > m_type
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:254
Trk::numberOfPixelDeadSensors
@ numberOfPixelDeadSensors
number of pixel hits with broad errors (width/sqrt(12))
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:65
InDet::InDetDenseEnvAmbiTrackSelectionTool::SplitSharedHit
@ SplitSharedHit
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:95
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
PseudoMeasurementOnTrack.h
SiliconID.h
This is an Identifier helper class for both the Pixel and SCT subdetectors. This class defines identi...
Trk::TrackScore
float TrackScore
Definition: TrackScore.h:10
xAOD::failedSubtrackCreation
@ failedSubtrackCreation
Definition: TrackingPrimitives.h:507
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDetDenseEnvAmbiTrackSelectionTool.h
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_assoTool
ToolHandle< Trk::IPRDtoTrackMapTool > m_assoTool
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:437
hist_file_dump.f
f
Definition: hist_file_dump.py:135
Trk::MeasurementBase::type
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_maxPixTwoPartCluster
IntegerProperty m_maxPixTwoPartCluster
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:459
InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep
void decideWhichHitsToKeep(const Trk::Track *, const Trk::TrackScore score, Trk::ClusterSplitProbabilityContainer &splitProbContainer, Trk::PRDtoTrackMap &prd_to_track_map, TrackHitDetails &trackHitDetails, TSoS_Details &tsosDetails, CacheEntry *ent, int trackId) const
Determine which hits to keep on this track Look at the hits on track and decided if they should be ke...
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:666
TrackSummary.h
Trk::ParametersBase
Definition: ParametersBase.h:55
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_passConversionSel
bool m_passConversionSel
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:122
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo::setSplit
void setSplit(bool split)
Definition: ClusterSplitProbabilityContainer.h:28
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_minPtBjetROI
FloatProperty m_minPtBjetROI
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:468
InDet::InDetDenseEnvAmbiTrackSelectionTool::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:41
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
Trk::PRDtoTrackMap::isUsed
bool isUsed(const PrepRawData &prd) const
does this PRD belong to at least one track?
InDet::InDetDenseEnvAmbiTrackSelectionTool::increaseSharedHitCounters
static void increaseSharedHitCounters(TrackHitDetails &trackHitDetails, bool isPix, bool isSCT)
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1673
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_maxPixOnePartCluster
IntegerProperty m_maxPixOnePartCluster
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:458
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_etaWidth
FloatProperty m_etaWidth
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:470
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
isIBL
bool isIBL(uint32_t robId)
Definition: PixelRodDecoder.cxx:44
keylayer_zslicemap.isPix
isPix
Definition: keylayer_zslicemap.py:127
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::Track::trackParameters
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:97
InDet::InDetDenseEnvAmbiTrackSelectionTool::OtherTsos
@ OtherTsos
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:110
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_minHits
IntegerProperty m_minHits
some cut values
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:443
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_minScoreShareTracks
FloatProperty m_minScoreShareTracks
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:448
InDet::InDetDenseEnvAmbiTrackSelectionTool::TSoS_Details::m_hitIsShared
std::vector< int > m_hitIsShared
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:256
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
TrackInfo.h
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
RIO_OnTrack.h
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_phiWidth
FloatProperty m_phiWidth
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:469
Trk::PrepRawDataType::PixelCluster
@ PixelCluster
Trk::ClusterSplitProbabilityContainer
Container to associate Cluster with cluster splitting probabilities.
Definition: ClusterSplitProbabilityContainer.h:17
InDet::InDetDenseEnvAmbiTrackSelectionTool::rejectSharedHitInvalid
static void rejectSharedHitInvalid(TrackHitDetails &trackHitDetails, TSoS_Details &tsosDetails, int index)
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1651
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_maxSharedModules
IntegerProperty m_maxSharedModules
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:445
InDet::InDetDenseEnvAmbiTrackSelectionTool::TSoS_Details::findIndexOfPreviousMeasurement
int findIndexOfPreviousMeasurement(int currentIndex) const
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:279
xAOD::decideWhichHitsToKeep
@ decideWhichHitsToKeep
Definition: TrackingPrimitives.h:467
AtlasDetectorID::is_indet
bool is_indet(Identifier id) const
Definition: AtlasDetectorID.h:683
InDet::InDetDenseEnvAmbiTrackSelectionTool::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: InDetDenseEnvAmbiTrackSelectionTool.cxx:1421
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numSCT_Shared
int m_numSCT_Shared
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:141
InDet::InDetDenseEnvAmbiTrackSelectionTool::TSoS_Details::m_tracksSharingHit
std::multimap< int, const Trk::Track * > m_tracksSharingHit
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:261
xAOD::sharedHitsNotEnoughUniqueSiHits
@ sharedHitsNotEnoughUniqueSiHits
Definition: TrackingPrimitives.h:498
InDet::InDetDenseEnvAmbiTrackSelectionTool::CacheEntry
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:294
xAOD::firstHitSharedAndPixIBL
@ firstHitSharedAndPixIBL
Definition: TrackingPrimitives.h:496
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_firstPixIsShared
bool m_firstPixIsShared
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:120
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numSCTHoles
int m_numSCTHoles
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:129
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.
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo::isTooBigToBeSplit
bool isTooBigToBeSplit() const
Definition: ClusterSplitProbabilityContainer.h:26
xAOD::score
@ score
Definition: TrackingPrimitives.h:513
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_inputHadClusterContainerName
SG::ReadHandleKey< ROIPhiRZContainer > m_inputHadClusterContainerName
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:471
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.
Trk::pixelCluster
@ pixelCluster
Definition: MeasurementType.h:22
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_minTRT_Hits
IntegerProperty m_minTRT_Hits
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:444
InDet::InDetDenseEnvAmbiTrackSelectionTool::isTwoPartClus
bool isTwoPartClus(float splitProb1, float splitProb2) const
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1621
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
DeMoScan.index
string index
Definition: DeMoScan.py:364
InDet::InDetDenseEnvAmbiTrackSelectionTool::TSoS_Details::m_splitProb1
std::vector< float > m_splitProb1
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:257
InDet::InDetDenseEnvAmbiTrackSelectionTool::finalize
virtual StatusCode finalize() override
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:62
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
InDet::InDetDenseEnvAmbiTrackSelectionTool::performHadDecayCheck
bool performHadDecayCheck(const Trk::Track *ptrTrack, Trk::PRDtoTrackMap &prd_to_track_map, TrackHitDetails &trackHitDetails, TSoS_Details &tsosDetails) const
Specific logic for identifing boosted light particle decays in jet topologies (tau and b),...
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1293
xAOD::notEnoughSiHits
@ notEnoughSiHits
Definition: TrackingPrimitives.h:503
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numPseudo
int m_numPseudo
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:136
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_minPixHitAccepted
IntegerProperty m_minPixHitAccepted
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:462
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_observerTool
PublicToolHandle< Trk::ITrkObserverTool > m_observerTool
Observer tool This tool is used to observe the tracks and their 'score'.
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:440
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_minUniqueSCTHits
IntegerProperty m_minUniqueSCTHits
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:456
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::Track::trackSummary
const Trk::TrackSummary * trackSummary() const
Returns a pointer to the const Trk::TrackSummary owned by this const track (could be nullptr)
InDet::InDetDenseEnvAmbiTrackSelectionTool::inHadronicROI
bool inHadronicROI(const Trk::Track *ptrTrack) const
Does track pass criteria for hadronic ROI?
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1481
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::totalPixelHits
int totalPixelHits() const
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:200
InDet::InDetDenseEnvAmbiTrackSelectionTool::rejectHitOverUse
static void rejectHitOverUse(TrackHitDetails &trackHitDetails, TSoS_Details &tsosDetails, int index)
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1632
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
DEBUG
#define DEBUG
Definition: page_access.h:11
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_thisHasIBLHit
bool m_thisHasIBLHit
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:117
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_parameterization
BooleanProperty m_parameterization
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:450
ClusterSplitProbabilityContainer.h
Trk::MeasurementBaseType::PseudoMeasurementOnTrack
@ PseudoMeasurementOnTrack
Definition: MeasurementBase.h:51
InDet::InDetDenseEnvAmbiTrackSelectionTool::RejectedHitInvalid
@ RejectedHitInvalid
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:103
Trk::FitQuality::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_shareSplitHits
BooleanProperty m_shareSplitHits
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:461
Trk::ParametersBase::eta
double eta() const
Access method for pseudorapidity - from momentum.
InDet::InDetDenseEnvAmbiTrackSelectionTool::UnusedHit
@ UnusedHit
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:93
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_minTrackChi2ForSharedHits
FloatProperty m_minTrackChi2ForSharedHits
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:455
Trk::FitQuality::numberDoF
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition: FitQuality.h:60
InDet::InDetDenseEnvAmbiTrackSelectionTool::isMultiPartClus
bool isMultiPartClus(float splitProb2) const
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1625
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.
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
xAOD::sharedSCT
@ sharedSCT
Definition: TrackingPrimitives.h:493
Trk::TrackSummary::get
int get(const SummaryType &type) const
returns the summary information for the passed SummaryType.
xAOD::TSOSRejectedHit
@ TSOSRejectedHit
Definition: TrackingPrimitives.h:487
xAOD::getCleanedOutTrack
@ getCleanedOutTrack
Definition: TrackingPrimitives.h:469
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::totalUniqueSiHits
int totalUniqueSiHits() const
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:182
InDet::InDetDenseEnvAmbiTrackSelectionTool::TSoS_Details::m_RIO
std::vector< const Trk::RIO_OnTrack * > m_RIO
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:259
checker_macros.h
Define macros for attributes used to control the static checker.
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::dumpInfo
void dumpInfo() const
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:205
Trk::TrackInfo::trackFitter
const TrackFitter & trackFitter() const
Access methods for track fitter.
InDet::InDetDenseEnvAmbiTrackSelectionTool::TSoS_Details::m_nTSoS
unsigned int m_nTSoS
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:253
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
InDet::InDetDenseEnvAmbiTrackSelectionTool::TSoS_Details
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:252
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::InDetDenseEnvAmbiTrackSelectionTool::m_etaDependentCutsSvc
ServiceHandle< IInDetEtaDependentCutsSvc > m_etaDependentCutsSvc
ITk eta-dependet cuts.
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:431
InDet::InDetDenseEnvAmbiTrackSelectionTool::addSharedHit
static void addSharedHit(TrackHitDetails &trackHitDetails, TSoS_Details &tsosDetails, int index)
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:1668
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo::splitProbability2
float splitProbability2() const
Definition: ClusterSplitProbabilityContainer.h:25
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
TrackStateOnSurface.h
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_useHClusSeed
BooleanProperty m_useHClusSeed
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:465
Trk::PRDtoTrackMap::ConstPrepRawDataTrackMapRange
std::pair< PrepRawDataTrackMap::const_iterator, PrepRawDataTrackMap::const_iterator > ConstPrepRawDataTrackMapRange
Definition: PRDtoTrackMap.h:44
TauGNNUtils::Variables::Track::trackEta
bool trackEta(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:477
xAOD::sharedIBLSharedWithNoIBLTrack
@ sharedIBLSharedWithNoIBLTrack
Definition: TrackingPrimitives.h:499
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
InDet::InDetDenseEnvAmbiTrackSelectionTool::m_minSiHitsToAllowSplitting
IntegerProperty m_minSiHitsToAllowSplitting
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:457
InDet::InDetDenseEnvAmbiTrackSelectionTool::TrackHitDetails::m_numPixelDeadSensor
int m_numPixelDeadSensor
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:125
xAOD::sharedHitsBadChi2
@ sharedHitsBadChi2
Definition: TrackingPrimitives.h:494
InDet::InDetDenseEnvAmbiTrackSelectionTool::checkOtherTracksValidity
bool checkOtherTracksValidity(TSoS_Details &tsosDetails, int index, Trk::ClusterSplitProbabilityContainer &splitProbContainer, Trk::PRDtoTrackMap &prd_to_track_map, int &maxiShared, int &maxOtherNPixel, bool &maxOtherHasIBL, CacheEntry *ent) const
Returns true if accepted tracks remain about thresholds, false otherwise maxiShared = max number of s...
Definition: InDetDenseEnvAmbiTrackSelectionTool.cxx:354
InDet::InDetDenseEnvAmbiTrackSelectionTool::TSoS_Details::m_splitProb2
std::vector< float > m_splitProb2
Definition: InDetDenseEnvAmbiTrackSelectionTool.h:258
Trk::TrackInfo::Unknown
@ Unknown
Track fitter not defined.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:41
Identifier
Definition: IdentifierFieldParser.cxx:14