Belle II Software development
ROIrawID.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 <arpa/inet.h>
10#include <tracking/dataobjects/ROIrawID.h>
11using namespace Belle2;
12
14{
15 // return ROIrawID::baseType htobe64(m_rawID.id);
16
17 uint32_t low_host, hi_host;
18 uint64_t low_be, hi_be;
19
20 /* Return immediately if byte order is big endian. */
21 if (htonl(0x01020304) == 0x01020304)
22 return m_rawID.id;
23 /* Change byte order in low and high words. */
24 low_host = m_rawID.id & 0x00000000FFFFFFFF;
25 hi_host = (m_rawID.id & 0xFFFFFFFF00000000) >> 32;
26 low_be = htonl(low_host);
27 hi_be = htonl(hi_host);
28 /* Exchange low and high words. */
29 return (ROIrawID::baseType)(low_be << 32 | hi_be);
30}
uint64_t baseType
base type
Definition: ROIrawID.h:28
union Belle2::ROIrawID::@301 m_rawID
raw ID
baseType getBigEndian() const
get bigEndian
Definition: ROIrawID.cc:13
Abstract base class for different kinds of events.