Belle II Software  release-08-01-10
CDCTriggerMLPData.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 #include <trg/cdc/dataobjects/CDCTriggerMLPData.h>
9 
10 using namespace Belle2;
11 
12 void
13 CDCTriggerMLPData::addHit(unsigned iSL, int iTS)
14 {
15  if (iSL < m_hitCounters.size()) {
16  int N = m_hitCounters[iSL].size();
17  // shift negative indices
18  if (iTS < 0) iTS += N;
19  // check the range
20  // 0, N: hit is on the track
21  // [0, N/4]: hit is in quadrant left of the track
22  // [N/4, 3N/4]: hit is in hemisphere opposite of the track (skipped)
23  // [3N/4, N]: hit is in quadrant right of the track
24  if ((0 <= iTS && iTS <= N / 4) || (3 * N / 4 <= iTS && iTS < N)) {
25  ++m_hitCounters[iSL][iTS];
26  }
27  }
28 }
29 
30 unsigned short
31 CDCTriggerMLPData::getHitCounter(unsigned iSL, int iTS) const
32 {
33  if (iSL < m_hitCounters.size()) {
34  if (iTS < 0) iTS += m_hitCounters[iSL].size();
35  if (0 <= iTS && (unsigned)iTS < m_hitCounters[iSL].size()) {
36  return m_hitCounters[iSL][iTS];
37  }
38  }
39  return 0;
40 }
void addHit(unsigned iSL, int iTS)
increase counter for super layer and track segment number in super layer.
std::vector< std::vector< unsigned short > > m_hitCounters
hit counter of active track segment IDs, used to determine the relevant id range for an MLP.
unsigned short getHitCounter(unsigned iSL, int iTS) const
get hit counter for super layer and track segment number is super layer.
Abstract base class for different kinds of events.