ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Trk::PrepRawDataComparisonFunction Class Reference

Class providing comparison function, or relational definition, for PrepRawData. More...

#include <PrepRawDataComparisonFunction.h>

Collaboration diagram for Trk::PrepRawDataComparisonFunction:

Public Member Functions

 PrepRawDataComparisonFunction (const Amg::Vector3D &sp, const Amg::Vector3D &dir)
 Full relation definition using a straight line propagation. More...
 
 PrepRawDataComparisonFunction ()=delete
 
 PrepRawDataComparisonFunction (const PrepRawDataComparisonFunction &PCF)=default
 
 PrepRawDataComparisonFunction (PrepRawDataComparisonFunction &&PCF)=default
 
PrepRawDataComparisonFunctionoperator= (const PrepRawDataComparisonFunction &PCF)=default
 
PrepRawDataComparisonFunctionoperator= (PrepRawDataComparisonFunction &&PCF)=default
 
 ~PrepRawDataComparisonFunction ()=default
 
bool operator() (const Trk::PrepRawData *one, const Trk::PrepRawData *two) const
 The comparison function defining in what case a PRD is 'smaller' than a second one. More...
 

Private Member Functions

double pathIntersectWithPlane (const Trk::PlaneSurface &psf) const
 
double pathIntersectWithLine (const Trk::StraightLineSurface &lsf) const
 
double pathIntersectWithDisc (const Trk::DiscSurface &dsf) const
 

Private Attributes

Amg::Vector3D m_point
 
Amg::Vector3D m_direction
 

Detailed Description

Class providing comparison function, or relational definition, for PrepRawData.

Definition at line 32 of file PrepRawDataComparisonFunction.h.

Constructor & Destructor Documentation

◆ PrepRawDataComparisonFunction() [1/4]

Trk::PrepRawDataComparisonFunction::PrepRawDataComparisonFunction ( const Amg::Vector3D sp,
const Amg::Vector3D dir 
)
inline

Full relation definition using a straight line propagation.

Definition at line 36 of file PrepRawDataComparisonFunction.h.

38  : m_point(sp)
39  , m_direction(dir.unit())
40  {}

◆ PrepRawDataComparisonFunction() [2/4]

Trk::PrepRawDataComparisonFunction::PrepRawDataComparisonFunction ( )
delete

◆ PrepRawDataComparisonFunction() [3/4]

Trk::PrepRawDataComparisonFunction::PrepRawDataComparisonFunction ( const PrepRawDataComparisonFunction PCF)
default

◆ PrepRawDataComparisonFunction() [4/4]

Trk::PrepRawDataComparisonFunction::PrepRawDataComparisonFunction ( PrepRawDataComparisonFunction &&  PCF)
default

◆ ~PrepRawDataComparisonFunction()

Trk::PrepRawDataComparisonFunction::~PrepRawDataComparisonFunction ( )
default

Member Function Documentation

◆ operator()()

bool Trk::PrepRawDataComparisonFunction::operator() ( const Trk::PrepRawData one,
const Trk::PrepRawData two 
) const
inline

The comparison function defining in what case a PRD is 'smaller' than a second one.

Definition at line 57 of file PrepRawDataComparisonFunction.h.

59  {
60 
61  // --- identify the surface type and get intersection path for surface 1
62  //
63  double path1 = 0;
64  const Trk::Surface& sf1 = one->detectorElement()->surface(one->identify());
65  const Trk::SurfaceType surfType1 = sf1.type();
66  switch (surfType1) {
68  const Trk::PlaneSurface& opsf =
69  static_cast<const Trk::PlaneSurface&>(sf1);
70  path1 = this->pathIntersectWithPlane(opsf);
71  } break;
73  const Trk::StraightLineSurface& ossf =
74  static_cast<const Trk::StraightLineSurface&>(sf1);
75  path1 = this->pathIntersectWithLine(ossf);
76  } break;
78  const Trk::DiscSurface& odsf =
79  static_cast<const Trk::DiscSurface&>(sf1);
80  path1 = this->pathIntersectWithDisc(odsf);
81  } break;
82  default: {
83  throw std::runtime_error(
84  "PrepRawDataComparisonFunction: surface type error!");
85  }
86  } // --- no raw data on Cylinder. Ever.
87 
88  // --- identify the surface type and get intersection path for surface 1
89  //
90  double path2 = 0;
91  const Trk::Surface& sf2 = two->detectorElement()->surface(two->identify());
92  const Trk::SurfaceType surfType2 = sf2.type();
93  switch (surfType2) {
95  const Trk::PlaneSurface& opsf =
96  static_cast<const Trk::PlaneSurface&>(sf2);
97  path2 = this->pathIntersectWithPlane(opsf);
98  } break;
100  const Trk::StraightLineSurface& ossf =
101  static_cast<const Trk::StraightLineSurface&>(sf2);
102  path2 = this->pathIntersectWithLine(ossf);
103  } break;
104  case Trk::SurfaceType::Disc: {
105  const Trk::DiscSurface& odsf =
106  static_cast<const Trk::DiscSurface&>(sf2);
107  path2 = this->pathIntersectWithDisc(odsf);
108  } break;
109  default: {
110  throw std::runtime_error(
111  "PrepRawDataComparisonFunction: surface type error!");
112  }
113  } // --- no raw data on Cylinder. Ever.
114 
115  return path1 < path2;
116  }

◆ operator=() [1/2]

PrepRawDataComparisonFunction& Trk::PrepRawDataComparisonFunction::operator= ( const PrepRawDataComparisonFunction PCF)
default

◆ operator=() [2/2]

PrepRawDataComparisonFunction& Trk::PrepRawDataComparisonFunction::operator= ( PrepRawDataComparisonFunction &&  PCF)
default

◆ pathIntersectWithDisc()

double Trk::PrepRawDataComparisonFunction::pathIntersectWithDisc ( const Trk::DiscSurface dsf) const
inlineprivate

Definition at line 142 of file PrepRawDataComparisonFunction.h.

143  {
144  double denom = m_direction.dot(dsf.normal());
145  return (denom) ? dsf.normal().dot(dsf.center() - m_point) / (denom)
146  : denom;
147  }

◆ pathIntersectWithLine()

double Trk::PrepRawDataComparisonFunction::pathIntersectWithLine ( const Trk::StraightLineSurface lsf) const
inlineprivate

Definition at line 129 of file PrepRawDataComparisonFunction.h.

130  {
131  Amg::Vector3D dirWire(lsf.transform().rotation().col(2).unit());
132  Amg::Vector3D trackToWire(lsf.center() - m_point);
133  double parallelity = m_direction.dot(dirWire);
134  double denom = 1 - parallelity * parallelity;
135  return (std::abs(denom) > 10e-7)
136  ? (trackToWire.dot(m_direction) -
137  trackToWire.dot(dirWire) * parallelity) /
138  denom
139  : 0.;
140  }

◆ pathIntersectWithPlane()

double Trk::PrepRawDataComparisonFunction::pathIntersectWithPlane ( const Trk::PlaneSurface psf) const
inlineprivate

Definition at line 122 of file PrepRawDataComparisonFunction.h.

123  {
124  double denom = m_direction.dot(psf.normal());
125  return (denom) ? psf.normal().dot(psf.center() - m_point) / (denom)
126  : denom;
127  }

Member Data Documentation

◆ m_direction

Amg::Vector3D Trk::PrepRawDataComparisonFunction::m_direction
private

Definition at line 120 of file PrepRawDataComparisonFunction.h.

◆ m_point

Amg::Vector3D Trk::PrepRawDataComparisonFunction::m_point
private

Definition at line 119 of file PrepRawDataComparisonFunction.h.


The documentation for this class was generated from the following file:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Trk::one
@ one
Definition: TrkDetDescr/TrkSurfaces/TrkSurfaces/RealQuadraticEquation.h:22
Trk::SurfaceType
SurfaceType
Definition: SurfaceTypes.h:17
Trk::DiscSurface
Definition: DiscSurface.h:54
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
Trk::two
@ two
Definition: TrkDetDescr/TrkSurfaces/TrkSurfaces/RealQuadraticEquation.h:23
Trk::PrepRawDataComparisonFunction::pathIntersectWithDisc
double pathIntersectWithDisc(const Trk::DiscSurface &dsf) const
Definition: PrepRawDataComparisonFunction.h:142
Trk::Surface::normal
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
compute_lumi.denom
denom
Definition: compute_lumi.py:76
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::PrepRawDataComparisonFunction::m_point
Amg::Vector3D m_point
Definition: PrepRawDataComparisonFunction.h:119
Trk::PrepRawDataComparisonFunction::pathIntersectWithLine
double pathIntersectWithLine(const Trk::StraightLineSurface &lsf) const
Definition: PrepRawDataComparisonFunction.h:129
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::PrepRawDataComparisonFunction::m_direction
Amg::Vector3D m_direction
Definition: PrepRawDataComparisonFunction.h:120
Trk::PlaneSurface
Definition: PlaneSurface.h:64
Trk::SurfaceType::Disc
@ Disc
Trk::SurfaceType::Plane
@ Plane
Trk::SurfaceType::Line
@ Line
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::PrepRawDataComparisonFunction::pathIntersectWithPlane
double pathIntersectWithPlane(const Trk::PlaneSurface &psf) const
Definition: PrepRawDataComparisonFunction.h:122
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Trk::Surface::type
constexpr virtual SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51