Belle II Software development
IWire.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <tracking/trackFindingCDC/numerics/Modulo.h>
11
12namespace Belle2 {
17 namespace TrackFindingCDC {
18
20 using IWire = signed short;
21
26 struct IWireUtil {
37 static IWire wrappedAround(IWire iWire, IWire nWires)
38 {
39 return moduloFast(iWire, nWires);
40 }
41
43 static IWire getNextCCW(IWire iWire, IWire nWires)
44 {
45 return wrappedAround(iWire + 1, nWires);
46 }
47
49 static IWire getNextCW(IWire iWire, IWire nWires)
50 {
51 return wrappedAround(iWire - 1, nWires);
52 }
53 };
54 }
56}
Abstract base class for different kinds of events.
This is a utility class for the free IWire type.
Definition: IWire.h:26
static IWire getNextCW(IWire iWire, IWire nWires)
Gets the next clockwise wire id properly wrapping near the wire of index zero.
Definition: IWire.h:49
static IWire wrappedAround(IWire iWire, IWire nWires)
Wraps the given in layer wire index by the total number of wires in this layer.
Definition: IWire.h:37
static IWire getNextCCW(IWire iWire, IWire nWires)
Gets the next counter clockwise wire id properly wrapping near wire of highest index.
Definition: IWire.h:43