ATLAS Offline Software
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 
12 namespace 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
TrkDriftCircleMath::MdtId::stationShift
static constexpr int stationShift
Definition: MdtId.h:19
TrkDriftCircleMath::MdtId::lay
int lay() const
Definition: MdtId.h:32
TrkDriftCircleMath::MdtId::maxNTubesPerLayer
static constexpr int maxNTubesPerLayer
the tube number of a tube in a tubeLayer in encoded in the GeoSerialIdentifier (modulo maxNTubesPerLa...
Definition: MdtId.h:17
TrkDriftCircleMath::MdtId::operator!=
bool operator!=(const MdtId &other) const
Definition: MdtId.h:37
TrkDriftCircleMath::MdtId
Definition: MdtId.h:14
TrkDriftCircleMath::MdtId::MdtId
MdtId(bool isBarrel, int ml, int lay, int tube)
Parameters:
Definition: MdtId.h:27
TrkDriftCircleMath
Function object to check whether two Segments are sub/super sets or different.
Definition: IMdtSegmentFinder.h:13
TrkDriftCircleMath::MdtId::ml
int ml() const
Definition: MdtId.h:31
TrkDriftCircleMath::MdtId::operator==
bool operator==(const MdtId &other) const
Definition: MdtId.h:36
TrkDriftCircleMath::MdtId::MdtId
MdtId()=default
TrkDriftCircleMath::operator<<
std::ostream & operator<<(std::ostream &os, const TrkDriftCircleMath::ClusterId &id)
Definition: ClusterId.cxx:9
TrkDriftCircleMath::MdtId::value
int value() const
Definition: MdtId.h:34
MdtIdHelper.h
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
TrkDriftCircleMath::MdtId::m_id
int m_id
Definition: MdtId.h:40
TrkDriftCircleMath::MdtId::isBarrel
bool isBarrel() const
Definition: MdtId.h:30
MdtIdHelper::maxNTubesPerLayer
static constexpr int maxNTubesPerLayer
The maxNTubesPerLayer represents the absolute maximum of tubes which are built into a single multilay...
Definition: MdtIdHelper.h:68
TrkDriftCircleMath::MdtId::tube
int tube() const
Definition: MdtId.h:33
TrkDriftCircleMath::MdtId::multiLayerShift
static constexpr int multiLayerShift
Definition: MdtId.h:18