ATLAS Offline Software
Loading...
Searching...
No Matches
MdtId.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef DCMATH_MDTID_H
6#define DCMATH_MDTID_H
7
9
10#include <ostream>
11
12namespace TrkDriftCircleMath {
13
14 class MdtId {
15 public:
18 static constexpr int multiLayerShift = 10000;
19 static constexpr int stationShift = 100000;
20
21 MdtId() = default;
27 MdtId(bool isBarrel, int ml, int lay, int tube) {
29 }
30 bool isBarrel() const { return m_id / stationShift; }
31 int ml() const { return (m_id % stationShift) / multiLayerShift; }
32 int lay() const { return (m_id % multiLayerShift) / maxNTubesPerLayer; }
33 int tube() const { return (m_id % multiLayerShift) % maxNTubesPerLayer; }
34 int value() const { return m_id; }
35
36 bool operator==(const MdtId& other) const { return m_id == other.m_id; }
37 bool operator!=(const MdtId& other) const { return !(*this == other); }
38
39 private:
40 int m_id{0};
41 };
42
43 // DR (clang32) operator<< to be defined inside the namespace
44 std::ostream& operator<<(std::ostream& os, const MdtId& id);
45
46} // namespace TrkDriftCircleMath
47
48#endif
static constexpr int maxNTubesPerLayer
The maxNTubesPerLayer represents the absolute maximum of tubes which are built into a single multilay...
Definition MdtIdHelper.h:68
static constexpr int multiLayerShift
Definition MdtId.h:18
static constexpr int maxNTubesPerLayer
the tube number of a tube in a tubeLayer in encoded in the GeoSerialIdentifier (modulo maxNTubesPerLa...
Definition MdtId.h:17
static constexpr int stationShift
Definition MdtId.h:19
MdtId(bool isBarrel, int ml, int lay, int tube)
Parameters:
Definition MdtId.h:27
bool isBarrel() const
Definition MdtId.h:30
bool operator!=(const MdtId &other) const
Definition MdtId.h:37
int value() const
Definition MdtId.h:34
bool operator==(const MdtId &other) const
Definition MdtId.h:36
Function object to check whether two Segments are sub/super sets or different.
std::ostream & operator<<(std::ostream &os, const TrkDriftCircleMath::ClusterId &id)
Definition ClusterId.cxx:9