Belle II Software  release-05-01-25
CDCTriggerSegmentHit.cc
1 #include <trg/cdc/dataobjects/CDCTriggerSegmentHit.h>
2 
3 using namespace Belle2;
4 
6  unsigned short priorityPosition,
7  unsigned short leftRight,
8  short priorityTime,
9  short fastestTime,
10  short foundTime,
11  short quadrant):
12  m_segmentID(segmentID), m_priorityPosition(priorityPosition), m_leftRight(leftRight),
13  m_priorityTime(priorityTime), m_fastestTime(fastestTime), m_foundTime(foundTime), m_quadrant(quadrant)
14 {
15  // find super layer and local wire id
16  std::array<int, 9> nWiresInSuperLayer = {
17  160, 160, 192, 224, 256, 288, 320, 352, 384
18  };
19  unsigned short iSL = 0;
20  unsigned short iWire = segmentID;
21  while (iWire >= nWiresInSuperLayer[iSL]) {
22  iWire -= nWiresInSuperLayer[iSL];
23  iSL += 1;
24  }
25  // shift from center wire to priority wire
26  if (priorityPosition == 1) {
27  if (iWire == 0)
28  iWire = nWiresInSuperLayer[iSL] - 1;
29  else
30  iWire -= 1;
31  }
32  unsigned short iLayer = (iSL == 0) ? 3 : 2;
33  if (priorityPosition == 1 || priorityPosition == 2)
34  iLayer += 1;
35  m_eWire = WireID(iSL, iLayer, iWire).getEWire();
36 }
37 
39  unsigned short iWire,
40  unsigned short priorityPosition,
41  unsigned short leftRight,
42  short priorityTime,
43  short fastestTime,
44  short foundTime,
45  short quadrant):
46  m_priorityPosition(priorityPosition), m_leftRight(leftRight),
47  m_priorityTime(priorityTime), m_fastestTime(fastestTime), m_foundTime(foundTime), m_quadrant(quadrant)
48 {
49  // calculate continuous segment ID
50  std::array<int, 9> nWiresInSuperLayer = {
51  160, 160, 192, 224, 256, 288, 320, 352, 384
52  };
53  m_segmentID = iWire;
54  for (unsigned i = 0; i < iSL; ++i) {
55  m_segmentID += nWiresInSuperLayer[i];
56  }
57  // shift from center wire to priority wire
58  if (priorityPosition == 1) {
59  if (iWire == 0)
60  iWire = nWiresInSuperLayer[iSL] - 1;
61  else
62  iWire -= 1;
63  }
64  unsigned short iLayer = (iSL == 0) ? 3 : 2;
65  if (priorityPosition == 1 || priorityPosition == 2)
66  iLayer += 1;
67  m_eWire = WireID(iSL, iLayer, iWire).getEWire();
68 }
69 
71  unsigned short segmentID,
72  unsigned short priorityPosition,
73  unsigned short leftRight,
74  short priorityTime,
75  short fastestTime,
76  short foundTime,
77  short quadrant):
78  m_segmentID(segmentID), m_priorityPosition(priorityPosition), m_leftRight(leftRight),
79  m_priorityTime(priorityTime), m_fastestTime(fastestTime), m_foundTime(foundTime),
80  m_eWire(priorityHit.getID()), m_quadrant(quadrant)
81 {}
82 
83 unsigned short
85 {
86  std::array<int, 9> nWiresInSuperLayer = {
87  160, 160, 192, 224, 256, 288, 320, 352, 384
88  };
89  unsigned short iWire = getIWire();
90  unsigned short iSL = getISuperLayer();
91  if (m_priorityPosition == 1) {
92  iWire += 1;
93  if (iWire == nWiresInSuperLayer[iSL]) {
94  iWire = 0;
95  }
96  }
97  return iWire;
98 }
Belle2::CDCTriggerSegmentHit::getISuperLayer
unsigned short getISuperLayer() const
get super layer number.
Definition: CDCTriggerSegmentHit.h:80
Belle2::WireID
Class to identify a wire inside the CDC.
Definition: WireID.h:44
Belle2::CDCTriggerSegmentHit::getIWire
unsigned short getIWire() const
get wire number of priority wire within layer.
Definition: CDCTriggerSegmentHit.h:90
Belle2::WireID::getEWire
unsigned short getEWire() const
Getter for encoded wire number.
Definition: WireID.h:164
Belle2::CDCHit
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:51
Belle2::getID
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
Definition: calibTools.h:71
Belle2::CDCTriggerSegmentHit::m_eWire
unsigned short m_eWire
Wire encoding of the priority wire.
Definition: CDCTriggerSegmentHit.h:128
Belle2::CDCTriggerSegmentHit::getIWireCenter
unsigned short getIWireCenter() const
get wire number of center wire within layer.
Definition: CDCTriggerSegmentHit.cc:84
Belle2::CDCTriggerSegmentHit::m_priorityPosition
unsigned short m_priorityPosition
position of the priority cell as an id: 0: no hit, 3: 1st priority, 1: 2nd right, 2: 2nd left
Definition: CDCTriggerSegmentHit.h:115
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CDCTriggerSegmentHit::m_segmentID
unsigned short m_segmentID
continuous ID of the track segment
Definition: CDCTriggerSegmentHit.h:112
Belle2::CDCTriggerSegmentHit::CDCTriggerSegmentHit
CDCTriggerSegmentHit()
default constructor.
Definition: CDCTriggerSegmentHit.h:19