Belle II Software  release-08-01-10
CDCChannelMap.h
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 #pragma once
9 
10 #include <TObject.h>
11 #include <cdc/dataobjects/WireID.h>
12 
13 namespace Belle2 {
22  class CDCChannelMap: public TObject {
23  public:
24 
29  m_wire(65535), m_board(0), m_channel(0)
30  {}
31 
35  CDCChannelMap(unsigned short slayer, unsigned short layer,
36  unsigned short wire,
37  unsigned short board, unsigned short channel):
38  m_wire(WireID(slayer, layer, wire).getEWire()),
39  m_board(board), m_channel(channel)
40  {
41 
42  }
43 
47  unsigned getBoardID() const {return m_board;}
48 
52  unsigned getBoardChannel() const {return m_channel;}
53 
57  unsigned short getISuperLayer() const
58  {
59  return (m_wire / 4096);
60  }
61 
65  unsigned short getILayer() const
66  {
67  return ((m_wire % 4096) / 512);
68  }
69 
73  unsigned short getIWire() const
74  {
75  return (m_wire % 512);
76  }
77 
78  private:
79  unsigned short m_wire;
80  unsigned short m_board;
81  unsigned short m_channel;
85  };
86 
88 } // end namespace Belle2
Database object of CDC channel map.
Definition: CDCChannelMap.h:22
unsigned short m_wire
Wire ID.
Definition: CDCChannelMap.h:79
unsigned short m_channel
Channel ID.
Definition: CDCChannelMap.h:81
CDCChannelMap()
Default constructor.
Definition: CDCChannelMap.h:28
ClassDef(CDCChannelMap, 2)
ClassDef.
unsigned short getIWire() const
Get wire ID.
Definition: CDCChannelMap.h:73
CDCChannelMap(unsigned short slayer, unsigned short layer, unsigned short wire, unsigned short board, unsigned short channel)
Constructor.
Definition: CDCChannelMap.h:35
unsigned getBoardChannel() const
Get channel.
Definition: CDCChannelMap.h:52
unsigned short getISuperLayer() const
Get super layer ID.
Definition: CDCChannelMap.h:57
unsigned getBoardID() const
Get Board ID.
Definition: CDCChannelMap.h:47
unsigned short getILayer() const
Get layer ID.
Definition: CDCChannelMap.h:65
unsigned short m_board
Board ID.
Definition: CDCChannelMap.h:80
Class to identify a wire inside the CDC.
Definition: WireID.h:34
Abstract base class for different kinds of events.