ATLAS Offline Software
SiIntersect.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SiIntersect.h
8 // (c) ATLAS Detector software
10 
11 #ifndef INDETREADOUTGEOMETRY_SIINTERSECT_H
12 #define INDETREADOUTGEOMETRY_SIINTERSECT_H
13 
14 namespace InDetDD {
15 
23  class SiIntersect {
24 
25  public:
26 
27  enum IntersectState {OUT = 0, BOUNDARY = 1, IN = 2};
28 
30 
31  bool in() const; // Definitely in
32  bool out() const; // Definitely out
33  bool nearBoundary() const; // Near boundary within tolerences
34  bool mayIntersect() const; // in() || nearBoundary()
35  operator bool() const; // Equivalent to mayIntersect().
36 
37  void setIn();
38  void setOut();
39  void setNearBoundary();
40 
41  private:
43 
44  };
45 
47  : m_state(state)
48 {}
49 
50 inline bool SiIntersect::in() const
51 {
52  return (m_state == IN);
53 }
54 
55 inline bool SiIntersect::out() const
56 {
57  return (m_state == OUT);
58 }
59 
60 inline bool SiIntersect::nearBoundary() const
61 {
62  return (m_state == BOUNDARY);
63 }
64 
65 
66 inline bool SiIntersect::mayIntersect() const
67 {
68  return (m_state == BOUNDARY || m_state == IN);
69 }
70 
71 inline SiIntersect::operator bool() const
72 {
73  return mayIntersect();
74 }
75 
76 inline void SiIntersect::setIn()
77 {
78  m_state = IN;
79 }
80 
81 inline void SiIntersect::setOut()
82 {
83  m_state = OUT;
84 }
85 
87 {
88  m_state = BOUNDARY;
89 }
90 
91 } // namespace InDetDD
92 
93 #endif //INDETREADOUTGEOMETRY_SIINTERSECT_H
94 
InDetDD::SiIntersect::setOut
void setOut()
Definition: SiIntersect.h:81
InDetDD::SiIntersect::out
bool out() const
Definition: SiIntersect.h:55
InDetDD::SiIntersect::BOUNDARY
@ BOUNDARY
Definition: SiIntersect.h:27
InDetDD::SiIntersect::SiIntersect
SiIntersect(IntersectState state=OUT)
Definition: SiIntersect.h:46
InDetDD::SiIntersect::in
bool in() const
Definition: SiIntersect.h:50
InDetDD::SiIntersect::IntersectState
IntersectState
Definition: SiIntersect.h:27
InDetDD::SiIntersect::setIn
void setIn()
Definition: SiIntersect.h:76
InDetDD::SiIntersect::IN
@ IN
Definition: SiIntersect.h:27
InDetDD::SiIntersect::m_state
IntersectState m_state
Definition: SiIntersect.h:42
InDetDD::SiIntersect::nearBoundary
bool nearBoundary() const
Definition: SiIntersect.h:60
InDetDD::SiIntersect
Definition: SiIntersect.h:23
InDetDD::SiIntersect::OUT
@ OUT
Definition: SiIntersect.h:27
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
InDetDD::SiIntersect::setNearBoundary
void setNearBoundary()
Definition: SiIntersect.h:86
InDetDD::SiIntersect::mayIntersect
bool mayIntersect() const
Definition: SiIntersect.h:66