ATLAS Offline Software
TrigFastTrackFinder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrigFastTrackFinder.cxx
7 // -------------------------------
8 // ATLAS Collaboration
9 //
10 // package created 16/04/2013 by Dmitry Emeliyanov (see ChangeLog for more details)
11 //
13 
14 
15 
16 #include "TrigFastTrackFinder.h"
17 
28 
29 //
30 #include "InDetIdentifier/SCT_ID.h"
32 #include "TrkTrack/Track.h"
33 
35 #include "TrkTrack/Track.h"
36 
37 #include "CxxUtils/phihelper.h"
38 
40 
42 
44 
45 //for UTT
48 
49 #include <cmath>
50 #include <iostream>
51 #include <algorithm>
52 #include <memory>
53 
54 TrigFastTrackFinder::TrigFastTrackFinder(const std::string& name, ISvcLocator* pSvcLocator) :
55 
56  AthReentrantAlgorithm(name, pSvcLocator),
57  m_trackMaker("InDet::SiTrackMaker_xk/InDetTrigSiTrackMaker"),
58  m_trigInDetTrackFitter("TrigInDetTrackFitter"),
59  m_trigZFinder("TrigZFinder/TrigZFinder", this ),
60  m_trackSummaryTool("Trk::ITrackSummaryTool/ITrackSummaryTool"),
61  m_disTrkFitter("Trk::GlobalChi2Fitter/InDetTrackFitter"),
62  m_useBeamSpot(true),
63  m_doZFinder(false),
64  m_doZFinderOnly(false),
65  m_storeZFinderVertices(false),
66  m_nfreeCut(5),
67  m_countTotalRoI(0),
68  m_countRoIwithEnoughHits(0),
69  m_countRoIwithTracks(0),
70  m_pixelId(0),
71  m_sctId(0),
72  m_idHelper(0),
73  m_particleHypothesis(Trk::pion),
74  m_useNewLayerNumberScheme(false),
75  m_useGPU(false),
76  m_LRTmode(false),
77  m_LRTD0Min(0.0),
78  m_LRTHardMinPt(0.0),
79  m_trigseedML_LUT(""),
80  m_dodEdxTrk(false),
81  m_doDisappearingTrk(false),
82  m_ITkMode(false),
83  m_standaloneMode(false)
84 {
85 
87  declareProperty( "MinHits", m_minHits = 5,"Minimum number of hits needed to perform tracking" );
88 
89  //** Zfinder mode
90  declareProperty( "doZFinder", m_doZFinder = true,"Use fast ZFinder to find z of primary vertices");
91  declareProperty( "doZFinderOnly", m_doZFinderOnly = false,"stop processing after ZFinder - no tracking performed");
92  declareProperty( "VertexSeededMode", m_vertexSeededMode = false); //** NOT USED Obsolete? ATR-24242
93  declareProperty( "doFastZVertexSeeding", m_doFastZVseeding = true,"Use ZFinder vertex information to filter seeds");
94  declareProperty( "zVertexResolution", m_tcs.m_zvError = 10.0," Half-width (mm) in z of z region used to filter seeds when doFastZVertexSeeding enabled" );
95  declareProperty( "zVertexResolutionEndcap", m_tcs.m_zvErrorEndcap = -1," Half-width (mm) in z of region used to filter seeds when doFastZVertexSeeding enabled, for endcap pixels; set to zVertexResolution value later if left negative" );
96  declareProperty( "StoreZFinderVertices", m_storeZFinderVertices = false ); //** NOT USED - to be implemented ATR-24242
97 
98 
100  declareProperty("useNewLayerNumberScheme", m_useNewLayerNumberScheme = false,"Use LayerNumberTool for layer numbers");
101 
103  declareProperty("Doublet_FilterRZ", m_tcs.m_doubletFilterRZ = true,"Enable check that doublet is consistent with the RoI in the RZ plane");
104  declareProperty("DoubletDR_Max", m_tcs.m_doublet_dR_Max = 270.0,"Maximum Radial distance between spacepoints forming Doublets");
105  declareProperty("SeedRadBinWidth", m_tcs.m_seedRadBinWidth = 2.0);
106 
108  declareProperty("Triplet_D0Max", m_tcs.m_tripletD0Max = 4.0,"Maximum d0 for triplet");
109  declareProperty("Triplet_D0_PPS_Max", m_tcs.m_tripletD0_PPS_Max = 1.7,"Maximin d0 for PPS doublets");
110  declareProperty("Triplet_nMaxPhiSlice", m_tcs.m_nMaxPhiSlice = 53,"Number of phi-slices used for seeding");
111  declareProperty("Triplet_MaxBufferLength", m_tcs.m_maxTripletBufferLength = 3,"Maximum number of triplets sharing a common middle spacepoint");
112  declareProperty("TripletDoPSS", m_tcs.m_tripletDoPSS = false,"Allow PSS Triplet seeds");
113  declareProperty("TripletDoPPS", m_tcs.m_tripletDoPPS = true,"Allow PPS triplet seeds");
114  declareProperty("TripletDoConfirm", m_tcs.m_tripletDoConfirm = false,"Enable triplet confirmation");
115  declareProperty("DoubletDR_Max_Confirm", m_tcs.m_doublet_dR_Max_Confirm = 150.0,"doublet max DR when TripletDoConfirm enabled");
116  declareProperty("TripletMaxCurvatureDiff", m_tcs.m_curv_delta = 0.001,"Maximum curvature difference allowed in seed confirmation");//for the triplet confirmation
117  declareProperty("Triplet_DtCut", m_tcs.m_tripletDtCut = 10.0);//i.e. 10*sigma_MS
118  declareProperty("pTmin", m_pTmin = 1000.0,"Triplet pT threshold is pTmin*Triplet_MinPtFrac" );
119  declareProperty("Triplet_MinPtFrac", m_tripletMinPtFrac = 0.3,"Triplet pT threshold is pTmin*Triplet_MinPtFrac");
120  declareProperty("doSeedRedundancyCheck", m_checkSeedRedundancy = false,"skip Triplets already used in a track");
121  declareProperty( "ConnectionFileName", m_connectionFile = "binTables_ITK_RUN4.txt");
122 
124  declareProperty("UseTrigSeedML", m_tcs.m_useTrigSeedML = 0,"set ML-based seed selection mode (0 disables)" );
125  declareProperty("TrigSeedML_LUT", m_trigseedML_LUT = "trigseed_ml_pixel_barrel_kde.lut","LUT used by ML-based seed selection");
126  declareProperty("maxEC_Pixel_cluster_length", m_tcs.m_maxEC_len = 1.5,"Maximum Endcap Pixel cluster length for ML-based seed selection" );
127 
128 
129  //* Clone removal (removal of tracks sharing too many hits */
130 
131  declareProperty( "FreeClustersCut" ,m_nfreeCut,"Minimum number of unshared clusters");
132 
133  //** Cuts applied to final tracks after Fit
134  declareProperty("TrackInitialD0Max", m_initialD0Max = 10.0,"Maximum d0 of track");
135  declareProperty("TrackZ0Max", m_Z0Max = 300.0,"Maximum z0 of track");
136 
137 
138  /* Monitoring */
139  declareProperty( "doResMon", m_doResMonitoring = true,"enable unbiased residual monitoring");
140  declareProperty( "UseBeamSpot", m_useBeamSpot = true,"Monitor d0 with respect to beamspot");
141 
142  //* Collection Names */
143  declareProperty("TracksName",
144  m_outputTracksKey = std::string("TrigFastTrackFinder_Tracks"),
145  "TrackCollection name");
146 
147  declareProperty("inputTracksName",
148  m_inputTracksKey = std::string(""),
149  "TrackCollection name");
150 
151  declareProperty("RoIs", m_roiCollectionKey = std::string("OutputRoIs"), "RoIs to read in");
152 
153  //* Tools */
154  declareProperty( "initialTrackMaker", m_trackMaker);
155  declareProperty( "trigInDetTrackFitter", m_trigInDetTrackFitter );
156  declareProperty( "trigZFinder", m_trigZFinder );
157  declareProperty("TrackSummaryTool", m_trackSummaryTool);
158 
159  // Accleration
160  declareProperty("useGPU", m_useGPU = false,"Use GPU acceleration");
161 
162  // Large Radius Tracking
163  declareProperty("LRT_Mode", m_LRTmode,"Enable Large Radius Tracking mode" );
164  declareProperty("LRT_D0Min", m_LRTD0Min=0.0,"Minimum d0 for tracks to be saved in LRT Mode" );
165  declareProperty("LRT_HardMinPt", m_LRTHardMinPt=0.0,"Minimum pT for tracks to be saved in LRT Mode");
166 
167  // UTT
168  declareProperty("dodEdxTrk", m_dodEdxTrk = false);
169  declareProperty("doDisappearingTrk", m_doDisappearingTrk = false);
170  declareProperty("DisTrackFitter", m_disTrkFitter );
171 
172  // Phase II
173  declareProperty("ITkMode", m_ITkMode = false);
174  declareProperty("StandaloneMode", m_standaloneMode = false);
175 
176 }
177 
178 //--------------------------------------------------------------------------
179 
181 
182 //-----------------------------------------------------------------------
183 
185 
187  ATH_CHECK(m_outputTracksKey.initialize() );
188 
189  // optional input tracks collection if present the clusters on previously found tracks are not used to form seeds
190  if (m_LRTmode) {
191  ATH_CHECK(m_inputTracksKey.initialize( !m_inputTracksKey.key().empty() ) );
192  }
193  // optional PRD to track association map
195 
196 
198 
199  ATH_MSG_DEBUG(" TrigFastTrackFinder : MinHits set to " << m_minHits);
200 
201  ATH_CHECK(m_numberingTool.retrieve());
202 
203  if(!m_ITkMode) {
204  ATH_CHECK(m_spacePointTool.retrieve());
205  }
206  else {
207  m_spacePointTool.disable();
208  }
209 
210  ATH_CHECK(m_trackMaker.retrieve());
211 
212  ATH_CHECK(m_trigInDetTrackFitter.retrieve());
213 
214  if (m_doZFinder) {
215  ATH_CHECK(m_trigZFinder.retrieve());
216  // If m_tcs.m_zvErrorEndcap has negative default value, it was not set by user,
217  // so set it to the same value as m_tcs.m_zvError
219  } else {
220  m_trigZFinder.disable();
221  }
222 
223  ATH_CHECK(m_trackSummaryTool.retrieve());
224 
225  //Get ID helper
226  ATH_CHECK(detStore()->retrieve(m_idHelper, "AtlasID"));
227 
228  ATH_CHECK(detStore()->retrieve(m_pixelId, "PixelID"));
229 
230  ATH_CHECK(detStore()->retrieve(m_sctId, "SCT_ID"));
231 
232  // monitoring
233  if ( !m_monTool.empty() ) {
234  ATH_CHECK(m_monTool.retrieve() );
235  }
236  else {
237  ATH_MSG_INFO("Monitoring tool is empty");
238  }
239 
240  ATH_MSG_DEBUG(" doResMon " << m_doResMonitoring);
241 
242  if(m_useGPU) {//for GPU acceleration
243  ATH_CHECK(m_accelSvc.retrieve());
244  ATH_CHECK(m_accelSvc->isReady());
245  ATH_CHECK(m_accelTool.retrieve());
246  }
247 
248  ATH_MSG_INFO("Use GPU acceleration : "<<std::boolalpha<<m_useGPU);
249 
250  if (m_LRTmode) {
251  ATH_MSG_INFO(" FTF configures in Large Radius Tracking Mode");
252  // set TrigTrackSeedGenerator to LRTmode
254 
255  }
256 
257  if(m_tcs.m_useTrigSeedML > 0) {
258  //LUT params
259  int lut_w = 30;
260  int lut_h = 45;
261  float lut_range[4] = {0.0,3.0,0.0,9.0};
262  TrigSeedML_LUT L(1,lut_w,lut_h,lut_range);
263  //read data from LUT file
264  std::string lut_fileName = PathResolver::find_file(m_trigseedML_LUT, "DATAPATH");
265  if (lut_fileName.empty()) {
266  ATH_MSG_ERROR("Cannot find TrigSeedML LUT file " << lut_fileName);
267  return StatusCode::FAILURE;
268  }
269  else {
270  ATH_MSG_INFO(lut_fileName);
271  std::ifstream ifs(lut_fileName.c_str());
272  int row, col0, col1;
273  while(!ifs.eof()) {
274  ifs >> row >> col0 >> col1;
275  if(ifs.eof()) break;
276  for(int c=col0;c<=col1;c++) L.setBin(row, c);
277  }
278  ifs.close();
279  ATH_MSG_INFO("TrigSeedML LUT initialized from file " << m_trigseedML_LUT);
280  m_tcs.m_vLUT.push_back(L);
281  }
282  }
283  if (m_ITkMode) {
284  ATH_CHECK(m_seedingTool.retrieve());
285  } else {
286  m_seedingTool.disable();
287  }
288 
289  // UTT tools
290  if( m_doDisappearingTrk ) {
291  ATH_CHECK(m_extrapolator.retrieve());
292  ATH_MSG_DEBUG("Retrieved tool " << m_extrapolator);
293 
294  ATH_CHECK(m_disTrkFitter.retrieve());
295  ATH_MSG_DEBUG("Retrieved tool " << m_disTrkFitter);
296  } else {
297  m_extrapolator.disable();
298  m_disTrkFitter.disable();
299  }
300 
301  // UTT read/write handles
302  ATH_CHECK( m_dEdxTrkKey.initialize(m_dodEdxTrk) );
303  ATH_CHECK( m_dEdxHitKey.initialize(m_dodEdxTrk) );
305 
306  //
307  ATH_MSG_DEBUG("FTF : " << name() );
308  ATH_MSG_DEBUG(" m_tcs.m_doubletFilterRZ : " << m_tcs.m_doubletFilterRZ );
309  ATH_MSG_DEBUG(" m_tcs.m_doublet_dR_Max : " << m_tcs.m_doublet_dR_Max );
310  ATH_MSG_DEBUG(" m_tcs.m_doublet_dR_Max_Confirm : " << m_tcs.m_doublet_dR_Max_Confirm );
311  ATH_MSG_DEBUG(" m_tcs.m_seedRadBinWidth : " << m_tcs.m_seedRadBinWidth );
312  ATH_MSG_DEBUG(" m_tcs.m_tripletD0Max : " << m_tcs.m_tripletD0Max );
313  ATH_MSG_DEBUG(" m_tcs.m_tripletD0_PPS_Max : " << m_tcs.m_tripletD0_PPS_Max );
314  ATH_MSG_DEBUG(" m_tcs.m_nMaxPhiSlice : " << m_tcs.m_nMaxPhiSlice );
315  ATH_MSG_DEBUG(" m_tcs.m_maxTripletBufferLength : " << m_tcs.m_maxTripletBufferLength );
316  ATH_MSG_DEBUG(" m_tcs.m_tripletDoPSS : " << m_tcs.m_tripletDoPSS );
317  ATH_MSG_DEBUG(" m_tcs.m_tripletDoPPS : " << m_tcs.m_tripletDoPPS );
318  ATH_MSG_DEBUG(" m_tcs.m_tripletDoConfirm : " << m_tcs.m_tripletDoConfirm );
319  ATH_MSG_DEBUG(" m_tcs.m_curv_delta : " << m_tcs.m_curv_delta );
320  ATH_MSG_DEBUG(" m_tcs.m_tripletDtCut : " << m_tcs.m_tripletDtCut );
321  ATH_MSG_DEBUG(" m_tcs.m_useTrigSeedML : " << m_tcs.m_useTrigSeedML );
322  ATH_MSG_DEBUG(" m_trigseedML_LUT : " << m_trigseedML_LUT );
323  ATH_MSG_DEBUG(" m_tcs.m_maxEC_len : " << m_tcs.m_maxEC_len );
324  ATH_MSG_DEBUG(" m_vertexSeededMode : " << m_vertexSeededMode );
325  ATH_MSG_DEBUG(" m_doZFinder : " << m_doZFinder );
326  ATH_MSG_DEBUG(" m_doZFinderOnly : " << m_doZFinderOnly );
327  ATH_MSG_DEBUG(" m_doFastZVseeding : " << m_doFastZVseeding );
328  ATH_MSG_DEBUG(" m_tcs.m_zvError : " << m_tcs.m_zvError );
329  ATH_MSG_DEBUG(" m_tcs.m_zvErrorEndcap : " << m_tcs.m_zvErrorEndcap );
330  ATH_MSG_DEBUG(" m_storeZFinderVertices : " << m_storeZFinderVertices );
331  ATH_MSG_DEBUG(" m_tripletMinPtFrac : " << m_tripletMinPtFrac );
332  ATH_MSG_DEBUG(" m_pTmin : " << m_pTmin );
333  ATH_MSG_DEBUG(" m_initialD0Max : " << m_initialD0Max );
334  ATH_MSG_DEBUG(" m_Z0Max : " << m_Z0Max );
335  ATH_MSG_DEBUG(" m_checkSeedRedundancy : " << m_checkSeedRedundancy );
336  ATH_MSG_DEBUG(" m_minHits : " << m_minHits );
337  ATH_MSG_DEBUG(" " );
338  ATH_MSG_DEBUG(" m_useBeamSpot : " << m_useBeamSpot );
339  ATH_MSG_DEBUG(" m_nfreeCut : " << m_nfreeCut );
340  ATH_MSG_DEBUG(" m_spacePointTool : " << m_spacePointTool );
341  ATH_MSG_DEBUG(" m_numberingTool : " << m_numberingTool );
342  ATH_MSG_DEBUG(" m_trackMaker : " << m_trackMaker );
343  ATH_MSG_DEBUG(" m_trigInDetTrackFitter : " << m_trigInDetTrackFitter );
344  ATH_MSG_DEBUG(" m_trigZFinder : " << m_trigZFinder );
345  ATH_MSG_DEBUG(" m_trackSummaryTool : " << m_trackSummaryTool );
346  ATH_MSG_DEBUG(" m_doResMonitoring : " << m_doResMonitoring );
347  ATH_MSG_DEBUG(" m_doCloneRemoval : " << m_doCloneRemoval );
348  ATH_MSG_DEBUG(" m_useNewLayerNumberScheme : " << m_useNewLayerNumberScheme );
349  ATH_MSG_DEBUG(" m_useGPU : " << m_useGPU );
350  ATH_MSG_DEBUG(" m_LRTmode : " << m_LRTmode );
351  ATH_MSG_DEBUG(" m_dodEdxTrk : " << m_dodEdxTrk );
352  ATH_MSG_DEBUG(" m_ITkMode : " << m_ITkMode );
353  ATH_MSG_DEBUG(" m_useTracklets : " << m_useTracklets );
354 
355  ATH_MSG_DEBUG(" Initialized successfully");
356 
357 
358  return StatusCode::SUCCESS;
359 }
360 
361 
362 //-------------------------------------------------------------------------
363 
365 {
366  //getting magic numbers from the layer numbering tool
367 
368  m_tcs.m_maxBarrelPix = m_numberingTool->offsetBarrelSCT();
369  m_tcs.m_minEndcapPix = m_numberingTool->offsetEndcapPixels();
370  m_tcs.m_maxEndcapPix = m_numberingTool->offsetEndcapSCT();
371  m_tcs.m_maxSiliconLayer = m_numberingTool->maxSiliconLayerNum();
372  m_tcs.m_layerGeometry.clear();
373 
375  const std::vector<TrigInDetSiLayer>* pVL = m_numberingTool->layerGeometry();
376  std::copy(pVL->begin(),pVL->end(),std::back_inserter(m_tcs.m_layerGeometry));
377  }
378 
380 
381  return StatusCode::SUCCESS;
382 }
383 
384 
385 StatusCode TrigFastTrackFinder::execute(const EventContext& ctx) const {
386 
388 
389  outputTracks = std::make_unique<TrackCollection>();
390 
391  const TrackCollection* inputTracks = nullptr;
392  if (m_LRTmode) {
393  if (!m_inputTracksKey.key().empty()){
394  SG::ReadHandle<TrackCollection> inputTrackHandle(m_inputTracksKey, ctx);
395  ATH_CHECK(inputTrackHandle.isValid());
396  inputTracks = inputTrackHandle.ptr();
397  }
398  }
400 
401  //RoI preparation/update
402 
403  if (m_standaloneMode) {
404  //the default fullscan TrigRoiDescriptor settings for beamspot width (z-range) are incorrect
405  const TrigRoiDescriptor internalRoI = TrigRoiDescriptor(0, -4.5, 4.5, 0, -M_PI, M_PI, 0, -150.0, 150.0);
406 
407  ATH_CHECK(findTracks(trackEventData, internalRoI, inputTracks, *outputTracks, ctx));
408 
409  } else {
411 
412  ATH_CHECK(roiCollection.isValid());
413 
414  if ( roiCollection->size()>1 ) ATH_MSG_WARNING( "More than one Roi in the collection: " << m_roiCollectionKey << ", this is not supported - use a composite Roi: Using the first Roi ONLY" );
415 
416  if ( roiCollection->size()==0) {
417  ATH_MSG_ERROR("No Roi found for " << m_roiCollectionKey.key() );
418  return StatusCode::FAILURE;
419  }
420 
421  TrigRoiDescriptor internalRoI = **roiCollection->begin();
422 
423  ATH_CHECK(findTracks(trackEventData, internalRoI, inputTracks, *outputTracks, ctx));
424  }
425 
427 
429  m_countTotalRoI++;
430 
431  return StatusCode::SUCCESS;
432 }
433 
434 
435 
437  const TrigRoiDescriptor& roi,
439  TrackCollection& outputTracks,
440  const EventContext& ctx) const {
441  ATH_MSG_DEBUG( "Input RoI " << roi );
442 
443  auto mnt_roi_nTracks = Monitored::Scalar<int>("roi_nTracks", 0);
444  std::vector<int> vec_seedSize;
445  auto mnt_seedSize = Monitored::Collection("trk_seedSize", vec_seedSize);
446  auto mnt_roi_nSPs = Monitored::Scalar<int>("roi_nSPs", 0);
447  auto mnt_roi_nSPsPIX = Monitored::Scalar<int>("roi_nSPsPIX", 0);
448  auto mnt_roi_nSPsSCT = Monitored::Scalar<int>("roi_nSPsSCT", 0);
449  auto monSP = Monitored::Group(m_monTool, mnt_roi_nSPsPIX, mnt_roi_nSPsSCT, mnt_seedSize);
450 
451  auto mnt_timer_Total = Monitored::Timer<std::chrono::milliseconds>("TIME_Total");
452  auto mnt_timer_SpacePointConversion = Monitored::Timer<std::chrono::milliseconds>("TIME_SpacePointConversion");
453  auto mnt_timer_PatternReco = Monitored::Timer<std::chrono::milliseconds>("TIME_PattReco");
454  auto mnt_timer_TripletMaking = Monitored::Timer<std::chrono::milliseconds>("TIME_Triplets");
455  auto mnt_timer_CombTracking = Monitored::Timer<std::chrono::milliseconds>("TIME_CmbTrack");
456  auto mnt_timer_TrackFitter = Monitored::Timer<std::chrono::milliseconds>("TIME_TrackFitter");
457  auto mnt_timer_dEdxTrk = Monitored::Timer<std::chrono::milliseconds>("TIME_dEdxTrk");
458  auto mnt_timer_disTrkZVertex = Monitored::Timer<std::chrono::milliseconds>("TIME_disTrkZVertex");
459  auto mnt_timer_disTrk = Monitored::Timer<std::chrono::milliseconds>("TIME_disappearingTrack");
460  auto monTime = Monitored::Group(m_monTool, mnt_roi_nTracks, mnt_roi_nSPs, mnt_timer_Total, mnt_timer_SpacePointConversion,
461  mnt_timer_PatternReco, mnt_timer_TripletMaking, mnt_timer_CombTracking, mnt_timer_TrackFitter,
462  mnt_timer_dEdxTrk, mnt_timer_disTrkZVertex, mnt_timer_disTrk);
463 
464  auto mnt_roi_lastStageExecuted = Monitored::Scalar<int>("roi_lastStageExecuted", 0);
465  auto monDataError = Monitored::Group(m_monTool, mnt_roi_lastStageExecuted);
466 
467  mnt_timer_Total.start();
468  mnt_timer_SpacePointConversion.start();
469 
470 
471  mnt_roi_lastStageExecuted = 1;
472 
473  std::vector<TrigSiSpacePointBase> convertedSpacePoints;
474 
475  convertedSpacePoints.reserve(5000);
476 
477  std::map<Identifier, std::vector<long int> > siClusterMap;
478 
479  if (!m_ITkMode) {
480 
481  if (m_LRTmode) {
482  // In LRT mode read the input track collection and enter the clusters on track into the cluster map so these are not used for seeding
483  if (!m_inputTracksKey.key().empty()) {
484  ATH_MSG_DEBUG("LRT Mode: Got input track collection with "<<inputTracks->size()<< "tracks");
485  long int trackIndex=0;
486  for (auto t:*inputTracks) {
487  updateClusterMap(trackIndex++, t, siClusterMap);
488  }
489  }
490  ATH_CHECK(m_spacePointTool->getSpacePoints(roi, convertedSpacePoints, mnt_roi_nSPsPIX, mnt_roi_nSPsSCT, ctx, &siClusterMap));
491  }
492  else {
493  ATH_CHECK(m_spacePointTool->getSpacePoints(roi, convertedSpacePoints, mnt_roi_nSPsPIX, mnt_roi_nSPsSCT, ctx));
494  }
495 
496  }
497 
498  mnt_timer_SpacePointConversion.stop();
499  mnt_roi_nSPs = mnt_roi_nSPsPIX + mnt_roi_nSPsSCT;
500 
501  if (!m_ITkMode) {
502 
503  if( mnt_roi_nSPs >= m_minHits ) {
504  ATH_MSG_DEBUG("REGTEST / Found " << mnt_roi_nSPs << " space points.");
505  ATH_MSG_DEBUG("REGTEST / Found " << mnt_roi_nSPsPIX << " Pixel space points.");
506  ATH_MSG_DEBUG("REGTEST / Found " << mnt_roi_nSPsSCT << " SCT space points.");
507  ATH_MSG_DEBUG("REGTEST / converted space points size = " << convertedSpacePoints.size());
509  }
510  else {
511  ATH_MSG_DEBUG("No tracks found - too few hits in ROI to run " << mnt_roi_nSPs);
513  return StatusCode::SUCCESS;
514  }
515  }
516 
517  mnt_roi_lastStageExecuted = 2;
518 
520  std::unique_ptr<TrigRoiDescriptor> tmpRoi = std::make_unique<TrigRoiDescriptor>(roi);
522  tmpRoi->manageConstituents(false);
523  auto vertices = std::make_unique<TrigVertexCollection>();
524  std::vector<float> vZv;
525 
526  if (m_doZFinder) {
527  auto mnt_timer_ZFinder = Monitored::Timer<std::chrono::milliseconds>("TIME_ZFinder");
528  auto monTimeZFinder = Monitored::Group(m_monTool, mnt_timer_ZFinder);
529  mnt_timer_ZFinder.start();
530 
532  tmpRoi = std::make_unique<TrigRoiDescriptor>(true);
533  tmpRoi->setComposite(true);
534 
535  vertices = std::make_unique<TrigVertexCollection>(*m_trigZFinder->findZ( convertedSpacePoints, roi));
536 
537  ATH_MSG_DEBUG("vertices->size(): " << vertices->size());
538 
539 
540  if ( m_doFastZVseeding ) {
541  vZv.reserve(vertices->size());
542  for (const auto vertex : *vertices) {
543  ATH_MSG_DEBUG("REGTEST / ZFinder vertex: " << *vertex);
544  float z = vertex->z();
545  float zMinus = z - 7.0;
546  float zPlus = z + 7.0;
547  TrigRoiDescriptor* newRoi = new TrigRoiDescriptor(roi.eta(), roi.etaMinus(), roi.etaPlus(),
548  roi.phi(), roi.phiMinus(), roi.phiPlus(), z, zMinus, zPlus);
549  tmpRoi->push_back(newRoi);
550  vZv.push_back(z);
551  }
552 
553  ATH_MSG_DEBUG("REGTEST / tmpRoi: " << *tmpRoi);
554  }
555 
556  mnt_timer_ZFinder.stop();
557 
558  if ( m_doZFinderOnly ) {
564  return StatusCode::SUCCESS;
565  }
566  }
567 
568 
569  mnt_roi_lastStageExecuted = 3;
570 
571  mnt_timer_PatternReco.start();
572 
573  mnt_timer_TripletMaking.start();
574 
575  std::vector<TrigInDetTriplet> triplets;
576 
577  std::vector<TrigInDetTracklet> new_tracklets;
578 
579  if(!m_useGPU) {
580 
581  if (m_ITkMode) {
582 
583  TrigInDetTrackSeedingResult seed_result = m_seedingTool->findSeeds(roi, new_tracklets, ctx);
584 
585  mnt_roi_nSPsPIX = seed_result.m_nPixelSPs;
586  mnt_roi_nSPsSCT = seed_result.m_nStripSPs;
587  mnt_roi_nSPs = mnt_roi_nSPsPIX + mnt_roi_nSPsSCT;
588 
589  if( mnt_roi_nSPs >= m_minHits ) {
590  ATH_MSG_DEBUG("REGTEST / Found " << mnt_roi_nSPs << " space points.");
591  ATH_MSG_DEBUG("REGTEST / Found " << mnt_roi_nSPsPIX << " Pixel space points.");
592  ATH_MSG_DEBUG("REGTEST / Found " << mnt_roi_nSPsSCT << " SCT space points.");
594  }
595  else {
596  ATH_MSG_DEBUG("No tracks found - too few hits in ROI to run " << mnt_roi_nSPs);
598  return StatusCode::SUCCESS;
599  }
600 
601  } else {
603 
604  seedGen.loadSpacePoints(convertedSpacePoints);
605 
607  seedGen.createSeeds(tmpRoi.get(), vZv);
608  }
609  else {
610  seedGen.createSeeds(tmpRoi.get());
611  }
612 
613  seedGen.getSeeds(triplets);
614  }
615  }
616  else {
617  //GPU offloading begins ...
618 
619  makeSeedsOnGPU(m_tcs, tmpRoi.get(), convertedSpacePoints, triplets);
620 
621  //GPU offloading ends ...
622  }
623 
624  unsigned int nTrackSeeds = m_useTracklets ? new_tracklets.size() : triplets.size();
625 
626  ATH_MSG_DEBUG("number of triplets: " << nTrackSeeds);
627 
628  mnt_timer_TripletMaking.stop();
629  mnt_roi_lastStageExecuted = 4;
630 
631  mnt_timer_CombTracking.start();
632 
633  // 8. Combinatorial tracking
634 
635  std::vector<std::tuple<bool, double,Trk::Track*>> qualityTracks; //bool used for later filtering
636  qualityTracks.reserve(nTrackSeeds);
637 
638  auto mnt_roi_nSeeds = Monitored::Scalar<int>("roi_nSeeds", 0);
639  auto monTrk_seed = Monitored::Group(m_monTool, mnt_roi_nSeeds);
640 
641  long int trackIndex=0;
642 
643  bool PIX = true;
644  bool SCT = true;
645 
646  m_trackMaker->newTrigEvent(ctx, trackEventData, PIX, SCT);
648 
649  std::vector<Trk::Track*> disFailTrks;
650  std::vector<Trk::Track*> disCombTrks;
651  std::vector<std::tuple<bool, double, Trk::Track*>> qualityDisFailTrks;
652  std::vector<std::tuple<bool, double, Trk::Track*>> qualityDisCombTrks;
653  int disTrk_n_disCombTrks=0;
654  int disTrk_n_disCombTrks_cleaning=0;
655  int disTrk_n_disFailTrks=0;
656  int disTrk_n_disFailTrks_cleaning=0;
657 
658 
659 
660  for(unsigned int seedIdx=0;seedIdx!=nTrackSeeds;seedIdx++) {
661 
662  std::vector<const Trk::SpacePoint*> spVec;
663 
664  if( m_useTracklets && (!new_tracklets.empty())) { //create an n-SP seed
665  spVec = new_tracklets[seedIdx].seed();
666  }
667  else {
668 
669  const TrigInDetTriplet &seed = triplets[seedIdx];
670  const Trk::SpacePoint* osp1 = seed.s1().offlineSpacePoint();
671  const Trk::SpacePoint* osp2 = seed.s2().offlineSpacePoint();
672  const Trk::SpacePoint* osp3 = seed.s3().offlineSpacePoint();
673 
674  spVec = {osp1, osp2, osp3};//create a 3-SP seed
675  }
676 
678  //check if clusters do not belong to any track
679  std::vector<Identifier> clusterIds;
680  extractClusterIds(spVec.at(0), clusterIds);
681  extractClusterIds(spVec.at(1), clusterIds);
682  extractClusterIds(spVec.at(2), clusterIds);
683  if(usedByAnyTrack(clusterIds, siClusterMap)) {
684  continue;
685  }
686  }
687  ++mnt_roi_nSeeds;
688 
689  std::list<Trk::Track*> tracks;
690  std::list<Trk::Track*> tracksFail;
691  std::list<Trk::Track*> tracksAll = m_trackMaker->getTracks(ctx, trackEventData, spVec);
692  auto resultCode = trackEventData.combinatorialData().resultCode();
693  if( ! m_doDisappearingTrk || (m_doDisappearingTrk && resultCode==InDet::SiCombinatorialTrackFinderData_xk::ResultCode::Success) ) {
694  tracks = tracksAll;
695  }
696  else {
697  tracksFail = tracksAll;
698  }
699 
700  if( m_doDisappearingTrk ) {
701  ATH_MSG_VERBOSE("size of tracks=" << tracks.size() << ", tracksFail=" << tracksFail.size() << ": resultCode=" << resultCode);
702  const TrigInDetTriplet &seed = triplets[seedIdx];
703  for(std::list<Trk::Track*>::const_iterator t=tracks.begin(); t!=tracks.end(); ++t) {
704  if( ! (*t) ) continue;
705  m_trackSummaryTool->updateTrack(ctx, **t);
706  disTrk_n_disCombTrks++;
707  if( (*t)->perigeeParameters()!=0 && isCleaningPassDisTrack(seed, (*t), false) ) {
708  ATH_MSG_VERBOSE("... combTrk, cleaningPass");
709  disTrk_n_disCombTrks_cleaning++;
710  disCombTrks.push_back((*t));
711  qualityDisCombTrks.emplace_back(std::make_tuple(true, -disTrackQuality((*t)), (*t)));
712  }
713  }
714  for(std::list<Trk::Track*>::const_iterator t=tracksFail.begin(); t!=tracksFail.end(); ++t) {
715  if( ! (*t) ) continue;
716  m_trackSummaryTool->updateTrack(ctx, **t);
717  disTrk_n_disFailTrks++;
718  if( (*t)->perigeeParameters()!=0 && isCleaningPassDisTrack(seed, (*t), true) ) {
719  ATH_MSG_VERBOSE("... failTrk, cleaningPass");
720  disTrk_n_disFailTrks_cleaning++;
721  disFailTrks.push_back((*t));
722  qualityDisFailTrks.emplace_back(std::make_tuple(true, -disTrackQuality((*t)), (*t)));
723  }
724  else {
725  delete(*t); // delete failed trk but not disFailTrk candidate
726  }
727  }
728  }
729 
730  for(std::list<Trk::Track*>::const_iterator t=tracks.begin(); t!=tracks.end(); ++t) {
731  if((*t)) {
732  float d0 = (*t)->perigeeParameters()==0 ? 10000.0 : (*t)->perigeeParameters()->parameters()[Trk::d0];
733  if (std::abs(d0) > m_initialD0Max) {
734  ATH_MSG_DEBUG("REGTEST / Reject track with d0 = " << d0 << " > " << m_initialD0Max);
735  qualityTracks.push_back(std::make_tuple(false,0,(*t)));//Flag track as bad, but keep in vector for later deletion
736  continue;
737  }
739  //update clusterMap
740  updateClusterMap(trackIndex++, (*t), siClusterMap);
741  }
742  if(m_doCloneRemoval) {
743  qualityTracks.push_back(std::make_tuple(true, -trackQuality((*t)), (*t)));
744  }
745  else {
746  qualityTracks.push_back(std::make_tuple(true, 0, (*t)));
747  }
748  }
749  }
750  ATH_MSG_VERBOSE("Found "<<tracks.size()<<" tracks using triplet");
751  }
752 
753  if( m_doDisappearingTrk ) {
754  ATH_MSG_DEBUG("===> nr of disFailTrks=" << disTrk_n_disFailTrks << " -> cleaning pass=" << disTrk_n_disFailTrks_cleaning);
755  ATH_MSG_DEBUG("===> nr of disCombTrks=" << disTrk_n_disCombTrks << " -> cleaning pass=" << disTrk_n_disCombTrks_cleaning);
756  }
757 
758  m_trackMaker->endEvent(trackEventData);
759 
760  //clone removal
761  if(m_doCloneRemoval) {
762  filterSharedTracks(qualityTracks);
763  }
764 
765  // filter shared hits
766  if( m_doDisappearingTrk ) {
767  filterSharedDisTracks(qualityDisFailTrks);
768  filterSharedDisTracks(qualityDisCombTrks);
769  }
770 
771  TrackCollection initialTracks;
772  initialTracks.reserve(qualityTracks.size());
773 
774  TrackCollection extraDisCombTracks;
775  // if( m_doDisappearingTrk ) extraDisCombTracks.reserve(qualityTracks.size());
776 
777  unsigned int idx=0;
778  std::vector<unsigned int> indexDisCombTrk;
779  for(const auto& q : qualityTracks) {
780  bool needed_for_disCombTrk = false;
781  if( m_doDisappearingTrk ) {
782  Trk::Track* trk_q = std::get<2>(q);
783  for(const auto& qdis : qualityDisCombTrks ) {
784  if( std::get<2>(qdis) == trk_q ) {
785  needed_for_disCombTrk = std::get<0>(qdis);
786  break;
787  }
788  }
789  if( needed_for_disCombTrk) ATH_MSG_VERBOSE("idx=" << idx << " ===> neded for disCombTrk");
790  }
791  if (std::get<0>(q)==true) {
792  initialTracks.push_back(std::get<2>(q));
793  if( m_doDisappearingTrk && needed_for_disCombTrk ) indexDisCombTrk.push_back(idx);
794  }
795  else {
796  if( ! m_doDisappearingTrk ) {
797  delete std::get<2>(q);
798  }
799  else {
800  if( needed_for_disCombTrk ) {
801  ATH_MSG_VERBOSE("... adding to extraDisCombTracks");
802  extraDisCombTracks.push_back(std::get<2>(q));
803  }
804  else {
805  delete std::get<2>(q);
806  }
807  }
808  }
809  idx++;
810  }
811  qualityTracks.clear();
812 
813  ATH_MSG_DEBUG("After clone removal "<<initialTracks.size()<<" tracks left");
814 
815 
816  mnt_timer_CombTracking.stop();
817  mnt_timer_PatternReco.stop();
818 
819  mnt_roi_lastStageExecuted = 5;
820 
821  mnt_timer_TrackFitter.start();
822 
823  if( ! m_dodEdxTrk ) {
824 
825  if(m_doTrackRefit) {
826  m_trigInDetTrackFitter->fit(initialTracks, outputTracks, ctx, m_particleHypothesis);
827  }
828  else {
829  outputTracks = std::move(initialTracks);
830  }
831  }
832  else {
833  TrackCollection outputTrackswTP;
834 
835  m_trigInDetTrackFitter->fit(initialTracks, outputTracks, outputTrackswTP, ctx, m_particleHypothesis, true); // add TP to TSoS for dEdx
836 
837  // large dEdx finding
838  mnt_timer_dEdxTrk.start();
839  for(auto t=outputTrackswTP.begin(); t!=outputTrackswTP.end();t++) { m_trackSummaryTool->updateTrack(ctx, **t); }
840  ATH_CHECK( finddEdxTrk(ctx,outputTrackswTP) );
841 
842  }
843 
844  if( m_dodEdxTrk ) mnt_timer_dEdxTrk.stop(); // to include timing to destroy TrackCollection object
845 
846  if( outputTracks.empty() ) {
847  ATH_MSG_DEBUG("REGTEST / No tracks fitted");
848  }
849 
850 
851  bool do_recoverDisCombTrk = true;
852  if( m_doDisappearingTrk && (initialTracks.size()!=outputTracks.size()) ) {
853  ATH_MSG_DEBUG("part of initialTracks fails in fitting. do not try to recover DisCombTracks");
854  do_recoverDisCombTrk = false;
855  }
856 
857  TrackCollection fittedExtraDisCombTracks;
858  fittedExtraDisCombTracks.reserve(extraDisCombTracks.size());
859  TrackCollection fittedDisCombTrks(SG::VIEW_ELEMENTS);
860  if( m_doDisappearingTrk) {
861  ATH_MSG_VERBOSE("nr of extraDisCombTracks=" << extraDisCombTracks.size());
862  if( extraDisCombTracks.size() > 0 ) {
863  ATH_MSG_VERBOSE("fitting extraDisCombTracks ...");
864  m_trigInDetTrackFitter->fit(extraDisCombTracks, fittedExtraDisCombTracks, ctx, m_particleHypothesis);
865  for (auto fittedTrack = fittedExtraDisCombTracks.begin(); fittedTrack!=fittedExtraDisCombTracks.end(); ++fittedTrack) {
866  (*fittedTrack)->info().setPatternRecognitionInfo(Trk::TrackInfo::FastTrackFinderSeed);
867  m_trackSummaryTool->updateTrack(ctx, **fittedTrack);
868  fittedDisCombTrks.push_back(*fittedTrack);
869  }
870  }
871  }
872 
873  //check track parameters
874 
875  for ( auto fittedTrack = outputTracks.begin(); fittedTrack!=outputTracks.end(); ) {
876  if ((*fittedTrack)->perigeeParameters()) {
877  float d0 = (*fittedTrack)->perigeeParameters()->parameters()[Trk::d0];
878  float z0 = (*fittedTrack)->perigeeParameters()->parameters()[Trk::z0];
879  if (std::abs(d0) > m_initialD0Max || std::abs(z0) > m_Z0Max) {
880  if(m_LRTmode){
881  ATH_MSG_DEBUG("REGTEST / Reject track after fit with d0 = " << d0 << " z0= " << z0
882  << " larger than limits (" << m_initialD0Max << ", " << m_Z0Max << ")");
883  }else{
884  ATH_MSG_WARNING("REGTEST / Reject track after fit with d0 = " << d0 << " z0= " << z0
885  << " larger than limits (" << m_initialD0Max << ", " << m_Z0Max << ")");
886  }
887  ATH_MSG_DEBUG(**fittedTrack);
888  fittedTrack = outputTracks.erase(fittedTrack);
889  continue;
890  }
891 
892  if(m_LRTmode){
893  //reject tracks which have a d0 below a cut but only when an input track collection (from ftf) is also present
894  if(m_LRTD0Min>0.0){
895  if(std::abs(d0) < m_LRTD0Min && !m_inputTracksKey.key().empty()){
896  ATH_MSG_DEBUG("REGTEST / Reject track after fit for min d0 (" << d0 << " < " << m_LRTD0Min <<")");
897  fittedTrack = outputTracks.erase(fittedTrack);
898  continue;
899  }
900  }
901 
902  //calculate pt
903  float trkPt = 0.0;
904  if(m_LRTHardMinPt > 0.0){
905  //avoid a floating poitn error
906  if(std::abs((*fittedTrack)->perigeeParameters()->parameters()[Trk::qOverP]) >= 1e-9){
907  trkPt = std::sin((*fittedTrack)->perigeeParameters()->parameters()[Trk::theta])/std::abs((*fittedTrack)->perigeeParameters()->parameters()[Trk::qOverP]);
908 
909  if(trkPt < m_LRTHardMinPt){
910  ATH_MSG_DEBUG("REGTEST / Reject track after fit for min pt (" << trkPt << " < " << m_LRTHardMinPt <<")");
911  fittedTrack = outputTracks.erase(fittedTrack);
912  continue;
913  }
914  }
915  }
916  }
917  }
918  ++fittedTrack;
919  }
920 
921  mnt_timer_TrackFitter.stop();
922 
923  //make track summary
924 
925  size_t counter(1);
926  idx = 0;
927 
928  for ( auto fittedTrack = outputTracks.begin();fittedTrack!=outputTracks.end();++fittedTrack) {
929 
930  (*fittedTrack)->info().setPatternRecognitionInfo(Trk::TrackInfo::FastTrackFinderSeed);
931  ATH_MSG_VERBOSE("Updating fitted track: " << counter);
932  ATH_MSG_VERBOSE(**fittedTrack);
933  m_trackSummaryTool->updateTrack(ctx, **fittedTrack);
934  ATH_MSG_VERBOSE("Updated track: " << counter);
935  ATH_MSG_VERBOSE(**fittedTrack);
936 
937  if( m_doDisappearingTrk && do_recoverDisCombTrk ) {
938  if( std::find(indexDisCombTrk.begin(),indexDisCombTrk.end(),idx)!=indexDisCombTrk.end() ) {
939  ATH_MSG_VERBOSE("fittedTrack idx=" << idx << ": recovers also for DisCombTrack");
940  fittedDisCombTrks.push_back(*fittedTrack);
941  }
942  }
943 
944  ++counter;
945  idx++;
946  }
947 
948  if( outputTracks.empty() ) {
949  ATH_MSG_DEBUG("REGTEST / No tracks reconstructed");
950  }
951  mnt_roi_lastStageExecuted = 6;
952 
953  mnt_roi_nTracks = outputTracks.size();
954 
955  // z-vertex for UTT
956  std::vector<double> disTrk_v_xVtx;
957  std::vector<double> disTrk_v_yVtx;
958  std::vector<double> disTrk_v_zVtx;
959  if( m_doDisappearingTrk ) {
960  mnt_timer_disTrkZVertex.start();
961  recoVertexForDisTrack(ctx, outputTracks, disTrk_v_xVtx, disTrk_v_yVtx, disTrk_v_zVtx);
962  mnt_timer_disTrkZVertex.stop();
963  }
964 
965  // disappearing track reco
966  if( m_doDisappearingTrk ) {
967  mnt_timer_disTrk.start();
968  ATH_CHECK( findDisTracks(ctx,outputTracks,qualityDisFailTrks,qualityDisCombTrks,fittedDisCombTrks,disTrk_v_xVtx,disTrk_v_yVtx,disTrk_v_zVtx) );
969  mnt_timer_disTrk.stop();
970  }
971  //monitor Z-vertexing
972 
973  //monitor number of tracks
974  ATH_MSG_DEBUG("REGTEST / Found " << outputTracks.size() << " tracks");
975  if( !outputTracks.empty() )
977 
979  fillMon(outputTracks, *vertices, roi, ctx);
980 
981  mnt_roi_lastStageExecuted = 7;
982 
983  mnt_timer_Total.stop();
984 
985  return StatusCode::SUCCESS;
986 }
987 
989 
991  m = Tr->trackStateOnSurfaces()->begin(),
992  me = Tr->trackStateOnSurfaces()->end ();
993 
994  double quality = 0. ;
995  const double W = 17.;
996 
997  for(; m!=me; ++m) {
998  const Trk::FitQualityOnSurface fq = (*m)->fitQualityOnSurface();
999  if(!fq) continue;
1000 
1001  double x2 = fq.chiSquared();
1002  double q;
1003  if(fq.numberDoF() == 2) q = (1.2*(W-x2*.5));
1004  else q = (W-x2 );
1005  if(q < 0.) q = 0.;
1006  quality+=q;
1007  }
1008  return quality;
1009 }
1010 
1011 void TrigFastTrackFinder::filterSharedTracks(std::vector<std::tuple<bool, double,Trk::Track*>>& QT) const {
1012 
1013  std::set<const Trk::PrepRawData*> clusters;
1014 
1015  const Trk::PrepRawData* prd[100];
1016 
1017  std::sort(QT.begin(), QT.end(),
1018  [](const std::tuple<bool, double, Trk::Track*>& lhs, const std::tuple<bool, double, Trk::Track*>& rhs) {
1019  return std::get<1>(lhs) < std::get<1>(rhs); } );
1020 
1021  for (auto& q : QT) {
1023  m = std::get<2>(q)->measurementsOnTrack()->begin(),
1024  me = std::get<2>(q)->measurementsOnTrack()->end ();
1025 
1026  int nf = 0, nc = 0;
1027  for(; m!=me; ++m ) {
1028 
1029  const Trk::PrepRawData* pr = ((const Trk::RIO_OnTrack*)(*m))->prepRawData();
1030  if(pr) {
1031  ++nc;
1032  if(clusters.find(pr)==clusters.end()) {prd[nf++]=pr; if(nf==100) break;}
1033  }
1034  }
1035  if((nf >= m_nfreeCut) || (nf == nc) ) {
1036  for(int n=0; n!=nf; ++n) clusters.insert(prd[n]);
1037  }
1038  else {
1039  std::get<0>(q) = false;
1040  }
1041  }
1042 }
1043 
1044 //---------------------------------------------------------------------------
1045 
1047 {
1048 
1049  ATH_MSG_INFO("=========================================================");
1050  ATH_MSG_INFO("TrigFastTrackFinder::finalize() - TrigFastTrackFinder Statistics: ");
1051  ATH_MSG_INFO("RoI processed: " << m_countTotalRoI);
1052  ATH_MSG_INFO("RoI with enough SPs : " << m_countRoIwithEnoughHits);
1053  ATH_MSG_INFO("RoI with Track(s) : " << m_countRoIwithTracks);
1054  ATH_MSG_INFO("=========================================================");
1055 
1056  return StatusCode::SUCCESS;
1057 }
1058 
1059 void TrigFastTrackFinder::updateClusterMap(long int trackIdx, const Trk::Track* pTrack, std::map<Identifier, std::vector<long int> >& clusterMap) const {
1060  //loop over clusters
1061 
1062  for(auto tMOT = pTrack->measurementsOnTrack()->begin(); tMOT != pTrack->measurementsOnTrack()->end(); ++tMOT) {
1063 
1064  const InDet::SiClusterOnTrack* siCLOT = dynamic_cast<const InDet::SiClusterOnTrack*>(*tMOT);
1065  if (siCLOT==nullptr) continue;
1066  const InDet::SiCluster* siCL = dynamic_cast<const InDet::SiCluster*>(siCLOT->prepRawData());
1067  if (siCL==nullptr) continue;
1068 
1069  if(m_ITkMode) {
1070  //skip non-pixel clusters because all seeds are PPP in ITK mode
1071  const InDet::PixelCluster* pixCL = dynamic_cast<const InDet::PixelCluster*>(siCL);
1072  if(pixCL==nullptr) continue;
1073  }
1074 
1075  Identifier id = siCL->identify();
1076  clusterMap[id].push_back(trackIdx);
1077  }
1078 }
1079 
1080 void TrigFastTrackFinder::extractClusterIds(const Trk::SpacePoint* pSP, std::vector<Identifier>& vIds) const {
1081  const InDet::SiCluster* pCL = dynamic_cast<const InDet::SiCluster*>(pSP->clusterList().first);
1082  if(pCL!=nullptr) vIds.push_back(pCL->identify());
1083  //check second cluster : SCT uv clusters only !
1084  pCL = dynamic_cast<const InDet::SiCluster*>(pSP->clusterList().second);
1085  if(pCL!=nullptr) vIds.push_back(pCL->identify());
1086 }
1087 
1088 bool TrigFastTrackFinder::usedByAnyTrack(const std::vector<Identifier>& vIds, std::map<Identifier, std::vector<long int> >& clusterMap) const {
1089 
1090  std::vector<long int> xSection;
1091  //initializing
1092  std::map<Identifier, std::vector<long int> >::iterator itm0 = clusterMap.find(*vIds.begin());
1093  if(itm0 == clusterMap.end()) return false;
1094  xSection.reserve((*itm0).second.size());
1095  std::copy((*itm0).second.begin(), (*itm0).second.end(), std::back_inserter(xSection));
1096  std::vector<Identifier>::const_iterator it = vIds.begin();++it;
1097  for(;it!=vIds.end();++it) {
1098  std::map<Identifier, std::vector<long int> >::iterator itm1 = clusterMap.find(*it);
1099  if(itm1 == clusterMap.end()) return false;
1100  std::vector<long int> tmp;
1101  std::set_intersection(xSection.begin(), xSection.end(), (*itm1).second.begin(),(*itm1).second.end(), std::back_inserter(tmp));
1102  if(tmp.empty()) return false;
1103  //update xSection
1104  xSection.clear();
1105  xSection.reserve(tmp.size());
1106  std::copy(tmp.begin(), tmp.end(), std::back_inserter(xSection));
1107  }
1108  return !xSection.empty();
1109 }
1110 
1112  const TrigRoiDescriptor& roi, const EventContext& ctx) const {
1113  float shift_x = 0;
1114  float shift_y = 0;
1115  if(m_useBeamSpot) {
1117  FTF::getBeamSpotShift(shift_x, shift_y, **beamSpotHandle);
1118  }
1119  auto mnt_roi_eta = Monitored::Scalar<float>("roi_eta", 0.0);
1120  auto mnt_roi_phi = Monitored::Scalar<float>("roi_phi", 0.0);
1121  auto mnt_roi_etaWidth = Monitored::Scalar<float>("roi_etaWidth", 0.0);
1122  auto mnt_roi_phiWidth = Monitored::Scalar<float>("roi_phiWidth", 0.0);
1123  auto mnt_roi_z = Monitored::Scalar<float>("roi_z", 0.0);
1124  auto mnt_roi_zWidth = Monitored::Scalar<float>("roi_zWidth", 0.0);
1125  auto monRoI = Monitored::Group(m_monTool, mnt_roi_eta, mnt_roi_phi, mnt_roi_etaWidth, mnt_roi_phiWidth, mnt_roi_z, mnt_roi_zWidth);
1126 
1127  if (roi.composite()){
1128  for(unsigned int i=0; i<roi.size(); i++) {
1129  const IRoiDescriptor *subroi = roi.at(i);
1130  if (subroi){
1131  mnt_roi_eta = subroi->eta();
1132  mnt_roi_phi = subroi->phi();
1133  mnt_roi_etaWidth = subroi->etaPlus() - subroi->etaMinus();
1134  mnt_roi_phiWidth = CxxUtils::wrapToPi(subroi->phiPlus() - subroi->phiMinus());
1135  mnt_roi_z = subroi->zed();
1136  mnt_roi_zWidth = subroi->zedPlus() - subroi->zedMinus();
1137  monRoI.fill();
1138  }
1139  }
1140  }
1141  else {
1142  mnt_roi_eta = roi.eta();
1143  mnt_roi_phi = roi.phi();
1144  mnt_roi_etaWidth = roi.etaPlus() - roi.etaMinus();
1145  mnt_roi_phiWidth = CxxUtils::wrapToPi(roi.phiPlus() - roi.phiMinus());
1146  mnt_roi_z = roi.zed();
1147  mnt_roi_zWidth = roi.zedPlus() - roi.zedMinus();
1148  }
1149 
1150  std::vector<float> mnt_trk_pt;
1151  std::vector<float> mnt_trk_a0;
1152  std::vector<float> mnt_trk_z0;
1153  std::vector<float> mnt_trk_phi0;
1154  std::vector<float> mnt_trk_eta;
1155  std::vector<float> mnt_trk_chi2dof;
1156  std::vector<float> mnt_trk_nSiHits;
1157  std::vector<float> mnt_trk_nPIXHits;
1158  std::vector<float> mnt_trk_nSCTHits;
1159  std::vector<float> mnt_trk_a0beam;
1160  std::vector<float> mnt_trk_z0beam;
1161  std::vector<float> mnt_trk_dPhi0;
1162  std::vector<float> mnt_trk_dEta;
1163 
1164  auto mon_pt = Monitored::Collection("trk_pt", mnt_trk_pt);
1165  auto mon_a0 = Monitored::Collection("trk_a0", mnt_trk_a0);
1166  auto mon_z0 = Monitored::Collection("trk_z0", mnt_trk_z0);
1167  auto mon_phi0 = Monitored::Collection("trk_phi0", mnt_trk_phi0);
1168  auto mon_eta = Monitored::Collection("trk_eta", mnt_trk_eta);
1169  auto mon_chi2dof = Monitored::Collection("trk_chi2dof", mnt_trk_chi2dof);
1170  auto mon_nSiHits = Monitored::Collection("trk_nSiHits", mnt_trk_nSiHits);
1171  auto mon_nPIXHits = Monitored::Collection("trk_nPIXHits", mnt_trk_nPIXHits);
1172  auto mon_nSCTHits = Monitored::Collection("trk_nSCTHits", mnt_trk_nSCTHits);
1173  auto mon_a0beam = Monitored::Collection("trk_a0beam", mnt_trk_a0beam);
1174  auto mon_z0beam = Monitored::Collection("trk_z0beam", mnt_trk_z0beam);
1175  auto mon_dPhi0 = Monitored::Collection("trk_dPhi0", mnt_trk_dPhi0);
1176  auto mon_dEta = Monitored::Collection("trk_dEta", mnt_trk_dEta);
1177  auto monTrk = Monitored::Group(m_monTool, mon_pt, mon_a0, mon_z0, mon_phi0, mon_eta, mon_chi2dof,
1178  mon_nSiHits, mon_nPIXHits, mon_nSCTHits, mon_a0beam, mon_z0beam, mon_dPhi0, mon_dEta);
1179 
1180  std::vector<float> mnt_roi_zVertices;
1181  auto mon_roi_nZvertices = Monitored::Scalar<int>("roi_nZvertices", 0);
1182  auto mon_roi_zVertices = Monitored::Collection("roi_zVertices", mnt_roi_zVertices);
1183  auto monVtx = Monitored::Group(m_monTool, mon_roi_nZvertices, mon_roi_zVertices);
1184  mon_roi_nZvertices = vertices.size();
1185  for (const auto vertex : vertices) {
1186  mnt_roi_zVertices.push_back(vertex->z());
1187  }
1188 
1189  for (auto track : tracks) {
1190  const Trk::TrackParameters* trackPars = track->perigeeParameters();
1191  if(trackPars==nullptr) {
1192  continue;
1193  }
1194 
1195  if(trackPars->covariance()==nullptr) {
1196  continue;
1197  }
1198 
1199  float a0 = trackPars->parameters()[Trk::d0];
1200  float z0 = trackPars->parameters()[Trk::z0];
1201  float phi0 = trackPars->parameters()[Trk::phi0];
1202  float theta = trackPars->parameters()[Trk::theta];
1203  float eta = -log(tan(0.5*theta));
1204  mnt_trk_a0.push_back(a0);
1205  mnt_trk_z0.push_back(z0);
1206  mnt_trk_phi0.push_back(phi0);
1207  mnt_trk_a0beam.push_back(a0+shift_x*std::sin(phi0)-shift_y*std::cos(phi0));
1208  mnt_trk_z0beam.push_back(z0+(shift_x*std::cos(phi0)+shift_y*std::sin(phi0))/std::tan(theta));
1209  mnt_trk_eta.push_back(eta);
1210  for(unsigned int i=0; i<roi.size(); i++) {
1211  mnt_trk_dPhi0.push_back(CxxUtils::wrapToPi(phi0 - (roi.at(i))->phi()));
1212  mnt_trk_dEta.push_back(eta - (roi.at(i))->eta());
1213  }
1214 
1215  float qOverP = trackPars->parameters()[Trk::qOverP];
1216  if (qOverP==0) {
1217  ATH_MSG_DEBUG("REGTEST / q/p == 0, adjusting to 1e-12");
1218  qOverP = 1e-12;
1219  }
1220  float pT=sin(theta)/qOverP;
1221 
1222  const Trk::FitQuality* fq = track->fitQuality();
1223  float chi2 = 1e8;
1224  if (fq) {
1225  ATH_MSG_VERBOSE("Fitted chi2: " << fq->chiSquared());
1226  ATH_MSG_VERBOSE("Fitted ndof: " << fq->numberDoF());
1227  if(fq->numberDoF()!=0) {
1228  chi2 = fq->chiSquared()/fq->numberDoF();
1229  }
1230  }
1231  mnt_trk_pt.push_back(pT);
1232  mnt_trk_chi2dof.push_back(chi2);
1233 
1234  int nPix=0, nSct=0;
1235 
1236  for(auto tSOS = track->trackStateOnSurfaces()->begin();
1237  tSOS!=track->trackStateOnSurfaces()->end(); ++tSOS) {
1238  if ((*tSOS)->type(Trk::TrackStateOnSurface::Perigee) == false) {
1239  const Trk::FitQualityOnSurface fq = (*tSOS)->fitQualityOnSurface();
1240  if(!fq) continue;
1241  int nd = fq.numberDoF();
1242  if(nd==2) nPix++;
1243  if(nd==1) nSct++;
1244  }
1245  }
1246  mnt_trk_nPIXHits.push_back(nPix);
1247  mnt_trk_nSCTHits.push_back(nSct/2);
1248  mnt_trk_nSiHits.push_back(nPix + nSct/2);
1249 
1250  ATH_MSG_DEBUG("REGTEST / track npix/nsct/phi0/pt/eta/d0/z0/chi2: " <<
1251  nPix << " / " <<
1252  nSct/2 << " / " <<
1253  phi0 << " / " <<
1254  pT << " / " <<
1255  eta << " / " <<
1256  a0 << " / " <<
1257  z0 << " / " <<
1258  chi2);
1259  // tighter selection for unbiased residuals
1260  bool goodTrack = std::fabs(pT)>1000. && (nPix + nSct/2) > 3 && nSct > 0;
1261  if (goodTrack && m_doResMonitoring) {
1263  }
1264  }
1265 }
1266 
1267 void TrigFastTrackFinder::runResidualMonitoring(const Trk::Track& track, const EventContext& ctx) const {
1268 
1269  std::vector<float> mnt_layer_IBL;
1270  std::vector<float> mnt_layer_PixB;
1271  std::vector<float> mnt_layer_PixE;
1272  std::vector<float> mnt_layer_SCTB;
1273  std::vector<float> mnt_layer_SCTE;
1274  std::vector<float> mnt_hit_IBLPhiResidual;
1275  std::vector<float> mnt_hit_IBLEtaResidual;
1276  std::vector<float> mnt_hit_IBLPhiPull;
1277  std::vector<float> mnt_hit_IBLEtaPull;
1278  std::vector<float> mnt_hit_PIXBarrelPhiResidual;
1279  std::vector<float> mnt_hit_PIXBarrelEtaResidual;
1280  std::vector<float> mnt_hit_PIXBarrelPhiPull;
1281  std::vector<float> mnt_hit_PIXBarrelEtaPull;
1282  std::vector<float> mnt_hit_SCTBarrelResidual;
1283  std::vector<float> mnt_hit_SCTBarrelPull;
1284  std::vector<float> mnt_hit_PIXEndcapPhiResidual;
1285  std::vector<float> mnt_hit_PIXEndcapEtaResidual;
1286  std::vector<float> mnt_hit_PIXEndcapPhiPull;
1287  std::vector<float> mnt_hit_PIXEndcapEtaPull;
1288  std::vector<float> mnt_hit_SCTEndcapResidual;
1289  std::vector<float> mnt_hit_SCTEndcapPull;
1290  std::vector<float> mnt_hit_PIXBarrelL1PhiResidual;
1291  std::vector<float> mnt_hit_PIXBarrelL1EtaResidual;
1292  std::vector<float> mnt_hit_PIXBarrelL2PhiResidual;
1293  std::vector<float> mnt_hit_PIXBarrelL2EtaResidual;
1294  std::vector<float> mnt_hit_PIXBarrelL3PhiResidual;
1295  std::vector<float> mnt_hit_PIXBarrelL3EtaResidual;
1296  std::vector<float> mnt_hit_PIXEndcapL1PhiResidual;
1297  std::vector<float> mnt_hit_PIXEndcapL1EtaResidual;
1298  std::vector<float> mnt_hit_PIXEndcapL2PhiResidual;
1299  std::vector<float> mnt_hit_PIXEndcapL2EtaResidual;
1300  std::vector<float> mnt_hit_PIXEndcapL3PhiResidual;
1301  std::vector<float> mnt_hit_PIXEndcapL3EtaResidual;
1302  std::vector<float> mnt_hit_SCTBarrelL1PhiResidual;
1303  std::vector<float> mnt_hit_SCTBarrelL2PhiResidual;
1304  std::vector<float> mnt_hit_SCTBarrelL3PhiResidual;
1305  std::vector<float> mnt_hit_SCTBarrelL4PhiResidual;
1306  std::vector<float> mnt_hit_SCTEndcapL1PhiResidual;
1307  std::vector<float> mnt_hit_SCTEndcapL2PhiResidual;
1308  std::vector<float> mnt_hit_SCTEndcapL3PhiResidual;
1309  std::vector<float> mnt_hit_SCTEndcapL4PhiResidual;
1310  std::vector<float> mnt_hit_SCTEndcapL5PhiResidual;
1311  std::vector<float> mnt_hit_SCTEndcapL6PhiResidual;
1312  std::vector<float> mnt_hit_SCTEndcapL7PhiResidual;
1313  std::vector<float> mnt_hit_SCTEndcapL8PhiResidual;
1314  std::vector<float> mnt_hit_SCTEndcapL9PhiResidual;
1315  auto mon_layer_IBL = Monitored::Collection("layer_IBL", mnt_layer_IBL);
1316  auto mon_layer_PixB = Monitored::Collection("layer_PixB",mnt_layer_PixB);
1317  auto mon_layer_PixE = Monitored::Collection("layer_PixE",mnt_layer_PixE);
1318  auto mon_layer_SCTB = Monitored::Collection("layer_SCTB",mnt_layer_SCTB);
1319  auto mon_layer_SCTE = Monitored::Collection("layer_SCTE",mnt_layer_SCTE);
1320  auto mon_hit_IBLPhiResidual = Monitored::Collection("hit_IBLPhiResidual",mnt_hit_IBLPhiResidual);
1321  auto mon_hit_IBLEtaResidual = Monitored::Collection("hit_IBLEtaResidual",mnt_hit_IBLEtaResidual);
1322  auto mon_hit_IBLPhiPull = Monitored::Collection("hit_IBLPhiPull",mnt_hit_IBLPhiPull);
1323  auto mon_hit_IBLEtaPull = Monitored::Collection("hit_IBLEtaPull",mnt_hit_IBLEtaPull);
1324  auto mon_hit_PIXBarrelPhiResidual = Monitored::Collection("hit_PIXBarrelPhiResidual",mnt_hit_PIXBarrelPhiResidual);
1325  auto mon_hit_PIXBarrelEtaResidual = Monitored::Collection("hit_PIXBarrelEtaResidual",mnt_hit_PIXBarrelEtaResidual);
1326  auto mon_hit_PIXBarrelPhiPull = Monitored::Collection("hit_PIXBarrelPhiPull",mnt_hit_PIXBarrelPhiPull);
1327  auto mon_hit_PIXBarrelEtaPull = Monitored::Collection("hit_PIXBarrelEtaPull",mnt_hit_PIXBarrelEtaPull);
1328  auto mon_hit_SCTBarrelResidual = Monitored::Collection("hit_SCTBarrelResidual",mnt_hit_SCTBarrelResidual);
1329  auto mon_hit_SCTBarrelPull = Monitored::Collection("hit_SCTBarrelPull",mnt_hit_SCTBarrelPull);
1330  auto mon_hit_PIXEndcapPhiResidual = Monitored::Collection("hit_PIXEndcapPhiResidual",mnt_hit_PIXEndcapPhiResidual);
1331  auto mon_hit_PIXEndcapEtaResidual = Monitored::Collection("hit_PIXEndcapEtaResidual",mnt_hit_PIXEndcapEtaResidual);
1332  auto mon_hit_PIXEndcapPhiPull = Monitored::Collection("hit_PIXEndcapPhiPull",mnt_hit_PIXEndcapPhiPull);
1333  auto mon_hit_PIXEndcapEtaPull = Monitored::Collection("hit_PIXEndcapEtaPull",mnt_hit_PIXEndcapEtaPull);
1334  auto mon_hit_SCTEndcapResidual = Monitored::Collection("hit_SCTEndcapResidual",mnt_hit_SCTEndcapResidual);
1335  auto mon_hit_SCTEndcapPull = Monitored::Collection("hit_SCTEndcapPull",mnt_hit_SCTEndcapPull);
1336  auto mon_hit_PIXBarrelL1PhiResidual = Monitored::Collection("hit_PIXBarrelL1PhiResidual",mnt_hit_PIXBarrelL1PhiResidual);
1337  auto mon_hit_PIXBarrelL1EtaResidual = Monitored::Collection("hit_PIXBarrelL1EtaResidual",mnt_hit_PIXBarrelL1EtaResidual);
1338  auto mon_hit_PIXBarrelL2PhiResidual = Monitored::Collection("hit_PIXBarrelL2PhiResidual",mnt_hit_PIXBarrelL2PhiResidual);
1339  auto mon_hit_PIXBarrelL2EtaResidual = Monitored::Collection("hit_PIXBarrelL2EtaResidual",mnt_hit_PIXBarrelL2EtaResidual);
1340  auto mon_hit_PIXBarrelL3PhiResidual = Monitored::Collection("hit_PIXBarrelL3PhiResidual",mnt_hit_PIXBarrelL3PhiResidual);
1341  auto mon_hit_PIXBarrelL3EtaResidual = Monitored::Collection("hit_PIXBarrelL3EtaResidual",mnt_hit_PIXBarrelL3EtaResidual);
1342  auto mon_hit_PIXEndcapL1PhiResidual = Monitored::Collection("hit_PIXEndcapL1PhiResidual",mnt_hit_PIXEndcapL1PhiResidual);
1343  auto mon_hit_PIXEndcapL1EtaResidual = Monitored::Collection("hit_PIXEndcapL1EtaResidual",mnt_hit_PIXEndcapL1EtaResidual);
1344  auto mon_hit_PIXEndcapL2PhiResidual = Monitored::Collection("hit_PIXEndcapL2PhiResidual",mnt_hit_PIXEndcapL2PhiResidual);
1345  auto mon_hit_PIXEndcapL2EtaResidual = Monitored::Collection("hit_PIXEndcapL2EtaResidual",mnt_hit_PIXEndcapL2EtaResidual);
1346  auto mon_hit_PIXEndcapL3PhiResidual = Monitored::Collection("hit_PIXEndcapL3PhiResidual",mnt_hit_PIXEndcapL3PhiResidual);
1347  auto mon_hit_PIXEndcapL3EtaResidual = Monitored::Collection("hit_PIXEndcapL3EtaResidual",mnt_hit_PIXEndcapL3EtaResidual);
1348  auto mon_hit_SCTBarrelL1PhiResidual = Monitored::Collection("hit_SCTBarrelL1PhiResidual",mnt_hit_SCTBarrelL1PhiResidual);
1349  auto mon_hit_SCTBarrelL2PhiResidual = Monitored::Collection("hit_SCTBarrelL2PhiResidual",mnt_hit_SCTBarrelL2PhiResidual);
1350  auto mon_hit_SCTBarrelL3PhiResidual = Monitored::Collection("hit_SCTBarrelL3PhiResidual",mnt_hit_SCTBarrelL3PhiResidual);
1351  auto mon_hit_SCTBarrelL4PhiResidual = Monitored::Collection("hit_SCTBarrelL4PhiResidual",mnt_hit_SCTBarrelL4PhiResidual);
1352  auto mon_hit_SCTEndcapL1PhiResidual = Monitored::Collection("hit_SCTEndcapL1PhiResidual",mnt_hit_SCTEndcapL1PhiResidual);
1353  auto mon_hit_SCTEndcapL2PhiResidual = Monitored::Collection("hit_SCTEndcapL2PhiResidual",mnt_hit_SCTEndcapL2PhiResidual);
1354  auto mon_hit_SCTEndcapL3PhiResidual = Monitored::Collection("hit_SCTEndcapL3PhiResidual",mnt_hit_SCTEndcapL3PhiResidual);
1355  auto mon_hit_SCTEndcapL4PhiResidual = Monitored::Collection("hit_SCTEndcapL4PhiResidual",mnt_hit_SCTEndcapL4PhiResidual);
1356  auto mon_hit_SCTEndcapL5PhiResidual = Monitored::Collection("hit_SCTEndcapL5PhiResidual",mnt_hit_SCTEndcapL5PhiResidual);
1357  auto mon_hit_SCTEndcapL6PhiResidual = Monitored::Collection("hit_SCTEndcapL6PhiResidual",mnt_hit_SCTEndcapL6PhiResidual);
1358  auto mon_hit_SCTEndcapL7PhiResidual = Monitored::Collection("hit_SCTEndcapL7PhiResidual",mnt_hit_SCTEndcapL7PhiResidual);
1359  auto mon_hit_SCTEndcapL8PhiResidual = Monitored::Collection("hit_SCTEndcapL8PhiResidual",mnt_hit_SCTEndcapL8PhiResidual);
1360  auto mon_hit_SCTEndcapL9PhiResidual = Monitored::Collection("hit_SCTEndcapL9PhiResidual",mnt_hit_SCTEndcapL9PhiResidual);
1361 
1362  auto monRes = Monitored::Group(m_monTool, mon_layer_IBL, mon_layer_PixB, mon_layer_PixE, mon_layer_SCTB, mon_layer_SCTE, mon_hit_IBLPhiResidual, mon_hit_IBLEtaResidual, mon_hit_IBLPhiPull, mon_hit_IBLEtaPull, mon_hit_PIXBarrelPhiResidual, mon_hit_PIXBarrelEtaResidual, mon_hit_PIXBarrelPhiPull, mon_hit_PIXBarrelEtaPull, mon_hit_SCTBarrelResidual, mon_hit_SCTBarrelPull, mon_hit_PIXEndcapPhiResidual, mon_hit_PIXEndcapEtaResidual, mon_hit_PIXEndcapPhiPull, mon_hit_PIXEndcapEtaPull, mon_hit_SCTEndcapResidual, mon_hit_SCTEndcapPull, mon_hit_PIXBarrelL1PhiResidual, mon_hit_PIXBarrelL1EtaResidual, mon_hit_PIXBarrelL2PhiResidual, mon_hit_PIXBarrelL2EtaResidual, mon_hit_PIXBarrelL3PhiResidual, mon_hit_PIXBarrelL3EtaResidual, mon_hit_PIXEndcapL1PhiResidual, mon_hit_PIXEndcapL1EtaResidual, mon_hit_PIXEndcapL2PhiResidual, mon_hit_PIXEndcapL2EtaResidual, mon_hit_PIXEndcapL3PhiResidual, mon_hit_PIXEndcapL3EtaResidual, mon_hit_SCTBarrelL1PhiResidual, mon_hit_SCTBarrelL2PhiResidual, mon_hit_SCTBarrelL3PhiResidual, mon_hit_SCTBarrelL4PhiResidual, mon_hit_SCTEndcapL1PhiResidual, mon_hit_SCTEndcapL2PhiResidual, mon_hit_SCTEndcapL3PhiResidual, mon_hit_SCTEndcapL4PhiResidual, mon_hit_SCTEndcapL5PhiResidual, mon_hit_SCTEndcapL6PhiResidual, mon_hit_SCTEndcapL7PhiResidual, mon_hit_SCTEndcapL8PhiResidual, mon_hit_SCTEndcapL9PhiResidual);
1363 
1364  std::vector<TrigL2HitResidual> vResid;
1365  vResid.clear();
1366  StatusCode scRes = m_trigInDetTrackFitter->getUnbiasedResiduals(track,vResid, ctx);
1367  if(!scRes.isSuccess()) return;
1368  for(std::vector<TrigL2HitResidual>::iterator it=vResid.begin();it!=vResid.end();++it) {
1369  Identifier id = it->identify();
1370  int pixlayer= (m_pixelId->layer_disk(id) );
1371  int sctlayer= (m_sctId->layer_disk(id) );
1372 
1373  switch(it->regionId()) {
1374  case Region::PixBarrel :
1375  mnt_layer_PixB.push_back(pixlayer);
1376  mnt_hit_PIXBarrelPhiResidual.push_back(it->phiResidual());
1377  mnt_hit_PIXBarrelPhiPull.push_back(it->phiPull());
1378  mnt_hit_PIXBarrelEtaResidual.push_back(it->etaResidual());
1379  mnt_hit_PIXBarrelEtaPull.push_back(it->etaPull());
1380  if (pixlayer == 1) {
1381  mnt_hit_PIXBarrelL1PhiResidual.push_back(it->phiResidual());
1382  mnt_hit_PIXBarrelL1EtaResidual.push_back(it->etaResidual());
1383  }
1384  if (pixlayer == 2) {
1385  mnt_hit_PIXBarrelL2PhiResidual.push_back(it->phiResidual());
1386  mnt_hit_PIXBarrelL2EtaResidual.push_back(it->etaResidual());
1387  }
1388  if (pixlayer == 3) {
1389  mnt_hit_PIXBarrelL3PhiResidual.push_back(it->phiResidual());
1390  mnt_hit_PIXBarrelL3EtaResidual.push_back(it->etaResidual());
1391  }
1392  break;
1393  case Region::PixEndcap :
1394  ATH_MSG_DEBUG("Pixel Endcap " );
1395  mnt_layer_PixE.push_back(pixlayer);
1396  mnt_hit_PIXEndcapPhiResidual.push_back(it->phiResidual());
1397  mnt_hit_PIXEndcapPhiPull.push_back(it->phiPull());
1398  mnt_hit_PIXEndcapEtaResidual.push_back(it->etaResidual());
1399  mnt_hit_PIXEndcapEtaPull.push_back(it->etaPull());
1400  if (pixlayer == 0) {
1401  mnt_hit_PIXEndcapL1PhiResidual.push_back(it->phiResidual());
1402  mnt_hit_PIXEndcapL1EtaResidual.push_back(it->etaResidual());
1403  }
1404  if (pixlayer == 1) {
1405  mnt_hit_PIXEndcapL2PhiResidual.push_back(it->phiResidual());
1406  mnt_hit_PIXEndcapL2EtaResidual.push_back(it->etaResidual());
1407  }
1408  if (pixlayer == 2) {
1409  mnt_hit_PIXEndcapL3PhiResidual.push_back(it->phiResidual());
1410  mnt_hit_PIXEndcapL3EtaResidual.push_back(it->etaResidual());
1411  }
1412  break;
1413  case Region::SctBarrel :
1414  mnt_layer_SCTB.push_back(sctlayer);
1415  mnt_hit_SCTBarrelResidual.push_back(it->phiResidual());
1416  mnt_hit_SCTBarrelPull.push_back(it->phiPull());
1417  if (sctlayer == 0) {
1418  mnt_hit_SCTBarrelL1PhiResidual.push_back(it->phiResidual());
1419  }
1420  if (sctlayer == 1) {
1421  mnt_hit_SCTBarrelL2PhiResidual.push_back(it->phiResidual());
1422  }
1423  if (sctlayer == 2) {
1424  mnt_hit_SCTBarrelL3PhiResidual.push_back(it->phiResidual());
1425  }
1426  if (sctlayer == 3) {
1427  mnt_hit_SCTBarrelL4PhiResidual.push_back(it->phiResidual());
1428  }
1429  break;
1430  case Region::SctEndcap :
1431  ATH_MSG_DEBUG("SCT Endcap" );
1432  mnt_layer_SCTE.push_back(sctlayer);
1433  mnt_hit_SCTEndcapResidual.push_back(it->phiResidual());
1434  mnt_hit_SCTEndcapPull.push_back(it->phiPull());
1435  if (sctlayer == 0) {
1436  mnt_hit_SCTEndcapL1PhiResidual.push_back(it->phiResidual());
1437  }
1438  if (sctlayer == 1) {
1439  mnt_hit_SCTEndcapL2PhiResidual.push_back(it->phiResidual());
1440  }
1441  if (sctlayer == 2) {
1442  mnt_hit_SCTEndcapL3PhiResidual.push_back(it->phiResidual());
1443  }
1444  if (sctlayer == 3) {
1445  mnt_hit_SCTEndcapL4PhiResidual.push_back(it->phiResidual());
1446  }
1447  if (sctlayer == 4) {
1448  mnt_hit_SCTEndcapL5PhiResidual.push_back(it->phiResidual());
1449  }
1450  if (sctlayer == 5) {
1451  mnt_hit_SCTEndcapL6PhiResidual.push_back(it->phiResidual());
1452  }
1453  if (sctlayer == 6) {
1454  mnt_hit_SCTEndcapL7PhiResidual.push_back(it->phiResidual());
1455  }
1456  if (sctlayer == 7) {
1457  mnt_hit_SCTEndcapL8PhiResidual.push_back(it->phiResidual());
1458  }
1459  if (sctlayer == 8) {
1460  mnt_hit_SCTEndcapL9PhiResidual.push_back(it->phiResidual());
1461  }
1462  break;
1463  case Region::IBL :
1464  mnt_layer_IBL.push_back(pixlayer);
1465  if (m_tcs.m_maxSiliconLayer==32) {
1466  mnt_hit_IBLPhiResidual.push_back(it->phiResidual());
1467  mnt_hit_IBLPhiPull.push_back(it->phiPull());
1468  mnt_hit_IBLEtaResidual.push_back(it->etaResidual());
1469  mnt_hit_IBLEtaPull.push_back(it->etaPull());
1470  }
1471  else {//No IBL, fill pixel histograms instead
1472  ATH_MSG_DEBUG("IBL wrong region" );
1473  mnt_hit_PIXBarrelPhiResidual.push_back(it->phiResidual());
1474  mnt_hit_PIXBarrelPhiPull.push_back(it->phiPull());
1475  mnt_hit_PIXBarrelEtaResidual.push_back(it->etaResidual());
1476  mnt_hit_PIXBarrelEtaPull.push_back(it->etaPull());
1477  }
1478  break;
1479  case Region::Undefined :
1480  ATH_MSG_DEBUG("Undefined ID region");
1481  break;
1482  }
1483  }
1484 }
1485 
1487 ::vector<TrigSiSpacePointBase>& vsp, std::vector<TrigInDetTriplet>& output) const {
1488 
1489  output.clear();
1490 
1491  TrigAccel::DATA_EXPORT_BUFFER* dataBuffer = new TrigAccel::DATA_EXPORT_BUFFER(5000);//i.e. 5KB
1492 
1493  size_t actualSize = m_accelTool->exportSeedMakingJob(tcs, roi, vsp, *dataBuffer);
1494 
1495  ATH_MSG_DEBUG("SeedMakingJob is ready, data size for transfer = " <<actualSize);
1496 
1497  std::shared_ptr<TrigAccel::OffloadBuffer> pBuff = std::make_shared<TrigAccel::OffloadBuffer>(dataBuffer);
1498 
1500 
1501  if(pJob) {
1502  ATH_MSG_DEBUG("Work item created for task "<<TrigAccel::InDetJobControlCode::MAKE_SEEDS);
1503 
1504  pJob->run();
1505 
1506  std::shared_ptr<TrigAccel::OffloadBuffer> pOB = pJob->getOutput();
1507 
1508  int nTriplets = m_accelTool->extractTripletsFromOutput(pOB,vsp, output);
1509 
1510  ATH_MSG_DEBUG("Found "<<nTriplets<<" triplets on GPU");
1511  }
1512 
1513  delete pJob;
1514  delete dataBuffer;
1515 }
1516 
1518 {
1519  if( m_dodEdxTrk ) {
1521  ATH_CHECK( dEdxTrkHandle.record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1522 
1524  ATH_CHECK( dEdxHitHandle.record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1525  }
1526  if( m_doDisappearingTrk ) {
1528  ATH_CHECK( disTrkCandHandle.record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1529  }
1530  return StatusCode::SUCCESS;
1531 }
1532 
1533 
1535 {
1536  float abseta = std::fabs(eta);
1537 
1538  // Pixel barrel or SCT barrel
1539  if( 0<=layer && layer <=7 ) {
1540  ATH_MSG_VERBOSE("layer=" << layer << ", eta=" << abseta);
1541  return layer;
1542  }
1543 
1544  int base = 0;
1545 
1546  //
1547  const float PixBR6limit = 1.29612;
1548  const float PixBR5limit = 1.45204;
1549  const float PixBR4limit = 1.64909;
1550  const float PixBR3limit = 1.90036;
1551  const float PixBR2limit = 2.2146;
1552 
1553  // Pixel Endcap #1
1554  base = 8;
1555  if( layer==base || layer==(base+12) ) {
1556  ATH_MSG_VERBOSE("Pix EC1, eta=" << abseta);
1557  if( abseta > PixBR2limit ) return 2;
1558  return 3;
1559  }
1560 
1561  // Pixel Endcap #2
1562  base = 9;
1563  if( layer==base || layer==(base+12) ) {
1564  ATH_MSG_VERBOSE("Pix EC2, eta=" << abseta);
1565  if( abseta > PixBR2limit ) return 2;
1566  return 3;
1567  }
1568 
1569  // Pixel Endcap #3
1570  base = 10;
1571  if( layer==base || layer==(base+12) ) {
1572  ATH_MSG_VERBOSE("Pix EC3, eta=" << abseta);
1573  return 3;
1574  }
1575 
1576  // SCT Endcap #1
1577  base = 11;
1578  if( layer==base || layer==(base+12) ) {
1579  ATH_MSG_VERBOSE("Sct EC1, eta=" << abseta);
1580  if( abseta < PixBR6limit ) return 7;
1581  else if( abseta < PixBR5limit ) return 6;
1582  return 5;
1583  }
1584 
1585  // SCT Endcap #2
1586  base = 12;
1587  if( layer==base || layer==(base+12) ) {
1588  ATH_MSG_VERBOSE("Sct EC2, eta=" << abseta);
1589  if( abseta < PixBR5limit ) return 7;
1590  else if( abseta < PixBR4limit ) return 6;
1591  return 4;
1592  }
1593 
1594  // SCT Endcap #3
1595  base = 13;
1596  if( layer==base || layer==(base+12) ) {
1597  ATH_MSG_VERBOSE("Sct EC3, eta=" << abseta);
1598  if( abseta < PixBR4limit ) return 7;
1599  return 5;
1600  }
1601 
1602  // SCT Endcap #4
1603  base = 14;
1604  if( layer==base || layer==(base+12) ) {
1605  ATH_MSG_VERBOSE("Sct EC4, eta=" << abseta);
1606  if( abseta < PixBR4limit ) return 6;
1607  else if( abseta < PixBR3limit ) return 6;
1608  return 4;
1609  }
1610 
1611  // SCT Endcap #5
1612  base = 15;
1613  if( layer==base || layer==(base+12) ) {
1614  ATH_MSG_VERBOSE("Sct EC5, eta=" << abseta);
1615  if( abseta < PixBR3limit ) return 7;
1616  return 5;
1617  }
1618 
1619  // SCT Endcap #6
1620  base = 16;
1621  if( layer==base || layer==(base+12) ) {
1622  ATH_MSG_VERBOSE("Sct EC6, eta=" << abseta);
1623  if( abseta < PixBR3limit ) return 6;
1624  return 4;
1625  }
1626 
1627  // SCT Endcap #7
1628  base = 17;
1629  if( layer==base || layer==(base+12) ) {
1630  ATH_MSG_VERBOSE("Sct EC7, eta=" << abseta);
1631  if( abseta < PixBR3limit ) return 7;
1632  return 5;
1633  }
1634 
1635  // SCT Endcap #8
1636  base = 18;
1637  if( layer==base || layer==(base+12) ) {
1638  ATH_MSG_VERBOSE("Sct EC8, eta=" << abseta);
1639  if( abseta < PixBR3limit ) return 7;
1640  return 6;
1641  }
1642 
1643  // SCT Endcap #9
1644  base = 19;
1645  if( layer==base || layer==(base+12) ) {
1646  ATH_MSG_VERBOSE("Sct EC9, eta=" << abseta);
1647  return 7;
1648  }
1649 
1650  return 0;
1651 }
1652 
1653 
1654 StatusCode TrigFastTrackFinder::finddEdxTrk(const EventContext& ctx, const TrackCollection& outputTracks) const
1655 {
1657  ATH_CHECK( dEdxTrkHandle.record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1658  auto dEdxTrkContainer = dEdxTrkHandle.ptr();
1659  dEdxTrkContainer->reserve(outputTracks.size());
1660 
1662  ATH_CHECK( dEdxHitHandle.record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1663  auto dEdxHitContainer = dEdxHitHandle.ptr();
1664 
1665  std::vector<float> mnt_dedx;
1666  std::vector<int> mnt_dedx_nusedhits;
1667  auto mon_dedx = Monitored::Collection("trk_dedx", mnt_dedx);
1668  auto mon_dedx_nusedhits = Monitored::Collection("trk_dedx_nusedhits", mnt_dedx_nusedhits);
1669  auto mondEdx = Monitored::Group(m_monTool, mon_dedx, mon_dedx_nusedhits);
1670 
1671  int i_track=0;
1672 
1673  ATH_MSG_VERBOSE("========== in finddEdxTrk ==========");
1674 
1675 
1676  static constexpr float TRKCUT_PTGEV_LOOSE = 3.0;
1677  static constexpr float TRKCUT_PTGEV_TIGHT = 10.0;
1678  static constexpr float TRKCUT_DEDX_LOOSE = 1.25;
1679  static constexpr float TRKCUT_DEDX_TIGHT = 1.55;
1680 
1681  for (const auto track: outputTracks) {
1682 
1683  float shift_x = 0; float shift_y = 0;
1684  if(m_useBeamSpot) {
1686  FTF::getBeamSpotShift(shift_x, shift_y, **beamSpotHandle);
1687  }
1688 
1689  ATH_MSG_VERBOSE("+++++++ i_track: " << i_track << " +++++++");
1690  i_track++;
1691 
1692  trackInfo theTrackInfo;
1693  bool igt = FTF::isGoodTrackUTT(track, theTrackInfo, shift_x, shift_y, TRKCUT_PTGEV_LOOSE);
1694  if (not igt) {continue;}
1695 
1696  ATH_MSG_VERBOSE("calculate dEdx -->");
1697  int pixelhits=0; int n_usedhits=0;
1698  std::vector<float> v_pixhit_dedx; std::vector<float> v_pixhit_tot; std::vector<float> v_pixhit_trkchi2; std::vector<float> v_pixhit_trkndof;
1699  std::vector<int> v_pixhit_iblovfl; std::vector<int> v_pixhit_loc; std::vector<int> v_pixhit_layer;
1700  float dedx = dEdx(track,pixelhits,n_usedhits,v_pixhit_dedx,v_pixhit_tot,v_pixhit_trkchi2,v_pixhit_trkndof,
1701  v_pixhit_iblovfl,v_pixhit_loc,v_pixhit_layer);
1702  ATH_MSG_VERBOSE("--> dedx = " << dedx);
1703 
1704  mnt_dedx.push_back(dedx);
1705  mnt_dedx_nusedhits.push_back(n_usedhits);
1706 
1707  bool hpt = (theTrackInfo.ptGeV >= TRKCUT_PTGEV_TIGHT && dedx >= TRKCUT_DEDX_LOOSE);
1708  bool lpt = (theTrackInfo.ptGeV >= TRKCUT_PTGEV_LOOSE && dedx >= TRKCUT_DEDX_TIGHT);
1709  if( ! hpt && ! lpt ) continue;
1710 
1711  xAOD::TrigComposite *dEdxTrk = new xAOD::TrigComposite();
1712  dEdxTrkContainer->push_back(dEdxTrk);
1713  dEdxTrk->setDetail<int> ("dEdxTrk_id", i_track);
1714  dEdxTrk->setDetail<float>("dEdxTrk_pt", theTrackInfo.ptGeV*Gaudi::Units::GeV);
1715  dEdxTrk->setDetail<float>("dEdxTrk_eta", theTrackInfo.eta);
1716  dEdxTrk->setDetail<float>("dEdxTrk_phi", theTrackInfo.phi0);
1717  dEdxTrk->setDetail<float>("dEdxTrk_a0beam", theTrackInfo.a0beam);
1718  dEdxTrk->setDetail<float>("dEdxTrk_dedx", dedx);
1719  dEdxTrk->setDetail<int> ("dEdxTrk_dedx_n_usedhits", n_usedhits);
1720  dEdxTrk->setDetail<int> ("dEdxTrk_n_hits_innermost", theTrackInfo.n_hits_innermost);
1721  dEdxTrk->setDetail<int> ("dEdxTrk_n_hits_inner", theTrackInfo.n_hits_inner);
1722  dEdxTrk->setDetail<int> ("dEdxTrk_n_hits_pix", theTrackInfo.n_hits_pix);
1723  dEdxTrk->setDetail<int> ("dEdxTrk_n_hits_sct", theTrackInfo.n_hits_sct);
1724 
1725  for(unsigned int i=0; i<v_pixhit_dedx.size(); i++) {
1726  xAOD::TrigComposite *dEdxHit = new xAOD::TrigComposite();
1727  dEdxHitContainer->push_back(dEdxHit);
1728  dEdxHit->setDetail<int> ("dEdxHit_trkid", i_track);
1729  dEdxHit->setDetail<float>("dEdxHit_dedx", v_pixhit_dedx[i]);
1730  dEdxHit->setDetail<float>("dEdxHit_tot", v_pixhit_tot[i]);
1731  dEdxHit->setDetail<float>("dEdxHit_trkchi2", v_pixhit_trkchi2[i]);
1732  dEdxHit->setDetail<float>("dEdxHit_trkndof", v_pixhit_trkndof[i]);
1733  dEdxHit->setDetail<int> ("dEdxHit_iblovfl", v_pixhit_iblovfl[i]);
1734  dEdxHit->setDetail<int> ("dEdxHit_loc", v_pixhit_loc[i]);
1735  dEdxHit->setDetail<int> ("dEdxHit_layer", v_pixhit_layer[i]);
1736  }
1737  }
1738  return StatusCode::SUCCESS;
1739 }
1740 
1741 
1742 
1743 float TrigFastTrackFinder::dEdx(const Trk::Track* track, int& pixelhits, int& n_usedhits,
1744  std::vector<float>& v_pixhit_dedx, std::vector<float>& v_pixhit_tot,
1745  std::vector<float>& v_pixhit_trkchi2, std::vector<float>& v_pixhit_trkndof,
1746  std::vector<int>& v_pixhit_iblovfl, std::vector<int>& v_pixhit_loc, std::vector<int>& v_pixhit_layer) const
1747 {
1748  const float Pixel_sensorthickness=.025; // 250 microns Pixel Planars
1749  const float IBL_3D_sensorthickness=.023; // 230 microns IBL 3D
1750  const float IBL_PLANAR_sensorthickness=.020; // 200 microns IBL Planars
1751 
1752  const float energyPair = 3.68e-6; // Energy in MeV to create an electron-hole pair in silicon
1753  const float sidensity = 2.329; // silicon density in g cm^-3
1754 
1755  float conversion_factor=energyPair/sidensity;
1756 
1757  // Loop over pixel hits on track, and calculate dE/dx:
1758 
1759  pixelhits = 0;
1760  n_usedhits = 0;
1761 
1762  v_pixhit_dedx.clear();
1763  v_pixhit_tot.clear();
1764  v_pixhit_trkchi2.clear();
1765  v_pixhit_trkndof.clear();
1766  v_pixhit_iblovfl.clear();
1767  v_pixhit_loc.clear();
1768  v_pixhit_layer.clear();
1769 
1770  const int PIXLOC_IBL_PL = 0;
1771  const int PIXLOC_IBL_3D = 1;
1772  const int PIXLOC_PIX_LY = 2;
1773  const int PIXLOC_PIX_EC = 3;
1774  const int PIXLOC_IBL_UNKNOWN = 4;
1775  const int PIXLOC_PIX_UNKNOWN = 5;
1776 
1777  std::multimap<float,int> dEdxMap;
1778  float dEdxValue = 0;
1779 
1780  // Check for track states:
1781  const Trk::TrackStates* recoTrackStates = track->trackStateOnSurfaces();
1782  if (recoTrackStates) {
1783 
1784  Trk::TrackStates::const_iterator tsosIter = recoTrackStates->begin();
1785  Trk::TrackStates::const_iterator tsosIterEnd = recoTrackStates->end();
1786 
1787  int i_tsos=0;
1788 
1789  // Loop over track states on surfaces (i.e. generalized hits):
1790  for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
1791 
1792  ATH_MSG_VERBOSE("-------- TSoS: " << i_tsos++ << " --------");
1793 
1794  const Trk::MeasurementBase *measurement = (*tsosIter)->measurementOnTrack();
1795  if ( measurement == nullptr ) {
1796  ATH_MSG_VERBOSE("no measurement on this TSoS, skip it");
1797  continue;
1798  }
1799  const Trk::TrackParameters* tp = (*tsosIter)->trackParameters();
1800  if( tp == nullptr ) {
1801  ATH_MSG_VERBOSE("no trackParameters() to this TSoS, skip it");
1802  continue;
1803  }
1804  const InDet::PixelClusterOnTrack *pixclus = dynamic_cast<const InDet::PixelClusterOnTrack*>(measurement);
1805  if ( pixclus == nullptr ) {
1806  ATH_MSG_VERBOSE("this TSoS is not Pixel, skip it");
1807  continue;
1808  }
1809  const InDet::PixelCluster* prd = pixclus->prepRawData();
1810  if( prd == nullptr ) {
1811  ATH_MSG_VERBOSE("no PrepRawData(), skip it");
1812  continue;
1813  }
1814 
1815  float dotProd = tp->momentum().dot(tp->associatedSurface().normal());
1816  float cosalpha = std::abs(dotProd/tp->momentum().mag());
1817  ATH_MSG_VERBOSE("dotProd / cosalpha = " << dotProd << " / " << cosalpha);
1818  if (std::abs(cosalpha)<.16) continue;
1819 
1820  const std::vector<int>& v_tots = prd->totList();
1821  float charge = prd->totalCharge();
1822  float tot = prd->totalToT();
1823  ATH_MSG_VERBOSE("charge / ToT = " << charge << " / " << tot);
1824  charge *= cosalpha; // path length correction
1825 
1826  double locx = pixclus->localParameters()[Trk::locX];
1827  double locy = pixclus->localParameters()[Trk::locY];
1828  int bec = m_pixelId->barrel_ec(pixclus->identify());
1829  int layer = m_pixelId->layer_disk(pixclus->identify());
1830  int eta_module = m_pixelId->eta_module(pixclus->identify()); //check eta module to select thickness
1831 
1832  float chi2 = 0.;
1833  float ndof = 0.;
1834  const Trk::FitQualityOnSurface fq = (*tsosIter)->fitQualityOnSurface();
1835  if(fq) {
1836  chi2 = fq.chiSquared();
1837  ndof = fq.doubleNumberDoF();
1838  }
1839 
1840  int iblOverflow=0; // keep track if this is IBL overflow
1841  float thickness=0;
1842  int loc=-1;
1843 
1844  if ( (bec==0) and (layer==0) ){ // IBL
1845  const float overflowIBLToT = 16; // m_overflowIBLToT = m_offlineCalibSvc->getIBLToToverflow();
1846  for (int pixToT : v_tots) {
1847  if (pixToT >= overflowIBLToT) {
1848  iblOverflow = 1; // overflow pixel hit -- flag cluster
1849  break; //no need to check other hits of this cluster
1850  }
1851  }
1852  if(iblOverflow==1) ATH_MSG_VERBOSE("IBL overflow");
1853 
1854  if(((eta_module>=-10 && eta_module<=-7)||(eta_module>=6 && eta_module<=9)) && (std::abs(locy)<10. && (locx>-8.33 && locx <8.3)) ){ // IBL 3D
1855  thickness = IBL_3D_sensorthickness;
1856  loc = PIXLOC_IBL_3D;
1857  }
1858  else if((eta_module>=-6 && eta_module<=5) && (std::abs(locy)<20. &&( locx >-8.33 && locx <8.3 )) ){ // IBL planer
1859  thickness = IBL_PLANAR_sensorthickness;
1860  loc = PIXLOC_IBL_PL;
1861  }
1862  else {
1863  ATH_MSG_VERBOSE("unknown IBL module");
1864  loc = PIXLOC_IBL_UNKNOWN;
1865  }
1866  }
1867  else if(bec==0 && std::abs(locy)<30. && (( locx > -8.20 && locx < -0.60 ) || ( locx > 0.50 && locx < 8.10 ) ) ){ //PIXEL layer
1868  thickness = Pixel_sensorthickness;
1869  loc = PIXLOC_PIX_LY;
1870  }
1871  else if(std::abs(bec) == 2 && std::abs(locy)<30. && ( ( locx > -8.15 && locx < -0.55 ) || ( locx > 0.55 && locx < 8.15 ) ) ) { //PIXEL endcap
1872  thickness = Pixel_sensorthickness;
1873  loc = PIXLOC_PIX_EC;
1874  }
1875  else {
1876  ATH_MSG_VERBOSE("unknown Pixel module");
1877  loc = PIXLOC_IBL_UNKNOWN;
1878  }
1879 
1880  dEdxValue = 0;
1881  if( loc != PIXLOC_IBL_UNKNOWN && loc != PIXLOC_PIX_UNKNOWN ) {
1882  dEdxValue = charge*conversion_factor/thickness;
1883  dEdxMap.insert(std::pair<float,int>(dEdxValue, iblOverflow));
1884  pixelhits++;
1885  }
1886  ATH_MSG_VERBOSE("dEdx=" << dEdxValue);
1887  v_pixhit_dedx.push_back(dEdxValue); v_pixhit_tot.push_back(tot);
1888  v_pixhit_trkchi2.push_back(chi2); v_pixhit_trkndof.push_back(ndof);
1889  v_pixhit_iblovfl.push_back(iblOverflow); v_pixhit_loc.push_back(loc); v_pixhit_layer.push_back(layer);
1890  }
1891  }
1892 
1893  // Now calculate dEdx, multimap is already sorted in ascending order
1894  // float averageCharge=-1;
1895 
1896  float averagedEdx=0.;
1897  int IBLOverflow=0;
1898 
1899  int i_map=0;
1900 
1901  for (std::pair<float,int> itdEdx : dEdxMap) {
1902  ATH_MSG_VERBOSE("++++++++ i_map: " << i_map++ << " ++++++++");
1903  if(itdEdx.second==0){
1904  ATH_MSG_VERBOSE("usedhits, dEdx=" << itdEdx.first);
1905  averagedEdx += itdEdx.first;
1906  n_usedhits++;
1907  }
1908  if(itdEdx.second > 0){
1909  ATH_MSG_VERBOSE("IBLOverflow");
1910  IBLOverflow++;
1911  }
1912  // break, skipping last or the two last elements depending on total measurements
1913  if (((int)pixelhits >= 5) and ((int)n_usedhits >= (int)pixelhits-2)) {
1914  ATH_MSG_VERBOSE("break, skipping last or two last elements");
1915  break;
1916  }
1917 
1918  // break, IBL Overflow case pixelhits==3 and 4
1919  if((int)IBLOverflow>0 and ((int)pixelhits==3) and (int)n_usedhits==1) {
1920  ATH_MSG_VERBOSE("break, IBL overflow case, pixel hits=3");
1921  break;
1922  }
1923  if((int)IBLOverflow>0 and ((int)pixelhits==4) and (int)n_usedhits==2) {
1924  ATH_MSG_VERBOSE("break, IBL overflow case, pixel hits=4");
1925  break;
1926  }
1927 
1928  if (((int)pixelhits > 1) and ((int)n_usedhits >=(int)pixelhits-1)) {
1929  ATH_MSG_VERBOSE("break, skipping last??");
1930  break;
1931  }
1932 
1933  if((int)IBLOverflow>0 and (int)pixelhits==1){ // only IBL in overflow
1934  ATH_MSG_VERBOSE("break, only IBL in overflow");
1935  averagedEdx=itdEdx.first;
1936  break;
1937  }
1938  }
1939 
1940  if (n_usedhits > 0 or (n_usedhits==0 and(int)IBLOverflow>0 and (int)pixelhits==1)) {
1941  if(n_usedhits > 0) averagedEdx = averagedEdx / n_usedhits;
1942  //if(n_usedhits == 0 and (int)IBLOverflow > 0 and (int)pixelhits == 1) averagedEdx = averagedEdx; //no-op
1943  ATH_MSG_DEBUG("=====> averaged dEdx = " << averagedEdx << " =====>");;
1944  ATH_MSG_DEBUG(" +++ Used hits: " << n_usedhits << ", IBL overflows: " << IBLOverflow );;
1945  ATH_MSG_DEBUG(" +++ Original number of measurements = " << pixelhits << " (map size = " << dEdxMap.size() << ") ");
1946  return averagedEdx;
1947  }
1948 
1949  // -- false return
1950  ATH_MSG_DEBUG("dEdx not calculated, return 0");
1951  return 0.;
1952 }
1953 
1955 {
1956  const float PT_CUT = 3.0;
1957  //
1958  const double FAIL_CHI2_OV_NDOF_CUT = 20.0;
1959  //
1960  const int COMB_N_HITS_IBL_OR_BL_CUT = 1;
1961  const int COMB_N_HITS_PIX_BR_CUT = 3;
1962  const double COMB_CHI2_OV_NDOF_PIX_BR_CUT = 3.0;
1963  const int COMB_N_GOOD_HITS_SCT_BR_CUT = 2;
1964  const int COMB_N_GOOD_DOUBLEHITS_SCT_BR_CUT = 0;
1965 
1966  // sanity check
1967  if( trk==nullptr ) return false;
1968  if( trk->perigeeParameters()==nullptr ) return false;
1969  if( trk->fitQuality()==nullptr ) return false;
1970 
1971  // if allpix/barrel
1972  if( !seed.s1().isPixel() || !seed.s2().isPixel() || !seed.s3().isPixel() ) return false;
1973  float s1_z = seed.s1().z();
1974  float s2_z = seed.s2().z();
1975  float s3_z = seed.s3().z();
1976  const float PIXEL_BARREL_Z = 410.0;
1977  if( std::abs(s1_z) > PIXEL_BARREL_Z || std::abs(s2_z) > PIXEL_BARREL_Z || std::abs(s3_z) > PIXEL_BARREL_Z ) return false;
1978  ATH_MSG_VERBOSE("FTF::isCleaningPassDisTrack> ... barrel cut passed");
1979 
1980  // pt cut
1981  double theta = trk->perigeeParameters()->parameters()[Trk::theta];
1982  double qOverP = std::abs(trk->perigeeParameters()->parameters()[Trk::qOverP]);
1983  if ( qOverP < 1e-12 ) qOverP = 1e-12;
1984  double pt = sin(theta)/qOverP;
1985  if( pt/1000.0 < PT_CUT ) return false;
1986  ATH_MSG_VERBOSE("FTF::isCleaningPassDisTrack> ... pT cut passed");
1987 
1988  // fail/comb dependent cuts
1989  if( isFail ) {
1990  double chi2 = trk->fitQuality()->chiSquared();
1991  double ndof = trk->fitQuality()->doubleNumberDoF();
1992  if( std::abs(ndof) < 1e-12 ) return false;
1993  if( chi2/ndof > FAIL_CHI2_OV_NDOF_CUT ) return false;
1994  ATH_MSG_VERBOSE("FTF::isCleaningPassDisTrack> ... (failTrk) Chi2 cut passed");
1995  }
1996  else {
1997 
1998  const auto & barrelInfo = getTrkBarrelLayerInfo(trk);
1999 
2000  int n_hits_iblbl = barrelInfo[0].nHits + barrelInfo[1].nHits;
2001  if( n_hits_iblbl < COMB_N_HITS_IBL_OR_BL_CUT ) return false;
2002 
2003  // PIX cuts
2004  int n_hits_pixbr = 0;
2005  double chi2_pixbr = 0;
2006  int ndof_pixbr = 0;
2007  for(unsigned int ily=0; ily<=3; ily++) {
2008  n_hits_pixbr += barrelInfo[ily].nHits;
2009  chi2_pixbr += barrelInfo[ily].chiSq;
2010  ndof_pixbr += barrelInfo[ily].nDof;
2011  }
2012  if( n_hits_pixbr < COMB_N_HITS_PIX_BR_CUT ) return false;
2013  if( ndof_pixbr < 1 ) return false;
2014  double chi2_ov_ndof_pixbr = chi2_pixbr / ndof_pixbr;
2015  if( chi2_ov_ndof_pixbr > COMB_CHI2_OV_NDOF_PIX_BR_CUT ) return false;
2016  ATH_MSG_VERBOSE("FTF::isCleaningPassDisTrack> ... (combTrk) Pix cut passed");
2017 
2018  // SCT cuts
2019  int n_hits_sctbr_good = 0;
2020  int n_doublehits_sctbr_good = 0;
2021  for(unsigned int ily=4; ily<=7; ily++) {
2022  n_hits_sctbr_good += barrelInfo[ily].nGood;
2023  if( barrelInfo[ily].nGood >= 2 ) n_doublehits_sctbr_good++;
2024  }
2025  if( n_hits_sctbr_good > COMB_N_GOOD_HITS_SCT_BR_CUT ) return false;
2026  if( n_doublehits_sctbr_good > COMB_N_GOOD_DOUBLEHITS_SCT_BR_CUT ) return false;
2027  ATH_MSG_VERBOSE("FTF::isCleaningPassDisTrack> ... (combTrk) SCT cut passed");
2028  }
2029 
2030  // cut passed
2031  return true;
2032 }
2033 
2034 std::array<TrigFastTrackFinder::OneLayerInfo_t, TrigFastTrackFinder::N_BARREL_LAYERS>
2036 {
2037  static constexpr double CHI2_GOOD_CUT = 3.0;
2038  //nHits, chiSq, nDof, nGood in array
2039  std::array<TrigFastTrackFinder::OneLayerInfo_t, TrigFastTrackFinder::N_BARREL_LAYERS> result{};
2040  if (not t) return result;
2041 
2042  const Trk::TrackStates* recoTrackStates = t->trackStateOnSurfaces();
2043  if (recoTrackStates) {
2044  Trk::TrackStates::const_iterator tsosIter = recoTrackStates->begin();
2045  Trk::TrackStates::const_iterator tsosIterEnd = recoTrackStates->end();
2046  for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
2047  const Trk::FitQualityOnSurface fq = (*tsosIter)->fitQualityOnSurface();
2048  double x2 = 0;
2049  int ndof = 0;
2050  if(fq) {
2051  x2 = fq.chiSquared();
2052  ndof = fq.numberDoF();
2053  }
2054  bool chi2_good = (x2 <= CHI2_GOOD_CUT);
2055  const Trk::MeasurementBase *measurement = (*tsosIter)->measurementOnTrack();
2056  const InDet::PixelClusterOnTrack *pixclus = dynamic_cast<const InDet::PixelClusterOnTrack*>(measurement);
2057  if (pixclus!=nullptr) {
2058  int bec = m_pixelId->barrel_ec(pixclus->identify());
2059  int layer = m_pixelId->layer_disk(pixclus->identify());
2060  if ( bec==0 ) {
2061  if( layer < 0 || 3 < layer ) {
2062  ATH_MSG_WARNING("Pixel layer out of range, layer=" << layer);
2063  continue;
2064  }
2065  result[layer].nHits++;
2066  result[layer].chiSq += x2;
2067  result[layer].nDof += ndof;
2068  if(chi2_good) result[layer].nGood++;
2069  }
2070  }
2071  const InDet::SCT_ClusterOnTrack *sctclus = dynamic_cast<const InDet::SCT_ClusterOnTrack*>(measurement);
2072  if (sctclus!=nullptr) {
2073  int bec = m_sctId->barrel_ec(sctclus->identify());
2074  int layer = m_sctId->layer_disk(sctclus->identify());
2075  if ( bec==0 ) {
2076  if( layer < 0 || 3 < layer ) {
2077  ATH_MSG_WARNING("SCT layer out of range, layer=" << layer);
2078  continue;
2079  }
2080  layer += 4;
2081  result[layer].nHits++;
2082  result[layer].chiSq += x2;
2083  result[layer].nDof += ndof;
2084  if(chi2_good) result[layer].nGood++;
2085  }
2086  }
2087  }//end loop on TSoS
2088  }
2089  return result;
2090 }
2091 
2093 {
2095  m = Tr->trackStateOnSurfaces()->begin(),
2096  me = Tr->trackStateOnSurfaces()->end ();
2097 
2098  double quality_pixel = 0. ;
2099  double quality_sct = 0. ;
2100 
2101  const double W = 17.;
2102 
2103  for(; m!=me; ++m) {
2104  const Trk::FitQualityOnSurface fq = (*m)->fitQualityOnSurface();
2105  if(!fq) continue;
2106 
2107  double x2 = fq.chiSquared();
2108  double q;
2109  if(fq.numberDoF() == 2) q = (1.2*(W-x2*.5));
2110  else q = (W-x2 );
2111  if(q < 0.) q = 0.;
2112 
2113  const Trk::MeasurementBase *measurement = (*m)->measurementOnTrack();
2114  if (measurement) {
2115  const InDet::PixelClusterOnTrack *pixclus = dynamic_cast<const InDet::PixelClusterOnTrack*>(measurement);
2116  if( pixclus !=0 ) quality_pixel += q;
2117  else quality_sct += q;
2118  }
2119  }
2120 
2121  //
2122  double quality = quality_pixel;
2123  quality -= quality_sct;
2124  if( quality < 0. ) quality = 0.;
2125 
2126  return quality;
2127 }
2128 
2129 void TrigFastTrackFinder::recoVertexForDisTrack(const EventContext& ctx, TrackCollection& tracks, std::vector<double>& v_xvtx, std::vector<double>& v_yvtx, std::vector<double>& v_zvtx) const
2130 {
2131  v_xvtx.clear();
2132  v_yvtx.clear();
2133  v_zvtx.clear();
2134 
2135  // beamspot and tilt
2137  Amg::Vector3D vertex = beamSpotHandle->beamPos();
2138  double xVTX = vertex.x();
2139  double yVTX = vertex.y();
2140  double tiltXZ = beamSpotHandle->beamTilt(0);
2141  double tiltYZ = beamSpotHandle->beamTilt(1);
2142 
2143  // zvertex
2144  const double CLUSTCUT_DIST_SIGMA = 5.0;
2145  const double CLUSTCUT_DIST = 2.5;
2146  const double CLUSTCUT_SEED_PT = 3.0;
2147 
2148  const int VTXCUT_N_TRACKS = 3;
2149  const int VTXCUT_ALGO = 1; // 0: highest pT track, 1: sumPt
2150 
2151  std::vector<std::tuple<int,double,double,Trk::Track*>> QT;
2152  QT.reserve(tracks.size());
2153 
2154  for (auto t=tracks.begin(); t!=tracks.end(); ++t) {
2155  if( ! isGoodForDisTrackVertex(*t, ctx) ) continue;
2156  // consider for vertex fitting (idx, sort, weight, Trk)
2157  double theta = (*t)->perigeeParameters()->parameters()[Trk::theta];
2158  double qOverP = std::abs((*t)->perigeeParameters()->parameters()[Trk::qOverP]);
2159  if ( qOverP < 1e-12 ) qOverP = 1e-12;
2160  double pt = sin(theta)/qOverP;
2161  pt /= 1000.0;
2162  QT.emplace_back(std::make_tuple(-1,pt,pt,(*t)));
2163  }
2164 
2165  // sort
2166  std::sort(QT.begin(), QT.end(),
2167  [](const std::tuple<int,double,double,Trk::Track*>& lhs, const std::tuple<int,double,double,Trk::Track*>& rhs) {
2168  return std::get<1>(lhs) > std::get<1>(rhs); } );
2169 
2170  // clustering
2171  std::vector<int> cluster_ntrk;
2172  std::vector<double> cluster_ptsum;
2173  std::vector<double> cluster_z;
2174  std::vector<double> cluster_wsum;
2175  std::vector<double> cluster_zerr;
2176  std::vector<double> cluster_w2sum;
2177 
2178  for(unsigned int i=0; i<QT.size(); ++i) {
2179  Trk::Track* t = std::get<3>(QT[i]);
2180  double z = t->perigeeParameters()->parameters()[Trk::z0];
2181  double zerr = sqrt((*(t->perigeeParameters()->covariance()))(Trk::z0,Trk::z0));
2182  double w = std::get<2>(QT[i]);
2183  double pt = std::get<1>(QT[i]);
2184  if(i==0) {
2185  cluster_ntrk.push_back(1); cluster_ptsum.push_back(pt);
2186  cluster_z.push_back(w*z); cluster_wsum.push_back(w);
2187  cluster_zerr.push_back(w*zerr*w*zerr); cluster_w2sum.push_back(w*w);
2188  continue;
2189  }
2190  //
2191  const int IDX_INITIAL = 100;
2192  double dist_min = 100.0;
2193  int idx_min = IDX_INITIAL;
2194  for(unsigned j=0; j<cluster_z.size(); ++j) {
2195  double dist = std::abs(z - cluster_z[j]/cluster_wsum[j]);
2196  if( dist < dist_min ) {
2197  dist_min = dist;
2198  idx_min = j;
2199  }
2200  }
2201  int match_idx = IDX_INITIAL;
2202  if( idx_min != IDX_INITIAL ) {
2203  double c_zerr_min = std::sqrt(cluster_zerr[idx_min]/cluster_w2sum[idx_min]);
2204  double err = std::sqrt(zerr*zerr+c_zerr_min*c_zerr_min);
2205  if( std::abs(err) < 1e-12 ) err = 1e-12;
2206  double dist = dist_min / err;
2207  if( dist < CLUSTCUT_DIST_SIGMA && dist_min < CLUSTCUT_DIST ) { match_idx = idx_min; }
2208  }
2209  //
2210  if( match_idx == IDX_INITIAL ) {
2211  if( pt > CLUSTCUT_SEED_PT && dist_min > CLUSTCUT_DIST ) {
2212  cluster_ntrk.push_back(1); cluster_ptsum.push_back(pt);
2213  cluster_z.push_back(w*z); cluster_wsum.push_back(w);
2214  cluster_zerr.push_back(w*zerr*w*zerr); cluster_w2sum.push_back(w*w);
2215  }
2216  continue;
2217  }
2218  int new_n = cluster_ntrk[match_idx] + 1;
2219  double new_ptsum = cluster_ptsum[match_idx] + pt;
2220  double new_z = cluster_z[match_idx] + w*z;
2221  double new_wsum = cluster_wsum[match_idx] + w;
2222  double new_zerr = cluster_zerr[match_idx] + w*zerr*w*zerr;
2223  double new_w2sum = cluster_w2sum[match_idx] + w*w;
2224  cluster_ntrk[match_idx] = new_n;
2225  cluster_ptsum[match_idx] = new_ptsum;
2226  cluster_z[match_idx] = new_z;
2227  cluster_wsum[match_idx] = new_wsum;
2228  cluster_zerr[match_idx] = new_zerr;
2229  cluster_w2sum[match_idx] = new_w2sum;
2230  }
2231  QT.clear();
2232 
2233  // determine zvtx (pt sort)
2234  std::vector<std::tuple<double,double,double,int>> zVtx;
2235  zVtx.reserve(tracks.size());
2236  for(unsigned int i=0; i<cluster_z.size(); i++) {
2237  if( cluster_ntrk[i] < VTXCUT_N_TRACKS ) continue;
2238  double z = cluster_z[i] / cluster_wsum[i];
2239  double zerr = std::sqrt(cluster_zerr[i] / cluster_w2sum[i]);
2240  zVtx.push_back(std::make_tuple(cluster_ptsum[i],z,zerr,cluster_ntrk[i]));
2241  }
2242  // ptsum sort
2243  if( VTXCUT_ALGO == 1 ) {
2244  std::sort(zVtx.begin(), zVtx.end(),
2245  [](const std::tuple<double,double,double,int>& lhs, const std::tuple<double,double,double,int>& rhs) {
2246  return std::get<0>(lhs) > std::get<0>(rhs); } );
2247  }
2248  ATH_MSG_VERBOSE("disTrkZVtertex> ===== looping zVtx size: " << zVtx.size());
2249  for(unsigned int i=0; i<zVtx.size(); i++) {
2250  double z = std::get<1>(zVtx[i]);
2251  double zerr = std::get<2>(zVtx[i]);
2252  double pt = std::get<0>(zVtx[i]);
2253  int n = std::get<3>(zVtx[i]);
2254  v_zvtx.push_back(z);
2255  v_xvtx.push_back(xVTX - tiltXZ*z); //correction for tilt
2256  v_yvtx.push_back(yVTX - tiltYZ*z); //correction for tilt
2257  ATH_MSG_VERBOSE("disTrkZVtertex> Vertex cand i=" << i << ": z = " << z << " +- " << zerr << ", sum n / pt = " << n << " / " << pt);
2258  }
2259 
2260  // monitoring
2261  auto mnt_disTrk_nVtx = Monitored::Scalar<int> ("disTrk_nVtx", 0);
2262  auto mnt_disTrk_xVtx = Monitored::Scalar<float>("disTrk_xVtx", 0);
2263  auto mnt_disTrk_yVtx = Monitored::Scalar<float>("disTrk_yVtx", 0);
2264  auto mnt_disTrk_zVtx = Monitored::Scalar<float>("disTrk_zVtx", 0);
2265  auto monDisTrk = Monitored::Group(m_monTool, mnt_disTrk_nVtx, mnt_disTrk_xVtx, mnt_disTrk_yVtx, mnt_disTrk_zVtx);
2266  mnt_disTrk_nVtx = v_zvtx.size();
2267  if(v_zvtx.size()>0) {
2268  mnt_disTrk_xVtx = v_xvtx[0];
2269  mnt_disTrk_yVtx = v_yvtx[0];
2270  mnt_disTrk_zVtx = v_zvtx[0];
2271  }
2272 }
2273 
2274 bool TrigFastTrackFinder::isGoodForDisTrackVertex(Trk::Track* t, const EventContext& ctx) const
2275 {
2276  const double TRKCUT_CHI2_OV_NDOF = 3.0;
2277  const double TRKCUT_PT = 1.0;
2278  const double TRKCUT_D0 = 2.0;
2279  const int TRKCUT_N_HITS_INNER = 1;
2280  const int TRKCUT_N_HITS_PIX = 3;
2281  const int TRKCUT_N_HITS = 7;
2282 
2283  // sanity check
2284  if ( ! t->perigeeParameters() ) return false;
2285  if ( ! t->fitQuality() ) return false;
2286  if ( t->trackSummary()==0 ) {
2287  m_trackSummaryTool->updateTrack(ctx, *t);
2288  if ( t->trackSummary()==0 ) return false;
2289  }
2290 
2291  // chi2
2292  double chi2 = t->fitQuality()->chiSquared();
2293  double ndof = t->fitQuality()->doubleNumberDoF();
2294  if( std::abs(ndof) < 1e-2 ) return false;
2295  double chi2_ov_ndof = chi2/ndof;
2296  if( chi2_ov_ndof > TRKCUT_CHI2_OV_NDOF ) return false;
2297 
2298  // pt
2299  double theta = t->perigeeParameters()->parameters()[Trk::theta];
2300  double qOverP = std::abs(t->perigeeParameters()->parameters()[Trk::qOverP]);
2301  if ( qOverP < 1e-12 ) qOverP = 1e-12;
2302  double pt = std::sin(theta)/qOverP;
2303  pt /= 1000.0;
2304  if( pt < TRKCUT_PT ) return false;
2305 
2306  // d0
2307  double d0 = t->perigeeParameters()->parameters()[Trk::d0];
2308  if( std::abs(d0) > TRKCUT_D0 ) return false;
2309 
2310  // nr hits
2311  int n_hits_innermost = t->trackSummary()->get(Trk::SummaryType::numberOfInnermostPixelLayerHits);
2312  int n_hits_next_to_innermost = t->trackSummary()->get(Trk::SummaryType::numberOfNextToInnermostPixelLayerHits);
2313  int n_hits_inner = n_hits_innermost + n_hits_next_to_innermost;
2314  int n_hits_pix = t->trackSummary()->get(Trk::SummaryType::numberOfPixelHits);
2315  int n_hits_sct = t->trackSummary()->get(Trk::SummaryType::numberOfSCTHits);
2316  if( n_hits_inner < TRKCUT_N_HITS_INNER ) return false;
2317  if( n_hits_pix < TRKCUT_N_HITS_PIX ) return false;
2318  if( (n_hits_pix+n_hits_sct) < TRKCUT_N_HITS ) return false;
2319 
2320  // ok
2321  return true;
2322 }
2323 
2324 void TrigFastTrackFinder::filterSharedDisTracks(std::vector<std::tuple<bool, double,Trk::Track*>>& QT) const
2325 {
2326  const int N_FREE_PIX_HITS_CUT = 2;
2327 
2328  std::set<const Trk::PrepRawData*> clusters;
2329 
2330  const Trk::PrepRawData* prd[100];
2331 
2332  std::sort(QT.begin(), QT.end(),
2333  [](const std::tuple<bool, double, Trk::Track*>& lhs, const std::tuple<bool, double, Trk::Track*>& rhs) {
2334  return std::get<1>(lhs) < std::get<1>(rhs); } );
2335 
2336  for (auto& q : QT) {
2338  m = std::get<2>(q)->measurementsOnTrack()->begin(),
2339  me = std::get<2>(q)->measurementsOnTrack()->end ();
2340 
2341  int nf = 0, nc = 0;
2342  for(; m!=me; ++m ) {
2343  const Trk::PrepRawData* pr = ((const Trk::RIO_OnTrack*)(*m))->prepRawData();
2344  if(pr) {
2345  const InDet::PixelClusterOnTrack *pixclus = dynamic_cast<const InDet::PixelClusterOnTrack*>((*m));
2346  if (pixclus) {
2347  ++nc;
2348  if(clusters.find(pr)==clusters.end()) {prd[nf++]=pr; if(nf==100) break;}
2349  }
2350  }
2351  }
2352  if((nf >= N_FREE_PIX_HITS_CUT) || (nf == nc) ) {
2353  for(int n=0; n!=nf; ++n) clusters.insert(prd[n]);
2354  }
2355  else {
2356  std::get<0>(q) = false;
2357  }
2358  }
2359 }
2360 
2362  TrackCollection& tracks,
2363  std::vector<std::tuple<bool, double, Trk::Track*>>& qualityDisFailTrks,
2364  std::vector<std::tuple<bool, double, Trk::Track*>>& qualityDisCombTrks,
2365  TrackCollection& fittedDisCombTrks,
2366  const std::vector<double>& v_xvtx,
2367  const std::vector<double>& v_yvtx,
2368  const std::vector<double>& v_zvtx) const
2369 {
2371  ATH_CHECK( disTrkCandHandle.record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
2372  auto disTrkCandContainer = disTrkCandHandle.ptr();
2373 
2374  // monitoring
2375  auto mnt_disFailTrk_n = Monitored::Scalar<int>("disFailTrk_n", 0);
2376  auto mnt_disFailTrk_nclone = Monitored::Scalar<int>("disFailTrk_nclone", 0);
2377  auto mnt_disFailTrk_ncand = Monitored::Scalar<int>("disFailTrk_ncand", 0);
2378  auto mnt_disCombTrk_n = Monitored::Scalar<int>("disCombTrk_n", 0);
2379  auto mnt_disCombTrk_nclone = Monitored::Scalar<int>("disCombTrk_nclone", 0);
2380  auto mnt_disCombTrk_ncand = Monitored::Scalar<int>("disCombTrk_ncand", 0);
2381  auto monDisTrk = Monitored::Group(m_monTool, mnt_disFailTrk_n, mnt_disFailTrk_nclone, mnt_disFailTrk_ncand, mnt_disCombTrk_n, mnt_disCombTrk_nclone, mnt_disCombTrk_ncand);
2382 
2383  // select tracks to be used for isolation calculation
2384  std::vector<Trk::Track*> tracksForIso;
2385  for (auto t=tracks.begin(); t!=tracks.end(); ++t) {
2386  if( isGoodForDisTrackVertex(*t,ctx) ) tracksForIso.push_back(*t);
2387  }
2388 
2389  //
2390  const std::string prefix = "disTrkCand";
2391 
2392  // disFailTrk
2393  TrackCollection initialDisFailTrks;
2394  initialDisFailTrks.reserve(qualityDisFailTrks.size());
2395  std::vector<int> resultCodes;
2396  for(const auto& q : qualityDisFailTrks) {
2397  if (std::get<0>(q)==true) {
2398  initialDisFailTrks.emplace_back(std::get<2>(q));
2399  }
2400  else {
2401  delete std::get<2>(q);
2402  }
2403  }
2404  ATH_MSG_VERBOSE("===> nr of disFailTrk=" << qualityDisFailTrks.size() << " -> clone removal=" << initialDisFailTrks.size());
2405 
2406  TrackCollection fittedDisFailTrks;
2407  m_trigInDetTrackFitter->fit(initialDisFailTrks, fittedDisFailTrks, ctx, m_particleHypothesis);
2408  int n_disFailTrkCands = recoAndFillDisTrkCand(prefix, &fittedDisFailTrks, tracksForIso, disTrkCandContainer, v_xvtx, v_yvtx, v_zvtx, true, ctx);
2409  ATH_MSG_VERBOSE("disFailTrk: nr of cands = " << n_disFailTrkCands);
2410 
2411  mnt_disFailTrk_n = qualityDisFailTrks.size();
2412  mnt_disFailTrk_nclone = initialDisFailTrks.size();
2413  mnt_disFailTrk_ncand = n_disFailTrkCands;
2414 
2415  // disCombTrk
2416  ATH_MSG_VERBOSE("===> nr of disCombTrk=" << qualityDisCombTrks.size() << " -> clone removal=" << fittedDisCombTrks.size());
2417  int n_disCombTrkCands = recoAndFillDisTrkCand(prefix, &fittedDisCombTrks, tracksForIso, disTrkCandContainer, v_xvtx, v_yvtx, v_zvtx, false, ctx);
2418  ATH_MSG_VERBOSE("disCombTrk: nr of cands = " << n_disCombTrkCands);
2419 
2420  mnt_disCombTrk_n = qualityDisCombTrks.size();
2421  mnt_disCombTrk_nclone = fittedDisCombTrks.size();
2422  mnt_disCombTrk_ncand = n_disCombTrkCands;
2423 
2424  return StatusCode::SUCCESS;
2425 }
2426 
2427 bool TrigFastTrackFinder::isPreselPassDisTrackAfterRefit(Trk::Track* trk, Trk::Track* refitTrk, double refit_d0_wrtVtx, double refit_z0_wrtVtx) const
2428 {
2429  const float PRESEL_PT_GEV = 5.0;
2430  const float PRESEL_REFIT_PT_GEV_P3S1 = 10.0;
2431  const double PRESEL_D0_WRTVTX = 5.0;
2432  const double PRESEL_Z0_WRTVTX = 50.0;
2433 
2434  // sanity check
2435  if( trk == nullptr ) return false;
2436 
2437  DisTrkCategory cat = getDisTrkCategory(trk);
2438  if( cat==DisTrkCategory::Pix4l_Sct1p || cat==DisTrkCategory::Pix3l_Sct1p ) { if( refitTrk == nullptr ) return false; }
2439 
2440  // refit d0
2441  if( std::abs(refit_d0_wrtVtx) > PRESEL_D0_WRTVTX ) return false;
2442 
2443  // refit z0
2444  if( std::abs(refit_z0_wrtVtx) > PRESEL_Z0_WRTVTX ) return false;
2445 
2446  // pt (either trk or refit trk should have pt beyond cut)
2447  std::vector<float> v_ptGeV;
2448  std::vector<Trk::Track*> v_trk;
2449  v_trk.push_back(trk);
2450  if( refitTrk != nullptr ) v_trk.push_back(refitTrk);
2451  for(auto t : v_trk) {
2452  float theta = t->perigeeParameters()->parameters()[Trk::theta];
2453  float qOverP = std::abs(t->perigeeParameters()->parameters()[Trk::qOverP]);
2454  if ( qOverP < 1e-12 ) qOverP = 1e-12;
2455  float ptGeV = sin(theta)/qOverP/Gaudi::Units::GeV;
2456  v_ptGeV.push_back(ptGeV);
2457  }
2458  bool isLowPt = true;
2459  for(auto pt : v_ptGeV) {
2460  if( pt > PRESEL_PT_GEV ) { isLowPt = false; break; }
2461  }
2462  if( isLowPt ) return false;
2463 
2464  // refit pt cut for Pix3l_Sct1p which dominates rates
2465  if( cat==DisTrkCategory::Pix3l_Sct1p ) {
2466  float refitPt = v_ptGeV[1];
2467  if( refitPt < PRESEL_REFIT_PT_GEV_P3S1 ) return false;
2468  }
2469 
2470  // cut passed
2471  return true;
2472 }
2473 
2474 bool TrigFastTrackFinder::isPreselPassDisTrackBeforeRefit(Trk::Track* trk, double d0_wrtVtx, double z0_wrtVtx) const
2475 {
2476  const double PRESEL_D0_WRTVTX = 5.0;
2477  const double PRESEL_Z0_WRTVTX = 50.0;
2478  const int PRESEL_N_GOOD_BR_LAYERS_PIX = 3;
2479  const double PRESEL_CHI2_OV_NDOF_PIX_BR_CUT = 5.0;
2480 
2481  // sanity check
2482  if( trk == nullptr ) return false;
2483  if( trk->perigeeParameters() == nullptr ) return false;
2484 
2485  // barrel hits
2486  const auto & barrelLayerInfo = getTrkBarrelLayerInfo(trk);
2487 
2488  // PIX cuts
2489  double chi2_pixbr = 0.0;
2490  int ndof_pixbr = 0;
2491  int n_good_brlayers_pix = 0;
2492  for(unsigned int ily=0; ily<=3; ily++) {
2493  if( barrelLayerInfo[ily].nGood >= 1 ) n_good_brlayers_pix++;
2494  chi2_pixbr += barrelLayerInfo[ily].chiSq;
2495  ndof_pixbr += barrelLayerInfo[ily].nDof;
2496  }
2497  if( n_good_brlayers_pix < PRESEL_N_GOOD_BR_LAYERS_PIX ) return false;
2498 
2499  if( ndof_pixbr < 1 ) return false;
2500  double chi2_ov_ndof_pixbr = chi2_pixbr / ndof_pixbr;
2501  if( chi2_ov_ndof_pixbr > PRESEL_CHI2_OV_NDOF_PIX_BR_CUT ) return false;
2502 
2503  // d0
2504  if( std::abs(d0_wrtVtx) > PRESEL_D0_WRTVTX ) return false;
2505 
2506  // z0
2507  if( std::abs(z0_wrtVtx) > PRESEL_Z0_WRTVTX ) return false;
2508 
2509  // cut passed
2510  return true;
2511 }
2512 
2513 std::unique_ptr<const Trk::TrackParameters> TrigFastTrackFinder::extrapolateDisTrackToBS(
2514  Trk::Track* t, const std::vector<double>& v_xvtx, const std::vector<double>& v_yvtx, const std::vector<double>& v_zvtx, const EventContext& ctx) const
2515 {
2516  float vtx_x = 0;
2517  float vtx_y = 0;
2518  float vtx_z = 9999;
2519  float trk_z0 = t->perigeeParameters()->parameters()[Trk::z0];
2520  float z0_min = 9999;
2521  for(unsigned int i_vtx=0; i_vtx<v_zvtx.size(); i_vtx++) {
2522  float z = v_zvtx[i_vtx];
2523  if( std::abs(trk_z0-z) < z0_min ) {
2524  z0_min = std::abs(trk_z0-z);
2525  vtx_z = z;
2526  vtx_x = v_xvtx[i_vtx];
2527  vtx_y = v_yvtx[i_vtx];
2528  }
2529  }
2530 
2531  Amg::Vector3D gp(vtx_x, vtx_y, vtx_z);
2532  Trk::PerigeeSurface persf(gp);
2533  std::unique_ptr<const Trk::TrackParameters> tmp =
2534  m_extrapolator->extrapolateDirectly(ctx, (*(t->perigeeParameters())), persf);
2535  if (tmp && tmp->associatedSurface().type() == Trk::SurfaceType::Perigee) {
2536  return tmp;
2537  }
2538  return nullptr;
2539 }
2540 
2542 {
2543  const auto & result = getTrkBarrelLayerInfo(trk);
2544 
2545  int n_good_brlayers_pix = 0;
2546  int n_hits_sct = 0;
2547  for(unsigned int ily=0; ily<8; ily++) {
2548  if( ily<=3 && result[ily].nGood >= 1 ) n_good_brlayers_pix++;
2549  if( 4<=ily ) {
2550  n_hits_sct += result[ily].nHits;
2551  }
2552  }
2553  if( trk->trackSummary()!=0 ) { n_hits_sct = trk->trackSummary()->get(Trk::SummaryType::numberOfSCTHits); }
2554 
2555  // category
2556  DisTrkCategory cat = DisTrkCategory::Other;
2557  if( n_good_brlayers_pix == 4 ) {
2558  if( n_hits_sct==0 ) { cat=DisTrkCategory::Pix4l_Sct0; }
2559  else { cat=DisTrkCategory::Pix4l_Sct1p; }
2560  }
2561  else if( n_good_brlayers_pix == 3 ) {
2562  if( n_hits_sct==0 ) { cat=DisTrkCategory::Pix3l_Sct0; }
2563  else { cat=DisTrkCategory::Pix3l_Sct1p; }
2564  }
2565  return cat;
2566 }
2567 
2568 void TrigFastTrackFinder::fillDisTrkCand(xAOD::TrigComposite* comp, const std::string& prefix, Trk::Track* trk, const std::unique_ptr<const Trk::TrackParameters>& vertexPerigee) const
2569 {
2570  std::vector<Trk::Track*> vtmp;
2571  fillDisTrkCand(comp,prefix,trk,vertexPerigee,false,vtmp);
2572 }
2573 
2574 void TrigFastTrackFinder::fillDisTrkCand(xAOD::TrigComposite* comp, const std::string& prefix, Trk::Track* trk, const std::unique_ptr<const Trk::TrackParameters>& vertexPerigee,
2575  bool fillIso, std::vector<Trk::Track*>& tracksForIso) const
2576 {
2577  // category
2578  int category = (trk != nullptr) ? (int)getDisTrkCategory(trk) : -1;
2579  if( prefix.find("refit") == std::string::npos ) comp->setDetail<int16_t>(prefix+"_category",(int16_t)category);
2580 
2581  // track
2582  float theta=0; float eta=0; float pt=0; float d0=0; float z0=0; float phi=0; float chi2=0; float ndof=0;
2583  int n_hits_innermost=-1; int n_hits_next_to_innermost=-1; int n_hits_inner=-1; int n_hits_pix=-1; int n_hits_sct=-1;
2584  if( trk != nullptr ) {
2585  theta = trk->perigeeParameters()->parameters()[Trk::theta];
2586  eta = -std::log(std::tan(0.5*theta));
2587  float qOverP = std::abs(trk->perigeeParameters()->parameters()[Trk::qOverP]);
2588  if ( qOverP < 1e-12 ) qOverP = 1e-12;
2589  pt = sin(theta)/qOverP;
2590  d0 = trk->perigeeParameters()->parameters()[Trk::d0];
2591  z0 = trk->perigeeParameters()->parameters()[Trk::z0];
2592  phi = trk->perigeeParameters()->parameters()[Trk::phi];
2593  chi2 = trk->fitQuality()->chiSquared();
2594  ndof = trk->fitQuality()->doubleNumberDoF();
2595  if( trk->trackSummary()!=0 ) {
2597  n_hits_sct = trk->trackSummary()->get(Trk::SummaryType::numberOfSCTHits);
2599  n_hits_next_to_innermost = trk->trackSummary()->get(Trk::SummaryType::numberOfNextToInnermostPixelLayerHits);
2600  n_hits_inner = n_hits_innermost + n_hits_next_to_innermost;
2601  }
2602  }
2603  comp->setDetail<float>(prefix+"_pt", pt);
2604  comp->setDetail<float>(prefix+"_eta", eta);
2605  comp->setDetail<float>(prefix+"_phi", phi);
2606  comp->setDetail<float>(prefix+"_d0", d0);
2607  comp->setDetail<float>(prefix+"_z0", z0);
2608  comp->setDetail<float>(prefix+"_chi2", chi2);
2609  comp->setDetail<float>(prefix+"_ndof", ndof);
2610  comp->setDetail<int16_t>(prefix+"_n_hits_innermost", (int16_t)n_hits_innermost);
2611  comp->setDetail<int16_t>(prefix+"_n_hits_inner", (int16_t)n_hits_inner);
2612  comp->setDetail<int16_t>(prefix+"_n_hits_pix", (int16_t)n_hits_pix);
2613  comp->setDetail<int16_t>(prefix+"_n_hits_sct", (int16_t)n_hits_sct);
2614 
2615  // extrapolate
2616  float theta_wrtVtx=0; float eta_wrtVtx=0; float pt_wrtVtx=0; float d0_wrtVtx=0; float z0_wrtVtx=0; float phi_wrtVtx=0;
2617  if( vertexPerigee != nullptr ) {
2618  theta_wrtVtx = vertexPerigee->parameters()[Trk::theta];
2619  eta_wrtVtx = -std::log(std::tan(0.5*theta_wrtVtx));
2620  float qOverP_wrtVtx = std::abs(vertexPerigee->parameters()[Trk::qOverP]);
2621  if ( qOverP_wrtVtx < 1e-12 ) qOverP_wrtVtx = 1e-12;
2622  pt_wrtVtx = std::sin(theta_wrtVtx)/qOverP_wrtVtx;
2623  d0_wrtVtx = vertexPerigee->parameters()[Trk::d0];
2624  z0_wrtVtx = vertexPerigee->parameters()[Trk::z0];
2625  phi_wrtVtx = vertexPerigee->parameters()[Trk::phi];
2626  }
2627  comp->setDetail<float>(prefix+"_pt_wrtVtx", pt_wrtVtx);
2628  comp->setDetail<float>(prefix+"_eta_wrtVtx", eta_wrtVtx);
2629  comp->setDetail<float>(prefix+"_phi_wrtVtx", phi_wrtVtx);
2630  comp->setDetail<float>(prefix+"_d0_wrtVtx", d0_wrtVtx);
2631  comp->setDetail<float>(prefix+"_z0_wrtVtx", z0_wrtVtx);
2632 
2633  // barrel hits
2634  std::array<OneLayerInfo_t, N_BARREL_LAYERS> barrelInfo{};
2635  barrelInfo = getTrkBarrelLayerInfo(trk);
2636  comp->setDetail<float>(prefix+"_chi2sum_br_ibl", barrelInfo[0].chiSq);
2637  comp->setDetail<float>(prefix+"_chi2sum_br_pix1", barrelInfo[1].chiSq);
2638  comp->setDetail<float>(prefix+"_chi2sum_br_pix2", barrelInfo[2].chiSq);
2639  comp->setDetail<float>(prefix+"_chi2sum_br_pix3", barrelInfo[3].chiSq);
2640  comp->setDetail<float>(prefix+"_chi2sum_br_sct1", barrelInfo[4].chiSq);
2641  comp->setDetail<float>(prefix+"_chi2sum_br_sct2", barrelInfo[5].chiSq);
2642  comp->setDetail<float>(prefix+"_chi2sum_br_sct3", barrelInfo[6].chiSq);
2643  comp->setDetail<float>(prefix+"_chi2sum_br_sct4", barrelInfo[7].chiSq);
2644  comp->setDetail<float>(prefix+"_ndofsum_br_ibl", barrelInfo[0].nDof);
2645  comp->setDetail<float>(prefix+"_ndofsum_br_pix1", barrelInfo[1].nDof);
2646  comp->setDetail<float>(prefix+"_ndofsum_br_pix2", barrelInfo[2].nDof);
2647  comp->setDetail<float>(prefix+"_ndofsum_br_pix3", barrelInfo[3].nDof);
2648  comp->setDetail<float>(prefix+"_ndofsum_br_sct1", barrelInfo[4].nDof);
2649  comp->setDetail<float>(prefix+"_ndofsum_br_sct2", barrelInfo[5].nDof);
2650  comp->setDetail<float>(prefix+"_ndofsum_br_sct3", barrelInfo[6].nDof);
2651  comp->setDetail<float>(prefix+"_ndofsum_br_sct4", barrelInfo[7].nDof);
2652 
2653  // isolation
2654  if( fillIso ) {
2655  const float ISOL_CALC_Z0_DIFF_CUT = 2.5;
2656  const float ISOL_CALC_DR_CUT_TO_AVOID_ZERO = 0.015;
2657  float iso1_dr01=0; float iso1_dr02=0;
2658  float iso2_dr01=0; float iso2_dr02=0;
2659  float iso3_dr01=0; float iso3_dr02=0;
2660  for(auto t=tracksForIso.begin(); t!=tracksForIso.end(); t++) {
2661  float z0_t = (*t)->perigeeParameters()->parameters()[Trk::z0];
2662  if( std::abs(z0_t - z0) <= ISOL_CALC_Z0_DIFF_CUT ) {
2663  float theta_t = (*t)->perigeeParameters()->parameters()[Trk::theta];
2664  float qOverP_t= std::abs((*t)->perigeeParameters()->parameters()[Trk::qOverP]);
2665  if ( qOverP_t < 1e-12 ) qOverP_t = 1e-12;
2666  float pt_t = std::sin(theta_t)/qOverP_t;
2667  float phi_t = (*t)->perigeeParameters()->parameters()[Trk::phi];
2668  float eta_t = -std::log(std::tan(theta_t/2.0));
2669  float deta = eta_t - eta;
2670  float dphi = std::abs(phi_t - phi);
2671  if( dphi > CLHEP::pi ) dphi = CLHEP::pi*2 - dphi;
2672  float dr = std::sqrt(deta*deta + dphi*dphi);
2673  if( dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.1 && pt_t > 1.0*Gaudi::Units::GeV ) iso1_dr01 += pt_t;
2674  if( dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.2 && pt_t > 1.0*Gaudi::Units::GeV ) iso1_dr02 += pt_t;
2675  //
2676  if( dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.1 && pt_t > 2.0*Gaudi::Units::GeV ) iso2_dr01 += pt_t;
2677  if( dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.2 && pt_t > 2.0*Gaudi::Units::GeV ) iso2_dr02 += pt_t;
2678  //
2679  if( dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.1 && pt_t > 3.0*Gaudi::Units::GeV ) iso3_dr01 += pt_t;
2680  if( dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.2 && pt_t > 3.0*Gaudi::Units::GeV ) iso3_dr02 += pt_t;
2681  }
2682  }
2683  comp->setDetail<float>(prefix+"_iso1_dr01", iso1_dr01);
2684  comp->setDetail<float>(prefix+"_iso1_dr02", iso1_dr02);
2685  comp->setDetail<float>(prefix+"_iso2_dr01", iso2_dr01);
2686  comp->setDetail<float>(prefix+"_iso2_dr02", iso2_dr02);
2687  comp->setDetail<float>(prefix+"_iso3_dr01", iso3_dr01);
2688  comp->setDetail<float>(prefix+"_iso3_dr02", iso3_dr02);
2689  }
2690 }
2691 
2692 int TrigFastTrackFinder::recoAndFillDisTrkCand(const std::string& base_prefix,
2693  TrackCollection* tracks, std::vector<Trk::Track*>& tracksForIso,
2694  xAOD::TrigCompositeContainer* trigCompositeContainer,
2695  const std::vector<double>& v_xvtx,
2696  const std::vector<double>& v_yvtx,
2697  const std::vector<double>& v_zvtx,
2698  bool isFail,
2699  const EventContext& ctx) const
2700 {
2701  std::string prefix;
2702 
2703  int n_stored_tracks = 0;
2704 
2705  for (auto trk = tracks->begin(); trk!=tracks->end(); ++trk) {
2706 
2707  Trk::Track* ptrk = *trk;
2708 
2709  if( ptrk == nullptr ) continue;
2710  if( ptrk->perigeeParameters()==nullptr ) continue;
2711 
2712  // extrapolate to vertex
2713  std::unique_ptr<const Trk::TrackParameters> vertexPerigee = extrapolateDisTrackToBS(ptrk,v_xvtx,v_yvtx,v_zvtx, ctx);
2714  double d0 = ptrk->perigeeParameters()->parameters()[Trk::d0];
2715  double z0 = ptrk->perigeeParameters()->parameters()[Trk::z0];
2716  double d0_wrtVtx = 0;
2717  double z0_wrtVtx = 0;
2718  if( vertexPerigee != nullptr ) {
2719  d0_wrtVtx = vertexPerigee->parameters()[Trk::d0];
2720  z0_wrtVtx = vertexPerigee->parameters()[Trk::z0];
2721  ATH_MSG_VERBOSE("d0 : " << d0 << " -> extrapolate -> " << d0_wrtVtx);
2722  ATH_MSG_VERBOSE("z0 : " << z0 << " -> extrapolate -> " << z0_wrtVtx);
2723  }
2724 
2725  m_trackSummaryTool->updateTrack(ctx, *ptrk);
2726 
2727  // pre-selection before refit
2728  if( ! isPreselPassDisTrackBeforeRefit(ptrk,d0_wrtVtx,z0_wrtVtx) ) continue;
2729 
2730  // refit
2731  std::unique_ptr<Trk::Track> refit_trk = disTrk_refit(ptrk, ctx);
2732  if( refit_trk != nullptr ) m_trackSummaryTool->updateTrack(ctx, *refit_trk);
2733 
2734  // extrapolate refitted track to vertex
2735  double refit_d0 = 0;
2736  double refit_z0 = 0;
2737  double refit_d0_wrtVtx = 0;
2738  double refit_z0_wrtVtx = 0;
2739  std::unique_ptr<const Trk::TrackParameters> refitVertexPerigee = nullptr;
2740  if( refit_trk != nullptr ) {
2741  refitVertexPerigee = extrapolateDisTrackToBS(refit_trk.get(),v_xvtx,v_yvtx,v_zvtx,ctx);
2742  if( refitVertexPerigee == nullptr ) {
2743  ATH_MSG_VERBOSE("extrapote to BS fails for refit track");
2744  }
2745  else {
2746  refit_d0 = refit_trk.get()->perigeeParameters()->parameters()[Trk::d0];
2747  refit_z0 = refit_trk.get()->perigeeParameters()->parameters()[Trk::z0];
2748  refit_d0_wrtVtx = refitVertexPerigee->parameters()[Trk::d0];
2749  refit_z0_wrtVtx = refitVertexPerigee->parameters()[Trk::z0];
2750  ATH_MSG_VERBOSE("refit trk d0 : " << refit_d0 << " -> extrapolate -> " << refit_d0_wrtVtx);
2751  ATH_MSG_VERBOSE("refit trk z0 : " << refit_z0 << " -> extrapolate -> " << refit_z0_wrtVtx);
2752  }
2753  }
2754 
2755  // pre-selection after refit
2756  if( ! isPreselPassDisTrackAfterRefit(ptrk,refit_trk.get(),refit_d0_wrtVtx,refit_z0_wrtVtx) ) continue;
2757 
2758  // store it!
2759  n_stored_tracks++;
2760 
2762  comp->makePrivateStore();
2763  trigCompositeContainer->push_back(comp);
2764 
2765  //
2766  int is_fail = isFail ? 1 : 0;
2767  comp->setDetail<int16_t>(base_prefix+"_is_fail",(int16_t)is_fail);
2768 
2769  // store trk info
2770  prefix = base_prefix;
2771  fillDisTrkCand(comp,prefix,ptrk,vertexPerigee,true,tracksForIso);
2772 
2773  // store refit trk info
2774  prefix = base_prefix + "_refit";
2775  if( refit_trk != nullptr ) {
2776  fillDisTrkCand(comp,prefix,refit_trk.get(),refitVertexPerigee);
2777  }
2778  else {
2779  fillDisTrkCand(comp,prefix,nullptr,refitVertexPerigee);
2780  }
2781  }
2782 
2783  //
2784  ATH_MSG_VERBOSE("========> filling trigcomposite for " << prefix << " end");
2785  ATH_MSG_VERBOSE("nr of " << prefix << " tracks / stored = " << tracks->size() << " / " << n_stored_tracks);
2786 
2787  //
2788  return n_stored_tracks;
2789 }
2790 
2791 std::unique_ptr<Trk::Track> TrigFastTrackFinder::disTrk_refit(Trk::Track* t, const EventContext& ctx) const
2792 {
2793  std::unique_ptr<Trk::Track> newtrack = nullptr;
2794 
2795  if( t == nullptr ) return newtrack;
2796  if( t->trackSummary() == nullptr ) m_trackSummaryTool->updateTrack(ctx, *t);
2797 
2798  ATH_MSG_VERBOSE("refitting - input track:");
2799  print_disTrk(t);
2800 
2801  const Trk::Perigee* origPerigee = t->perigeeParameters();
2802  if( origPerigee == nullptr ) return newtrack;
2803  ATH_MSG_VERBOSE("... origPerigee is there");
2804 
2805  // remove SCT hits
2806  std::vector<const Trk::MeasurementBase*> vec;
2807  int n_measurements = 0;
2808  int n_measurements_refit = 0;
2809  const Trk::TrackStates* recoTrackStates = t->trackStateOnSurfaces();
2810  if (recoTrackStates) {
2811  Trk::TrackStates::const_iterator tsosIter = recoTrackStates->begin();
2812  Trk::TrackStates::const_iterator tsosIterEnd = recoTrackStates->end();
2813  for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
2814  const Trk::MeasurementBase *measurement = (*tsosIter)->measurementOnTrack();
2815  if (measurement) {
2816  n_measurements++;
2817  const InDet::PixelClusterOnTrack *pixclus = dynamic_cast<const InDet::PixelClusterOnTrack*>(measurement);
2818  const InDet::SCT_ClusterOnTrack *sctclus = dynamic_cast<const InDet::SCT_ClusterOnTrack*>(measurement);
2819  bool to_add = true;
2820  if ( !pixclus && sctclus ) to_add = false;
2821  if( to_add ) {
2822  vec.push_back(measurement);
2823  n_measurements_refit++;
2824  }
2825  }
2826  }
2827  }
2828  ATH_MSG_VERBOSE("... Nr of measurments / refit = " << n_measurements << " / " << n_measurements_refit);
2829 
2830  // perform refit
2831  newtrack = m_disTrkFitter->fit(ctx,vec, *origPerigee, false, m_particleHypothesis); // false to run outlier switch
2832  ATH_MSG_VERBOSE("... ---> refit track:");
2833  if( newtrack!=0 && newtrack.get() ) {
2834  print_disTrk(dynamic_cast<const Trk::Track*>(newtrack.get()));
2835  }
2836  else {
2837  ATH_MSG_VERBOSE("... refit failed");
2838  }
2839 
2840  //
2841  return newtrack;
2842 }
2843 
2845 {
2846  float chi2=0; float ndof=0; float d0=0; float z0=0; float phi=0; float theta=0; float pt=0;
2847  if( t!=nullptr ) {
2848  chi2 = t->fitQuality()->chiSquared();
2849  ndof = t->fitQuality()->doubleNumberDoF();
2850  d0 = t->perigeeParameters()->parameters()[Trk::d0];
2851  z0 = t->perigeeParameters()->parameters()[Trk::z0];
2852  phi = t->perigeeParameters()->parameters()[Trk::phi];
2853  theta = t->perigeeParameters()->parameters()[Trk::theta];
2854  float qOverP = std::abs(t->perigeeParameters()->parameters()[Trk::qOverP]);
2855  if ( qOverP < 1e-12 ) qOverP = 1e-12;
2856  pt = sin(theta)/qOverP;
2857  pt /= Gaudi::Units::GeV;
2858  }
2859  ATH_MSG_DEBUG("... pt / theta / phi / d0 / z0 = " << pt << " / " << theta << " / " << phi << " / " << d0 << " / " << z0);
2860  ATH_MSG_DEBUG("... chi2 / ndof = " << chi2 << " / " << ndof);
2861 }
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
TrigCombinatorialSettings::m_nMaxPhiSlice
int m_nMaxPhiSlice
Definition: TrigCombinatorialSettings.h:68
TrigFastTrackFinder::m_disTrkCandKey
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_disTrkCandKey
Definition: TrigFastTrackFinder.h:167
TrigFastTrackFinder::m_LRTHardMinPt
float m_LRTHardMinPt
Definition: TrigFastTrackFinder.h:232
TrigInDetTriplet
Definition: TrigInDetTriplet.h:13
Trk::SpacePoint::clusterList
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:127
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TrigFastTrackFinder::m_spacePointTool
ToolHandle< ITrigSpacePointConversionTool > m_spacePointTool
Definition: TrigFastTrackFinder.h:144
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
TrigFastTrackFinder::DisTrkCategory
DisTrkCategory
Definition: TrigFastTrackFinder.h:118
plotting.yearwise_luminosity_vs_mu.comp
comp
Definition: yearwise_luminosity_vs_mu.py:23
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
base
std::string base
Definition: hcg.cxx:78
query_example.row
row
Definition: query_example.py:24
IRoiDescriptor::phi
virtual double phi() const =0
Methods to retrieve data members.
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:134
TrigInDetTrackSeedingResult::m_nStripSPs
int m_nStripSPs
Definition: TrigInDetTrackSeedingResult.h:12
SCT_ClusterOnTrack.h
Region::SctBarrel
@ SctBarrel
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
TrigAccel::DataExportBuffer
Definition: DataExportBuffer.h:14
TrigFastTrackFinder::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigFastTrackFinder.h:149
Trk::TrackStateOnSurface::Perigee
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Definition: TrackStateOnSurface.h:117
TrigAccel::DATA_EXPORT_BUFFER
struct TrigAccel::DataExportBuffer DATA_EXPORT_BUFFER
TrigFastTrackFinder::m_pTmin
float m_pTmin
Definition: TrigFastTrackFinder.h:193
xAOD::TrigComposite_v1::setDetail
bool setDetail(const std::string &name, const TYPE &value)
Set an TYPE detail on the object.
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
TrigCombinatorialSettings::m_zvErrorEndcap
float m_zvErrorEndcap
Definition: TrigCombinatorialSettings.h:72
trackInfo::ptGeV
float ptGeV
Definition: TrigInDetUtils.h:15
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
Region::PixBarrel
@ PixBarrel
Trk::Track::fitQuality
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
TrigFastTrackFinder::findTracks
StatusCode findTracks(InDet::SiTrackMakerEventData_xk &event_data, const TrigRoiDescriptor &roi, const TrackCollection *inputTracks, TrackCollection &outputTracks, const EventContext &ctx) const
Definition: TrigFastTrackFinder.cxx:436
trackInfo::n_hits_inner
int n_hits_inner
Definition: TrigInDetUtils.h:14
get_generator_info.result
result
Definition: get_generator_info.py:21
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TrigFastTrackFinder::filterSharedDisTracks
void filterSharedDisTracks(std::vector< std::tuple< bool, double, Trk::Track * >> &) const
Definition: TrigFastTrackFinder.cxx:2324
TrackParameters.h
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TrigFastTrackFinder::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: TrigFastTrackFinder.h:214
DataVector::emplace_back
value_type emplace_back(value_type pElem)
Add an element to the end of the collection.
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
RoiDescriptor::zedMinus
virtual double zedMinus() const override final
z at the most backward end of the RoI
Definition: RoiDescriptor.h:113
Trk::locX
@ locX
Definition: ParamDefs.h:37
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
FTF::isGoodTrackUTT
bool isGoodTrackUTT(const Trk::Track *track, trackInfo &theTrackInfo, const float shift_x, const float shift_y, float trkcut_ptgev)
Definition: TrigInDetUtils.cxx:4
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
TrigCombinatorialSettings::m_tripletD0_PPS_Max
float m_tripletD0_PPS_Max
Definition: TrigCombinatorialSettings.h:59
TRIG_TRACK_SEED_GENERATOR
class TrigTrackSeedGenerator TRIG_TRACK_SEED_GENERATOR
xAOD::TrigComposite
TrigComposite_v1 TrigComposite
Declare the latest version of the class.
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:16
TrigCombinatorialSettings::m_tripletDtCut
float m_tripletDtCut
Definition: TrigCombinatorialSettings.h:67
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
TrigCombinatorialSettings::m_maxSiliconLayer
int m_maxSiliconLayer
Definition: TrigCombinatorialSettings.h:52
TrigFastTrackFinder::m_trigInDetTrackFitter
ToolHandle< ITrigInDetTrackFitter > m_trigInDetTrackFitter
Definition: TrigFastTrackFinder.h:146
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
PixelCluster.h
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: PixelID.h:619
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
TrigAccel::Work::run
virtual bool run()=0
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
JetTiledMap::W
@ W
Definition: TiledEtaPhiMap.h:44
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrigTrackSeedGenerator.h
TrigFastTrackFinder::m_accelSvc
ServiceHandle< ITrigInDetAccelerationSvc > m_accelSvc
Definition: TrigFastTrackFinder.h:155
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Region::SctEndcap
@ SctEndcap
TrigFastTrackFinder::m_checkSeedRedundancy
bool m_checkSeedRedundancy
Definition: TrigFastTrackFinder.h:196
IRoiDescriptor::etaMinus
virtual double etaMinus() const =0
TrigFastTrackFinder::m_outputTracksKey
SG::WriteHandleKey< TrackCollection > m_outputTracksKey
Definition: TrigFastTrackFinder.h:160
CxxUtils::wrapToPi
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
Definition: phihelper.h:24
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
TrigFastTrackFinder::dEdx
float dEdx(const Trk::Track *, int &, int &, std::vector< float > &, std::vector< float > &, std::vector< float > &, std::vector< float > &, std::vector< int > &, std::vector< int > &, std::vector< int > &) const
Definition: TrigFastTrackFinder.cxx:1743
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
TrigFastTrackFinder::m_doTrackRefit
Gaudi::Property< bool > m_doTrackRefit
Definition: TrigFastTrackFinder.h:283
TrigCombinatorialSettings::m_maxBarrelPix
int m_maxBarrelPix
Definition: TrigCombinatorialSettings.h:52
TrigFastTrackFinder::makeSeedsOnGPU
void makeSeedsOnGPU(const TrigCombinatorialSettings &, const IRoiDescriptor *, const std::vector< TrigSiSpacePointBase > &, std::vector< TrigInDetTriplet > &) const
Definition: TrigFastTrackFinder.cxx:1486
TrigAccel::Work::getOutput
virtual std::shared_ptr< OffloadBuffer > getOutput()=0
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TrigCombinatorialSettings::m_layerGeometry
std::vector< TrigInDetSiLayer > m_layerGeometry
Definition: TrigCombinatorialSettings.h:76
TrigInDetTracklet.h
test_pyathena.pt
pt
Definition: test_pyathena.py:11
TrigFastTrackFinder::m_doCloneRemoval
Gaudi::Property< bool > m_doCloneRemoval
Definition: TrigFastTrackFinder.h:282
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TrigCombinatorialSettings::m_curv_delta
float m_curv_delta
Definition: TrigCombinatorialSettings.h:65
RoiDescriptor::composite
virtual bool composite() const override final
SuperRoI compatability methods.
Definition: RoiDescriptor.h:137
ParticleTest.tp
tp
Definition: ParticleTest.py:25
TrigFastTrackFinder::m_disTrkFitter
ToolHandle< Trk::ITrackFitter > m_disTrkFitter
Definition: TrigFastTrackFinder.h:151
xAOD::pion
@ pion
Definition: TrackingPrimitives.h:196
Trk::z0
@ z0
Definition: ParamDefs.h:64
TrigCombinatorialSettings::m_LRTmode
bool m_LRTmode
Definition: TrigCombinatorialSettings.h:73
RoiDescriptor::size
virtual unsigned size() const override final
number of constituents
Definition: RoiDescriptor.h:145
TrigCombinatorialSettings::m_tripletPtMin
float m_tripletPtMin
Definition: TrigCombinatorialSettings.h:60
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
TrigFastTrackFinder::m_doZFinder
bool m_doZFinder
Definition: TrigFastTrackFinder.h:175
SiClusterOnTrack.h
TrigFastTrackFinder::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: TrigFastTrackFinder.h:150
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
Trk::FitQualityOnSurface::doubleNumberDoF
double doubleNumberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as double
Definition: FitQuality.h:68
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
FTF::getBeamSpotShift
void getBeamSpotShift(float &shift_x, float &shift_y, const InDet::BeamSpotData &beamSpotHandle)
Definition: TrigInDetUtils.cxx:30
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TrigFastTrackFinder::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: TrigFastTrackFinder.cxx:385
TrigCombinatorialSettings::m_tripletDoConfirm
bool m_tripletDoConfirm
Definition: TrigCombinatorialSettings.h:64
IRoiDescriptor::etaPlus
virtual double etaPlus() const =0
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
TrigFastTrackFinder::m_standaloneMode
bool m_standaloneMode
Definition: TrigFastTrackFinder.h:277
InDetAccessor::qOverP
@ qOverP
perigee
Definition: InDetAccessor.h:35
TrigFastTrackFinder::m_inputTracksKey
SG::ReadHandleKey< TrackCollection > m_inputTracksKey
Definition: TrigFastTrackFinder.h:159
TrigFastTrackFinder::finalize
virtual StatusCode finalize() override
Definition: TrigFastTrackFinder.cxx:1046
SCT_Cluster.h
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
TrigFastTrackFinder::m_useGPU
bool m_useGPU
Definition: TrigFastTrackFinder.h:223
TrigSeedML_LUT
Definition: TrigSeedML_LUT.h:10
InDet::PixelCluster::totList
const std::vector< int > & totList() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:201
pi
#define pi
Definition: TileMuonFitter.cxx:65
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
TrigFastTrackFinder::~TrigFastTrackFinder
virtual ~TrigFastTrackFinder()
Definition: TrigFastTrackFinder.cxx:180
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
TrigFastTrackFinder::extractClusterIds
void extractClusterIds(const Trk::SpacePoint *, std::vector< Identifier > &) const
Definition: TrigFastTrackFinder.cxx:1080
Region::PixEndcap
@ PixEndcap
Track.h
TrigCombinatorialSettings::m_maxEC_len
float m_maxEC_len
Definition: TrigCombinatorialSettings.h:80
TrigFastTrackFinder::m_doDisappearingTrk
bool m_doDisappearingTrk
Definition: TrigFastTrackFinder.h:251
Trk::FitQualityOnSurface
Definition: FitQualityOnSurface.h:19
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
TrigInDetUtils.h
TrigCombinatorialSettings::m_zvError
float m_zvError
Definition: TrigCombinatorialSettings.h:71
IRoiDescriptor::eta
virtual double eta() const =0
trackInfo::eta
float eta
Definition: TrigInDetUtils.h:15
TrigFastTrackFinder::updateClusterMap
void updateClusterMap(long int, const Trk::Track *, std::map< Identifier, std::vector< long int > > &) const
Definition: TrigFastTrackFinder.cxx:1059
TrigFastTrackFinder::m_initialD0Max
float m_initialD0Max
Definition: TrigFastTrackFinder.h:194
TrigFastTrackFinder::m_dEdxTrkKey
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_dEdxTrkKey
Definition: TrigFastTrackFinder.h:165
TrigFastTrackFinder::m_LRTmode
bool m_LRTmode
Definition: TrigFastTrackFinder.h:230
TrigCombinatorialSettings::m_doublet_dR_Max
float m_doublet_dR_Max
Definition: TrigCombinatorialSettings.h:55
trackInfo::n_hits_pix
int n_hits_pix
Definition: TrigInDetUtils.h:14
TrigSeedML_LUT::setBin
void setBin(int r, int c)
Definition: TrigSeedML_LUT.h:70
perfmonmt-refit.idx_min
idx_min
Definition: perfmonmt-refit.py:83
TrigFastTrackFinder::getDisTrkCategory
TrigFastTrackFinder::DisTrkCategory getDisTrkCategory(Trk::Track *trk) const
Definition: TrigFastTrackFinder.cxx:2541
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
RoiDescriptor::push_back
void push_back(const IRoiDescriptor *roi)
add a RoiDescriptor
Definition: RoiDescriptor.h:157
TrigFastTrackFinder::disTrk_refit
std::unique_ptr< Trk::Track > disTrk_refit(Trk::Track *t, const EventContext &ctx) const
Definition: TrigFastTrackFinder.cxx:2791
TrigFastTrackFinder::runResidualMonitoring
void runResidualMonitoring(const Trk::Track &track, const EventContext &) const
Definition: TrigFastTrackFinder.cxx:1267
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
python.TrigInDetConfig.inputTracks
inputTracks
Definition: TrigInDetConfig.py:183
RoiDescriptor::at
virtual const IRoiDescriptor * at(int i) const override final
find an RoiDescriptor constituent
Definition: RoiDescriptor.h:148
TrigFastTrackFinder::m_countRoIwithEnoughHits
std::atomic< unsigned int > m_countRoIwithEnoughHits
Definition: TrigFastTrackFinder.h:209
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
TrigFastTrackFinder::m_vertexSeededMode
bool m_vertexSeededMode
Definition: TrigFastTrackFinder.h:173
TrigSiSpacePointBase.h
TrigCombinatorialSettings::m_seedRadBinWidth
float m_seedRadBinWidth
Definition: TrigCombinatorialSettings.h:61
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:66
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
vector
Definition: MultiHisto.h:13
InDet::PixelCluster::totalToT
int totalToT() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:205
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigCombinatorialSettings::m_tripletDoPPS
bool m_tripletDoPPS
Definition: TrigCombinatorialSettings.h:63
ReweightUtils.category
category
Definition: ReweightUtils.py:15
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
TrigFastTrackFinder::finddEdxTrk
StatusCode finddEdxTrk(const EventContext &, const TrackCollection &) const
Definition: TrigFastTrackFinder.cxx:1654
TrigFastTrackFinder::getSPLayer
int getSPLayer(int, float) const
Definition: TrigFastTrackFinder.cxx:1534
TrigFastTrackFinder.h
TrigFastTrackFinder::m_tcs
TrigCombinatorialSettings m_tcs
Definition: TrigFastTrackFinder.h:185
TrigL2HitResidual.h
TrigFastTrackFinder::usedByAnyTrack
bool usedByAnyTrack(const std::vector< Identifier > &, std::map< Identifier, std::vector< long int > > &) const
Definition: TrigFastTrackFinder.cxx:1088
TileDCSDataPlotter.pr
pr
Definition: TileDCSDataPlotter.py:922
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
TrigFastTrackFinder::m_Z0Max
float m_Z0Max
Definition: TrigFastTrackFinder.h:195
TrigFastTrackFinder::m_useBeamSpot
bool m_useBeamSpot
Definition: TrigFastTrackFinder.h:171
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IRoiDescriptor::phiMinus
virtual double phiMinus() const =0
Region::IBL
@ IBL
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
Trk::ParametersBase
Definition: ParametersBase.h:55
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
trackInfo::n_hits_sct
int n_hits_sct
Definition: TrigInDetUtils.h:14
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
Trk::FitQualityOnSurface::numberDoF
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition: FitQuality.h:60
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
python.compareNtuple.nGood
nGood
Definition: compareNtuple.py:55
a0
double a0
Definition: globals.cxx:27
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
DataVector< Trk::Track >
TrigFastTrackFinder::initialize
virtual StatusCode initialize() override
Definition: TrigFastTrackFinder.cxx:184
TrigFastTrackFinder::disTrackQuality
double disTrackQuality(const Trk::Track *) const
Definition: TrigFastTrackFinder.cxx:2092
TrigFastTrackFinder::m_dodEdxTrk
bool m_dodEdxTrk
Definition: TrigFastTrackFinder.h:244
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
TrigFastTrackFinder::findDisTracks
StatusCode findDisTracks(const EventContext &, TrackCollection &, std::vector< std::tuple< bool, double, Trk::Track * >> &, std::vector< std::tuple< bool, double, Trk::Track * >> &, TrackCollection &, const std::vector< double > &, const std::vector< double > &, const std::vector< double > &) const
Definition: TrigFastTrackFinder.cxx:2361
TrigFastTrackFinder::m_roiCollectionKey
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
Definition: TrigFastTrackFinder.h:158
TrigCombinatorialSettings::m_maxTripletBufferLength
unsigned int m_maxTripletBufferLength
Definition: TrigCombinatorialSettings.h:69
trackInfo
Definition: TrigInDetUtils.h:13
TrigCompositeAuxContainer.h
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TrigFastTrackFinder::m_ITkMode
bool m_ITkMode
Definition: TrigFastTrackFinder.h:276
SCT
Definition: SCT_ChipUtils.h:14
TrigCombinatorialSettings::m_tripletDoPSS
bool m_tripletDoPSS
Definition: TrigCombinatorialSettings.h:62
TrigFastTrackFinder::trackQuality
double trackQuality(const Trk::Track *Tr) const
Definition: TrigFastTrackFinder.cxx:988
TrigFastTrackFinder::start
virtual StatusCode start() override
Definition: TrigFastTrackFinder.cxx:364
TrigFastTrackFinder::m_nfreeCut
int m_nfreeCut
Definition: TrigFastTrackFinder.h:189
IRoiDescriptor::phiPlus
virtual double phiPlus() const =0
extreme phi values
TrigFastTrackFinder::m_LRTD0Min
float m_LRTD0Min
Definition: TrigFastTrackFinder.h:231
InDet::ExtendedSiTrackMakerEventData_xk
Definition: SiSPSeededTrackFinder.cxx:161
TrigFastTrackFinder::m_connectionFile
std::string m_connectionFile
Definition: TrigFastTrackFinder.h:235
merge.output
output
Definition: merge.py:17
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk::MeasurementBase
Definition: MeasurementBase.h:58
TrigFastTrackFinder::m_trackSummaryTool
ToolHandle< Trk::ITrackSummaryTool > m_trackSummaryTool
Definition: TrigFastTrackFinder.h:148
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
TrigFastTrackFinder::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: TrigFastTrackFinder.h:198
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition: PixelID.h:651
TrigFastTrackFinder::m_seedingTool
ToolHandle< ITrigInDetTrackSeedingTool > m_seedingTool
Definition: TrigFastTrackFinder.h:279
xAOD::numberOfNextToInnermostPixelLayerHits
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
Definition: TrackingPrimitives.h:248
Trk::SurfaceType::Perigee
@ Perigee
PathResolver.h
trackInfo::a0beam
float a0beam
Definition: TrigInDetUtils.h:15
TrigCombinatorialSettings::m_useTrigSeedML
int m_useTrigSeedML
Definition: TrigCombinatorialSettings.h:78
TrigFastTrackFinder::m_trackMaker
ToolHandle< InDet::ISiTrackMaker > m_trackMaker
Definition: TrigFastTrackFinder.h:145
TrigFastTrackFinder::print_disTrk
void print_disTrk(const Trk::Track *t) const
Definition: TrigFastTrackFinder.cxx:2844
TrigFastTrackFinder::isPreselPassDisTrackBeforeRefit
bool isPreselPassDisTrackBeforeRefit(Trk::Track *, double, double) const
Definition: TrigFastTrackFinder.cxx:2474
TrigFastTrackFinder::m_accelTool
ToolHandle< ITrigInDetAccelerationTool > m_accelTool
Definition: TrigFastTrackFinder.h:154
RoiDescriptor::zed
virtual double zed() const override final
Definition: RoiDescriptor.h:102
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
TrigInDetTrackSeedingResult::m_nPixelSPs
int m_nPixelSPs
Definition: TrigInDetTrackSeedingResult.h:10
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::d0
@ d0
Definition: ParamDefs.h:63
RIO_OnTrack.h
TrigFastTrackFinder::m_dEdxHitKey
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_dEdxHitKey
Definition: TrigFastTrackFinder.h:166
TrigAccel::Work
Definition: Work.h:14
charge
double charge(const T &p)
Definition: AtlasPID.h:756
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
phihelper.h
Helper for azimuthal angle calculations.
Region::Undefined
@ Undefined
TrigInDetTrackSeedingResult
Definition: TrigInDetTrackSeedingResult.h:8
TrigFastTrackFinder::m_doFastZVseeding
bool m_doFastZVseeding
Definition: TrigFastTrackFinder.h:180
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TrigFastTrackFinder::fillMon
void fillMon(const TrackCollection &tracks, const TrigVertexCollection &vertices, const TrigRoiDescriptor &roi, const EventContext &ctx) const
Definition: TrigFastTrackFinder.cxx:1111
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TrigVertexCollection
Definition: TrigVertexCollection.h:13
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.
TrigFastTrackFinder::m_prdToTrackMap
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
Definition: TrigFastTrackFinder.h:163
TrigFastTrackFinder::TrigFastTrackFinder
TrigFastTrackFinder(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrigFastTrackFinder.cxx:54
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
TrigFastTrackFinder::m_useNewLayerNumberScheme
bool m_useNewLayerNumberScheme
Definition: TrigFastTrackFinder.h:219
SG::ReadHandle::ptr
const_pointer_type ptr()
Dereference the pointer.
TrigFastTrackFinder::isGoodForDisTrackVertex
bool isGoodForDisTrackVertex(Trk::Track *, const EventContext &) const
Definition: TrigFastTrackFinder.cxx:2274
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::Track::measurementsOnTrack
const DataVector< const MeasurementBase > * measurementsOnTrack() const
return a pointer to a vector of MeasurementBase (NOT including any that come from outliers).
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:178
TrigCombinatorialSettings::m_minEndcapPix
int m_minEndcapPix
Definition: TrigCombinatorialSettings.h:52
TrigCombinatorialSettings::m_doubletFilterRZ
bool m_doubletFilterRZ
Definition: TrigCombinatorialSettings.h:66
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
TrigFastTrackFinder::fillDisTrkCand
void fillDisTrkCand(xAOD::TrigComposite *, const std::string &, Trk::Track *, const std::unique_ptr< const Trk::TrackParameters > &) const
Definition: TrigFastTrackFinder.cxx:2568
RoiDescriptor::etaPlus
virtual double etaPlus() const override final
gets eta at zedPlus
Definition: RoiDescriptor.h:115
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
TrigCombinatorialSettings::m_vLUT
std::vector< TrigSeedML_LUT > m_vLUT
Definition: TrigCombinatorialSettings.h:79
TrigCombinatorialSettings::m_maxEndcapPix
int m_maxEndcapPix
Definition: TrigCombinatorialSettings.h:52
InDet::SiCombinatorialTrackFinderData_xk::setFlagToReturnFailedTrack
void setFlagToReturnFailedTrack(const bool)
Setter for flagToReturnFailedTrack (for disappearing track trigger)
Definition: SiCombinatorialTrackFinderData_xk.cxx:42
InDet::PixelClusterOnTrack::prepRawData
virtual const PixelCluster * prepRawData() const override final
returns the PrepRawData - is a SiCluster in this scope
Definition: PixelClusterOnTrack.h:179
TrigFastTrackFinder::m_countTotalRoI
std::atomic< unsigned int > m_countTotalRoI
Definition: TrigFastTrackFinder.h:208
TrigFastTrackFinder::m_trigseedML_LUT
std::string m_trigseedML_LUT
Definition: TrigFastTrackFinder.h:234
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
IRoiDescriptor::zedPlus
virtual double zedPlus() const =0
the zed and eta values at the most forward and most rear ends of the RoI
Trk::TrackInfo::FastTrackFinderSeed
@ FastTrackFinderSeed
for tracks seeded by the FastTrackFinder
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:252
InDet::PixelClusterOnTrack
Definition: PixelClusterOnTrack.h:51
TrigFastTrackFinder::m_doZFinderOnly
bool m_doZFinderOnly
Definition: TrigFastTrackFinder.h:176
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
RoiDescriptor::phi
virtual double phi() const override final
Methods to retrieve data members.
Definition: RoiDescriptor.h:100
Trk::Track::trackSummary
const Trk::TrackSummary * trackSummary() const
Returns a pointer to the const Trk::TrackSummary owned by this const track (could be nullptr)
trackInfo::phi0
float phi0
Definition: TrigInDetUtils.h:15
TrigCombinatorialSettings::m_doublet_dR_Max_Confirm
float m_doublet_dR_Max_Confirm
Definition: TrigCombinatorialSettings.h:56
TrigFastTrackFinder::createEmptyUTTEDMs
StatusCode createEmptyUTTEDMs(const EventContext &) const
Definition: TrigFastTrackFinder.cxx:1517
TrigFastTrackFinder::m_countRoIwithTracks
std::atomic< unsigned int > m_countRoIwithTracks
Definition: TrigFastTrackFinder.h:210
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
InDet::SiCombinatorialTrackFinderData_xk::resultCode
SiCombinatorialTrackFinderData_xk::ResultCode resultCode() const
Definition: SiCombinatorialTrackFinderData_xk.h:183
InDet::PixelCluster::totalCharge
float totalCharge() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:213
TrigFastTrackFinder::isPreselPassDisTrackAfterRefit
bool isPreselPassDisTrackAfterRefit(Trk::Track *, Trk::Track *, double, double) const
Definition: TrigFastTrackFinder.cxx:2427
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
TrigFastTrackFinder::m_minHits
int m_minHits
Definition: TrigFastTrackFinder.h:187
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
TrigFastTrackFinder::m_storeZFinderVertices
bool m_storeZFinderVertices
Definition: TrigFastTrackFinder.h:178
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
TrigFastTrackFinder::recoAndFillDisTrkCand
int recoAndFillDisTrkCand(const std::string &, TrackCollection *, std::vector< Trk::Track * > &, xAOD::TrigCompositeContainer *, const std::vector< double > &, const std::vector< double > &, const std::vector< double > &, bool, const EventContext &) const
Definition: TrigFastTrackFinder.cxx:2692
RoiDescriptor::eta
virtual double eta() const override final
Definition: RoiDescriptor.h:101
extractSporadic.q
list q
Definition: extractSporadic.py:98
IRoiDescriptor::zed
virtual double zed() const =0
IRoiDescriptor::zedMinus
virtual double zedMinus() const =0
TrigCombinatorialSettings::m_tripletD0Max
float m_tripletD0Max
Definition: TrigCombinatorialSettings.h:58
RoiDescriptor::setComposite
void setComposite(bool b=true)
Definition: RoiDescriptor.h:138
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
TrigFastTrackFinder::filterSharedTracks
void filterSharedTracks(std::vector< std::tuple< bool, double, Trk::Track * >> &QT) const
Definition: TrigFastTrackFinder.cxx:1011
TrigFastTrackFinder::m_pixelId
const PixelID * m_pixelId
Definition: TrigFastTrackFinder.h:212
Trk::FitQuality::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
TrigFastTrackFinder::m_trigZFinder
ToolHandle< ITrigZFinder > m_trigZFinder
Definition: TrigFastTrackFinder.h:147
InDet::SiTrackMakerEventData_xk
Definition: SiTrackMakerEventData_xk.h:43
TrigFastTrackFinder::m_particleHypothesis
Trk::ParticleHypothesis m_particleHypothesis
Definition: TrigFastTrackFinder.h:217
Trk::phi
@ phi
Definition: ParamDefs.h:75
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68
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
TrigFastTrackFinder::m_sctId
const SCT_ID * m_sctId
Definition: TrigFastTrackFinder.h:213
TrigFastTrackFinder::m_useTracklets
Gaudi::Property< bool > m_useTracklets
Definition: TrigFastTrackFinder.h:284
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
calibdata.copy
bool copy
Definition: calibdata.py:27
TrigFastTrackFinder::m_numberingTool
ToolHandle< ITrigL2LayerNumberTool > m_numberingTool
Definition: TrigFastTrackFinder.h:143
RoiDescriptor::manageConstituents
bool manageConstituents() const
always manage constituents ???
Definition: RoiDescriptor.h:141
Trk::TrackSummary::get
int get(const SummaryType &type) const
returns the summary information for the passed SummaryType.
trackInfo::n_hits_innermost
int n_hits_innermost
Definition: TrigInDetUtils.h:14
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
RoiDescriptor::phiPlus
virtual double phiPlus() const override final
gets phiPlus
Definition: RoiDescriptor.h:118
TrigFastTrackFinder::getTrkBarrelLayerInfo
std::array< OneLayerInfo_t, N_BARREL_LAYERS > getTrkBarrelLayerInfo(Trk::Track *aTrack) const
Definition: TrigFastTrackFinder.cxx:2035
TrigAccel::MAKE_SEEDS
@ MAKE_SEEDS
Definition: TrigInDetAccelCodes.h:29
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
DataVector::erase
iterator erase(iterator position)
Remove element at a given position.
RoiDescriptor::etaMinus
virtual double etaMinus() const override final
gets eta at zMinus
Definition: RoiDescriptor.h:116
PixelClusterOnTrack.h
TrigInDetTriplet.h
test_pyathena.counter
counter
Definition: test_pyathena.py:15
set_intersection
Set * set_intersection(Set *set1, Set *set2)
Perform an intersection of two sets.
TrigFastTrackFinder::isCleaningPassDisTrack
bool isCleaningPassDisTrack(const TrigInDetTriplet &, Trk::Track *, bool) const
Definition: TrigFastTrackFinder.cxx:1954
RoiDescriptor::phiMinus
virtual double phiMinus() const override final
gets phiMinus
Definition: RoiDescriptor.h:119
python.compressB64.c
def c
Definition: compressB64.py:93
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrigFastTrackFinder::m_doResMonitoring
bool m_doResMonitoring
Definition: TrigFastTrackFinder.h:182
TrigFastTrackFinder::recoVertexForDisTrack
void recoVertexForDisTrack(const EventContext &, TrackCollection &, std::vector< double > &, std::vector< double > &, std::vector< double > &) const
Definition: TrigFastTrackFinder.cxx:2129
InDet::SiCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h:40
TrigCombinatorialSettings
Definition: TrigCombinatorialSettings.h:13
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
Trk::FitQualityOnSurface::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
plotBeamSpotMon.nc
int nc
Definition: plotBeamSpotMon.py:83
Trk::phi0
@ phi0
Definition: ParamDefs.h:65
TrigFastTrackFinder::extrapolateDisTrackToBS
std::unique_ptr< const Trk::TrackParameters > extrapolateDisTrackToBS(Trk::Track *, const std::vector< double > &, const std::vector< double > &, const std::vector< double > &, const EventContext &) const
Definition: TrigFastTrackFinder.cxx:2513
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Trk::FitQuality::doubleNumberDoF
double doubleNumberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as double
Definition: FitQuality.h:68
xAOD::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Definition: TrackingPrimitives.h:237
InDet::SiClusterOnTrack
Definition: SiClusterOnTrack.h:39
InDet::SCT_ClusterOnTrack
Definition: SCT_ClusterOnTrack.h:44
TrigFastTrackFinder::m_tripletMinPtFrac
float m_tripletMinPtFrac
Definition: TrigFastTrackFinder.h:192
InDet::SiTrackMakerEventData_xk::combinatorialData
SiCombinatorialTrackFinderData_xk & combinatorialData()
Definition: SiTrackMakerEventData_xk.cxx:76
Identifier
Definition: IdentifierFieldParser.cxx:14
RoiDescriptor::zedPlus
virtual double zedPlus() const override final
z at the most forward end of the RoI
Definition: RoiDescriptor.h:112