Project
Loading...
Searching...
No Matches
DsDetId.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
12#ifndef O2_MCH_RAW_ELECMAP_DS_DET_ID_H
13#define O2_MCH_RAW_ELECMAP_DS_DET_ID_H
14
15#include <cstdint>
16#include <iosfwd>
17
18namespace o2::mch::raw
19{
22{
23 public:
24 DsDetId(int deId, int dsId);
25
27 uint16_t deId() const { return mDeId; }
28
31 uint16_t dsId() const { return mDsId; }
32
33 bool operator<(const DsDetId& rhs) const
34 {
35 if (mDeId < rhs.mDeId) {
36 return true;
37 }
38 return mDsId < rhs.mDsId;
39 }
40
41 private:
42 uint16_t mDeId;
43 uint16_t mDsId;
44};
45
47DsDetId decodeDsDetId(uint32_t code);
48
50uint32_t encode(const DsDetId& id);
51
53std::string asString(DsDetId dsDetId);
54
55std::ostream& operator<<(std::ostream& os, const DsDetId& id);
56
57} // namespace o2::mch::raw
58#endif
A DsDetId is just a pair (detection element id, dual sampa id)
Definition DsDetId.h:22
bool operator<(const DsDetId &rhs) const
Definition DsDetId.h:33
uint16_t deId() const
deId returns one of the 156 possible detection element id
Definition DsDetId.h:27
uint16_t dsId() const
Definition DsDetId.h:31
std::string asString(const SampaCluster &sc)
DsDetId decodeDsDetId(uint32_t code)
Create a DsDetId object from a integer code.
Definition DsDetId.cxx:33
uint32_t encode(const DsDetId &id)
Create an integer code for the given id.
Definition DsDetId.cxx:28
std::ostream & operator<<(std::ostream &stream, o2::InteractionRecord const &ir)