ATLAS Offline Software
Functions
Trk::TrackFitInputPreparator Namespace Reference

Helpers to transform combinations of tracking input (for example, existing tracks plus additional measurements) into a digestable fitter input: either tracks, measurement-sets or proto-state vectors. More...

Functions

MeasurementSet stripMeasurements (const Track &, const MeasurementSet &)
 get the MeasurementSet out of a track+measurements combination. More...
 
PrepRawDataSet stripPrepRawData (const Track &, const PrepRawDataSet &, const SortInputFlag, const bool)
 create a vector of PrepRawData* from the mixed input of track and single PrepRawData. More...
 

Detailed Description

Helpers to transform combinations of tracking input (for example, existing tracks plus additional measurements) into a digestable fitter input: either tracks, measurement-sets or proto-state vectors.

Author
Wolfgang Liebig http://consult.cern.ch/xwho/people/54608

Function Documentation

◆ stripMeasurements()

Trk::MeasurementSet Trk::TrackFitInputPreparator::stripMeasurements ( const Track inputTrk,
const MeasurementSet inputMbs 
)

get the MeasurementSet out of a track+measurements combination.

Definition at line 19 of file TrackFitInputPreparator.cxx.

22 {
23  MeasurementSet newMbSet;
24  // collect MBs from Track (speed: assume use for extending track at end)
26  inputTrk.measurementsOnTrack()->begin();
27  for (; it != inputTrk.measurementsOnTrack()->end(); ++it)
28  if ((*it))
29  newMbSet.push_back(*it);
30  // add MBs from input list
31  MeasurementSet::const_iterator itSet = inputMbs.begin();
32  for (; itSet != inputMbs.end(); ++itSet)
33  if ((*itSet))
34  newMbSet.push_back(*itSet);
35  return newMbSet;
36 }

◆ stripPrepRawData()

Trk::PrepRawDataSet Trk::TrackFitInputPreparator::stripPrepRawData ( const Track inputTrk,
const PrepRawDataSet inputPrds,
const SortInputFlag  doSorting,
const bool  reintegrateOutliers 
)

create a vector of PrepRawData* from the mixed input of track and single PrepRawData.

Switch for applying a sort function as well as re-integration of outliers onto the input track.

Definition at line 42 of file TrackFitInputPreparator.cxx.

47 {
48  // apped PRDs to end of track. For pre-pend make a parameter
49  PrepRawDataSet newPrdSet;
50 
51  // collect PrepRawData pointers from input track ROTs
52  TS_iterator it = inputTrk.trackStateOnSurfaces()->begin();
53  for (; it != inputTrk.trackStateOnSurfaces()->end(); ++it) {
54  if ((*it)->measurementOnTrack() &&
55  (!((*it)->type(TrackStateOnSurface::Outlier)) || reintegrateOutliers)) {
56 
57  const Trk::RIO_OnTrack* rot = nullptr;
58  if ((*it)->measurementOnTrack()->type(
60  rot = static_cast<const Trk::RIO_OnTrack*>((*it)->measurementOnTrack());
61  }
62  if (rot) {
63  const PrepRawData* prepRD = rot->prepRawData();
64  if (prepRD) {
65  newPrdSet.push_back(prepRD);
66  }
67  }
68  }
69  }
70  Trk::PrepRawDataSet::const_iterator itSet = inputPrds.begin();
71  for (; itSet != inputPrds.end(); ++itSet)
72  if ((*itSet))
73  newPrdSet.push_back(*itSet);
74 
75  if (doSorting) {
77  (*inputTrk.trackParameters()->begin())->position(),
78  (*inputTrk.trackParameters()->begin())->momentum());
79 
80  if (!std::is_sorted(newPrdSet.begin(), newPrdSet.end(), PRD_CompFunc))
81  std::sort(newPrdSet.begin(), newPrdSet.end(), PRD_CompFunc);
82  }
83  return newPrdSet;
84 }
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::PrepRawDataSet
std::vector< const PrepRawData * > PrepRawDataSet
vector of clusters and drift circles
Definition: FitterTypes.h:26
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::TS_iterator
DataVector< const TrackStateOnSurface >::const_iterator TS_iterator
Definition: TrackFitInputPreparator.h:22
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Trk::MeasurementSet
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
Definition: FitterTypes.h:30
Trk::RIO_OnTrack::prepRawData
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
Trk::PrepRawDataComparisonFunction
Class providing comparison function, or relational definition, for PrepRawData.
Definition: PrepRawDataComparisonFunction.h:33