Project
Loading...
Searching...
No Matches
ClusterID.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef ALICEO2_ITSMFT_CLUSTERID_H
17#define ALICEO2_ITSMFT_CLUSTERID_H
18
19namespace o2::itsmft
20{
21
22// max number of layers for which the ITS/MFT clusters, ROF records and patterns can be provided separately
23constexpr int MaxITSClusLayers = 7;
24constexpr int MaxMFTClusLayers = 10;
26
33constexpr int ClusLayerShift = 27;
34constexpr int ClusIndexMask = (0x1 << ClusLayerShift) - 1;
35static_assert((1 << (31 - ClusLayerShift)) >= MaxClusLayers, "ClusLayerShift leaves no room for the layer ID");
36
37constexpr int composeClusID(int lr, int idx) { return (lr << ClusLayerShift) + idx; }
38constexpr int clusID2Layer(int id) { return id >> ClusLayerShift; }
39constexpr int clusID2Index(int id) { return id & ClusIndexMask; }
40
41} // namespace o2::itsmft
42
43#endif
constexpr int clusID2Layer(int id)
Definition ClusterID.h:38
constexpr int MaxITSClusLayers
Definition ClusterID.h:23
constexpr int composeClusID(int lr, int idx)
Definition ClusterID.h:37
constexpr int MaxMFTClusLayers
Definition ClusterID.h:24
constexpr int MaxClusLayers
Definition ClusterID.h:25
constexpr int clusID2Index(int id)
Definition ClusterID.h:39
constexpr int ClusIndexMask
Definition ClusterID.h:34
constexpr int ClusLayerShift
Definition ClusterID.h:33