ATLAS Offline Software
TRT_SeededTrackFinder_ATL.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Implementation file for class InDet::TRT_SeededTrackFinder_ATL
8 // (c) ATLAS Detector software
11 // Version 10 04/12/2006 Thomas Koffas
13 
14 
15 #include "GaudiKernel/MsgStream.h"
16 
17 #include "CLHEP/Vector/ThreeVector.h"
18 
19 //Track
20 //
24 
25 //The main Input file
26 //
28 
29 //SCT Geometry
30 //
31 #include "InDetIdentifier/TRT_ID.h"
34 #include "TrkTrack/TrackInfo.h"
35 
36 //Updator tool
38 
39 //Propagator tool
41 
42 // For SiCombinatorialTrackFinder_xk
44 
45 //Tool for getting the SiDetElements from geometry
47 
48 //Needed for the RIO_OnTrackCreator
50 
51 //Space point seed finding tool
52 
55 
56 //ReadHandle
57 #include "StoreGate/ReadHandle.h"
58 
59 #include <cmath>
60 #include <iostream>
61 #include <iomanip>
62 #include <utility>
63 #include <string_view>
64 
65 namespace{
66  double
67  getRadius(const Trk::SpacePoint* pPoint){
68  return pPoint->globalPosition().perp();
69  }
70  double
71  getZ(const Trk::SpacePoint* pPoint){
72  return pPoint->globalPosition().z();
73  }
74 
75  double
76  thetaFromSpacePoints(const Trk::SpacePoint* pPoint0, const Trk::SpacePoint* pPoint1 ){
77  const double deltaR = getRadius(pPoint1) - getRadius(pPoint0);
78  const double deltaZ = getZ(pPoint1) - getZ(pPoint0);
79  return std::atan2(deltaR,deltaZ);
80  }
81 
82 }
83 
85 // Constructor
87 
89 (const std::string& t,const std::string& n,const IInterface* p)
90  : AthAlgTool(t,n,p),
91  m_fieldmode("MapSolenoid"),
92  m_roadmaker("InDet::SiDetElementsRoadMaker_xk"),
93  m_proptool("Trk::RungeKuttaPropagator/InDetPropagator"),
94  m_updatorTool("Trk::KalmanUpdator_xk/InDetPatternUpdator"),
95  m_tracksfinder("InDet::SiCombinatorialTrackFinder_xk", this),
96  m_trtId(nullptr),
97  m_errorScale {1., 1., 1., 1., 1.}
98 {
99  m_xi2max = 15. ; //Maximum chi2 per DOF to accept track candidate
100  m_xi2maxNoAdd = 50. ; //Chi2 to accept as hit
101  m_xi2maxlink = 100. ; //Chi2 during cluster search
102  m_nholesmax = 1 ; //Maximum number of holes
103  m_dholesmax = 1 ; //Maximum hole gap
104  m_nclusmin = 4 ; //Minimum number of clusters
105  m_nwclusmin = 4 ; //Minimum number of weighted clusters
106  m_pTmin = 500. ; //Minimal Pt cut
107  m_bremCorrect = false ; //Repeat seed search after brem correction
108  m_propR = false ; //Clean-up seeds by propagating to the first endcap hit
109  m_useassoTool = false ; //Use prd-track association tool during combinatorial track finding
110  m_outlierCut = 25. ;
111  m_searchInCaloROI = false ;
112  m_phiWidth = .3 ;
113 
114 
115  declareInterface<ITRT_SeededTrackFinder>(this);
116 
117  declareProperty("PropagatorTool" ,m_proptool );
118  declareProperty("UpdatorTool" ,m_updatorTool );
119  declareProperty("RoadTool" ,m_roadmaker );
120  declareProperty("SeedTool" ,m_seedmaker );
121  declareProperty("CombinatorialTrackFinder",m_tracksfinder );
122  declareProperty("MagneticFieldMode" ,m_fieldmode );
123  declareProperty("Xi2max" ,m_xi2max );
124  declareProperty("Xi2maxNoAdd" ,m_xi2maxNoAdd );
125  declareProperty("Xi2maxlink" ,m_xi2maxlink );
126  declareProperty("pTmin" ,m_pTmin );
127  declareProperty("nHolesMax" ,m_nholesmax );
128  declareProperty("nHolesGapMax" ,m_dholesmax );
129  declareProperty("nClustersMin" ,m_nclusmin );
130  declareProperty("nWClustersMin" ,m_nwclusmin );
131  declareProperty("ErrorScaling" ,m_errorScale );
132  declareProperty("BremCorrection" ,m_bremCorrect );
133  declareProperty("ConsistentSeeds" ,m_propR );
134  declareProperty("UseAssociationTool" ,m_useassoTool );
135  declareProperty("OutlierCut" ,m_outlierCut );
136  declareProperty("SearchInCaloROI" ,m_searchInCaloROI);
137  declareProperty("phiWidth" ,m_phiWidth );
138 
139 }
140 
142 
143 
145 // Initialisation
147 
148 StatusCode
150 
151  ATH_MSG_DEBUG("Initializing TRT_SeededTrackFinder_ATL");
154 
155  // Get propagator tool
156  ATH_CHECK(m_proptool.retrieve());
157 
158  // Get updator tool
159  ATH_CHECK(m_updatorTool.retrieve());
160 
161  // Get detector elements road maker tool
162  ATH_CHECK(m_roadmaker.retrieve());
163 
164  // Get seeds maker tool
165  ATH_CHECK(m_seedmaker.retrieve());
166 
167  // Get combinatorial track finder tool
168  ATH_CHECK( m_tracksfinder.retrieve());
169 
170  // Set track quality cuts for track finding tool
172 
173  ATH_CHECK( detStore()->retrieve(m_trtId, "TRT_ID"));
174 
175  // Get output print level
177 
178  //initlialize readhandlekey
180 
181  return StatusCode::SUCCESS;
182 
183 }
184 
186 // Finalize
188 
189 StatusCode
191  return StatusCode::SUCCESS;
192 }
193 
195 // Dumps relevant information into the MsgStream
197 
198 MsgStream&
200  out<<"\n";
201  return dumpconditions(out);
202 }
203 
205 // Dumps conditions information into the MsgStream
207 
208 MsgStream&
210  auto paddedName=[](const auto & str)->std::string{
211  const auto n = 62-std::size(str);
212  std::string result(n,' '); //padding
213  result+='|';
214  result+='\n';
215  return std::string(str)+result;
216  };
217 
218  auto format = [](MsgStream& m)->MsgStream&{
219  m<<std::setw(12)<<std::setprecision(5);
220  return m;
221  };
222 
223  constexpr std::string_view fieldmode[9] ={"NoField" ,"ConstantField","SolenoidalField",
224  "ToroidalField" ,"Grid3DField" ,"RealisticField" ,
225  "UndefinedField","AthenaField" , "?????" };
226 
228  if(mode<0 || mode>8 ) mode = 8;
229 
230  constexpr auto horizontalRule{
231  "|-----------------------------------------------------------------------------------------|\n"
232  };
233 
234  constexpr auto padding{" |\n"};
235  out<<horizontalRule;
236  out<<"| Tool for propagation | "<<paddedName(m_proptool.type());
237  out<<"| Tool for updator | "<<paddedName(m_updatorTool.type());
238  out<<"| Tool for road maker | "<<paddedName(m_roadmaker.type());
239  out<<"| Tool for seed maker | "<<paddedName(m_seedmaker.type());
240  out<<"| Tool for track finding | "<<paddedName(m_tracksfinder.type());
241  out<<"| Magnetic field mode | "<<paddedName(fieldmode[mode]);
242  out<<"| Min pT of track (MeV) | "<<format<<m_pTmin<<padding;
243  out<<"| Max Xi2 for cluster | "<<format<<m_xi2max<<padding;
244  out<<"| Max Xi2 for outlayer | "<<format<<m_xi2maxNoAdd<<padding;
245  out<<"| Max Xi2 for link | "<<format<<m_xi2maxlink<<padding;
246  out<<"| Min number of clusters | "<<std::setw(12)<<m_nclusmin<<padding;
247  out<<"| Max number holes | "<<std::setw(12)<<m_nholesmax<<padding;
248  out<<"| Max holes gap | "<<std::setw(12)<<m_dholesmax<<padding;
249  out<<horizontalRule;
250  return out;
251 }
252 
253 
255 // Dumps relevant information into the ostream
257 
258 std::ostream&
260  return out;
261 }
262 
264 // Initiate track finding tool
266 
267 std::unique_ptr<InDet::ITRT_SeededTrackFinder::IEventData>
268 InDet::TRT_SeededTrackFinder_ATL::newEvent(const EventContext& ctx, SiCombinatorialTrackFinderData_xk& combinatorialData) const
269 {
270 
272  auto event_data_p = std::make_unique<InDet::TRT_SeededTrackFinder_ATL::EventData>(combinatorialData,
273  m_seedmaker->newEvent());
274  // New event for track finder tool
275  m_tracksfinder->newEvent(ctx, event_data_p->combinatorialData());
276 
277  // Print event information
278  if(msgLvl(MSG::DEBUG)) {
280  msg(MSG::DEBUG) << endmsg;
281  }
282 
283  // Get the calo ROI:
284  if(m_searchInCaloROI ) {
286  if (!calo_rois.isValid()) {
287  ATH_MSG_FATAL("Failed to get EM Calo cluster collection " << m_caloClusterROIKey );
288  }
289  event_data_p->setCaloClusterROIEM(*calo_rois);
290  }
291  return event_data_p;
292 }
293 
295 std::unique_ptr<InDet::ITRT_SeededTrackFinder::IEventData>
297  const std::vector<IdentifierHash>& listOfPixIds,
298  const std::vector<IdentifierHash>& listOfSCTIds) const{
299  auto event_data_p = std::make_unique<InDet::TRT_SeededTrackFinder_ATL::EventData>(combinatorialData,
300  m_seedmaker->newRegion(listOfPixIds,listOfSCTIds));
301 
302  // New event for track finder tool
303  m_tracksfinder->newEvent(ctx, event_data_p->combinatorialData());
304 
305 
306  // Print event information
307  if(msgLvl(MSG::DEBUG)) {
309  msg(MSG::DEBUG) << endmsg;
310  }
311 
312  return event_data_p;
313 }
314 
316 // Finalize track finding tool for given event
318 
319 void
321  //event_data cannot be const if passed to m_tracksfinder->endEvent
323  // End event for track finder tool
324  m_tracksfinder->endEvent(event_data.combinatorialData());
325 
326 }
327 
329 // Main method for back tracking through the Si ID
330 // starting from an intial track segment
332 
333 std::list<Trk::Track*>
335  InDet::ITRT_SeededTrackFinder::IEventData &virt_event_data, const Trk::TrackSegment& tS) const{
336  //non-const because findTrack alters event_data
338  // return list, will be copied by value (fix!)
339  std::list<Trk::Track*> aSiTrack;
340 
341  // protection for having the expected type of segment parameters
342  if ( tS.localParameters().parameterKey() != 31 ){
343  ATH_MSG_WARNING("Wrong type of TRT segment, rejected !" );
344  return aSiTrack;
345  }
346 
347  //Get the track segment information and build the initial track parameters
348  const Trk::LocalParameters& Vp = tS.localParameters();
350  throw std::logic_error("Unhandled surface.");
351  }
352 
353  const AmgSymMatrix(5)& locCov = tS.localCovariance();
354  AmgSymMatrix(5) ie = locCov;
355 
356  std::unique_ptr<Trk::TrackParameters> newPerPar =
358  Vp.get(Trk::loc2),
359  Vp.get(Trk::phi),
360  Vp.get(Trk::theta),
361  Vp.get(Trk::qOverP),
362  ie);
363 
364  if(newPerPar){
365  ATH_MSG_DEBUG("Initial Track Parameters created from TRT segment, ");
366  ATH_MSG_VERBOSE(*newPerPar) ;
367  }else{
368  ATH_MSG_WARNING( "Could not get initial TRT track parameters, rejected! " );
369  return aSiTrack;
370  }
371  constexpr auto horizontalRule{"==============================================================\n"};
372  //Do the actual tracking and smoothing and get the Si track states on surface
373  ATH_MSG_DEBUG(horizontalRule << "Start initial search with 3-4 SCT layer combinations ");
374 
375  if (m_searchInCaloROI && !isCaloCompatible( *newPerPar, event_data )) {
376  return aSiTrack;
377  }
378 
379  // Get AtlasFieldCache
381  const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
382  if (fieldCondObj == nullptr) {
383  ATH_MSG_ERROR("TRT_SeededTrackFinder_ATL::getTracks: Failed to retrieve AtlasFieldCacheCondObj with key " << m_fieldCondObjInputKey.key());
384  return aSiTrack;
385  }
386  MagField::AtlasFieldCache fieldCache;
387  fieldCondObj->getInitializedCache (fieldCache);
388 
389  aSiTrack = findTrack(ctx, fieldCache, event_data, *newPerPar, tS);
390  if((aSiTrack.empty())&&(m_bremCorrect)){
391  ATH_MSG_DEBUG(horizontalRule << "Could not create track states on surface for this track!Try to add brem correction.");
392 
393  std::unique_ptr<const Trk::TrackParameters> modTP = modifyTrackParameters(*newPerPar,0);
394  ATH_MSG_VERBOSE("Modified TRT Track Parameters for brem. \n"<<(*modTP));
395  aSiTrack = findTrack(ctx, fieldCache, event_data, *modTP, tS);
396  if(aSiTrack.empty()){
397  ATH_MSG_DEBUG("Could not create track states on surface for this track after all!");
398  return aSiTrack;
399  }
400  ATH_MSG_DEBUG(horizontalRule);
401  }
402 
403  //Return list of tracks (by value !?)
404  return aSiTrack;
405 }
406 
408 // Main method for back tracking through the Si ID
409 // starting from initial track parameters
411 
412 std::list<Trk::Track*>
415  const Trk::TrackSegment& tS) const{
416  SiCombinatorialTrackFinderData_xk& combinatorialData=event_data.combinatorialData();
417  //Return list copied by value (fix!!)
418  std::list<Trk::Track*> associatedSiTrack; // List of found tracks per TRT segment
419  constexpr double pi2 = 2.*M_PI;
420  constexpr double pi=M_PI;
421 
422  //Get the seeds
423  std::list<std::pair<const Trk::SpacePoint*,const Trk::SpacePoint*> >
424  SpE = m_seedmaker->find2Sp(ctx, initTP,event_data.spacePointFinderEventData()); //Get a list of SP pairs
425 
426  ATH_MSG_DEBUG("---------------> SP SEED LIST SIZE " << SpE.size() );
427  if(SpE.empty()){return associatedSiTrack;}
428 
429  //
430  // --------------- loop over the found seeds
431  //
432 
433  //Get the track states on surface that correspond to each SP pair that came from the seeding
434  std::vector<const Trk::SpacePoint*> SpVec{nullptr, nullptr};
435 
436  std::list<std::pair<const Trk::SpacePoint*,const Trk::SpacePoint*> >::iterator r,re=SpE.end();
437  for(r=SpE.begin();r!=re; ++r){
438  std::list<Trk::Track*> aTracks ; // List of tracks found per seed
439  std::list<Trk::Track*> cTracks ; // List of cleaned tracks found per seed
440  event_data.noise().reset(); //Initiate the noise production tool at the beginning of each seed
441 
442  //
443  // --------------- filter SP to improve prediction, scale errors
444  //
445 
446  //Get the track parameters to use to get the detector elements for each SP pair
447  std::pair<const Trk::SpacePoint*, const Trk::SpacePoint*>& pSP = *r;
448  if (pSP.first != pSP.second){
449  ATH_MSG_DEBUG( "----> Seed Pair: SP 1 " << (pSP.first)->r() << " SP 2 " << (pSP.second)->r() );
450  } else {
451  if(msgLvl(MSG::DEBUG)) {
452  msg(MSG::DEBUG) << "----> Seed Single: SP 1 " << (pSP.first)->r() << "\n";
453  msg(MSG::DEBUG) << " Will not process for the time being ! A special module is needed\n" ;
454  msg(MSG::DEBUG) << " to deal with late conversion (no search and stablized input fit ).\n";
455  msg(MSG::DEBUG) << " Current version is unstable in the SP updates and gets unpredictable results." << endmsg;
456  }
457  continue;
458  }
459 
461  SpVec[0]=(pSP.second);
462  SpVec[1]=(pSP.first);
463  if(!newClusters(SpVec,event_data)) {
464  ATH_MSG_DEBUG( "Seed SPs already used by a single track. Ignore..." );
465  continue;
466  }
467  if(!newSeed(SpVec,event_data)) {
468  ATH_MSG_DEBUG( "Seed SPs already used by other tracks. Ignore..." );
469  continue;
470  }
471 
472  //
473  // ----------------Check the SP seed if field is ON
474  //
475  if(fieldCache.solenoidOn()){
476  bool seedGood = checkSeed(SpVec,tS,initTP);
477  if(!seedGood && m_propR) {
478  ATH_MSG_DEBUG( "Seed not consistent with TRT segment. Ignore..." );
479  continue;
480  }
481  }
482 
483  //
484  // ----------------Get new better track parameters using the SP seed
485  //
486  ATH_MSG_DEBUG( "Get better track parameters using the seed" );
487  double newTheta = thetaFromSpacePoints(SpVec[0], SpVec[1]);
488  const AmgVector(5)& iv = initTP.parameters();
489  double newPhi = iv[2];
490  //Protect for theta and phi being out of range
491  if (newTheta > pi) newTheta = fmod(newTheta+pi,pi2)-pi;
492  else if(newTheta <-pi) newTheta = fmod(newTheta-pi,pi2)+pi;
493  if(newTheta<0.){ newTheta = -newTheta; newPhi+=pi; }
494  if (newPhi > pi) newPhi = fmod(newPhi+pi,pi2)-pi;
495  else if(newPhi <-pi) newPhi = fmod(newPhi-pi,pi2)+pi;
496  if(newTheta<0.27) {
497  ATH_MSG_DEBUG("Pseudorapidity greater than 2.Ignore" );
498  continue;
499  }
500 
501  const AmgSymMatrix(5) * vCM = initTP.covariance();
502  AmgSymMatrix(5) nvCM;
503  nvCM<<
504  m_errorScale[0]*m_errorScale[0]*(*vCM)(0,0),0.,0.,0.,0.,
505  0.,m_errorScale[1]*m_errorScale[1]*(*vCM)(1,1),0.,0.,0.,
506  0.,0.,m_errorScale[2]*m_errorScale[2]*(*vCM)(2,2),0.,0.,
507  0.,0.,0.,m_errorScale[3]*m_errorScale[3]*(*vCM)(3,3),0.,
508  //cppcheck-suppress constStatement
509  0.,0.,0.,0.,m_errorScale[4]*m_errorScale[4]*(*vCM)(4,4);
510 
511 
512  //New intial track parameters saved as MeasuredAtaStraightLine
513  std::unique_ptr<const Trk::TrackParameters> niTP =
515  iv[0], iv[1], newPhi, newTheta, iv[4], nvCM);
516 
517  if (niTP) {
518  ATH_MSG_DEBUG("Initial Track Parameters created and scaled from TRT segment, ");
519  ATH_MSG_VERBOSE(*niTP);
520  } else {
521  ATH_MSG_DEBUG("Could not get initial TRT track parameters! " );
522  continue;
523  }
524 
525  //
526  // ----------------Propagate through the SP seed
527  //
528  ATH_MSG_DEBUG( "Propagating through the seed" );
529  bool outl = false;
530 
531  //update with first SP
532  ATH_MSG_DEBUG( "Update with 1st SP from seed" );
533  std::unique_ptr<const Trk::TrackParameters> upTP = getTP(fieldCache, pSP.first,*niTP,outl,event_data);
534  //If no track parameters are found, go to the next seed
535  if(!upTP){
536  ATH_MSG_DEBUG( "Extrapolation through seed failed!Seed bogus.Move to next seed" );
537  continue;
538  }
539  //Not good if SP pair has outliers. Clean up the memory and move to next seed
540  if(outl){
541  ATH_MSG_DEBUG("Seed with outliers. Will not process!");
542  continue;
543  }
544 
545  //update with second SP ?
546  if (pSP.first != pSP.second) {
547  //update with second SP
548  ATH_MSG_DEBUG( "Update with 2nd SP from seed" );
549  std::unique_ptr<const Trk::TrackParameters> newTP = getTP(fieldCache, pSP.second,*upTP,outl,event_data);
550  //If no track parameters are found, go to the next seed
551  if(!newTP){
552  ATH_MSG_DEBUG( "Extrapolation through seed failed!Seed bogus.Move to next seed" );
553  continue;
554  }
555  //Not good if SP pair has outliers. Clean up the memory and move to next seed
556  if(outl){
557  ATH_MSG_DEBUG("Seed with outliers.Will not process!");
558  continue;
559  }
560  // copy the newTP to upTP
561  upTP = std::move(newTP);
562  }
563 
564  //Protect the road maker tool when the momentum is too low since the particle will spiral inside the tracker
565  if(upTP->momentum().perp()<m_pTmin){
566  ATH_MSG_DEBUG("Low pT.Stop! ");
567  continue;
568  }
569 
570  //
571  // --------------- get Si detector element road
572  //
573  const Trk::PerigeeSurface persurf (Amg::Vector3D(0,0,0));
574 
575  //Get track parameters at the end of SCT to start backwards propagation
576  auto per = m_proptool->propagate(ctx,*upTP,persurf,Trk::oppositeMomentum,false,
577  m_fieldprop,Trk::nonInteracting); //Propagate
578  if(!per){
579  ATH_MSG_DEBUG("No extrapolated track parameters!");
580  continue;
581  }
582 
583  if(msgLvl(MSG::VERBOSE)) {
584  msg(MSG::VERBOSE) << "Perigee after SP updates at same surface" << endmsg;
585  msg(MSG::VERBOSE) << *per << endmsg;
586  }
587 
588  //Get list of InDet Elements
589  std::vector<const InDetDD::SiDetectorElement*> DE;
590  m_roadmaker->detElementsRoad(ctx, fieldCache, *per,Trk::alongMomentum,DE,event_data.roadMakerData());
591  if( int(DE.size()) < m_nclusmin){ //Not enough detector elements to satisfy the minimum number of clusters requirement. Stop
592  ATH_MSG_DEBUG( "Too few detector elements, not expected" );
593  continue;
594  }
595 
596  //
597  // --------------- Cast it to measured parameters at 2nd SP with diagonal error matrix
598  //
599  const AmgVector(5)& piv = upTP->parameters();
600 
601  //Get the intial Error matrix, diagonalize it and scale the errors
602  std::unique_ptr<const Trk::TrackParameters> mesTP{};
603  const AmgSymMatrix(5)* pvCM = upTP->covariance();
604  if(pvCM){
605  AmgSymMatrix(5) pnvCM;
606  pnvCM<<
607  m_errorScale[0]*m_errorScale[0]*(*pvCM)(0,0),0.,0.,0.,0.,
608  0.,m_errorScale[1]*m_errorScale[1]*(*pvCM)(1,1),0.,0.,0.,
609  0.,0.,m_errorScale[2]*m_errorScale[2]*(*pvCM)(2,2),0.,0.,
610  0.,0.,0.,m_errorScale[3]*m_errorScale[3]*(*pvCM)(3,3),0.,
611  //cppcheck-suppress constStatement
612  0.,0.,0.,0.,m_errorScale[4]*m_errorScale[4]*(*pvCM)(4,4);
613 
614  mesTP = upTP->associatedSurface().createUniqueTrackParameters(piv[0],piv[1],piv[2],piv[3],piv[4],pnvCM);
615  if(mesTP){
616  ATH_MSG_DEBUG( "Initial Track Parameters at 1st SP created and scaled from TRT segment, " );
617  ATH_MSG_VERBOSE( *mesTP );
618  }else{
619  continue;
620  }
621  }else{
622  continue;
623  }
624 
625  //
626  // --------------- Get the Si extensions using the combinatorial track finding tool
627  //
628  std::vector<Amg::Vector3D> Gp;
629  aTracks = m_tracksfinder->getTracks(combinatorialData, *mesTP, SpVec, Gp, DE, m_trackquality, ctx);
630  if(aTracks.empty()) {
631  ATH_MSG_DEBUG("No tracks found by the combinatorial track finder!");
632  }
633 
634  //
635  // --------------- Drop spurious pixel hits
636  //
637  cTracks=cleanTrack(aTracks);
638 
639  //
640  // --------------- Add tracks in the track multimap and in the overall list of TRT segment associated tracks
641  //
642  std::list<Trk::Track*>::iterator t = cTracks.begin();
643  while(t!=cTracks.end()) {
644  if(!isNewTrack((*t),event_data)) {
645  delete (*t);
646  cTracks.erase(t++);
647  } else {
648  clusterTrackMap((*t),event_data);
649  associatedSiTrack.push_back((*t++));
650  }
651  }
652  }
653 
654  return associatedSiTrack;
655 }
656 
658 // update track parameters using SP
660 
661 std::unique_ptr<const Trk::TrackParameters>
663  const Trk::TrackParameters& startTP,
664  bool& outl,
666  std::unique_ptr<const Trk::TrackParameters> iTP{};
667  outl = false;
668  const Trk::Surface& surf = SP->associatedSurface();//Get the associated surface
669  Trk::PropDirection dir = Trk::oppositeMomentum; //Propagate backwards i.e. opposite momentum when filtering
670  Trk::ParticleHypothesis part = Trk::nonInteracting;//Choose a non interacting particle
671  auto eTP = m_proptool->propagate(Gaudi::Hive::currentContext(),
672  startTP,surf,dir,false,m_fieldprop,part); //Propagate
673 
674  if(!eTP){
675  ATH_MSG_DEBUG( "Extrapolation to Si element failed");
676  ATH_MSG_VERBOSE( surf );
677  return nullptr;
678  }else{
679  //Based on the hit information update the track parameters and the error matrix
680  Trk::FitQualityOnSurface* sct_fitChi2 = nullptr;
681  std::unique_ptr<const Trk::TrackParameters> uTP = m_updatorTool->addToState(*eTP,SP->localParameters(),SP->localCovariance(),sct_fitChi2);
682  if(!uTP) { //The updator failed
683  if (sct_fitChi2) {
684  ATH_MSG_DEBUG( "Updator returned no update, but a DitQuality object, a leak !");
685  delete sct_fitChi2;
686  }
687  event_data.noise().production(-1,1,*eTP);
688 
689  iTP = addNoise(event_data.noise(),*eTP,0);
690  ATH_MSG_DEBUG("The updator failed! Count an outlier ");
691  outl = true;
692  }else{
693  //Keep as a measurement only if fit chi2 less than 25.Otherwise outlier
694  float outlierCut = m_outlierCut;
695  if(!fieldCache.solenoidOn()) outlierCut = 1000000.; // Increase the outlier chi2 cut if solenoid field is OFF
696  if( sct_fitChi2->chiSquared() < outlierCut && std::abs(uTP->parameters()[Trk::theta]) > 0.17 ){
697  ATH_MSG_DEBUG("Update worked, will update return track parameters, chi2: "<<(sct_fitChi2->chiSquared()));
698  event_data.noise().production(-1,1,*uTP);
699  iTP = addNoise(event_data.noise(),*uTP,0);
700  }else{
701  ATH_MSG_DEBUG("Outlier, did not satisfy cuts, chi2: "<<(sct_fitChi2->chiSquared())<<" "<<std::abs(uTP->parameters()[Trk::theta]));
702  event_data.noise().production(-1,1,*eTP);
703  iTP = addNoise(event_data.noise(),*eTP,0);
704  outl = true;
705  }
706  // Clean up
707  delete sct_fitChi2;
708  }
709  }
710  return iTP;
711 }
712 
714 // Add noise to track parameters
715 // 0-Filtering, 1-Smoothing
717 
718 std::unique_ptr<const Trk::TrackParameters>
720  ATH_MSG_DEBUG( "Adding noise to track parameters... " );
721  const double covAzim=noise.covarianceAzim();
722  const double covPola=noise.covariancePola();
723  const double covIMom=noise.covarianceIMom();
724  const double corIMom=noise.correctionIMom();
725  //Get the noise augmented parameters and the 15 lower half covariance matrix elements from the first input track parameters
726  const AmgVector(5)& Vp1 = P1.parameters();
727  double M[5]={Vp1[0],Vp1[1],Vp1[2],Vp1[3],Vp1[4]};
728  if(!isSmooth){
729  M[4] *= corIMom;
730  }else{
731  M[4] /= corIMom;
732  }
733  const AmgSymMatrix(5)* C = P1.covariance();
734  if(C){
735  AmgSymMatrix(5) nC;
736  nC = (*C);
737  nC(2,2)+=covAzim;
738  nC(3,3)+=covPola;
739  nC(4,4)+=covIMom;
740  return P1.associatedSurface().createUniqueTrackParameters(M[0],M[1],M[2],M[3],M[4],nC);
741  }
742  return nullptr;
743 }
744 
745 
746 
748 // Get new theta estimate using the SPs from the seed
750 
751 bool
753  (std::vector<const Trk::SpacePoint*>& vsp,const Trk::TrackSegment& tS,const Trk::TrackParameters & tP) const{
754  bool isGood = true;
755  int nEC = 0; double gz = 0.;
757  const AmgVector(5)& pTS=tP.parameters();
759  if(std::abs(std::log(std::tan(pTS[3]/2.)))>0.8){
761  for(int it=0; it<int(tS.numberOfMeasurementBases()); it++){
762  //Check if it is a pseudo measurement and move on
763  if ( dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(tS.measurement(it)) ) continue;
764  const InDet::TRT_DriftCircleOnTrack* trtcircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(tS.measurement(it));
765  if(trtcircle){
766  Identifier id=trtcircle->detectorElement()->identify();
767  int isB = m_trtId->barrel_ec(id);
768  if(isB==2 || isB==-2) nEC++;
769  if(nEC==1){
770  gz = trtcircle->globalPosition().z();
771  break;
772  }
773  }
774  }
775  double tanTheta = std::tan(thetaFromSpacePoints(vsp[0], vsp[1]));
777  double propR = getRadius(vsp[1]) + (gz-getZ(vsp[1]))*tanTheta;
778  if(propR<620. || propR>1010.) isGood=false;
779  double zIn = gz-propR/tanTheta;
780  if(zIn>300.) isGood = false;
781  }
782  return isGood;
783 }
784 
786 // Calculate initial track parameters for back tracking
787 // using TRT New Tracking segments
789 
790 std::unique_ptr<const Trk::TrackParameters>
794  const AmgVector(5)& pV = TP.parameters();
795  double ip[5] = {pV[0], pV[1], pV[2], pV[3], pV[4]};
796 
798  const double & q = ip[4]; //no need to take std::abs, its squared next
799  const double covarianceIMom = 0.25*q*q;
800  ip[4] *= 0.5;
801 
802  const AmgSymMatrix(5) * CM = TP.covariance();
803  AmgSymMatrix(5) nM = (*CM);
804 
805  if(mode==0){ //Modification initiated before seed propagation
806  nM(4,4) = 10.*(0.1*((*CM)(4,4))+covarianceIMom);
807  }
808  if(mode==1){ //Modification initiated before pixel propagation
809  nM(4,4)+=covarianceIMom;
810  }
811  return TP.associatedSurface().createUniqueTrackParameters(ip[0], ip[1], ip[2], ip[3], ip[4], nM);
812 }
813 
815 // Set track quality cuts
817 
818 void
820  // Integer cuts
821  //
822  m_trackquality.setIntCut ("MinNumberOfClusters", m_nclusmin );
823  m_trackquality.setIntCut ("MinNumberOfWClusters", m_nwclusmin );
824  m_trackquality.setIntCut ("MaxNumberOfHoles" , m_nholesmax );
825  m_trackquality.setIntCut ("MaxHolesGap" , m_dholesmax );
826  if( m_useassoTool ) m_trackquality.setIntCut ("UseAssociationTool",1);
827  else m_trackquality.setIntCut ("UseAssociationTool",0);
828 
829  // Double cuts
830  //
832  m_trackquality.setDoubleCut("MaxXi2forCluster" ,m_xi2max );
833  m_trackquality.setDoubleCut("MaxXi2forOutlier" ,m_xi2maxNoAdd);
834  m_trackquality.setDoubleCut("MaxXi2forSearch" ,m_xi2maxlink );
835 }
836 
838 // Clusters-track multimap production
840 
843 {
845  m = Tr->measurementsOnTrack()->begin(),
846  me = Tr->measurementsOnTrack()->end ();
847 
848  for(; m!=me; ++m) {
849  const Trk::PrepRawData* prd = ((const Trk::RIO_OnTrack*)(*m))->prepRawData();
850  if(prd) event_data.clusterTrack().insert(std::make_pair(prd,Tr));
851  }
852 }
853 
855 // New clusters comparison with clusters associated with track
856 // Reject seeds that all SPs belong to one and the same track
858 
859 bool
860 InDet::TRT_SeededTrackFinder_ATL::newClusters(const std::vector<const Trk::SpacePoint*>& Sp,
862  const Trk::PrepRawData* prd [ 40];
863  const Trk::Track* trk[2][200];
864  std::multimap<const Trk::PrepRawData*,const Trk::Track*>::const_iterator
865  t[40],te = event_data.clusterTrack().end();
866  std::vector<const Trk::SpacePoint*>::const_iterator s=Sp.begin(),se=Sp.end();
867  int n = 0;
868 
869  //If at least one of the clusters in the seed is not used by a track the seed is good
870  for(; s!=se; ++s) {
871  if((*s)->clusterList().first ) {
872  prd[n] = (*s)->clusterList().first;
873  t [n] = event_data.clusterTrack().find(prd[n]);
874  if(t[n]==te) return true;
875  ++n;
876  }
877  if((*s)->clusterList().second) {
878  prd[n] = (*s)->clusterList().second;
879  t [n] = event_data.clusterTrack().find(prd[n]);
880  if(t[n]==te) return true;
881  ++n;
882  }
883  if(n==40) break;
884  }
885  if(!n) return false;
886 
887  //Array of pointers to the different tracks that the first used cluster belongs to
888  int m = 0;
889  auto & pTracks=t[0];
890  for(; pTracks!=te; ++pTracks) {
891  if (m==30) return false;
892  if( (*pTracks).first != prd[0] ) break;
893  trk[0][m++] = (*pTracks).second;
894  if(m==200) break;
895  }
896 
897  //For a seed to be declared bad, all other clusters should belong to the same track as that of the first used cluster
898  int in=0, ou=1;
899  for(int i=1; i!=n; ++i) {
900  int l = 0; //Number of tracks that share the same clusters
901  auto & pTheseTracks=t[i];
902  for(; pTheseTracks!=te; ++pTheseTracks) {
903  if( (*pTheseTracks).first != prd[i] ) break;
904  for(int j=0; j!=m; ++j) {
905  if((*pTheseTracks).second == trk[in][j]) {trk[ou][l++]= trk[in][j];
906  break;
907  }
908  }
909  }
910  if(l==0) return true; //At least one of the seed clusters belongs to a track different from that of the first used clusters
911  m=l;
912  if(in==0) {
913  in=1; ou=0;
914  } else {
915  in=0; ou=1;
916  }
917  }
918 
919  return false;
920 }
921 
923 // New clusters comparison with clusters associated with track
924 // Reject seeds that all SPs have been already used by other tracks
926 
927  bool
928  InDet::TRT_SeededTrackFinder_ATL::newSeed(const std::vector<const Trk::SpacePoint*>& Sp,
930  const Trk::PrepRawData* prd [ 40];
931  const Trk::Track* trk[2][200];
932  std::multimap<const Trk::PrepRawData*,const Trk::Track*>::const_iterator
933  tt,t[40],te = event_data.clusterTrack().end();
934 
935  std::vector<const Trk::SpacePoint*>::const_iterator s=Sp.begin(),se=Sp.end();
936  int n = 0;
937  int nc = 0;
938  for(; s!=se; ++s) {
939  if((*s)->clusterList().first ) {
940  prd[n] = (*s)->clusterList().first;
941  t [n] = event_data.clusterTrack().find(prd[n]); if(t[n]!=te) ++nc; ++n;
942  }
943  if((*s)->clusterList().second) {
944  prd[n] = (*s)->clusterList().second;
945  t [n] = event_data.clusterTrack().find(prd[n]); if(t[n]!=te) ++nc; ++n;
946  }
947  if(n>=40) break;
948  }
949  if(!nc) return true;
950  if(n==nc) {
951  int m = 0;
952  for(tt=t[0]; tt!=te; ++tt) {
953  if( (*tt).first != prd[0] ) break;
954  trk[0][m++] = (*tt).second;
955  if(m==200) break;
956  }
957  int in=0, ou=1, i=1;
958  for(; i!=n; ++i) {
959  int l = 0;
960  for(tt=t[i]; t[i]!=te; ++tt) {
961  if( (*tt).first != prd[i] ) break;
962  for(int j=0; j!=m; ++j) {
963  if((*tt).second == trk[in][j]) {
964  trk[ou][l++]= trk[in][j];
965  break;
966  }
967  }
968  }
969  if(l==0) break;
970  m=l;
971  if(in==0) {
972  in=1;
973  ou=0;
974  } else {
975  in=0;
976  ou=1;
977  }
978  }
979  if(i==n) return false;
980  }
981 
982  //if(!(*Sp.rbegin())->clusterList().second) return true;
983 
984  int h = 0;
985  for(int i=0; i!=n; ++i) {
986  for(tt=t[i]; t[i]!=te; ++tt) {
987  if( (*tt).first != prd[i] ) break;
988  if((*tt).second->trackStateOnSurfaces()->size() >= 10) {
989  ++h;
990  break;
991  }
992  }
993  }
994  return h == 0;
995 }
996 
998 // Test is it new track
1000 
1001 bool
1004 
1005  const Trk::PrepRawData* prd [100];
1006  std::multimap<const Trk::PrepRawData*,const Trk::Track*>::const_iterator
1007  ti,t[100],te = event_data.clusterTrack().end();
1008  int n = 0 ;
1010  m = Tr->measurementsOnTrack()->begin(),
1011  me = Tr->measurementsOnTrack()->end ();
1012 
1013  for(; m!=me; ++m) {
1014  const Trk::PrepRawData* pr = ((const Trk::RIO_OnTrack*)(*m))->prepRawData();
1015  if(pr) {
1016  prd[n] =pr;
1017  t[n] = event_data.clusterTrack().find(prd[n]);
1018  if(t[n]==te) return true;
1019  ++n;
1020  }
1021  }
1022 
1023  int nclt = n;
1024 
1025  for(int i=0; i!=n; ++i) {
1026  int nclmax = 0;
1027  for(ti=t[i]; ti!=te; ++ti) {
1028  if( (*ti).first != prd[i] ) break;
1029  int ncl = (*ti).second->trackStateOnSurfaces()->size();
1030  if(ncl > nclmax) nclmax = ncl;
1031  }
1032  if(nclt > nclmax) return true;
1033  }
1034  return false;
1035 }
1036 
1038 // Eliminate spurious pixel hits
1040 
1041 std::list<Trk::Track*>
1042 InDet::TRT_SeededTrackFinder_ATL::cleanTrack(std::list<Trk::Track*> lTrk) const{
1043  std::list<Trk::Track*> cleanSiTrack; // List of clean Si tracks per TRT segment
1044  std::list<Trk::Track*>::const_iterator it = lTrk.begin();
1045  std::list<Trk::Track*>::const_iterator itEnd = lTrk.end();
1046  for (; it != itEnd ; ++it){
1047  int nPixHits = 0; //Number of Pixel PRDs
1048  int nSctHits = 0; //Number of SCT PRDs
1049  double pixR = 0.; //Radial position of last pixel PRD
1050  double sctR = 0.; //Radial position of first SCT PRD
1051 
1052  const Trk::TrackStates* newtsos = (*it)->trackStateOnSurfaces();
1053  if(!newtsos) continue;
1054  Trk::TrackStates::const_iterator itp, itpe=newtsos->end();
1055  for(itp=newtsos->begin(); itp!=itpe; ++itp){
1057  const InDet::SiClusterOnTrack* clus = dynamic_cast<const InDet::SiClusterOnTrack*>((*itp)->measurementOnTrack());
1058  if(clus && ((*itp)->type(Trk::TrackStateOnSurface::Measurement))){ //Count the number of hits used in the track
1059  const InDet::SiCluster* RawDataClus=dynamic_cast<const InDet::SiCluster*>(clus->prepRawData());
1060  if(RawDataClus==nullptr){
1061  ATH_MSG_DEBUG( "Si Cluster without PrepRawData!!!" );
1062  continue;
1063  }
1064  if(RawDataClus->detectorElement()->isPixel()){
1065  nPixHits++;
1066  pixR = RawDataClus->globalPosition().perp();
1067  }
1068  if((RawDataClus->detectorElement()->isSCT()) && (nSctHits==0)) {
1069  sctR = RawDataClus->globalPosition().perp();
1070  nSctHits++;
1071  break;
1072  }
1073  }
1074  }
1075 
1077  if(nPixHits==1 && (sctR-pixR)>200.){
1078  auto cltsos = std::make_unique<Trk::TrackStates>();
1079  auto fq = (*it)->fitQuality()->uniqueClone();
1080  // copy track Si states into track
1082  for(p_tsos=newtsos->begin()+nPixHits;p_tsos!=newtsos->end();++p_tsos){
1083  cltsos->push_back( (*p_tsos)->clone() );
1084  }
1087  // info.setPatternRecognitionInfo(Trk::TrackInfo::TRTSeededTrackFinder);
1088  Trk::Track* nTrack = new Trk::Track(info, std::move(cltsos), std::move(fq));
1089  cleanSiTrack.push_back(nTrack);
1090  delete (*it);
1091  }else{
1092  cleanSiTrack.push_back((*it));
1093  }
1094  }
1095 
1096  return cleanSiTrack;
1097 }
1098 
1099 
1101 // Test is it track with calo seed compatible
1103 bool
1105  const InDet::TRT_SeededTrackFinder_ATL::EventData &event_data) const{
1106  if(!event_data.caloClusterROIEM()) return false;
1107  const AmgVector(5)& Vp = Tp.parameters();
1108  const double F = Vp[2];
1109  ROIPhiRZContainer::const_iterator roi_iter = event_data.caloClusterROIEM()->lowerPhiBound( F, m_phiWidth);
1110  return roi_iter != event_data.caloClusterROIEM()->end();
1111 }
1112 
1113 
1115 // MagneticFieldProperties production
1117 void
1122 }
grepfile.info
info
Definition: grepfile.py:38
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
InDet::TRT_SeededTrackFinder_ATL::EventData::caloClusterROIEM
const ROIPhiRZContainer * caloClusterROIEM() const
Definition: TRT_SeededTrackFinder_ATL.h:134
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
beamspotman.r
def r
Definition: beamspotman.py:676
Trk::LocalParameters
Definition: LocalParameters.h:98
InDet::ITRT_SeededTrackFinder::IEventData
Definition: ITRT_SeededTrackFinder.h:40
TruthTest.itp
itp
Definition: TruthTest.py:46
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
InDet::TRT_SeededTrackFinder_ATL::m_fieldprop
Trk::MagneticFieldProperties m_fieldprop
Magnetic field mode
Definition: TRT_SeededTrackFinder_ATL.h:161
get_generator_info.result
result
Definition: get_generator_info.py:21
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
InDet::TRT_SeededTrackFinder_ATL::findTrack
std::list< Trk::Track * > findTrack(const EventContext &ctx, MagField::AtlasFieldCache &fieldCache, InDet::TRT_SeededTrackFinder_ATL::EventData &event_data, const Trk::TrackParameters &, const Trk::TrackSegment &) const
Find the corresponding list of Si tracks
Definition: TRT_SeededTrackFinder_ATL.cxx:413
InDet::TrackQualityCuts::setIntCut
void setIntCut(const std::string &, int)
Definition: ISiCombinatorialTrackFinder.h:179
vtune_athena.format
format
Definition: vtune_athena.py:14
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::MagneticFieldProperties
Definition: MagneticFieldProperties.h:31
PerigeeSurface.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
AtlasFieldCacheCondObj
Definition: AtlasFieldCacheCondObj.h:19
InDet::TRT_SeededTrackFinder_ATL::checkSeed
bool checkSeed(std::vector< const Trk::SpacePoint * > &, const Trk::TrackSegment &, const Trk::TrackParameters &) const
Check consistency of seed and TRT track segment.
Definition: TRT_SeededTrackFinder_ATL.cxx:753
InDet::TRT_SeededTrackFinder_ATL::m_fieldmode
std::string m_fieldmode
Protected Data
Definition: TRT_SeededTrackFinder_ATL.h:159
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
InDet::TRT_SeededTrackFinder_ATL::isCaloCompatible
bool isCaloCompatible(const Trk::TrackParameters &, const InDet::TRT_SeededTrackFinder_ATL::EventData &event_data) const
Only propagate to the Si if the TRT segment is compatible with a calo measurement.
Definition: TRT_SeededTrackFinder_ATL.cxx:1104
InDet::TRT_SeededTrackFinder_ATL::isNewTrack
static bool isNewTrack(Trk::Track *, InDet::TRT_SeededTrackFinder_ATL::EventData &event_data)
Clean-up duplicate tracks
Definition: TRT_SeededTrackFinder_ATL.cxx:1002
Trk::SpacePoint::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:146
InDet::TRT_SeededTrackFinder_ATL::m_xi2max
double m_xi2max
Track quality cuts to be passed to the combinatorial track finder.
Definition: TRT_SeededTrackFinder_ATL.h:178
Trk::LocalParameters::parameterKey
int parameterKey() const
Identifier key for matrix expansion/reduction.
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
Trk::oppositeMomentum
@ oppositeMomentum
Definition: PropDirection.h:21
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
plotBeamSpotVxVal.outlierCut
int outlierCut
Definition: plotBeamSpotVxVal.py:61
IRIO_OnTrackCreator.h
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
InDet::TRT_SeededTrackFinder_ATL::m_roadmaker
ToolHandle< InDet::ISiDetElementsRoadMaker > m_roadmaker
Magnetic field properties.
Definition: TRT_SeededTrackFinder_ATL.h:165
InDet::TRT_SeededTrackFinder_ATL::m_xi2maxNoAdd
double m_xi2maxNoAdd
max Xi2 for updators
Definition: TRT_SeededTrackFinder_ATL.h:179
skel.it
it
Definition: skel.GENtoEVGEN.py:423
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
python.PhysicalConstants.pi2
float pi2
Definition: PhysicalConstants.py:52
M_PI
#define M_PI
Definition: ActiveFraction.h:11
InDet::TRT_SeededTrackFinder_ATL::m_nholesmax
int m_nholesmax
min pT
Definition: TRT_SeededTrackFinder_ATL.h:182
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Trk::loc2
@ loc2
generic first and second local coordinate
Definition: ParamDefs.h:41
FitQualityOnSurface.h
InDet::TRT_SeededTrackFinder_ATL::m_phiWidth
double m_phiWidth
Definition: TRT_SeededTrackFinder_ATL.h:257
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
IPropagator.h
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
SiClusterOnTrack.h
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
InDet::TRT_SeededTrackFinder_ATL::m_useassoTool
bool m_useassoTool
Check seed-TRT segment consistency at large etas.
Definition: TRT_SeededTrackFinder_ATL.h:188
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::TrackSegment
Definition: TrackSegment.h:56
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
IDTPM::getZ
float getZ(const xAOD::TrackParticle &)
Accessor utility function for getting the value of prodZ.
Definition: TrackParametersHelper.h:104
InDet::TRT_SeededTrackFinder_ATL::m_propR
bool m_propR
Optional Brem correction.
Definition: TRT_SeededTrackFinder_ATL.h:187
InDet::TRT_SeededTrackFinder_ATL::addNoise
std::unique_ptr< const Trk::TrackParameters > addNoise(const SiNoise_bt &, const Trk::TrackParameters &, int) const
Add material effects
Definition: TRT_SeededTrackFinder_ATL.cxx:719
keylayer_zslicemap.se
se
Definition: keylayer_zslicemap.py:194
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
InDet::TRT_SeededTrackFinder_ATL::m_outlierCut
double m_outlierCut
Optional error scaling of track parameters
Definition: TRT_SeededTrackFinder_ATL.h:191
InDet::TRT_DriftCircleOnTrack::detectorElement
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
returns the detector element, assoicated with the PRD of this class
Definition: TRT_DriftCircleOnTrack.h:224
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:52
dqutils::padding
std::atomic< int > padding
Definition: MonitoringFile_MoveVertexMonitoring.cxx:20
pi
#define pi
Definition: TileMuonFitter.cxx:65
Trk::Segment::numberOfMeasurementBases
unsigned int numberOfMeasurementBases() const
Return the number of contained Trk::MeasurementBase (s)
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:193
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
IUpdator.h
InDet::TRT_SeededTrackFinder_ATL::m_updatorTool
ToolHandle< Trk::IUpdator > m_updatorTool
Propagator tool
Definition: TRT_SeededTrackFinder_ATL.h:168
PlotCalibFromCool.ie
ie
Definition: PlotCalibFromCool.py:420
Trk::PseudoMeasurementOnTrack
Class to handle pseudo-measurements in fitters and on track objects.
Definition: PseudoMeasurementOnTrack.h:44
Trk::FastField
@ FastField
call the fast field access method of the FieldSvc
Definition: MagneticFieldMode.h:20
Trk::LocalParameters::get
double get(ParamDefs par) const
Retrieve specified parameter (const version).
Trk::FitQualityOnSurface
Definition: FitQualityOnSurface.h:19
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
InDet::TRT_SeededTrackFinder_ATL::dump
MsgStream & dump(MsgStream &out) const override
Print internal tool parameters and status
Definition: TRT_SeededTrackFinder_ATL.cxx:199
ROIPhiRZContainer::lowerPhiBound
const_iterator lowerPhiBound(float phi, float roi_phi_width) const
Definition: ROIPhiRZContainer.h:59
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
InDet::TRT_SeededTrackFinder_ATL::m_fieldCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
Combinatorial track finder tool.
Definition: TRT_SeededTrackFinder_ATL.h:171
InDet::TRT_SeededTrackFinder_ATL::~TRT_SeededTrackFinder_ATL
virtual ~TRT_SeededTrackFinder_ATL()
InDet::SiNoise_bt::reset
void reset()
Definition: SiNoise_bt.cxx:15
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ISiDetElementsRoadMaker.h
TRT_SeededTrackFinder_ATL.h
Trk::SpacePoint::associatedSurface
virtual const Surface & associatedSurface() const override final
Interface method to get the associated Surface.
Definition: SpacePoint.cxx:71
InDet::TRT_SeededTrackFinder_ATL::EventData::combinatorialData
virtual InDet::SiCombinatorialTrackFinderData_xk & combinatorialData() override
Definition: TRT_SeededTrackFinder_ATL.h:128
lumiFormat.i
int i
Definition: lumiFormat.py:92
Trk::Surface::createUniqueTrackParameters
virtual ChargedTrackParametersUniquePtr createUniqueTrackParameters(double l1, double l2, double phi, double theat, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const =0
Use the Surface as a ParametersBase constructor, from local parameters - charged.
InDet::TRT_SeededTrackFinder_ATL::EventData::roadMakerData
InDet::SiDetElementRoadMakerData_xk & roadMakerData()
Definition: TRT_SeededTrackFinder_ATL.h:141
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:72
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
extractSporadic.h
list h
Definition: extractSporadic.py:97
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::SiNoise_bt
Definition: SiNoise_bt.h:23
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
InDet::TRT_SeededTrackFinder_ATL::newClusters
static bool newClusters(const std::vector< const Trk::SpacePoint * > &, InDet::TRT_SeededTrackFinder_ATL::EventData &event_data)
Seed used by another track?
Definition: TRT_SeededTrackFinder_ATL.cxx:860
SiCombinatorialTrackFinderData_xk.h
TileDCSDataPlotter.pr
pr
Definition: TileDCSDataPlotter.py:922
InDet::TRT_SeededTrackFinder_ATL::m_trackquality
InDet::TrackQualityCuts m_trackquality
Use prd-track association tool.
Definition: TRT_SeededTrackFinder_ATL.h:189
PseudoMeasurementOnTrack.h
InDet::TRT_SeededTrackFinder_ATL::m_seedmaker
ToolHandle< InDet::ITRT_SeededSpacePointFinder > m_seedmaker
Road maker tool
Definition: TRT_SeededTrackFinder_ATL.h:166
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
InDet::TRT_SeededTrackFinder_ATL::modifyTrackParameters
static std::unique_ptr< const Trk::TrackParameters > modifyTrackParameters(const Trk::TrackParameters &, int)
Modify track parameters if brem correction
Definition: TRT_SeededTrackFinder_ATL.cxx:791
Trk::Segment::measurement
const MeasurementBase * measurement(unsigned int) const
returns the Trk::MeasurementBase objects depending on the integer
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:184
InDet::TRT_SeededTrackFinder_ATL::getTP
std::unique_ptr< const Trk::TrackParameters > getTP(MagField::AtlasFieldCache &fieldCache, const Trk::SpacePoint *, const Trk::TrackParameters &, bool &, InDet::TRT_SeededTrackFinder_ATL::EventData &event_data) const
Update track parameters through space point propagation
Definition: TRT_SeededTrackFinder_ATL.cxx:662
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::TRT_SeededTrackFinder_ATL::m_caloClusterROIKey
SG::ReadHandleKey< ROIPhiRZContainer > m_caloClusterROIKey
Outlier chi2 cut when propagating through the seed.
Definition: TRT_SeededTrackFinder_ATL.h:193
Preparation.mode
mode
Definition: Preparation.py:95
InDet::TRT_SeededTrackFinder_ATL::cleanTrack
std::list< Trk::Track * > cleanTrack(std::list< Trk::Track * >) const
Eliminate spurious Pixel clusters in track
Definition: TRT_SeededTrackFinder_ATL.cxx:1042
InDetDD::TRT_BaseElement::identify
virtual Identifier identify() const override final
identifier of this detector element:
InDet::TRT_SeededTrackFinder_ATL::initialize
virtual StatusCode initialize() override
Definition: TRT_SeededTrackFinder_ATL.cxx:149
InDet::TRT_SeededTrackFinder_ATL::EventData::spacePointFinderEventData
InDet::ITRT_SeededSpacePointFinder::IEventData & spacePointFinderEventData()
Definition: TRT_SeededTrackFinder_ATL.h:131
InDet::TRT_SeededTrackFinder_ATL::m_dholesmax
int m_dholesmax
Max number holes
Definition: TRT_SeededTrackFinder_ATL.h:183
Trk::TrackSegment::associatedSurface
const Surface & associatedSurface() const override final
returns the surface for the local to global transformation
Definition: TrackSegment.h:112
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
InDet::TrackQualityCuts::setDoubleCut
void setDoubleCut(const std::string &, double)
Definition: ISiCombinatorialTrackFinder.h:186
Trk::ParametersBase
Definition: ParametersBase.h:55
TRT_DriftCircleOnTrack.h
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
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:866
InDet::TRT_SeededTrackFinder_ATL::EventData::clusterTrack
std::multimap< const Trk::PrepRawData *, const Trk::Track * > & clusterTrack()
Definition: TRT_SeededTrackFinder_ATL.h:132
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
InDet::SiCluster::detectorElement
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
MagField::AtlasFieldCache::solenoidOn
bool solenoidOn() const
status of the magnets
Trk::FullField
@ FullField
Field is set to be realistic, but within a given Volume.
Definition: MagneticFieldMode.h:21
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
beamspotman.dir
string dir
Definition: beamspotman.py:623
InDet::TRT_SeededTrackFinder_ATL::m_bremCorrect
bool m_bremCorrect
Min number weighted clusters.
Definition: TRT_SeededTrackFinder_ATL.h:186
InDet::TRT_SeededTrackFinder_ATL::newEvent
virtual std::unique_ptr< InDet::ITRT_SeededTrackFinder::IEventData > newEvent(const EventContext &ctx, SiCombinatorialTrackFinderData_xk &combinatorialData) const override
New event initialization.
Definition: TRT_SeededTrackFinder_ATL.cxx:268
InDetDD::SiDetectorElement::isPixel
bool isPixel() const
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk::NoField
@ NoField
Field is set to 0., 0., 0.,.
Definition: MagneticFieldMode.h:18
InDet::TRT_SeededTrackFinder_ATL::m_searchInCaloROI
bool m_searchInCaloROI
Outlier chi2 cut when propagating through the seed.
Definition: TRT_SeededTrackFinder_ATL.h:192
InDet::TRT_SeededTrackFinder_ATL::setTrackQualityCuts
void setTrackQualityCuts()
Set the track quality cuts for combinatorial track finding
Definition: TRT_SeededTrackFinder_ATL.cxx:819
InDet::TRT_SeededTrackFinder_ATL::clusterTrackMap
static void clusterTrackMap(Trk::Track *, InDet::TRT_SeededTrackFinder_ATL::EventData &event_data)
Map PRDs-tracks.
Definition: TRT_SeededTrackFinder_ATL.cxx:841
TrackInfo.h
Trk::nonInteracting
@ nonInteracting
Definition: ParticleHypothesis.h:25
SiCluster.h
InDet::TRT_SeededTrackFinder_ATL::EventData
Definition: TRT_SeededTrackFinder_ATL.h:120
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDet::TRT_SeededTrackFinder_ATL::magneticFieldInit
void magneticFieldInit()
Private Methods
Definition: TRT_SeededTrackFinder_ATL.cxx:1118
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::MagneticFieldProperties::magneticFieldMode
MagneticFieldMode magneticFieldMode() const
Returns the MagneticFieldMode as specified.
Trk::RIO_OnTrack::prepRawData
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
InDet::TRT_SeededTrackFinder_ATL::m_trtId
const TRT_ID * m_trtId
ID TRT helper.
Definition: TRT_SeededTrackFinder_ATL.h:175
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
InDet::TRT_SeededTrackFinder_ATL::endEvent
virtual void endEvent(InDet::ITRT_SeededTrackFinder::IEventData &event_data) const override
End of event tasks
Definition: TRT_SeededTrackFinder_ATL.cxx:320
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
InDet::TRT_SeededTrackFinder_ATL::m_pTmin
double m_pTmin
max Xi2 for clusters
Definition: TRT_SeededTrackFinder_ATL.h:181
InDet::SiCluster::globalPosition
const Amg::Vector3D & globalPosition() const
return global position reference
InDet::SiCombinatorialTrackFinderData_xk
Definition: SiCombinatorialTrackFinderData_xk.h:34
h
InDet::TRT_SeededTrackFinder_ATL::newRegion
virtual std::unique_ptr< InDet::ITRT_SeededTrackFinder::IEventData > newRegion(const EventContext &ctx, SiCombinatorialTrackFinderData_xk &combinatorialData, const std::vector< IdentifierHash > &, const std::vector< IdentifierHash > &) const override
New region intialization.
Definition: TRT_SeededTrackFinder_ATL.cxx:296
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
InDet::TRT_SeededTrackFinder_ATL::m_nclusmin
int m_nclusmin
Max gap between holes.
Definition: TRT_SeededTrackFinder_ATL.h:184
InDet::TRT_SeededTrackFinder_ATL::EventData::noise
InDet::SiNoise_bt & noise()
Definition: TRT_SeededTrackFinder_ATL.h:139
re
const boost::regex re(r_e)
DEBUG
#define DEBUG
Definition: page_access.h:11
F
#define F(x, y, z)
Definition: MD5.cxx:112
InDet::TRT_SeededTrackFinder_ATL::m_tracksfinder
ToolHandle< InDet::ISiCombinatorialTrackFinder > m_tracksfinder
Updator tool
Definition: TRT_SeededTrackFinder_ATL.h:169
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
MagField::AtlasFieldCache
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Definition: AtlasFieldCache.h:43
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
InDet::TRT_SeededTrackFinder_ATL::TRT_SeededTrackFinder_ATL
TRT_SeededTrackFinder_ATL(const std::string &, const std::string &, const IInterface *)
Standard tool methods
Definition: TRT_SeededTrackFinder_ATL.cxx:89
extractSporadic.q
list q
Definition: extractSporadic.py:98
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::phi
@ phi
Definition: ParamDefs.h:81
str
Definition: BTagTrackIpAccessor.cxx:11
InDetDD::SiDetectorElement::isSCT
bool isSCT() const
InDet::TRT_SeededTrackFinder_ATL::m_errorScale
std::vector< double > m_errorScale
Definition: TRT_SeededTrackFinder_ATL.h:190
Trk::EventDataBase< EventData, InDet::ITRT_SeededTrackFinder::IEventData >::getPrivateEventData
static EventData & getPrivateEventData(InDet::ITRT_SeededTrackFinder::IEventData &virt_event_data)
Definition: EventDataBase.h:19
InDet::TRT_SeededTrackFinder_ATL::m_nwclusmin
int m_nwclusmin
Min number clusters.
Definition: TRT_SeededTrackFinder_ATL.h:185
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
InDet::TRT_SeededTrackFinder_ATL::newSeed
static bool newSeed(const std::vector< const Trk::SpacePoint * > &, InDet::TRT_SeededTrackFinder_ATL::EventData &event_data)
Seed SPs used by other high quality tracks?
Definition: TRT_SeededTrackFinder_ATL.cxx:928
InDet::TRT_SeededTrackFinder_ATL::dumpconditions
MsgStream & dumpconditions(MsgStream &out) const
Definition: TRT_SeededTrackFinder_ATL.cxx:209
ReadHandle.h
Handle class for reading from StoreGate.
InDet::TRT_DriftCircleOnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
return the global position of this RIO_OnTrack
Definition: TRT_DriftCircleOnTrack.cxx:160
AthAlgTool
Definition: AthAlgTool.h:26
makeComparison.deltaZ
int deltaZ
Definition: makeComparison.py:46
Trk::SurfaceType::Line
@ Line
FitQuality.h
Trk::loc1
@ loc1
Definition: ParamDefs.h:40
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
InDet::TRT_SeededTrackFinder_ATL::getTrack
virtual std::list< Trk::Track * > getTrack(const EventContext &ctx, InDet::ITRT_SeededTrackFinder::IEventData &event_data, const Trk::TrackSegment &) const override
Main methods for local track finding
Definition: TRT_SeededTrackFinder_ATL.cxx:334
InDet::SiNoise_bt::production
void production(int direction, int model, const Trk::TrackParameters &tp)
Definition: SiNoise_bt.cxx:25
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
Trk::Surface::type
constexpr virtual SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
InDet::TRT_SeededTrackFinder_ATL::m_proptool
ToolHandle< Trk::IPropagator > m_proptool
Seed maker tool
Definition: TRT_SeededTrackFinder_ATL.h:167
InDet::TRT_SeededTrackFinder_ATL::finalize
virtual StatusCode finalize() override
Definition: TRT_SeededTrackFinder_ATL.cxx:190
InDet::SiCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h:40
Trk::FitQualityOnSurface::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
plotBeamSpotMon.nc
int nc
Definition: plotBeamSpotMon.py:83
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
WriteCellNoiseToCool.noise
noise
Definition: WriteCellNoiseToCool.py:380
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
InDet::SiClusterOnTrack
Definition: SiClusterOnTrack.h:39
InDet::TRT_SeededTrackFinder_ATL::m_xi2maxlink
double m_xi2maxlink
max Xi2 for outliers
Definition: TRT_SeededTrackFinder_ATL.h:180