8#include <tracking/trackFindingCDC/topology/CDCWireSuperLayer.h>
10#include <tracking/trackFindingCDC/numerics/Modulo.h>
13using namespace TrackFindingCDC;
31 IWire iOtherWire)
const
36 const ILayer iLayerDifference = iOtherLayer - iLayer;
37 const ILayer absILayerDifference = abs(iLayerDifference);
41 const IWire nWires = layer.size();
44 int iOtherRow = 2 * iOtherWire + deltaShift;
45 int iRowDelta = symmetricModuloFast(iOtherRow - iRow, 2 * nWires);
46 int absIRowDelta = abs(iRowDelta);
48 if ((absILayerDifference + absIRowDelta) > 4 or absILayerDifference > 2)
return WireNeighborKind();
51 int cellDistance = absILayerDifference == 2 ? 2 : (absILayerDifference + absIRowDelta) / 2;
56 }
else if (iLayerDifference == 0) {
58 }
else if (absIRowDelta == 3) {
68 if (iLayerDifference > 0) {
72 int oClockDirection = moduloFast(slope + 3 , 12);
84 if (deltaShift == ERotation::c_CounterClockwise) {
87 }
else if (deltaShift == ERotation::c_Clockwise) {
91 B2WARNING(
"Wire numbering shift bigger than one in magnitude. Adjust getNeighbor functions " <<
static_cast<int>(deltaShift));
92 B2WARNING(
"From iLayer " << iLayer <<
" and wire " << iWire <<
" to iLayer " << iLayer - 1);
106 if (deltaShift == ERotation::c_CounterClockwise) {
109 }
else if (deltaShift == ERotation::c_Clockwise) {
113 B2WARNING(
"Wire numbering shift bigger than one in magnitude. Adjust getNeighbor functions " <<
static_cast<int>(deltaShift));
114 B2WARNING(
"From iLayer " << iLayer <<
" and wire " << iWire <<
" to iLayer " << iLayer + 1);
Class representing a sense wire layer in the central drift chamber.
const CDCWire & getWireWrappedAround(IWire iWire) const
Returns the wire by its id in the layer.
ERotation getShiftDelta(const CDCWireLayer &baseLayer) const
Getter for the relative difference in wire numbering shift.
void initialize()
Initializes the superlayer variables of according the layer range. Set the numbering shift of contain...
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.
WireNeighborPair getNeighborsInwards(ILayer iLayer, IWire iWire) const
Getter for the two closest neighbors in the layer inwards of the given on.
A pair of iterators usable with the range base for loop.
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...
ERotation
Enumeration to represent the distinct possibilities of the right left passage information.
Abstract base class for different kinds of events.