Project
Loading...
Searching...
No Matches
ChannelCode.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_DATAFORMATS_MCH_CHANNEL_CODE_H_
13#define O2_DATAFORMATS_MCH_CHANNEL_CODE_H_
14
15#include <RtypesCore.h>
16#include <cstdint>
17#include <string>
18#include "Rtypes.h"
19
20namespace o2::mch
21{
47{
48 public:
49 ChannelCode() = default;
57 ChannelCode(uint16_t deId, uint16_t dePadIndex);
69 ChannelCode(uint16_t solarId, uint8_t elinkIndex, uint8_t channel);
70
72 uint16_t getDeId() const;
75 uint16_t getDePadIndex() const;
77 uint16_t getDsId() const;
79 uint16_t getDsIndex() const;
81 uint16_t getSolarId() const;
83 uint16_t getSolarIndex() const;
85 uint8_t getChannel() const;
87 uint8_t getDeIndex() const;
89 uint8_t getElinkId() const;
91 uint8_t getElinkIndex() const { return getElinkId(); }
92
93 /* whether the code is valid.
94 *
95 * Note that the only way to build an invalid ChannelCode is by using
96 * the default constructor, that we cannot suppress
97 * (needed e.g. by Root or by some vector functions)
98 */
99 bool isValid() const { return mValue != sInvalidValue; }
100
101 /* get the actual code */
102 uint64_t value() const { return mValue; }
103
104 private:
105 void set(uint8_t deIndex,
106 uint16_t dePadIndex,
107 uint16_t dsIndex,
108 uint16_t solarIndex,
109 uint8_t elinkIndex,
110 uint8_t channel);
111
112 private:
113 /* marker for an invalid value. */
114 static const uint64_t sInvalidValue{0xFFFFFFFF};
115
125 uint64_t mValue{sInvalidValue};
126
127 ClassDefNV(ChannelCode, 1); // An identifier for a MCH channel
128};
129
131std::string asString(const ChannelCode& cc);
132
133inline bool operator==(const ChannelCode& a, const ChannelCode& b) { return a.value() == b.value(); }
134inline bool operator!=(const ChannelCode& a, const ChannelCode& b) { return a.value() != b.value(); }
135inline bool operator<(const ChannelCode& a, const ChannelCode& b) { return a.value() < b.value(); }
136inline bool operator>(const ChannelCode& a, const ChannelCode& b) { return a.value() > b.value(); }
137inline bool operator<=(const ChannelCode& a, const ChannelCode& b) { return a.value() <= b.value(); }
138inline bool operator>=(const ChannelCode& a, const ChannelCode& b) { return a.value() >= b.value(); }
139
140} // namespace o2::mch
141#endif
unsigned short int uint16_t
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
bool isValid() const
Definition ChannelCode.h:99
uint16_t getDsIndex() const
uint8_t getDeIndex() const
uint16_t getSolarId() const
uint16_t getDeId() const
uint16_t getSolarIndex() const
uint16_t getDsId() const
uint64_t value() const
uint8_t getElinkId() const
uint8_t getElinkIndex() const
Definition ChannelCode.h:91
uint8_t getChannel() const
uint16_t getDePadIndex() const
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
bool operator==(const DsChannelId &a, const DsChannelId &b)
Definition DsChannelId.h:65
std::string asString(const o2::mch::TrackMCH &t)
Definition TrackMCH.cxx:104
bool operator>=(const DsChannelId &a, const DsChannelId &b)
Definition DsChannelId.h:70
bool operator>(const DsChannelId &a, const DsChannelId &b)
Definition DsChannelId.h:68
bool operator<(const DsChannelId &a, const DsChannelId &b)
Definition DsChannelId.h:67
bool operator!=(const DsChannelId &a, const DsChannelId &b)
Definition DsChannelId.h:66
bool operator<=(const DsChannelId &a, const DsChannelId &b)
Definition DsChannelId.h:69
std::vector< o2::mch::ChannelCode > cc