ATLAS Offline Software
Static Public Member Functions | List of all members
Trk::RoT_Extractor Class Reference

Small utility to cast MeasurementBase (either in a vector or single) into RIO_OnTrack. More...

#include <RoT_Extractor.h>

Collaboration diagram for Trk::RoT_Extractor:

Static Public Member Functions

static void extract (std::vector< const RIO_OnTrack * > &rots, const std::vector< const MeasurementBase * > &measurements)
 
static void extract (std::vector< const RIO_OnTrack * > &rots, const std::vector< const MeasurementBase * > &measurements, bool convertCompRots=false)
 
static void extract (const RIO_OnTrack *&rot, const MeasurementBase *meas)
 

Detailed Description

Small utility to cast MeasurementBase (either in a vector or single) into RIO_OnTrack.

CompetingRIOsOnTrack objects are understood (ROT with max. assign-prob taken). If MB object is of different flavour than ROT, it is skipped.

Author
Edward Moyse

Definition at line 41 of file TrackStatHelper.cxx.

Member Function Documentation

◆ extract() [1/3]

void Trk::RoT_Extractor::extract ( const RIO_OnTrack *&  rot,
const MeasurementBase meas 
)
static

Definition at line 45 of file RoT_Extractor.cxx.

47 {
48 
49  if (meas->type(Trk::MeasurementBaseType::RIO_OnTrack)) {
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 }

◆ extract() [2/3]

static void Trk::RoT_Extractor::extract ( std::vector< const RIO_OnTrack * > &  rots,
const std::vector< const MeasurementBase * > &  measurements 
)
static

◆ extract() [3/3]

void Trk::RoT_Extractor::extract ( std::vector< const RIO_OnTrack * > &  rots,
const std::vector< const MeasurementBase * > &  measurements,
bool  convertCompRots = false 
)
static

Definition at line 15 of file RoT_Extractor.cxx.

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;
26  if ((*it)->type(Trk::MeasurementBaseType::RIO_OnTrack)) {
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 }

The documentation for this class was generated from the following files:
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::CompetingRIOsOnTrack::rioOnTrack
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
Trk::MeasurementBaseType::CompetingRIOsOnTrack
@ CompetingRIOsOnTrack
Definition: MeasurementBase.h:50
Trk::CompetingRIOsOnTrack
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
Definition: CompetingRIOsOnTrack.h:64
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
Trk::CompetingRIOsOnTrack::indexOfMaxAssignProb
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
Definition: CompetingRIOsOnTrack.cxx:101