ATLAS Offline Software
TRT_SegmentToTrackTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 #include "TrkSurfaces/Surface.h"
10 
12 //Extrapolator tool
14 //Scoring tool
16 #include <cmath>
17 
18 using Amg::Vector3D;
19 using CLHEP::mm;
20 
21 namespace {
22  Amg::Vector2D project2D(const Amg::Vector3D &vec) {
23  Amg::Vector2D tmp{vec[0],vec[1] };
24  return tmp;
25  }
26 }
27 namespace InDet {
28 
29  // Constructor with parameters:
31  const std::string &name,
32  const IInterface *parent) :
34  m_fieldUnitConversion(1000.),
35  m_extrapolator("Trk::Extrapolator/InDetExtrapolator"),
36  m_scoringTool("Trk::TrackScoringTool/TrackScoringTool"),
37  m_trtId(nullptr)
38  {
39  declareInterface<InDet::ITRT_SegmentToTrackTool>( this );
40  m_doRefit = false ; //Do a final careful refit of tracks
41  m_suppressHoleSearch = false ; //Suppress hole search
42  m_sharedFrac = 0.3 ; //Maximum fraction of shared hits !!!!!!!!!!!!!!!!!!!!!! offline 0.3!!!!!!!!!!!!!!!!!!!!!!!
43  declareProperty("FinalRefit" ,m_doRefit ); //Do a final careful refit of tracks
44  declareProperty("SuppressHoleSearch" ,m_suppressHoleSearch); //Suppress hole search during the track summary creation
45  declareProperty("MaxSharedHitsFraction" ,m_sharedFrac ); //Maximum fraction of shared drift circles
46  declareProperty("Extrapolator" ,m_extrapolator ); //Extrapolator tool
47  declareProperty("ScoringTool" ,m_scoringTool ); //Track scoring tool
48  }
49 
51  = default;
52 
53 
55 
57 
58  ATH_CHECK(m_extrapolator.retrieve() );
59 
60  ATH_CHECK(m_fitterTool.retrieve(DisableTool{ !m_doRefit }));
61  ATH_CHECK(m_assoTool.retrieve( DisableTool{m_assoTool.name().empty()} ));
62  ATH_CHECK(m_trackSummaryTool.retrieve( DisableTool{m_trackSummaryTool.name().empty()} ));
63 
64  // Get the scoring tool
65  ATH_CHECK( m_scoringTool.retrieve() );
66 
67  ATH_CHECK( detStore()->retrieve(m_trtId, "TRT_ID") );
71 
72  // Get output print level
73  //
74  ATH_MSG_DEBUG( *this );
75 
76  return StatusCode::SUCCESS;
77 
78  }
79 
82  return sc;
83  }
84 
85 
87  // Dumps relevant information into the MsgStream
89  MsgStream& InDet::TRT_SegmentToTrackTool::dump( MsgStream& out ) const {
90  out<<std::endl;
91  return dumpconditions(out);
92  }
93 
95  // Dumps conditions information into the MsgStream
97 
98  MsgStream& InDet::TRT_SegmentToTrackTool::dumpconditions( MsgStream& out ) const
99  {
100  int n = 65-m_fitterTool.type().size();
101  std::string s1; for(int i=0; i<n; ++i) s1.append(" "); s1.append("|");
102  n = 65-m_assoTool.type().size();
103  std::string s2; for(int i=0; i<n; ++i) s2.append(" "); s2.append("|");
104  n = 65-m_scoringTool.type().size();
105  std::string s5; for(int i=0; i<n; ++i) s5.append(" "); s5.append("|");
106 
107 
108  out<<std::endl
109  <<"|----------------------------------------------------------------------"
110  <<"-------------------|"<<std::endl;
111  out<<"| Tool for final track refitting | "<<m_fitterTool.type() <<s1<<std::endl;
112  out<<"| Tool for track scoring | "<<m_scoringTool.type() <<s5<<std::endl;
113  out<<"| Association service | "<<m_assoTool.type() <<s2<<std::endl;
114  out<<"|----------------------------------------------------------------------"
115  <<"-------------------|";
116  return out;
117  }
118 
119 
121  // Dumps event information into the MsgStream
124  return out;
125  }
126 
128  // Dumps relevant information into the ostream
130 
131  std::ostream& InDet::TRT_SegmentToTrackTool::dump( std::ostream& out ) const
132  {
133  return out;
134  }
135 
136 
137  Trk::Track* TRT_SegmentToTrackTool::segToTrack(const EventContext& ctx, const Trk::TrackSegment& tS) const {
138 
139  ATH_MSG_DEBUG("Transforming the TRT segment into a track...");
140 
141  //
142  // Get the track segment fit quality. If not there drop segment
143  //
144  if (!tS.fitQuality()) {
145  ATH_MSG_DEBUG("Segment has no fit quality ! Discard...");
146  return nullptr;
147  }
148  auto fq = tS.fitQuality()->uniqueClone();
149 
150  //
151  // Get the track segment information about the initial track parameters
152  //
153  const AmgVector(5)& par = tS.localParameters();
154  AmgSymMatrix(5) ep = AmgSymMatrix(5)(tS.localCovariance());
155  const Trk::TrackParameters* segPar =
156  tS.associatedSurface()
158  par[Trk::loc2],
159  par[Trk::phi],
160  par[Trk::theta],
161  par[Trk::qOverP],
162  std::move(ep))
163  .release();
164 
165  if (segPar) {
166  ATH_MSG_VERBOSE("Initial TRT Segment Parameters : " << (*segPar));
167  } else {
168  ATH_MSG_DEBUG("Could not get initial TRT segment parameters! ");
169  // clean up
170  return nullptr;
171  }
172 
173  // --- create new track state on surface vector
174  auto ntsos = std::make_unique<Trk::TrackStates>();
175 
176  //
177  // if no refit, make it a perigee
178  //
179  if (!m_doRefit) {
180 
181  const Trk::TrackStateOnSurface* par_tsos = nullptr;
182 
183  // --- create surface at perigee
184  Amg::Vector3D perigeePosition(0., 0., 0.);
185  Trk::PerigeeSurface perigeeSurface(perigeePosition);
186  // --- turn parameters into perigee...
187  std::unique_ptr<Trk::TrackParameters> tmp =
188  m_extrapolator->extrapolate(ctx, *segPar, perigeeSurface);
189  std::unique_ptr<Trk::Perigee> perParm = nullptr;
190  //pass ownership if of the right type
191  if (tmp && tmp->associatedSurface().type() == Trk::SurfaceType::Perigee) {
192  perParm.reset(static_cast<Trk::Perigee*>(tmp.release()));
193  }
194  if (perParm) {
195  ATH_MSG_VERBOSE("Perigee version of Parameters : " << (*segPar));
196  } else {
197  ATH_MSG_DEBUG("Failed to build perigee parameters.Discard...");
198  ntsos->clear();
199  delete segPar;
200  segPar = nullptr;
201  return nullptr;
202  }
203 
204  // now create a perigee TSOS
205  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>
206  typePattern;
207  typePattern.set(Trk::TrackStateOnSurface::Perigee);
208  par_tsos = new Trk::TrackStateOnSurface(
209  nullptr, std::move(perParm), nullptr, typePattern);
210  // push new TSOS into the list
211  ntsos->push_back(par_tsos);
212  }
213 
214  //
215  // now loop over the TSOS and copy them in
216  //
217 
218  // psuedo measurement information
219  int npseudo = 0;
220  double pseudotheta = 0;
221  const Trk::MeasurementBase* pseudo = nullptr;
222  // other measurement information
223  const Trk::Surface *firstsurf = nullptr, *firstecsurf = nullptr,
224  *lastsurf = nullptr;
225  const Trk::MeasurementBase* firstmeas = nullptr;
226  // counters for barrel and endcap
227  int nbarrel = 0, nendcap = 0;
228  // some variables for endcaps
229  std::vector<std::pair<double, double>> points;
230  points.reserve(40);
231  double oldphi = 0;
232 
233  const Trk::Surface *surf_zmin=nullptr;
234  const Trk::Surface *surf_zmax=nullptr;
235  int meas_zmin_i=int(tS.numberOfMeasurementBases());
236  int meas_zmax_i=int(tS.numberOfMeasurementBases());
237 
238  // loop over the measurements in track segment (tS)
239  for (int it = 0; it < int(tS.numberOfMeasurementBases()); it++) {
240 
241  // the track state on service we like to constuct ...
242  const Trk::TrackStateOnSurface* seg_tsos = nullptr;
243 
244  // is this ROT a psuedo-measurement ?
245  if (dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(
246  tS.measurement(it))) {
247  // did we have a speudo-measurement before ?
248  if (pseudo) {
249  // get theta from pseudo measurements
250  pseudotheta =
251  std::atan2(tS.measurement(it)->associatedSurface().center().perp(),
252  tS.measurement(it)->associatedSurface().center().z());
253  }
254  // keep this pseudo measurement
255  pseudo = tS.measurement(it);
256  // update counter
257  npseudo++;
258 
259  if (m_doRefit) {
260  // refit means we can simply copy the state, otherwise we skip it
261  seg_tsos =
262  new Trk::TrackStateOnSurface(tS.measurement(it)->uniqueClone(), nullptr);
263  }
264 
265  } else {
266  //
267  // normal measurement, not a pseudo measurement
268  //
269  // copy measurement
270  seg_tsos =
271  new Trk::TrackStateOnSurface(tS.measurement(it)->uniqueClone(), nullptr);
272  //
273  // --- following is for the hack below
274  //
275 
276  // remember first measurement
277  if (!firstmeas)
278  firstmeas = tS.measurement(it);
279  if (!firstsurf)
280  firstsurf = &tS.measurement(it)->associatedSurface();
281  // it is always the last one
282  lastsurf = &tS.measurement(it)->associatedSurface();
283 
284  // detect endcap elemeents
286  // increase counter and keep some information
287  nendcap++;
288  if (!firstecsurf)
289  firstecsurf = &tS.measurement(it)->associatedSurface();
290 
291  double tmpphi =
292  tS.measurement(it)->associatedSurface().center().phi();
293  if (!points.empty() &&
294  std::abs(tmpphi - oldphi) > M_PI) { // correct for boundary at +/- pi
295  if (tmpphi < 0)
296  tmpphi += 2 * M_PI;
297  else
298  tmpphi -= 2 * M_PI;
299  }
300  // remember oldphi
301  oldphi = tmpphi;
302 
303  if (!surf_zmax || std::abs(tS.measurement(it)->associatedSurface().center().z())>std::abs(surf_zmax->center().z())) {
304  surf_zmax = &tS.measurement(it)->associatedSurface();
305  meas_zmax_i = it;
306  }
307  if (!surf_zmin || std::abs(tS.measurement(it)->associatedSurface().center().z())<std::abs(surf_zmin->center().z())) {
308  surf_zmin = &tS.measurement(it)->associatedSurface();
309  meas_zmin_i = it;
310  }
311  // copy the points
312  points.emplace_back(
313  tS.measurement(it)->associatedSurface().center().z(), tmpphi);
314 
315  } else
316  nbarrel++;
317 
318  //
319  // --- end of hack stuff
320  //
321  }
322 
323  // push new TSOS into the list
324  if (seg_tsos)
325  ntsos->push_back(seg_tsos);
326  }
327 
328  // Construct the new track
330  info.setPatternRecognitionInfo(Trk::TrackInfo::TRTStandalone);
331 
332  // create new track candidate
333  if (!m_doRefit) {
334  return new Trk::Track(info, std::move(ntsos), std::move(fq));
335  } else {
336  //
337  // ----------------------------- this is a horrible hack to make the
338  // segments fittable
339  //
340 
341  // in case of only 1 pseudo measurement, use the theta from it.
342  if (npseudo == 1)
343  pseudotheta = pseudo->localParameters()[Trk::theta];
344 
345  // we need new perigee parameters
346  double myqoverp = 0, myphi = 0, myd0 = 0, myz0 = 0, mytheta = pseudotheta;
347 
348  if (nendcap < 4) {
349  //
350  // --- are we in the barrel mostly
351  //
352 
353  // momentum
354  myqoverp = par[4] * std::sin(pseudotheta) / std::sin(par[3]);
355 
356  // --- create surface at perigee
357  Amg::Vector3D perigeePosition(0., 0., 0.);
358  Trk::PerigeeSurface perigeeSurface(perigeePosition);
359  // -- get perigee
360  std::unique_ptr<const Trk::TrackParameters> tmp =
361  m_extrapolator->extrapolate(ctx, *segPar, perigeeSurface);
362  std::unique_ptr<const Trk::Perigee> tempper = nullptr;
363  if (tmp && tmp->associatedSurface().type() == Trk::SurfaceType::Perigee) {
364  tempper.reset(static_cast<const Trk::Perigee*>(tmp.release()));
365  }
366  if (!tempper) {
367  ATH_MSG_DEBUG("Could not produce perigee");
368  delete segPar;
369  segPar = nullptr;
370  return nullptr;
371  }
372 
373  // keep some values
374  myd0 = tempper->parameters()[Trk::d0];
375  myphi = tempper->parameters()[Trk::phi0];
376 
377  } else {
378  //
379  // --- endcap or transition track
380  //
381 
382  // get estimate of parameters
383  double sx = 0, sy = 0, sxx = 0, sxy = 0, d = 0;
384  float zmin = points.empty() ? 0 : points.begin()->first, zmax = 0;
385  // loop over all points
386 
387  for (auto & point : points) {
388  sx += point.first;
389  sy += point.second;
390  sxy += point.first * point.second;
391  sxx += point.first * point.first;
392  if (std::abs(point.first) > std::abs(zmax)) {
393  zmax = point.first;
394  }
395  if (std::abs(point.first) < std::abs(zmin)) {
396  zmin = point.first;
397  }
398  }
399 
400  if (std::abs(pseudotheta) < 1.e-6) {
401  ATH_MSG_DEBUG("pseudomeasurements missing on the segment?");
402 
403  if ( meas_zmin_i < int(tS.numberOfMeasurementBases())
404  && meas_zmax_i < int(tS.numberOfMeasurementBases())) {
405  Amg::Vector3D meas_zmin = tS.measurement(meas_zmin_i)->globalPosition();
406  Amg::Vector3D meas_zmax = tS.measurement(meas_zmax_i)->globalPosition();
407  double diff_z (meas_zmax.z() - meas_zmin.z());
408  if (std::abs(diff_z)>1e-6) {
409  double diff_r( meas_zmax.perp() - meas_zmin.perp());
410  pseudotheta = std::atan2(diff_r, diff_z);
411  ATH_MSG_DEBUG("Initial pseudo theta is zero. Compute pseudo from inner- and outermost endcap measurements. delta R: " <<
412  meas_zmax.perp() << " - " << meas_zmin.perp() << " = " << diff_r
413  << " , diff Z: " << meas_zmax.z() << " - " << meas_zmin.z()
414  << " = " << diff_z
415  << " " << pseudotheta);
416  }
417  }
418 
419  if (std::abs(pseudotheta) < 1.e-6) {
420  constexpr std::array<float,2> boundary_r {644., 1004.};
421  // true if track extends from endcap A to endcap C:
422  bool is_across_sides=std::signbit(zmin)!=std::signbit(zmax);
423  double r_path=is_across_sides ? 2 * boundary_r[1] : boundary_r[1]-boundary_r[0];
424  double r1 =0.;
425  double r2 =0.;
426  if (surf_zmin && surf_zmax) {
427  bool is_reverse=std::abs(surf_zmin->center().z())>std::abs(surf_zmax->center().z());
428  // use the innermost and outermost surfaces (defined by z-coordinate) to compute the
429  // travel distance in R-direction assume that the outermost surface is always crossed
430  // at the outermost radial position assume more over that the the innermost surface
431  // is either crossed at the innermost or outermost position what ever leads to the
432  // largest travel distance in r.
433 
434  std::array<const Trk::Surface *,2> boundary_surface{
435  is_reverse ? surf_zmax : surf_zmin,
436  is_reverse ? surf_zmin : surf_zmax};
437  // true if track goes from the outside to the insde :
438  std::array<Amg::Vector2D,2> translation;
439  std::array<Amg::Vector2D,2> height;
440  for (unsigned int boundary_i=boundary_surface.size(); boundary_i-->0;) {
441  if ( boundary_surface[boundary_i]->type() == Trk::SurfaceType::Line
442  && boundary_surface[boundary_i]->bounds().type() == Trk::SurfaceBounds::Cylinder) {
443  const Trk::CylinderBounds &
444  cylinder_bounds = dynamic_cast<const Trk::CylinderBounds &>(boundary_surface[boundary_i]->bounds());
445  height[boundary_i]= project2D( boundary_surface[boundary_i]->transform().rotation()
446  * Amg::Vector3D(0,0, cylinder_bounds.halflengthZ()) );
447  translation[boundary_i]=project2D( boundary_surface[boundary_i]->transform().translation() );
448  }
449  }
450  r1 = (translation[1] + height[1] - ( translation[0] + height[0])).perp();
451  r2 = (translation[1] + height[1] - ( translation[0] - height[0])).perp();
452  r_path=std::max(r1,r2);
453 
454  }
455  pseudotheta = std::atan2(r_path, zmax - zmin);
456  ATH_MSG_DEBUG("Initial pseudo theta is zero. Pseudo theta from inner- and outermost surfaces. Deleta r " << r2 << " - " << r1 << " -> " << r_path
457  << " , delta Z " << zmax << " - " << zmin << " -> " << (zmax-zmin)
458  << " " << pseudotheta);
459  }
460  }
461 
462  // get q/p
463  d = (points.size() * sxx - sx * sx);
464  double dphidz = ((points.size() * sxy - sy * sx) / d);
465  myqoverp = (std::abs(pseudotheta) > 1e-6)
466  ? -dphidz / (0.6 * std::tan(pseudotheta))
467  : 1000.;
468 
469  // some geometry stuff to estimate further paramters...
470  double halfz = 200.;
471  const Trk::CylinderBounds* cylb =
472  dynamic_cast<const Trk::CylinderBounds*>(&firstsurf->bounds());
473  if (!cylb)
474  ATH_MSG_ERROR("Cast of bounds failed, should never happen");
475  else
476  halfz = cylb->halflengthZ();
477  const Trk::CylinderBounds* cylb2 =
478  dynamic_cast<const Trk::CylinderBounds*>(&lastsurf->bounds());
479  double halfz2 = 200.;
480  if (!cylb2)
481  ATH_MSG_ERROR("Cast of bounds failed, should never happen");
482  else
483  halfz2 = cylb2->halflengthZ();
484  Amg::Vector3D strawdir1 = -firstsurf->transform().rotation().col(2);
485  Amg::Vector3D strawdir2 = -lastsurf->transform().rotation().col(2);
486  Amg::Vector3D pos1;
487  Amg::Vector3D pos2;
488 
489  // ME: this is hardcoding, not nice and should be fixed
490  if (std::abs(lastsurf->center().z()) < 2650 * mm) {
491  pos2 = lastsurf->center() + halfz2 * strawdir2;
492  if (nbarrel == 0) {
493  double dr = std::abs(std::tan(pseudotheta) * (lastsurf->center().z() -
494  firstsurf->center().z()));
495  pos1 = firstsurf->center() + (halfz - dr) * strawdir1;
496  } else {
497  double dz = std::abs((pos2.perp() - firstsurf->center().perp()) /
498  std::tan(pseudotheta));
499  if (pos2.z() > 0)
500  dz = -dz;
501  double z1 = pos2.z() + dz;
502  pos1 = Amg::Vector3D(
503  firstsurf->center().x(), firstsurf->center().y(), z1);
504  }
505  } else {
506  double dr = std::abs(std::tan(pseudotheta) *
507  (lastsurf->center().z() - firstsurf->center().z()));
508  pos2 = lastsurf->center() + (dr - halfz2) * strawdir2;
509  pos1 = firstsurf->center() - halfz * strawdir1;
510  }
511 
512  // ME: I don't understand this yet, why is this done only if barrel ==
513  // 0, while above this nendcap < 4 ?
514  if (nbarrel == 0 &&
515  std::abs(std::tan(pseudotheta) * (firstsurf->center().z() -
516  lastsurf->center().z())) < 250 * mm &&
517  std::abs(firstsurf->center().z()) > 1000 * mm) {
518 
519  // ME: wow this is hacking the vector ...
520  const Trk::MeasurementBase* firstmeas =
521  (**ntsos->begin()).measurementOnTrack();
522  Amg::MatrixX newcov(2, 2);
523  newcov.setZero();
524  newcov(0, 0) = (firstmeas->localCovariance())(0, 0);
525  newcov(1, 1) = (myqoverp != 0) ? .0001 * myqoverp * myqoverp : 1.e-8;
526  Trk::LocalParameters newpar(std::make_pair(0, Trk::locZ),
527  std::make_pair(myqoverp, Trk::qOverP));
528  auto newpseudo =
529  std::make_unique<Trk::PseudoMeasurementOnTrack>(
530  std::move(newpar),
531  std::move(newcov),
532  firstmeas->associatedSurface());
533  // hack replace first measurement with pseudomeasurement
534  ntsos->erase(ntsos->begin());
535  ntsos->insert(ntsos->begin(),
536  new Trk::TrackStateOnSurface(std::move(newpseudo), nullptr));
537  }
538 
539  Amg::Vector3D field1;
540 
541  MagField::AtlasFieldCache fieldCache;
542 
543  // Get field cache object
546  };
547  const AtlasFieldCacheCondObj* fieldCondObj{ *readHandle };
548  if (fieldCondObj == nullptr) {
550  "segToTrack: Failed to retrieve AtlasFieldCacheCondObj with key "
552  return nullptr;
553  }
554  fieldCondObj->getInitializedCache(fieldCache);
555 
556  // MT version uses cache
557  fieldCache.getField(Amg::Vector3D(.5 * (pos1 + pos2)).data(),
558  field1.data());
559 
560  field1 *= m_fieldUnitConversion; // field in Tesla
561 
562  double phideflection =
563  -.3 * (pos2 - pos1).perp() * field1.z() * myqoverp / std::sin(pseudotheta);
564  double precisephi = (nbarrel == 0)
565  ? (pos2 - pos1).phi() - .5 * phideflection
566  : (pos2 - pos1).phi() + .5 * phideflection;
567  double radius = (myqoverp != 0. && field1.z() != 0.)
568  ? -std::sin(pseudotheta) / (.3 * field1.z() * myqoverp)
569  : 1.e6;
570  double precisetheta =
571  (myqoverp != 0.)
572  ? std::atan2(std::abs(radius * phideflection), pos2.z() - pos1.z())
573  : pseudotheta;
574  if (precisetheta < 0)
575  precisetheta += M_PI;
576  if (precisephi < -M_PI)
577  precisephi += 2 * M_PI;
578  if (precisephi > M_PI)
579  precisephi -= 2 * M_PI;
580 
581  // now extrapolate backwards from the first surface to get starting
582  // parameters
583  const Trk::StraightLineSurface* surfforpar = nullptr;
584  if (nbarrel == 0)
585  surfforpar = dynamic_cast<const Trk::StraightLineSurface*>(firstsurf);
586  else
587  surfforpar = dynamic_cast<const Trk::StraightLineSurface*>(lastsurf);
588  if (!surfforpar)
589  ATH_MSG_ERROR("Cast of surface failed, should never happen");
590 
591  Trk::AtaStraightLine ataline(((nbarrel == 0) ? pos1 : pos2),
592  precisephi,
593  precisetheta,
594  myqoverp,
595  *surfforpar);
596  Trk::PerigeeSurface persurf;
597  const Trk::TrackParameters* extrappar =
598  m_extrapolator->extrapolateDirectly(ctx, ataline, persurf).release();
599 
600  // now get parameters
601  if (extrappar) {
602  if (nendcap >= 4) {
603  myphi = extrappar->parameters()[Trk::phi0];
604  myd0 = extrappar->parameters()[Trk::d0];
605  }
606 
607  // construct theta again
608  double z0 = extrappar->parameters()[Trk::z0];
609  if (nbarrel == 0)
610  mytheta = std::atan(std::tan(extrappar->parameters()[Trk::theta]) *
611  std::abs((z0 - pos1.z()) / pos1.z()));
612  else
613  mytheta = std::atan(std::tan(extrappar->parameters()[Trk::theta]) *
614  std::abs((z0 - pos2.z()) / pos2.z()));
615 
616  if (mytheta < 0)
617  mytheta += M_PI;
618 
619  delete extrappar;
620  extrappar = nullptr;
621  }
622  }
623  while (myphi > M_PI)
624  myphi -= 2 * M_PI;
625  while (myphi < -M_PI)
626  myphi += 2 * M_PI;
627 
628  double P[5] = { myd0, myz0, myphi, mytheta, myqoverp };
629 
630  // create perigee TSOS and add as first (!) TSOS
631 
632  auto per =
633  std::make_unique<Trk::Perigee>(P[0], P[1], P[2], P[3], P[4], Trk::PerigeeSurface());
634  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>
635  typePattern;
636  typePattern.set(Trk::TrackStateOnSurface::Perigee);
638  nullptr, std::move(per), nullptr, typePattern);
639  ntsos->insert(ntsos->begin(), seg_tsos);
640 
641  //
642  // ------------------------------------------------------- now refit the
643  // track
644  //
645 
646  Trk::Track newTrack (info, std::move(ntsos), std::move(fq));
647  Trk::Track* fitTrack =
648  m_fitterTool->fit(ctx,newTrack, true, Trk::nonInteracting).release();
649 
650  // cleanup
651  if (segPar) {
652  delete segPar;
653  segPar = nullptr;
654  }
655 
656  if (!fitTrack) {
657  ATH_MSG_DEBUG("Refit of TRT track segment failed!");
658  return nullptr;
659  }
660 
661  //
662  // -------------------------------------- hack the covarinace back to
663  // something reasonable
664  //
665  const Trk::TrackParameters* firstmeaspar = nullptr;
667  fitTrack->trackParameters()->begin();
668  do {
669  // skip pesudo measurements on perigee
670  if ((*parit)->covariance() &&
671  ((*parit)->associatedSurface() == tS.associatedSurface()))
672  firstmeaspar = *parit;
673  ++parit;
674  } while (firstmeaspar == nullptr &&
675  parit != fitTrack->trackParameters()->end());
676 
677  // Create new perigee starting from the modified first measurement that
678  // has a more reasonable covariance matrix
679  // const Trk::Perigee* perTrack=dynamic_cast<const
680  // Trk::Perigee*>(fitTrack->perigeeParameters());
681  const Trk::Perigee* perTrack = fitTrack->perigeeParameters();
682 
683  if (!perTrack || !perTrack->covariance()) {
684  ATH_MSG_ERROR("Cast of perigee fails, should never happen !");
685  return nullptr;
686  } else {
687  ATH_MSG_VERBOSE ("Perigee after refit with fudges to make it converge : " << (*perTrack) );
688 
689  if(firstmeaspar && firstmeaspar->position().perp()<2000*mm && std::abs(firstmeaspar->position().z())<3000*mm){
690 
691  // Modify first measurement so that it has reasonable errors on z and theta
692  AmgSymMatrix(5) fcovmat = AmgSymMatrix(5)(*(firstmeaspar->covariance()));
693  // factors by which we like to scale the cov, this takes the original segment errors into account
694  double scaleZ = std::sqrt(tS.localCovariance()(1,1))/std::sqrt( (fcovmat)(1,1));
695  double scaleTheta = std::sqrt(tS.localCovariance()(3,3))/std::sqrt( (fcovmat)(3,3));
696  // now do it
697  fcovmat(1,0)=scaleZ*((fcovmat)(1,0));
698  fcovmat(0,1) = (fcovmat)(1,0);
699  fcovmat(1,1)=tS.localCovariance()(1,1);
700  fcovmat(2,1)=scaleZ*((fcovmat)(2,1));
701  fcovmat(1,2) = (fcovmat)(2,1);
702  fcovmat(3,1)=scaleZ*scaleTheta*((fcovmat)(3,1));
703  fcovmat(1,3) = (fcovmat)(3,1);
704  fcovmat(4,1)=scaleZ*((fcovmat)(4,1));
705  fcovmat(1,4) = (fcovmat)(4,1);
706  fcovmat(3,0)=scaleTheta*((fcovmat)(3,0));
707  fcovmat(0,3) = (fcovmat)(3,0);
708  fcovmat(3,2)=scaleTheta*((fcovmat)(3,2));
709  fcovmat(2,3) = (fcovmat)(3,2);
710  fcovmat(3,3)=tS.localCovariance()(3,3);
711  fcovmat(4,3)=scaleTheta*((fcovmat)(4,3));
712  fcovmat(3,4) = (fcovmat)(4,3);
713 
714  // const Amg::VectorX& par = firstmeaspar->parameters();
715  const AmgVector(5)& par = firstmeaspar->parameters();
716  const Trk::TrackParameters* updatedPars =
718  par[Trk::loc1],
719  par[Trk::loc2],
720  par[Trk::phi],
721  par[Trk::theta],
722  par[Trk::qOverP],
723  std::move(fcovmat)).release();
724 
725  // now take parameters at first measurement and exptrapolate to perigee
726  const Trk::TrackParameters* newperpar =
727  m_extrapolator->extrapolate(ctx,
728  *updatedPars,
729  perTrack->associatedSurface(),
731  false,
732  Trk::nonInteracting).release();
733  delete updatedPars; updatedPars = nullptr;
734 
735  if (!newperpar || !newperpar->covariance()) {
736  ATH_MSG_WARNING ("Can not hack perigee parameters, extrapolation failed");
737  delete newperpar; newperpar = nullptr;
738  } else {
739  // this is a HACK !!!
740  // perTrack is owned by fitTrack which is not const here
741  // thus the const-ness is only removed from somthting which is not strictly const here.
742  AmgSymMatrix(5)& errmat ATLAS_THREAD_SAFE = const_cast<AmgSymMatrix(5)&>(*perTrack->covariance());
743  // overwrite cov in perTrack
744  errmat = *newperpar->covariance();
745  delete newperpar; newperpar = nullptr;
746  // check that new cov makes sense !
747  const AmgSymMatrix(5)& CM = *perTrack->covariance();
748  if( CM(1,1)==0.||CM(3,3)==0. ) {
749  ATH_MSG_DEBUG ("Hacked perigee covariance is CRAP, reject track");
750  delete fitTrack; return nullptr;
751  } else {
752  ATH_MSG_VERBOSE ("Perigee after fit with scaled covariance matrix : " << *perTrack);
753  }
754  }
755  }
756  }
757  // return fitted track
758  return fitTrack;
759  }
760  }
761 
762 
764  const Trk::PRDtoTrackMap *prd_to_track_map) const {
765 
766  ATH_MSG_DEBUG ("Checking whether the TRT segment has already been used...");
767 
768  // some counters to be handled
769  int nShared = 0; // Shared drift circles in segment
770  int nHits = 0; // Number of TRT measurements
771 
772  if (m_assoTool.isEnabled()&& !prd_to_track_map) ATH_MSG_ERROR("PRDtoTrackMap to be used but not provided by the client");
773  // loop over the track states
774  for(int it=0; it<int(tS.numberOfMeasurementBases()); ++it){
775 
776  // remove pseudo measurements
777  if ( dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(tS.measurement(it)) )
778  continue;
779 
780  // get the measurment
781  const InDet::TRT_DriftCircleOnTrack* trtcircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(tS.measurement(it));
782  if (!trtcircle) continue;
783 
784  // get PRD measurement
785  const InDet::TRT_DriftCircle* RawDataClus=dynamic_cast<const InDet::TRT_DriftCircle*>(trtcircle->prepRawData());
786  if(!RawDataClus) continue;
787 
788  // count up number of hits
789  nHits++;
790 
791  if(m_assoTool.isEnabled() && prd_to_track_map && prd_to_track_map->isUsed(*RawDataClus)) nShared++;
792  }
793 
794  if(nShared >= int(m_sharedFrac * nHits)) {
795  ATH_MSG_DEBUG ("Too many shared hits.Will drop the TRT segment");
796  return true;
797  } else {
798  return false;
799  }
800 
801 
802  }
803 
805 
806  ATH_MSG_DEBUG ("Try to recover low TRT DC segments in crack...");
807 
808  // counters
809  int nEC = 0; int nBRL = 0; int firstWheel = -999; int lastLayer = -999;
810 
811  // loop over the track states
812  for(int it=0; it<int(tS.numberOfMeasurementBases()); ++it){
813 
814  //test if it is a pseudo measurement
815  if ( dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(tS.measurement(it)) )
816  continue;
817 
818  // get measurement
819  const InDet::TRT_DriftCircleOnTrack* trtcircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(tS.measurement(it));
820  if(!trtcircle) continue;
821 
822  // get identifier
823  Identifier id = trtcircle->detectorElement()->identify();
824  // barrel or endcap
825  int isB = m_trtId->barrel_ec(id);
826  if (isB==2 || isB==-2) {
827  nEC++;
828  if(nEC == 1)
829  firstWheel = m_trtId->layer_or_wheel(id);
830  }
831  else if (isB==1 || isB==-1) {
832  nBRL++;
833  lastLayer = m_trtId->layer_or_wheel(id);
834  }
835 
836  }
837 
838  // now the logic
839  return (nEC>0 && nBRL>0) ||
840 
841  (nEC==0 && nBRL>0 && lastLayer<2) ||
842 
843  (nEC>0 && nBRL==0 && (firstWheel>10 || firstWheel<2));
844 
845  }
846 
848  // @TODO avoid non const member m_trackScoreTrackMap
849  ATH_MSG_DEBUG ("Add track to the scoring multimap...");
850  if (m_trackSummaryTool.isEnabled()) {
851  m_trackSummaryTool->computeAndReplaceTrackSummary(*trk,
853  }
854 
855  //Score the track under investigation
856  Trk::TrackScore score = m_scoringTool->score(*trk);
857  ATH_MSG_DEBUG ("TRT-only: score is " << score);
858 
859  if (score==0) {
860  // statistics...
861  ATH_MSG_DEBUG ("Track score is zero, reject it");
863  // clean up
864  delete trk;
865  } else {
866  // add track to map, map is sorted small to big !
867  event_data.m_trackScores.emplace_back(-score, trk );
868  }
869 
870 
871  }
872 
873 
875  ITRT_SegmentToTrackTool::EventData &event_data) const {
876 
877  ATH_MSG_DEBUG ("Resolving the TRT tracks in score map...");
878 
879 
880  std::unique_ptr<Trk::PRDtoTrackMap> prd_to_track_map;
881  if (m_assoTool.isEnabled()) {
882  prd_to_track_map=m_assoTool->createPRDtoTrackMap();
883  if (prd_to_track_map_in) {
884  *prd_to_track_map = *prd_to_track_map_in;
885  }
886  }
887 
888  //final copy - ownership is passed out of algorithm
889  std::unique_ptr<TrackCollection> final_tracks = std::make_unique<TrackCollection>();
890  final_tracks->reserve( event_data.m_trackScores.size());
891  std::stable_sort(event_data.m_trackScores.begin(),
892  event_data.m_trackScores.end(),
893  []( const std::pair< Trk::TrackScore, Trk::Track* > &a,
894  const std::pair< Trk::TrackScore, Trk::Track* > &b)
895  { return a.first < b.first; });
896 
897  for (std::pair< Trk::TrackScore, Trk::Track* > &track_score : event_data.m_trackScores) {
898 
899  ATH_MSG_DEBUG ("--- Trying next track "<<track_score.second<<"\t with score "<<-track_score.first);
900 
901  // some counters to be handled
902  int nShared = 0; // Shared drift circles in segment
903  int nHits = 0; // Number of TRT measurements
904 
905  // get vector of TSOS
906  const Trk::TrackStates* tsos = (track_score.second)->trackStateOnSurfaces();
907 
908  // loop over vector of TSOS
909  for ( const Trk::TrackStateOnSurface *a_tsos : *tsos) {
910 
911  // get measurment from TSOS
912  const Trk::MeasurementBase* meas = a_tsos->measurementOnTrack();
913  if (!meas)
914  continue;
915 
916  // make sure it is a TRT_DC and not a pseudo measurement
917  const InDet::TRT_DriftCircleOnTrack* rot =
918  dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(meas);
919  if (!rot)
920  continue;
921 
922  // get to the PRD object
923  const InDet::TRT_DriftCircle* RawDataClus =
924  dynamic_cast<const InDet::TRT_DriftCircle*>(rot->prepRawData());
925  if (!RawDataClus)
926  continue;
927 
928  // count up number of hits
929  nHits++;
930 
931  // count up number of shared hits
932  if (m_assoTool.isEnabled() && prd_to_track_map->isUsed(*RawDataClus))
933  nShared++;
934  }
935 
936  ATH_MSG_DEBUG ("TRT-only has " << nHits << " hits and " << nShared << " of them are shared");
937 
938  // cut on the number of shared hits with the max fraction
939  if(nShared >= int(m_sharedFrac * nHits)) {
940  // statistics
942  ATH_MSG_DEBUG ("Too many shared hits, remove it !");
943  delete track_score.second;
944  continue;
945  }
946 
947  // ok, this seems like a useful track
948  final_tracks->push_back(track_score.second);
949 
951  ATH_MSG_DEBUG ("TRT-only is accepted");
952 
953  //Register the track with the association tool
954  if(m_assoTool.isEnabled()) {
955  if(m_assoTool->addPRDs(*prd_to_track_map,*(track_score.second)).isFailure()) {
956  ATH_MSG_WARNING ("addPRDs() failed!");
957  }
958  }
959 
960  }
961 
962  return final_tracks.release();
963 
964  }
965 
966 }
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
grepfile.info
info
Definition: grepfile.py:38
InDet::TRT_SegmentToTrackTool::toLower
virtual bool toLower(const Trk::TrackSegment &) const override
Definition: TRT_SegmentToTrackTool.cxx:804
InDet::TRT_SegmentToTrackTool::m_fitterTool
ToolHandle< Trk::ITrackFitter > m_fitterTool
Definition: TRT_SegmentToTrackTool.h:99
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDet::TRT_SegmentToTrackTool::m_suppressHoleSearch
bool m_suppressHoleSearch
Suppress hole search during the track summary creation.
Definition: TRT_SegmentToTrackTool.h:95
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
Trk::LocalParameters
Definition: LocalParameters.h:98
InDet::TRT_SegmentToTrackTool::m_assoTool
ToolHandle< Trk::IPRDtoTrackMapTool > m_assoTool
Definition: TRT_SegmentToTrackTool.h:100
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
Trk::TrackStateOnSurface::Perigee
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Definition: TrackStateOnSurface.h:117
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
fitman.sy
sy
Definition: fitman.py:524
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
InDet::TRT_DriftCircleOnTrack::prepRawData
virtual const TRT_DriftCircle * prepRawData() const override final
returns the PrepRawData - is a TRT_DriftCircle in this scope
Definition: TRT_DriftCircleOnTrack.h:202
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
max
#define max(a, b)
Definition: cfImp.cxx:41
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Surface.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
AtlasFieldCacheCondObj
Definition: AtlasFieldCacheCondObj.h:19
InDet::ITRT_SegmentToTrackTool::EventData::knTrkScoreZero
@ knTrkScoreZero
Number of tracks rejected by score zero.
Definition: ITRT_SegmentToTrackTool.h:52
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
perp
Scalar perp() const
perp method - perpenticular length
Definition: AmgMatrixBasePlugin.h:35
InDet::TRT_SegmentToTrackTool::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: TRT_SegmentToTrackTool.h:115
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
Trk::PRDtoTrackMap
Definition: PRDtoTrackMap.h:17
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:176
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:137
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
initialize
void initialize()
Definition: run_EoverP.cxx:894
Trk::Surface::associatedDetectorElementIdentifier
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
python.compressB64.sx
string sx
Definition: compressB64.py:96
InDet::TRT_SegmentToTrackTool::finalize
virtual StatusCode finalize() override
Definition: TRT_SegmentToTrackTool.cxx:80
skel.it
it
Definition: skel.GENtoEVGEN.py:423
InDet::TRT_SegmentToTrackTool::TRT_SegmentToTrackTool
TRT_SegmentToTrackTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TRT_SegmentToTrackTool.cxx:30
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
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Trk::z0
@ z0
Definition: ParamDefs.h:70
Trk::loc2
@ loc2
generic first and second local coordinate
Definition: ParamDefs.h:41
IExtrapolator.h
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
InDet::TRT_SegmentToTrackTool::m_fieldUnitConversion
double m_fieldUnitConversion
Definition: TRT_SegmentToTrackTool.h:93
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
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
ITrackScoringTool.h
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
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
InDet::TRT_DriftCircle
Definition: TRT_DriftCircle.h:32
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
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
InDet::TRT_SegmentToTrackTool::dumpevent
static MsgStream & dumpevent(MsgStream &out)
Tracks that will be passed out of AmbiProcessor.
Definition: TRT_SegmentToTrackTool.cxx:123
Trk::PseudoMeasurementOnTrack
Class to handle pseudo-measurements in fitters and on track objects.
Definition: PseudoMeasurementOnTrack.h:44
Trk::ParametersT::associatedSurface
virtual const S & associatedSurface() const override final
Access to the Surface method.
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::locZ
@ locZ
local cylindrical
Definition: ParamDefs.h:48
InDet::TRT_SegmentToTrackTool::segToTrack
virtual Trk::Track * segToTrack(const EventContext &ctx, const Trk::TrackSegment &) const override
Definition: TRT_SegmentToTrackTool.cxx:137
InDet::TRT_SegmentToTrackTool::addNewTrack
virtual void addNewTrack(Trk::Track *, ITRT_SegmentToTrackTool::EventData &event_data) const override
Add track into the track-score multimap.
Definition: TRT_SegmentToTrackTool.cxx:847
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_SegmentToTrackTool::dumpconditions
MsgStream & dumpconditions(MsgStream &out) const
Definition: TRT_SegmentToTrackTool.cxx:98
InDet::ITRT_SegmentToTrackTool::EventData::m_trackScores
std::vector< std::pair< Trk::TrackScore, Trk::Track * > > m_trackScores
Definition: ITRT_SegmentToTrackTool.h:51
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:72
Trk::MeasurementBase::uniqueClone
std::unique_ptr< MeasurementBase > uniqueClone() const
NVI Clone giving up unique pointer.
Definition: MeasurementBase.h:77
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::rotation
rotation
Definition: TrackSurface_v1.cxx:15
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
Trk::CylinderBounds
Definition: CylinderBounds.h:46
InDet::TRT_SegmentToTrackTool::m_trtId
const TRT_ID * m_trtId
ID TRT helper.
Definition: TRT_SegmentToTrackTool.h:121
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
InDet::TRT_SegmentToTrackTool::initialize
virtual StatusCode initialize() override
Definition: TRT_SegmentToTrackTool.cxx:54
PseudoMeasurementOnTrack.h
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:176
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::TrackScore
float TrackScore
Definition: TrackScore.h:10
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDetDD::TRT_BaseElement::identify
virtual Identifier identify() const override final
identifier of this detector element:
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::TRT_SegmentToTrackTool::m_trackSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Definition: TRT_SegmentToTrackTool.h:105
Trk::ParametersBase
Definition: ParametersBase.h:55
TRT_DriftCircleOnTrack.h
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:866
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
DataVector< Trk::Track >
TRT_ID::layer_or_wheel
int layer_or_wheel(const Identifier &id) const
Definition: TRT_ID.h:884
Trk::PRDtoTrackMap::isUsed
bool isUsed(const PrepRawData &prd) const
does this PRD belong to at least one track?
TRT_SegmentToTrackTool.h
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::Track::trackParameters
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:97
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
Trk::SurfaceType::Perigee
@ Perigee
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
Trk::Surface::bounds
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Trk::MeasurementBase::associatedSurface
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
Trk::d0
@ d0
Definition: ParamDefs.h:69
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
Trk::FitQuality::uniqueClone
std::unique_ptr< FitQuality > uniqueClone() const
NVI uniqueClone.
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
Trk::nonInteracting
@ nonInteracting
Definition: ParticleHypothesis.h:25
InDet::TRT_SegmentToTrackTool::~TRT_SegmentToTrackTool
virtual ~TRT_SegmentToTrackTool()
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Trk::MeasurementBase::globalPosition
virtual const Amg::Vector3D & globalPosition() const =0
Interface method to get the global Position.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDet::TRT_SegmentToTrackTool::m_scoringTool
ToolHandle< Trk::ITrackScoringTool > m_scoringTool
Track scoring tool.
Definition: TRT_SegmentToTrackTool.h:111
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDet::TRT_SegmentToTrackTool::m_doRefit
bool m_doRefit
Do final careful refit of tracks.
Definition: TRT_SegmentToTrackTool.h:92
InDet::TRT_SegmentToTrackTool::segIsUsed
virtual bool segIsUsed(const Trk::TrackSegment &, const Trk::PRDtoTrackMap *prd_to_track_map) const override
Check if the TRT segment has already been assigned a Si extension
Definition: TRT_SegmentToTrackTool.cxx:763
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
xAOD::score
@ score
Definition: TrackingPrimitives.h:513
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
TRT_ID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel.
Definition: TRT_ID.h:857
a
TList * a
Definition: liststreamerinfos.cxx:10
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
InDet::ITRT_SegmentToTrackTool::EventData::knTRTTrk
@ knTRTTrk
Number of TRT-only tracks on output.
Definition: ITRT_SegmentToTrackTool.h:54
MagField::AtlasFieldCache
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Definition: AtlasFieldCache.h:43
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
InDet::TRT_SegmentToTrackTool::resolveTracks
virtual TrackCollection * resolveTracks(const Trk::PRDtoTrackMap *prd_to_track_map, ITRT_SegmentToTrackTool::EventData &event_data) const override
Resolve the standalone TRT tracks based on the number of shared TRT hits.
Definition: TRT_SegmentToTrackTool.cxx:874
MagField::AtlasFieldCache::getField
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
Definition: AtlasFieldCache.cxx:42
Trk::phi
@ phi
Definition: ParamDefs.h:81
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
InDet::ITRT_SegmentToTrackTool::EventData::knTrkSegUsed
@ knTrkSegUsed
Number of excluded segments by other TRT segments.
Definition: ITRT_SegmentToTrackTool.h:53
AthAlgTool
Definition: AthAlgTool.h:26
Trk::SurfaceType::Line
@ Line
InDet::TRT_SegmentToTrackTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Track extrapolator tool.
Definition: TRT_SegmentToTrackTool.h:97
Trk::Segment::fitQuality
const FitQuality * fitQuality() const
return the FitQuality object, returns NULL if no FitQuality is defined
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:160
Trk::loc1
@ loc1
Definition: ParamDefs.h:40
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
InDet::ITRT_SegmentToTrackTool::EventData
Definition: ITRT_SegmentToTrackTool.h:50
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
InDet::ITRT_SegmentToTrackTool::EventData::m_counter
std::array< int, kNCounter > m_counter
Definition: ITRT_SegmentToTrackTool.h:56
Trk::phi0
@ phi0
Definition: ParamDefs.h:71
InDet::TRT_SegmentToTrackTool::dump
virtual MsgStream & dump(MsgStream &out) const override
Definition: TRT_SegmentToTrackTool.cxx:89
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51
Trk::CylinderBounds::halflengthZ
double halflengthZ() const
This method returns the halflengthZ.
Trk::SurfaceBounds::Cylinder
@ Cylinder
Definition: SurfaceBounds.h:61
InDet::TRT_SegmentToTrackTool::m_sharedFrac
double m_sharedFrac
Maximum fraction of shared TRT drift circles.
Definition: TRT_SegmentToTrackTool.h:94
Trk::TrackInfo::TRTStandalone
@ TRTStandalone
TRT Standalone.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:162