Belle II Software  release-05-01-25
IWire.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/numerics/Modulo.h>
13 
14 namespace Belle2 {
19  namespace TrackFindingCDC {
20 
22  using IWire = signed short;
23 
28  struct IWireUtil {
39  static IWire wrappedAround(IWire iWire, IWire nWires)
40  {
41  return moduloFast(iWire, nWires);
42  }
43 
45  static IWire getNextCCW(IWire iWire, IWire nWires)
46  {
47  return wrappedAround(iWire + 1, nWires);
48  }
49 
51  static IWire getNextCW(IWire iWire, IWire nWires)
52  {
53  return wrappedAround(iWire - 1, nWires);
54  }
55  };
56  }
58 }
Belle2::TrackFindingCDC::IWireUtil::wrappedAround
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:47
Belle2::TrackFindingCDC::IWireUtil::getNextCW
static IWire getNextCW(IWire iWire, IWire nWires)
Gets the next clockwise wire id properly wrapping near the wire of index zero.
Definition: IWire.h:59
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::IWireUtil::getNextCCW
static IWire getNextCCW(IWire iWire, IWire nWires)
Gets the next counter clockwise wire id properly wrapping near wire of highest index.
Definition: IWire.h:53