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

#include <TRT_OverlapDescriptor.h>

Inheritance diagram for InDet::TRT_OverlapDescriptor:
Collaboration diagram for InDet::TRT_OverlapDescriptor:

Public Member Functions

 TRT_OverlapDescriptor (const TRT_ID *helper, double bTolerance=0.9, double oTolerance=1.1)
 Constructor. More...
 
 TRT_OverlapDescriptor (const TRT_OverlapDescriptor &od)
 Copy Constructor. More...
 
TRT_OverlapDescriptoroperator= (const TRT_OverlapDescriptor &)=default
 Default assignment. More...
 
virtual ~TRT_OverlapDescriptor ()
 Destructor. More...
 
TRT_OverlapDescriptorclone () const
 Pseudo-Constructor. More...
 
bool reachableSurfaces (std::vector< Trk::SurfaceIntersection > &cSurfaces, const Trk::Surface &sf, const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
 get the compatible surfaces More...
 

Private Member Functions

int checkAndFill (std::vector< Trk::SurfaceIntersection > &cSurfaces, const Trk::Surface &sf, const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
 

Private Attributes

const TRT_IDm_trtIdHelper
 the Id helper More...
 
double m_breakTolerance
 if the straight line intersection is within this fraction of the bounds - don't look for neighbours More...
 
double m_outsideTolerance
 accept even if it outside the bounds by this tolerance More...
 

Detailed Description

Class to describe overlaps in the TRT detector, it extends the Trk::OverlapDescriptor base class.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 31 of file TRT_OverlapDescriptor.h.

Constructor & Destructor Documentation

◆ TRT_OverlapDescriptor() [1/2]

InDet::TRT_OverlapDescriptor::TRT_OverlapDescriptor ( const TRT_ID helper,
double  bTolerance = 0.9,
double  oTolerance = 1.1 
)
inline

Constructor.

Definition at line 34 of file TRT_OverlapDescriptor.h.

34  :
36  m_breakTolerance(bTolerance),
37  m_outsideTolerance(oTolerance)
38  {}

◆ TRT_OverlapDescriptor() [2/2]

InDet::TRT_OverlapDescriptor::TRT_OverlapDescriptor ( const TRT_OverlapDescriptor od)
inline

Copy Constructor.

Definition at line 40 of file TRT_OverlapDescriptor.h.

40  :
42  m_trtIdHelper(od.m_trtIdHelper),
43  m_breakTolerance(od.m_breakTolerance),
44  m_outsideTolerance(od.m_outsideTolerance)
45  {}

◆ ~TRT_OverlapDescriptor()

virtual InDet::TRT_OverlapDescriptor::~TRT_OverlapDescriptor ( )
inlinevirtual

Destructor.

Definition at line 51 of file TRT_OverlapDescriptor.h.

51 {}

Member Function Documentation

◆ checkAndFill()

int InDet::TRT_OverlapDescriptor::checkAndFill ( std::vector< Trk::SurfaceIntersection > &  cSurfaces,
const Trk::Surface sf,
const Amg::Vector3D pos,
const Amg::Vector3D dir 
) const
private

Definition at line 63 of file TRT_OverlapDescriptor.cxx.

68 {
69  Trk::Intersection sfIntersection =
70  sf.straightLineIntersection(pos, dir, false, false);
71  // we have a valid intersection - is it within tolerance ?
72  if (sfIntersection.valid) {
73  // this is the boundary cylinder of the straw surface
74  double rSurface2 = sf.bounds().r() * sf.bounds().r();
75  // what's the distance - hess' normal form
76  const Amg::Vector3D& sCenter = sf.center();
77  const Amg::Vector3D sDirection = sf.transform().rotation().col(2);
78  // d^2 = | (dir) x
79  double d2 =
80  (sDirection.cross((sfIntersection.position - sCenter))).squaredNorm();
81  // check it
82  bool acceptSurface =
83  d2 < (m_outsideTolerance * m_outsideTolerance * rSurface2);
84  if (acceptSurface)
85  cSurfaces.emplace_back(sfIntersection, &sf);
86  // give the break signal if it's really inside
87  return (d2 < (m_breakTolerance * m_breakTolerance * rSurface2)
88  ? 0
89  : (sfIntersection.position.phi() > sf.center().phi() ? 1 : -1));
90  }
91  // base the decision on the position phi value
92  return (pos.phi() > sf.center().phi() ? 1 : -1);
93 }

◆ clone()

TRT_OverlapDescriptor * InDet::TRT_OverlapDescriptor::clone ( ) const
inlinevirtual

Pseudo-Constructor.

Implements Trk::OverlapDescriptor.

Definition at line 75 of file TRT_OverlapDescriptor.h.

75 { return new TRT_OverlapDescriptor(*this); }

◆ operator=()

TRT_OverlapDescriptor& InDet::TRT_OverlapDescriptor::operator= ( const TRT_OverlapDescriptor )
default

Default assignment.

◆ reachableSurfaces()

bool InDet::TRT_OverlapDescriptor::reachableSurfaces ( std::vector< Trk::SurfaceIntersection > &  cSurfaces,
const Trk::Surface sf,
const Amg::Vector3D pos,
const Amg::Vector3D dir 
) const
virtual

get the compatible surfaces

Implements Trk::OverlapDescriptor.

Definition at line 18 of file TRT_OverlapDescriptor.cxx.

24 {
25  const Amg::Vector3D dir = momentum.unit();
26  // first add the target surface - if it fits
27  int nextInt = checkAndFill(cSurfaces, tsf, position, dir);
28  if (!nextInt)
29  return true;
30 
31  // make sure we have the correct associated element
32  const auto* tmp = tsf.associatedDetectorElement();
33  const InDetDD::TRT_BaseElement* trtBaseElement =
34  tmp->detectorType() == Trk::DetectorElemType::TRT
35  ? static_cast<const InDetDD::TRT_BaseElement*>(tmp)
36  : nullptr;
37 
38  // we have a trt base element
39  if (trtBaseElement) {
40 
41  Identifier strawID = tsf.associatedDetectorElementIdentifier();
42 
43  // straw Max
44  int strawMax = trtBaseElement->nStraws() - 1;
45  int strawInt = m_trtIdHelper->straw(strawID);
46 
47  if (strawInt != 0 && strawInt < strawMax && strawMax != -999) {
48  // get the next straw
49  Identifier nextID =
50  m_trtIdHelper->straw_id(trtBaseElement->identify(), strawInt + nextInt);
51  const Trk::Surface* nextStraw = (strawInt > 1 && strawInt < strawMax)
52  ? (&(trtBaseElement->surface(nextID)))
53  : nullptr;
54  if (nextStraw)
55  nextInt = checkAndFill(cSurfaces, *nextStraw, position, dir);
56  }
57  }
58 
59  return true;
60 }

Member Data Documentation

◆ m_breakTolerance

double InDet::TRT_OverlapDescriptor::m_breakTolerance
private

if the straight line intersection is within this fraction of the bounds - don't look for neighbours

Definition at line 70 of file TRT_OverlapDescriptor.h.

◆ m_outsideTolerance

double InDet::TRT_OverlapDescriptor::m_outsideTolerance
private

accept even if it outside the bounds by this tolerance

Definition at line 71 of file TRT_OverlapDescriptor.h.

◆ m_trtIdHelper

const TRT_ID* InDet::TRT_OverlapDescriptor::m_trtIdHelper
private

the Id helper

Definition at line 69 of file TRT_OverlapDescriptor.h.


The documentation for this class was generated from the following files:
Trk::Intersection
Definition: Intersection.h:24
Trk::DetectorElemType::TRT
@ TRT
InDetDD::TRT_BaseElement::nStraws
unsigned int nStraws() const
Number of straws in the element.
InDet::TRT_OverlapDescriptor::m_trtIdHelper
const TRT_ID * m_trtIdHelper
the Id helper
Definition: TRT_OverlapDescriptor.h:69
InDet::TRT_OverlapDescriptor::TRT_OverlapDescriptor
TRT_OverlapDescriptor(const TRT_ID *helper, double bTolerance=0.9, double oTolerance=1.1)
Constructor.
Definition: TRT_OverlapDescriptor.h:34
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
TRT_ID::straw
int straw(const Identifier &id) const
Definition: TRT_ID.h:902
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
InDetDD::TRT_BaseElement::identify
virtual Identifier identify() const override final
identifier of this detector element:
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
Trk::Intersection::position
Amg::Vector3D position
Definition: Intersection.h:25
beamspotman.dir
string dir
Definition: beamspotman.py:623
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::Intersection::valid
bool valid
Definition: Intersection.h:28
Trk::OverlapDescriptor
Definition: OverlapDescriptor.h:41
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
dq_defect_virtual_defect_validation.d2
d2
Definition: dq_defect_virtual_defect_validation.py:81
InDet::TRT_OverlapDescriptor::m_breakTolerance
double m_breakTolerance
if the straight line intersection is within this fraction of the bounds - don't look for neighbours
Definition: TRT_OverlapDescriptor.h:70
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
InDetDD::TRT_BaseElement::surface
virtual const Trk::Surface & surface() const override final
Element Surface: access to the Surface (straw layer)
InDet::TRT_OverlapDescriptor::m_outsideTolerance
double m_outsideTolerance
accept even if it outside the bounds by this tolerance
Definition: TRT_OverlapDescriptor.h:71
InDet::TRT_OverlapDescriptor::checkAndFill
int checkAndFill(std::vector< Trk::SurfaceIntersection > &cSurfaces, const Trk::Surface &sf, const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
Definition: TRT_OverlapDescriptor.cxx:63
InDetDD::TRT_BaseElement
Definition: TRT_BaseElement.h:57
TRT_ID::straw_id
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw:
Definition: TRT_ID.h:581