ATLAS Offline Software
TrackFitInputPreparator.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 // TrackFitInputPreparator, (c) ATLAS Detector software
8 
13 #include "TrkTrack/Track.h"
14 
15 
16 // give back the Measurements stripped of a track+measurement input combination.
17 //
20  const Trk::Track& inputTrk,
21  const Trk::MeasurementSet& inputMbs)
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 }
37 
38 // Create a vector of PrepRawData* from the mixed input of track and single
39 // PRDs.
40 //
43  const Trk::Track& inputTrk,
44  const Trk::PrepRawDataSet& inputPrds,
45  const SortInputFlag doSorting,
46  const bool reintegrateOutliers)
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 }
85 
Trk::SortInputFlag
bool SortInputFlag
switch to toggle sorting
Definition: TrackFitInputPreparator.h:20
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
TrackFitInputPreparator.h
MeasurementBase.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::TrackFitInputPreparator::stripPrepRawData
PrepRawDataSet stripPrepRawData(const Track &, const PrepRawDataSet &, const SortInputFlag, const bool)
create a vector of PrepRawData* from the mixed input of track and single PrepRawData.
Definition: TrackFitInputPreparator.cxx:42
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Track.h
PrepRawDataComparisonFunction.h
Trk::MeasurementSet
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
Definition: FitterTypes.h:30
Trk::PrepRawData
Definition: PrepRawData.h:62
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
RIO_OnTrack.h
Trk::RIO_OnTrack::prepRawData
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
Trk::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
Trk::PrepRawDataComparisonFunction
Class providing comparison function, or relational definition, for PrepRawData.
Definition: PrepRawDataComparisonFunction.h:33
Trk::TrackFitInputPreparator::stripMeasurements
MeasurementSet stripMeasurements(const Track &, const MeasurementSet &)
get the MeasurementSet out of a track+measurements combination.
Definition: TrackFitInputPreparator.cxx:19
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.