8#include <cdc/topology/CDCWireSuperLayer.h>
10#include <tracking/trackingUtilities/numerics/Modulo.h>
14using namespace TrackingUtilities;
32 IWire iOtherWire)
const
37 const ILayer iLayerDifference = iOtherLayer - iLayer;
38 const ILayer absILayerDifference = abs(iLayerDifference);
42 const IWire nWires = layer.size();
45 int iOtherRow = 2 * iOtherWire + deltaShift;
46 int iRowDelta = symmetricModuloFast(iOtherRow - iRow, 2 * nWires);
47 int absIRowDelta = abs(iRowDelta);
49 if ((absILayerDifference + absIRowDelta) > 4 or absILayerDifference > 2)
return WireNeighborKind();
52 int cellDistance = absILayerDifference == 2 ? 2 : (absILayerDifference + absIRowDelta) / 2;
57 }
else if (iLayerDifference == 0) {
59 }
else if (absIRowDelta == 3) {
69 if (iLayerDifference > 0) {
73 int oClockDirection = moduloFast(slope + 3, 12);
83 const ERotation deltaShift = neighborLayer.
getShiftDelta(layer);
85 if (deltaShift == ERotation::c_CounterClockwise) {
88 }
else if (deltaShift == ERotation::c_Clockwise) {
92 B2WARNING(
"Wire numbering shift bigger than one in magnitude. Adjust getNeighbor functions " <<
static_cast<int>(deltaShift));
93 B2WARNING(
"From iLayer " << iLayer <<
" and wire " << iWire <<
" to iLayer " << iLayer - 1);
105 const ERotation deltaShift = neighborLayer.
getShiftDelta(layer);
107 if (deltaShift == ERotation::c_CounterClockwise) {
110 }
else if (deltaShift == ERotation::c_Clockwise) {
114 B2WARNING(
"Wire numbering shift bigger than one in magnitude. Adjust getNeighbor functions " <<
static_cast<int>(deltaShift));
115 B2WARNING(
"From iLayer " << iLayer <<
" and wire " << iWire <<
" to iLayer " << iLayer + 1);
Class representing a sense wire layer in the central drift chamber.
TrackingUtilities::ERotation getShiftDelta(const CDCWireLayer &baseLayer) const
Getter for the relative difference in wire numbering shift.
const CDCWire & getWireWrappedAround(IWire iWire) const
Returns the wire by its id in the layer.
double m_refTanLambda
Memory for (fitted) proportionality factor between the increasing cylindrical radius and the referenc...
void initialize()
Initializes the superlayer variables of according the layer range. Set the numbering shift of contain...
double m_outerRefZ
Memory for the (fitted) z of the reference wire reference points at the outer cylindricalR of this su...
double m_innerRefZ
Memory for the (fitted) z of the reference wire reference points at the inner cylindricalR of this su...
WireNeighborPair getNeighborsOutwards(ILayer iLayer, IWire iWire) const
Getter for the two closest neighbors in the layer outwards of the given on.
CDCWireSuperLayer()
Empty constructor for creating an empty dummy CDCWireSuperLayer for studies with a CDC with missing s...
bool isValidILayer(ILayer iLayer) const
Checks if the given layer id belongs to a valid layer in this superlayer.
const CDCWireLayer & getWireLayer(ILayer iLayer) const
Gives the layer by its layer id within the superlayer.
WireNeighborKind getNeighborKind(ILayer iLayer, IWire iWire, ILayer iOtherLayer, IWire iOtherWire) const
Checks if two wires are closest neighbors.
TrackingUtilities::ConstVectorRange< CDCWireLayer > Super
Type of the base class.
WireNeighborPair getNeighborsInwards(ILayer iLayer, IWire iWire) const
Getter for the two closest neighbors in the layer inwards of the given on.
Type for the neighbor relationship from one wire to another.
Class representing a pair of neighbors in the CDC in a single layer For certain circumstances it is a...
signed short IWire
The type of the wire ids enumerating wires within a given layer.
signed short ILayer
The type of the layer ids enumerating layers within a superlayer.
Abstract base class for different kinds of events.