Belle II Software  release-08-01-10
WireID.cc
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 
9 #include "cdc/dataobjects/WireID.h"
10 
11 using namespace Belle2;
12 using namespace std;
13 
14 void WireID::setWireID(const unsigned short iCLayer, const unsigned short iWire)
15 {
16  B2DEBUG(250, "setWireID called with " << iCLayer << ", " << iWire);
17  if (iCLayer < 8) {
18  setWireID(0, iCLayer, iWire);
19  } else {
20  setWireID(((iCLayer - 8) / 6) + 1, (iCLayer - 2) % 6, iWire);
21  }
22 }
23 
24 unsigned short WireID::getICLayer() const
25 {
26  if (getISuperLayer() == 0) { return getILayer(); }
27  return 8 + (getISuperLayer() - 1) * 6 + getILayer();
28 }
29 
30 WireID::WireID(const unsigned short iCLayer, const unsigned short iWire)
31 {
32  setWireID(iCLayer, iWire);
33 }
34 
35 WireID::WireID(const unsigned short iSuperLayer, const unsigned short iLayer, const unsigned short iWire)
36 {
37  setWireID(iSuperLayer, iLayer, iWire);
38 }
unsigned short getICLayer() const
Getter for continuous layer numbering.
Definition: WireID.cc:24
WireID(unsigned short eWire=65535)
Constructor taking the encoded wire number.
Definition: WireID.h:45
void setWireID(unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire)
Setter using official numbering.
Definition: WireID.h:112
Abstract base class for different kinds of events.