Project
Loading...
Searching...
No Matches
Cluster.cxx
Go to the documentation of this file.
1// Copyright 2019-2026 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
14
16#include "Framework/Logger.h"
17#include <cassert>
18#include <iostream>
19#include <format>
20
21// Root ClassImp macros for serialization metadata
24
25namespace o2
26{
27namespace iotof
28{
29
30std::string Cluster::asString() const
31{
32 LOG(debug) << "[Cluster::asString] Converting Cluster to string";
33 return std::format(
34 "chip: {:5d} | row: {:3d} col: {:3d} | span: {:2d}x{:2d} | pattern: {:5d} topology: {:4d}",
35 getChipID(),
36 getRow(),
37 getCol(),
38 getRowSpan(),
39 getColSpan(),
40 getPattern(),
41 getTopology());
42}
43
44//______________________________________________________________________________
45void Cluster::print() const
46{
47 std::cout << *this << "\n";
48}
49
50//______________________________________________________________________________
51void Cluster::sanityCheck()
52{
53 LOG(debug) << "[Cluster::sanityCheck] Performing sanity check on Cluster fields";
54
55 // Ensure extracted values fit within allowed bit masks
56 assert(getRow() <= ClusterInfo::MaskRow);
57 assert(getCol() <= ClusterInfo::MaskCol);
62}
63
64} // namespace iotof
65} // namespace o2
66
67// Stream operator implementation
68std::ostream& operator<<(std::ostream& stream, const o2::iotof::Cluster& cl)
69{
70 stream << cl.asString();
71 return stream;
72}
ClassImp(o2::hmpid::Cluster)
Definition of the IOTOF cluster.
std::ostream & operator<<(std::ostream &stream, const o2::iotof::Cluster &cl)
Definition Cluster.cxx:68
std::ostringstream debug
void print(Option_t *opt="") const
Definition Cluster.cxx:197
uint8_t getRowSpan() const
Definition Cluster.h:132
uint32_t getRow() const
Definition Cluster.h:130
uint32_t getCol() const
Definition Cluster.h:131
uint8_t getColSpan() const
Definition Cluster.h:133
uint32_t getChipID() const
Definition Cluster.h:149
uint32_t getPattern() const
Definition Cluster.h:134
std::string asString() const
Definition Cluster.cxx:30
uint32_t getTopology() const
Definition Cluster.h:135
GLuint GLuint stream
Definition glcorearb.h:1806
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Compact encoding for ALICE3 IOTOF cluster parameters inside a single 64-bit word.
Definition Cluster.h:30
static constexpr uint64_t MaskCol
Definition Cluster.h:49
static constexpr uint64_t MaskTopology
Definition Cluster.h:53
static constexpr uint64_t MaskColSpan
Definition Cluster.h:51
static constexpr uint64_t MaskPattern
Definition Cluster.h:52
static constexpr uint64_t MaskRow
Definition Cluster.h:48
static constexpr uint64_t MaskRowSpan
Definition Cluster.h:50
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"