Belle II Software development
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
11using namespace Belle2;
12using namespace std;
13
14void 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
24unsigned short WireID::getICLayer() const
25{
26 if (getISuperLayer() == 0) { return getILayer(); }
27 return 8 + (getISuperLayer() - 1) * 6 + getILayer();
28}
29
30WireID::WireID(const unsigned short iCLayer, const unsigned short iWire)
31{
32 setWireID(iCLayer, iWire);
33}
34
35WireID::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
unsigned short getISuperLayer() const
Getter for Super-Layer.
Definition: WireID.h:130
WireID(unsigned short eWire=65535)
Constructor taking the encoded wire number.
Definition: WireID.h:45
unsigned short getILayer() const
Getter for layer within the Super-Layer.
Definition: WireID.h:136
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.
STL namespace.