ATLAS Offline Software
Intersection.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Intersection.h, (c) ATLAS Detector software
8 
9 #ifndef TRKDETDESCRUTILS_INTERSECTION_H
10 #define TRKDETDESCRUTILS_INTERSECTION_H
11 
14 
15 namespace Trk {
16 
24 {
26  double pathLength;
27  double distance;
28  bool valid;
29 
30  Intersection(const Amg::Vector3D& sinter, double slenght, bool svalid, double dist = 0.)
31  : position(sinter)
32  , pathLength(slenght)
33  , distance(dist)
34  , valid(svalid)
35  {}
36 
37  // smaller operator for sorting
38  bool operator<(const Intersection& si) const { return (valid && pathLength < si.pathLength); }
39 };
40 
42 template<class T>
44 {
45 public:
47  const T* object;
49 
51  ObjectIntersection(const Intersection& sInter, const T* sObject, PropDirection dir = alongMomentum)
52  : intersection(sInter)
53  , object(sObject)
54  , pDirection(dir)
55  {}
56 
58  bool operator<(const ObjectIntersection<T>& oi) const { return (intersection < oi.intersection); }
59 };
60 
62 template<class T, class R, class S>
64 {
65 public:
67  const T* object;
68  const R* representation;
69  const S* result;
71 
74  const T* sObject,
75  const R* sRepresentation,
76  const S* sResult,
78  : intersection(sInter)
79  , object(sObject)
80  , representation(sRepresentation)
81  , result(sResult)
82  , pDirection(dir)
83  {}
84 
86  bool operator<(const FullIntersection<T, R, S>& oi) const { return (intersection < oi.intersection); }
87 };
88 
89 }
90 
91 #endif
Trk::Intersection::operator<
bool operator<(const Intersection &si) const
Definition: Intersection.h:38
Trk::FullIntersection::operator<
bool operator<(const FullIntersection< T, R, S > &oi) const
smaller operator for ordering & sorting
Definition: Intersection.h:86
Trk::Intersection
Definition: Intersection.h:24
Trk::Intersection::pathLength
double pathLength
Definition: Intersection.h:26
Trk::ObjectIntersection
class extensions to return also the object
Definition: Intersection.h:44
Trk::FullIntersection::FullIntersection
FullIntersection(const Intersection &sInter, const T *sObject, const R *sRepresentation, const S *sResult, PropDirection dir=alongMomentum)
Full intersection.
Definition: Intersection.h:73
PropDirection.h
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
Trk::Intersection::distance
double distance
Definition: Intersection.h:27
JetTiledMap::S
@ S
Definition: TiledEtaPhiMap.h:44
GeoPrimitives.h
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
Trk::ObjectIntersection::object
const T * object
Definition: Intersection.h:47
Trk::ObjectIntersection::operator<
bool operator<(const ObjectIntersection< T > &oi) const
smaller operator for ordering & sorting
Definition: Intersection.h:58
Trk::Intersection::position
Amg::Vector3D position
Definition: Intersection.h:25
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::FullIntersection::pDirection
PropDirection pDirection
Definition: Intersection.h:70
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::Intersection::Intersection
Intersection(const Amg::Vector3D &sinter, double slenght, bool svalid, double dist=0.)
Definition: Intersection.h:30
Trk::Intersection::valid
bool valid
Definition: Intersection.h:28
Trk::ObjectIntersection::intersection
Intersection intersection
Definition: Intersection.h:46
Trk::FullIntersection::intersection
Intersection intersection
Definition: Intersection.h:66
Trk::ObjectIntersection::pDirection
PropDirection pDirection
Definition: Intersection.h:48
Trk::FullIntersection::object
const T * object
Definition: Intersection.h:67
Trk::FullIntersection::representation
const R * representation
Definition: Intersection.h:68
Trk::FullIntersection
Class extension to return the object, a represenation & the result.
Definition: Intersection.h:64
Trk::FullIntersection::result
const S * result
Definition: Intersection.h:69
Trk::ObjectIntersection::ObjectIntersection
ObjectIntersection(const Intersection &sInter, const T *sObject, PropDirection dir=alongMomentum)
Object intersection.
Definition: Intersection.h:51