Belle II Software development
WireNeighborKind Class Reference

Type for the neighbor relationship from one wire to another. More...

#include <WireNeighborKind.h>

Public Member Functions

 WireNeighborKind ()=default
 Default constructor - constructs an invalid neighbor kind.
 
 WireNeighborKind (short cellDistance, short oClockDirection)
 Useful constructor from cell distance and direction to reach the designated neighbor.
 
short getILayerDifference () const
 Calculate the distance between the current and the layer of the designated neighbor.
 
short getAbsILayerDifference () const
 Calculate the absolute distance between the current and the layer of the designated neighbor.
 
short getILayerDifferenceSign () const
 Calculate if the designated neighbor is more outside.
 
short getCellDistance () const
 Get the distance to the wire neighbor counted in number of cells.
 
short getOClockDirection () const
 Get the direction on the clock to follow to reach the neighbor.
 
bool isValid () const
 Check if the neighbor kind is in principle valid.
 

Private Attributes

short m_cellDistance = 0
 Memory for the distance between to wires counted in numbers of cells.
 
short m_oClockDirection = 0
 Memory for the direction the neighbor is located. Range 1 - 12 imaged on a regular clock.
 

Detailed Description

Type for the neighbor relationship from one wire to another.

Representations is tailored to cover the primary and secondary neighborhood only.

Definition at line 25 of file WireNeighborKind.h.

Constructor & Destructor Documentation

◆ WireNeighborKind()

WireNeighborKind ( short  cellDistance,
short  oClockDirection 
)
inline

Useful constructor from cell distance and direction to reach the designated neighbor.

Definition at line 32 of file WireNeighborKind.h.

33 : m_cellDistance(cellDistance)
34 , m_oClockDirection(moduloFast(oClockDirection, 12))
35 {}
short m_oClockDirection
Memory for the direction the neighbor is located. Range 1 - 12 imaged on a regular clock.
short m_cellDistance
Memory for the distance between to wires counted in numbers of cells.

Member Function Documentation

◆ getAbsILayerDifference()

short getAbsILayerDifference ( ) const
inline

Calculate the absolute distance between the current and the layer of the designated neighbor.

Definition at line 44 of file WireNeighborKind.h.

45 {
46 short slope = abs(symmetricModuloFast(getOClockDirection() + 3, 6));
47 short iAbsLayerDifference = slope * getCellDistance() / 2;
48 if (iAbsLayerDifference > 2) iAbsLayerDifference = 2;
49 return iAbsLayerDifference;
50 }
short getOClockDirection() const
Get the direction on the clock to follow to reach the neighbor.
short getCellDistance() const
Get the distance to the wire neighbor counted in number of cells.

◆ getCellDistance()

short getCellDistance ( ) const
inline

Get the distance to the wire neighbor counted in number of cells.

This is typically 1 for the primary neighbors and 2 for the secondary neighbors

Definition at line 62 of file WireNeighborKind.h.

63 { return m_cellDistance; }

◆ getILayerDifference()

short getILayerDifference ( ) const
inline

Calculate the distance between the current and the layer of the designated neighbor.

Definition at line 38 of file WireNeighborKind.h.

39 {
41 }
short getAbsILayerDifference() const
Calculate the absolute distance between the current and the layer of the designated neighbor.
short getILayerDifferenceSign() const
Calculate if the designated neighbor is more outside.

◆ getILayerDifferenceSign()

short getILayerDifferenceSign ( ) const
inline

Calculate if the designated neighbor is more outside.

Definition at line 53 of file WireNeighborKind.h.

54 {
55 return sign(symmetricModuloFast(getOClockDirection() + 3, 12));
56 }

◆ getOClockDirection()

short getOClockDirection ( ) const
inline

Get the direction on the clock to follow to reach the neighbor.

Definition at line 66 of file WireNeighborKind.h.

67 { return m_oClockDirection; }

◆ isValid()

bool isValid ( ) const
inline

Check if the neighbor kind is in principle valid.

Definition at line 70 of file WireNeighborKind.h.

71 {
72 return
73 m_cellDistance >= 1 and
74 m_cellDistance <= 2 and
75 m_oClockDirection >= 0 and
77 }

Member Data Documentation

◆ m_cellDistance

short m_cellDistance = 0
private

Memory for the distance between to wires counted in numbers of cells.

Definition at line 81 of file WireNeighborKind.h.

◆ m_oClockDirection

short m_oClockDirection = 0
private

Memory for the direction the neighbor is located. Range 1 - 12 imaged on a regular clock.

Definition at line 84 of file WireNeighborKind.h.


The documentation for this class was generated from the following file: