Belle II Software development
WireID Class Reference

Class to identify a wire inside the CDC. More...

#include <WireID.h>

Inheritance diagram for WireID:

Public Member Functions

 WireID (unsigned short eWire=65535)
 Constructor taking the encoded wire number.
 
 WireID (const WireID &wireID)
 Copy constructor.
 
 WireID (unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire)
 Constructor using the official numbering scheme.
 
 WireID (unsigned short iCLayer, unsigned short iWire)
 Constructor using continuous layer numbers as used in the geometry build-up for the simulation.
 
WireIDoperator= (const WireID &wireID)
 Assignment operator.
 
WireIDoperator= (unsigned short eWire)
 Assignment from unsigned short.
 
 operator unsigned short () const
 Convert to unsigned short.
 
bool operator== (const WireID &rhs) const
 Check for equality.
 
bool operator< (const WireID &rhs) const
 Order by unique id.
 
void setWireID (unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire)
 Setter using official numbering.
 
void setWireID (unsigned short iCLayer, unsigned short iWire)
 Setter using numbering of geometry build-up.
 
void setWireID (unsigned short eWire)
 Setter using the encoded wire number.
 
unsigned short getISuperLayer () const
 Getter for Super-Layer.
 
unsigned short getILayer () const
 Getter for layer within the Super-Layer.
 
unsigned short getIWire () const
 Getter for wire within the layer.
 
unsigned short getICLayer () const
 Getter for continuous layer numbering.
 
unsigned short getEWire () const
 Getter for encoded wire number.
 

Private Member Functions

 ClassDef (WireID, 2)
 ROOT Macro.
 

Private Attributes

unsigned short m_eWire
 Internal storage for the wire identifier in the encoded form.
 

Detailed Description

Class to identify a wire inside the CDC.

There are three representations for this:

  • Super-Layer, Layer within the Super-Layer, Wire within the Layer as documented here,
  • Layer as continuous counted through all Super-Layers, Wire within the Layer,
  • Wire number encoded into a single unsigned short. This works as following:
    SuperLayer: bits 1 - 4 (/4096)
    Layer: bits 5 - 7 (% 4096, / 512)
    Wire: bits 8 - 16 (% 512)
    Note: These operations could as well be achieved by bit-shifting operations.

Definition at line 34 of file WireID.h.

Constructor & Destructor Documentation

◆ WireID() [1/4]

WireID ( unsigned short  eWire = 65535)
inlineexplicit

Constructor taking the encoded wire number.

Parameters
eWireNumber of wire using the encoded format. Careful - wires are not continuously within the encoded number. The default is set to the maximum allowed value, as 0 corresponds already to some wire. This assigned value does NOT correspond to any real wire.

Definition at line 45 of file WireID.h.

46 {
47 m_eWire = eWire;
48 }
unsigned short m_eWire
Internal storage for the wire identifier in the encoded form.
Definition: WireID.h:161

◆ WireID() [2/4]

WireID ( const WireID wireID)
inline

Copy constructor.

Definition at line 51 of file WireID.h.

51 : TObject(wireID)
52 {
53 m_eWire = wireID.m_eWire;
54 }

◆ WireID() [3/4]

WireID ( unsigned short  iSuperLayer,
unsigned short  iLayer,
unsigned short  iWire 
)

Constructor using the official numbering scheme.

Parameters
iSuperLayerNumber of Super-Layer.
iLayerNumber of Layer within the Super-Layer.
iWireWire number within the layer.

Definition at line 35 of file WireID.cc.

36{
37 setWireID(iSuperLayer, iLayer, iWire);
38}
void setWireID(unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire)
Setter using official numbering.
Definition: WireID.h:112

◆ WireID() [4/4]

WireID ( unsigned short  iCLayer,
unsigned short  iWire 
)

Constructor using continuous layer numbers as used in the geometry build-up for the simulation.

Parameters
iCLayerNumber of Layer counted continuously over the full CDC.
iWireNumber of Wire within the layer equivalenty to the official numbering.

Definition at line 30 of file WireID.cc.

31{
32 setWireID(iCLayer, iWire);
33}

Member Function Documentation

◆ getEWire()

unsigned short getEWire ( ) const
inline

Getter for encoded wire number.

Definition at line 154 of file WireID.h.

155 {
156 return m_eWire;
157 }

◆ getICLayer()

unsigned short getICLayer ( ) const

Getter for continuous layer numbering.

Definition at line 24 of file WireID.cc.

25{
26 if (getISuperLayer() == 0) { return getILayer(); }
27 return 8 + (getISuperLayer() - 1) * 6 + getILayer();
28}
unsigned short getISuperLayer() const
Getter for Super-Layer.
Definition: WireID.h:130
unsigned short getILayer() const
Getter for layer within the Super-Layer.
Definition: WireID.h:136

◆ getILayer()

unsigned short getILayer ( ) const
inline

Getter for layer within the Super-Layer.

Definition at line 136 of file WireID.h.

137 {
138 return ((m_eWire % 4096) / 512);
139 }

◆ getISuperLayer()

unsigned short getISuperLayer ( ) const
inline

Getter for Super-Layer.

Definition at line 130 of file WireID.h.

131 {
132 return (m_eWire / 4096);
133 }

◆ getIWire()

unsigned short getIWire ( ) const
inline

Getter for wire within the layer.

This getter works for the official numbering scheme as well as the one used in the geometry build-up.

Definition at line 145 of file WireID.h.

146 {
147 return (m_eWire % 512);
148 }

◆ operator unsigned short()

operator unsigned short ( ) const
inline

Convert to unsigned short.

Definition at line 92 of file WireID.h.

93 {
94 return getEWire();
95 }
unsigned short getEWire() const
Getter for encoded wire number.
Definition: WireID.h:154

◆ operator<()

bool operator< ( const WireID rhs) const
inline

Order by unique id.

Definition at line 104 of file WireID.h.

105 {
106 return getEWire() < rhs.getEWire();
107 }

◆ operator=() [1/2]

WireID & operator= ( const WireID wireID)
inline

Assignment operator.

Definition at line 74 of file WireID.h.

75 {
76 m_eWire = wireID.m_eWire;
77 static_cast<TObject>(*this) = wireID;
78 return *this;
79 }

◆ operator=() [2/2]

WireID & operator= ( unsigned short  eWire)
inline

Assignment from unsigned short.

Parameters
eWireThis parameter should be the wire number in the encoded format.

Definition at line 85 of file WireID.h.

86 {
87 m_eWire = eWire;
88 return *this;
89 }

◆ operator==()

bool operator== ( const WireID rhs) const
inline

Check for equality.

Definition at line 98 of file WireID.h.

99 {
100 return getEWire() == rhs.getEWire();
101 }

◆ setWireID() [1/3]

void setWireID ( unsigned short  eWire)
inline

Setter using the encoded wire number.

Definition at line 122 of file WireID.h.

123 {
124 B2DEBUG(250, "setWireID called with " << eWire);
125 m_eWire = eWire;
126 }

◆ setWireID() [2/3]

void setWireID ( unsigned short  iCLayer,
unsigned short  iWire 
)

Setter using numbering of geometry build-up.

Definition at line 14 of file WireID.cc.

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}

◆ setWireID() [3/3]

void setWireID ( unsigned short  iSuperLayer,
unsigned short  iLayer,
unsigned short  iWire 
)
inline

Setter using official numbering.

Definition at line 112 of file WireID.h.

113 {
114 B2DEBUG(250, "setWireID called with " << iSuperLayer << ", " << iLayer << ", " << iWire);
115 m_eWire = iWire + 512 * iLayer + 4096 * iSuperLayer;
116 }

Member Data Documentation

◆ m_eWire

unsigned short m_eWire
private

Internal storage for the wire identifier in the encoded form.

Definition at line 161 of file WireID.h.


The documentation for this class was generated from the following files: