Belle II Software  release-08-01-10
CDCWireSuperLayer Class Reference

Class representating a sense wire superlayer in the central drift chamber. More...

#include <CDCWireSuperLayer.h>

Inheritance diagram for CDCWireSuperLayer:
Collaboration diagram for CDCWireSuperLayer:

Public Types

using Super = ConstVectorRange< CDCWireLayer >
 Type of the base class.
 
using Iterator = AIterator
 Iterator type of the range.
 
using iterator = Iterator
 Iterator definition for stl.
 
using Reference = typename std::iterator_traits< AIterator >::reference
 The type the iterator references.
 
using value_type = typename std::iterator_traits< AIterator >::value_type
 The type behind the iterator (make it possible to use the range as a "list")
 

Public Member Functions

 CDCWireSuperLayer ()
 Empty constructor for creating an empty dummy CDCWireSuperLayer for studies with a CDC with missing super layers.
 
 CDCWireSuperLayer (const ConstVectorRange< CDCWireLayer > &wireLayers)
 Constructor taking the range of layers the superlayer shall contain. Use rather getInstance() to avoid instance constructions.
 
 CDCWireSuperLayer (const CDCWireSuperLayer &wireSuperLayer)=delete
 Disallow copy construction of wire super layers.
 
 CDCWireSuperLayer (CDCWireSuperLayer &&wireSuperLayer)=default
 Allow move construction of wire super layers for use in std::vector.
 
void operator= (const CDCWireSuperLayer &wireSuperLayer)=delete
 Disallow copy assignment of wire super layers.
 
void initialize ()
 Intializes the superlayer variables of according the layer range. Set the numbering shift of contained layers.
 
Iterator begin () const
 Begin of the range for range based for.
 
Iterator end () const
 End of the range for range based for.
 
bool empty () const
 Checks if the begin equals the end iterator, hence if the range is empty.
 
std::size_t size () const
 Returns the total number of objects in this range.
 
Reference front () const
 Returns the derefenced iterator at begin()
 
Reference back () const
 Returns the derefenced iterator before end()
 
Reference operator[] (std::size_t i) const
 Returns the object at index i.
 
Reference at (std::size_t i) const
 Returns the object at index i.
 
bool count (Reference t)
 Counts the number of equivalent items in the range.
 
Superlayer index
ISuperLayer getISuperLayer () const
 Getter for the super layer id.
 
Layer getters
bool isValidILayer (ILayer iLayer) const
 Checks if the given layer id belongs to a valid layer in this superlayer.
 
const CDCWireLayergetWireLayer (ILayer iLayer) const
 Gives the layer by its layer id within the superlayer.
 
Wire getters
bool isValidIWire (ILayer iLayer, IWire iWire) const
 Checks if the given wire id belongs to a valid wire in this superlayer.
 
const CDCWiregetWire (ILayer iLayer, IWire iWire) const
 Gives the wire by its layer id within the superlayer and the wire id in the layer.
 
Geometry properties
bool isAxial () const
 Indicates if the wire is axial or stereo.
 
EStereoKind getStereoKind () const
 Getter for the stereo type of the wire layer Gives the stereo type of the wire. More...
 
double getInnerCylindricalR () const
 Getter for the inner radius of the layer as retrived from the CDCGeometryPar by the inner most layer.
 
double getOuterCylindricalR () const
 Getter for the outer radius of the layer as retrived from the CDCGeometryPar by the outer most layer.
 
double getMiddleCylindricalR () const
 Getter for the radius in the middle of the layer.
 
double getInnerRefZ () const
 Getter for the (fitted) z of the reference wire reference points at the inner cylindricalR of this super layer.
 
double getOuterRefZ () const
 Getter for the (fitted) z of the reference wire reference points at the outer cylindricalR of this super layer.
 
double getRefTanLambda () const
 Getter for (fitted) proporitionality factor between the increasing cylindrical radius and the refernce z coordinate in this superlayer.
 
Closest neighborhood

Note : Not all neighbors might be present at the boundaries of the superlayer.

In case the neighbor asked for does not exist the function return nullptr instead.

WireNeighborKind getNeighborKind (ILayer iLayer, IWire iWire, ILayer iOtherLayer, IWire iOtherWire) const
 Checks if two wires are closest neighbors. More...
 
MayBePtr< const CDCWiregetPrimaryNeighbor (short oClockDirection, ILayer iLayer, IWire iWire) const
 Getter for the two closest neighbors in the given o'clock direction. More...
 
WireNeighborPair getNeighborsOutwards (ILayer iLayer, IWire iWire) const
 Getter for the two closest neighbors in the layer outwards of the given on.
 
WireNeighborPair getNeighborsInwards (ILayer iLayer, IWire iWire) const
 Getter for the two closest neighbors in the layer inwards of the given on.
 
MayBePtr< const CDCWiregetNeighborCCWOutwards (ILayer iLayer, IWire iWire) const
 Getter for the nearest clockwise neighbor in the next layer outwards by wire id and layer id with in this superlayer.
 
MayBePtr< const CDCWiregetNeighborCWOutwards (ILayer iLayer, IWire iWire) const
 Getter for the nearest clockwise neighbor in the next layer outwards by wire id and layer id with in this superlayer.
 
MayBePtr< const CDCWiregetNeighborCW (ILayer iLayer, IWire iWire) const
 Getter for the nearest clockwise neighbor by wire id and layer id with in this superlayer.
 
MayBePtr< const CDCWiregetNeighborCCW (ILayer iLayer, IWire iWire) const
 Getter for the nearest counterclockwise neighbor by wire id and layer id with in this superlayer.
 
MayBePtr< const CDCWiregetNeighborCCWInwards (ILayer iLayer, IWire iWire) const
 Getter for the nearest clockwise neighbor in the next layer outwards by wire id and layer id with in this superlayer.
 
MayBePtr< const CDCWiregetNeighborCWInwards (ILayer iLayer, IWire iWire) const
 Getter for the nearest clockwise neighbor in the next layer outwards by wire id and layer id with in this superlayer.
 
MayBePtr< const CDCWiregetSecondaryNeighbor (short oClockDirection, ILayer iLayer, IWire iWire) const
 getSecondaryNeighbor Secondary neighborhood The secondary neighbors are numbered like positions on the normal twelve hour clock. More...
 
MayBePtr< const CDCWiregetSecondNeighborOneOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the one o'clock position.
 
MayBePtr< const CDCWiregetSecondNeighborTwoOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the two o'clock position.
 
MayBePtr< const CDCWiregetSecondNeighborThreeOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the three o'clock position.
 
MayBePtr< const CDCWiregetSecondNeighborFourOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the four o'clock position.
 
MayBePtr< const CDCWiregetSecondNeighborFiveOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the five o'clock position.
 
MayBePtr< const CDCWiregetSecondNeighborSixOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the six o'clock position.
 
MayBePtr< const CDCWiregetSecondNeighborSevenOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the seven o'clock position.
 
MayBePtr< const CDCWiregetSecondNeighborEightOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the eight o'clock position.
 
MayBePtr< const CDCWiregetSecondNeighborNineOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the nine o'clock position.
 
MayBePtr< const CDCWiregetSecondNeighborTenOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the ten o'clock position.
 
MayBePtr< const CDCWiregetSecondNeighborElevenOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the elven o'clock position.
 
MayBePtr< const CDCWiregetSecondNeighborTwelveOClock (ILayer iLayer, IWire iWire) const
 Getter for secondary neighbor at the twelve o'clock position.
 

Private Attributes

double m_innerRefZ
 Memory for the (fitted) z of the reference wire reference points at the inner cylindricalR of this super layer.
 
double m_outerRefZ
 Memory for the (fitted) z of the reference wire reference points at the outer cylindricalR of this super layer.
 
double m_refTanLambda
 Memory for (fitted) proporitionality factor between the increasing cylindrical radius and the refernce z coordinate in this superlayer.
 

Detailed Description

Class representating a sense wire superlayer in the central drift chamber.

This class represents the a CDC superlayer as a range of wire layers.
The range is sorted with increasing layer ids for maximal fast look up.
It provides methods for checking the validity of layer and wire ids as well as
a getter for the layers and wires in this layer.
Additionally it is iterable as a range of CDCWireLayers.
The superlayer also defines the closest and the secondary neighborhood.
The class does not provide the memory for the wire layers by itself.
It uses iterators into a vector of CDCWireLayers.
The vector of CDCWireLayers is normally provided by the CDCWireTopology object instance.
Note : All possible superlayer object are stored in the CDCWireTopology
which you can get with the static getInstance() functions.
There is rarely a need for constructing a superlayer object and
it should be avoided.

Definition at line 43 of file CDCWireSuperLayer.h.

Member Function Documentation

◆ getNeighborKind()

WireNeighborKind getNeighborKind ( ILayer  iLayer,
IWire  iWire,
ILayer  iOtherLayer,
IWire  iOtherWire 
) const

Checks if two wires are closest neighbors.

see details. Returns the relation of the first wire to the second wire give by their layer id within the superlayer and the wire id.

Definition at line 28 of file CDCWireSuperLayer.cc.

32 {
33  if (not isValidILayer(iLayer)) return WireNeighborKind();
34  if (not isValidILayer(iOtherLayer)) return WireNeighborKind();
35 
36  const ILayer iLayerDifference = iOtherLayer - iLayer;
37  const ILayer absILayerDifference = abs(iLayerDifference);
38  const CDCWireLayer& layer = getWireLayer(iLayer);
39  const CDCWireLayer& otherLayer = getWireLayer(iOtherLayer);
40  const ERotation deltaShift = otherLayer.getShiftDelta(layer);
41  const IWire nWires = layer.size();
42 
43  int iRow = 2 * iWire;
44  int iOtherRow = 2 * iOtherWire + deltaShift;
45  int iRowDelta = symmetricModuloFast(iOtherRow - iRow, 2 * nWires);
46  int absIRowDelta = abs(iRowDelta);
47 
48  if ((absILayerDifference + absIRowDelta) > 4 or absILayerDifference > 2) return WireNeighborKind(); // Invalid case
49  if (absILayerDifference + absIRowDelta == 0) return WireNeighborKind(0, 0);
50 
51  int cellDistance = absILayerDifference == 2 ? 2 : (absILayerDifference + absIRowDelta) / 2;
52 
53  int slope = 0;
54  if (iRowDelta == 0) {
55  slope = 3;
56  } else if (iLayerDifference == 0) {
57  slope = 0;
58  } else if (absIRowDelta == 3) {
59  slope = 1;
60  } else {
61  slope = 2;
62  }
63 
64  if (iRowDelta > 0) {
65  slope = 6 - slope;
66  }
67 
68  if (iLayerDifference > 0) {
69  slope = -slope;
70  }
71 
72  int oClockDirection = moduloFast(slope + 3 , 12);
73  return WireNeighborKind(cellDistance, oClockDirection);
74 }
Class representating a sense wire layer in the central drift chamber.
Definition: CDCWireLayer.h:42
ERotation getShiftDelta(const CDCWireLayer &baseLayer) const
Getter for the relative difference in wire numbering shift.
Definition: CDCWireLayer.h:124
const CDCWireLayer & getWireLayer(ILayer iLayer) const
Gives the layer by its layer id within the superlayer.
bool isValidILayer(ILayer iLayer) const
Checks if the given layer id belongs to a valid layer in this superlayer.
Type for the neighbor relationship from one wire to another.
ERotation
Enumeration to represent the distinct possibilities of the right left passage information.
Definition: ERotation.h:25

◆ getPrimaryNeighbor()

MayBePtr<const CDCWire> getPrimaryNeighbor ( short  oClockDirection,
ILayer  iLayer,
IWire  iWire 
) const
inline

Getter for the two closest neighbors in the given o'clock direction.

Valid values for the o clock direction are 1, 3, 5, 7, 9, 11.

Definition at line 179 of file CDCWireSuperLayer.h.

182  {
183  oClockDirection = modulo(oClockDirection, 12);
184  switch (oClockDirection) {
185  case 1:
186  return getNeighborCWOutwards(iLayer, iWire);
187  case 3:
188  return getNeighborCW(iLayer, iWire);
189  case 5:
190  return getNeighborCWInwards(iLayer, iWire);
191  case 7:
192  return getNeighborCCWInwards(iLayer, iWire);
193  case 9:
194  return getNeighborCCW(iLayer, iWire);
195  case 11:
196  return getNeighborCCWOutwards(iLayer, iWire);
197  default:
198  return nullptr;
199  }
200  }
MayBePtr< const CDCWire > getNeighborCCWOutwards(ILayer iLayer, IWire iWire) const
Getter for the nearest clockwise neighbor in the next layer outwards by wire id and layer id with in ...
MayBePtr< const CDCWire > getNeighborCCWInwards(ILayer iLayer, IWire iWire) const
Getter for the nearest clockwise neighbor in the next layer outwards by wire id and layer id with in ...
MayBePtr< const CDCWire > getNeighborCCW(ILayer iLayer, IWire iWire) const
Getter for the nearest counterclockwise neighbor by wire id and layer id with in this superlayer.
MayBePtr< const CDCWire > getNeighborCWInwards(ILayer iLayer, IWire iWire) const
Getter for the nearest clockwise neighbor in the next layer outwards by wire id and layer id with in ...
MayBePtr< const CDCWire > getNeighborCWOutwards(ILayer iLayer, IWire iWire) const
Getter for the nearest clockwise neighbor in the next layer outwards by wire id and layer id with in ...
MayBePtr< const CDCWire > getNeighborCW(ILayer iLayer, IWire iWire) const
Getter for the nearest clockwise neighbor by wire id and layer id with in this superlayer.

◆ getSecondaryNeighbor()

MayBePtr<const CDCWire> getSecondaryNeighbor ( short  oClockDirection,
ILayer  iLayer,
IWire  iWire 
) const
inline

getSecondaryNeighbor Secondary neighborhood The secondary neighbors are numbered like positions on the normal twelve hour clock.

Due to the hexogonal arrangement of the wires, the secondary neighbors are positioned just like the numbers on the clock if you took the center of the clock to the wire position and the twelve o'clock poing in the outwards direction.

Note : Not all neighbors might be present at the boundaries of the superlayer. In case the neighbor asked for does not exist, the functions return nullptr instead.

Definition at line 245 of file CDCWireSuperLayer.h.

◆ getStereoKind()

EStereoKind getStereoKind ( ) const
inline

Getter for the stereo type of the wire layer Gives the stereo type of the wire.


Result is one of EStereoKind::c_Axial, EStereoKind::c_StereoU and EStereoKind::c_StereoV.
The stereo type is shared by all wires in the same superlayer.
The superlayer pattern for Belle II is AUAVAUAVA according the TDR

Definition at line 128 of file CDCWireSuperLayer.h.


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