12#ifndef O2_MCH_RAW_SAMPA_CLUSTER_H
13#define O2_MCH_RAW_SAMPA_CLUSTER_H
18#include <fmt/format.h>
84template <
typename CHARGESUM>
89 uint32_t bunchCrossingCounter{0};
90 for (
auto i = 0;
i <
data.size();
i++) {
91 if (
data[
i].isClusterSum() != refValue) {
92 throw std::invalid_argument(fmt::format(
"all cluster of this encoder should be of the same type ({}) but {}-th does not match ", (refValue ?
"clusterSum" :
"samples"),
i));
94 auto bc =
data[
i].bunchCrossing;
96 bunchCrossingCounter =
bc;
98 if (
bc != bunchCrossingCounter) {
99 throw std::invalid_argument(fmt::format(
"all sampa clusters should have the same bunch crossing number : first is {} and got {}\n", bunchCrossingCounter,
bc));
104std::ostream&
operator<<(std::ostream& os,
const SampaCluster& sc);
106std::string
asString(
const SampaCluster& sc);
GLboolean GLboolean GLboolean GLboolean a
void assertNotMixingClusters(const std::vector< SampaCluster > &data)
std::string asString(const SampaCluster &sc)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::ostream & operator<<(std::ostream &stream, o2::InteractionRecord const &ir)
Piece of data for one Sampa channel.
uint32_t sum() const
sum returns the total charge in the cluster
uint16_t nofSamples() const
std::vector< uint16_t > samples
uint16_t nof10BitWords() const
bool isClusterSum() const
isClusterSum returns true if this cluster is not holding raw samples.