ATLAS Offline Software
Loading...
Searching...
No Matches
RoT_Extractor.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6// RoT_Extractor.cxx, (c) ATLAS Detector software //
8
13
14void
16 std::vector<const RIO_OnTrack*>& rots,
17 const std::vector<const MeasurementBase*>& measurements,
18 bool convertCompRots)
19{
20 using namespace std;
21 rots.reserve(rots.size() + measurements.size());
22 vector<const MeasurementBase*>::const_iterator it = measurements.begin();
23 vector<const MeasurementBase*>::const_iterator itEnd = measurements.end();
24 for (; it != itEnd; ++it) {
25 const Trk::RIO_OnTrack* rot = nullptr;
27 rot = static_cast<const RIO_OnTrack*>(*it);
28 }
29 if (convertCompRots && nullptr == rot) {
30 const Trk::CompetingRIOsOnTrack* comprot = nullptr;
32 comprot = static_cast<const Trk::CompetingRIOsOnTrack*>(*it);
33 }
34 if (comprot) {
35 rot = &comprot->rioOnTrack(comprot->indexOfMaxAssignProb());
36 }
37 }
38 if (nullptr != rot) {
39 rots.push_back(rot);
40 }
41 }
42}
43
44void
46 const Trk::MeasurementBase* meas)
47{
48
50 rot = static_cast<const RIO_OnTrack*>(meas);
51 }
52 if (rot == nullptr) {
53 const Trk::CompetingRIOsOnTrack* comprot = nullptr;
55 comprot = static_cast<const Trk::CompetingRIOsOnTrack*>(meas);
56 }
57 if (comprot) {
58 rot = &comprot->rioOnTrack(comprot->indexOfMaxAssignProb());
59 }
60 }
61}
62
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
This class is the pure abstract base class for all fittable tracking measurements.
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition RIO_OnTrack.h:70
static void extract(std::vector< const RIO_OnTrack * > &rots, const std::vector< const MeasurementBase * > &measurements)
STL namespace.