Belle II Software development
TOPAsicMask.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
9#include <top/dataobjects/TOPAsicMask.h>
10
11namespace Belle2 {
17 bool TOPAsicMask::isActive(int moduleID, unsigned channel) const
18 {
19 if (m_masks.empty()) return true;
20
21 unsigned asic = channel / 8;
22 unsigned bs = (moduleID - 1) * 4 + asic / 16;
23 if (bs >= m_masks.size()) return true;
24
25 unsigned word = m_masks[bs];
26 unsigned bit = asic % 16;
27 return ((word >> bit) & 0x1) == 0;
28 }
29
31} // end namespace Belle2
32
std::vector< unsigned short > m_masks
bit fields of masked ASIC's (one per BS)
Definition: TOPAsicMask.h:54
bool isActive(int moduleID, unsigned channel) const
Returns true if channel is not explicitely labeled as masked.
Definition: TOPAsicMask.cc:17
Abstract base class for different kinds of events.