Belle II Software  release-05-02-19
WireID.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Heck *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include "cdc/dataobjects/WireID.h"
12 
13 using namespace Belle2;
14 using namespace std;
15 
16 void WireID::setWireID(const unsigned short iCLayer, const unsigned short iWire)
17 {
18  B2DEBUG(250, "setWireID called with " << iCLayer << ", " << iWire);
19  if (iCLayer < 8) {
20  setWireID(0, iCLayer, iWire);
21  } else {
22  setWireID(((iCLayer - 8) / 6) + 1, (iCLayer - 2) % 6, iWire);
23  }
24 }
25 
26 unsigned short WireID::getICLayer() const
27 {
28  if (getISuperLayer() == 0) { return getILayer(); }
29  return 8 + (getISuperLayer() - 1) * 6 + getILayer();
30 }
31 
32 WireID::WireID(const unsigned short iCLayer, const unsigned short iWire)
33 {
34  setWireID(iCLayer, iWire);
35 }
36 
37 WireID::WireID(const unsigned short iSuperLayer, const unsigned short iLayer, const unsigned short iWire)
38 {
39  setWireID(iSuperLayer, iLayer, iWire);
40 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::WireID::WireID
WireID(unsigned short eWire=65535)
Constructor taking the encoded wire number.
Definition: WireID.h:55
Belle2::WireID::setWireID
void setWireID(unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire)
Setter using official numbering.
Definition: WireID.h:122
Belle2::WireID::getICLayer
unsigned short getICLayer() const
Getter for continuous layer numbering.
Definition: WireID.cc:26