Project
Loading...
Searching...
No Matches
CompCluster.cxx
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
14
16#include <cassert>
17#include <iostream>
18#include <format>
19
20using namespace o2::itsmft;
21
22std::ostream& operator<<(std::ostream& stream, const CompCluster& cl)
23{
24 stream << cl.asString();
25 return stream;
26}
27
28std::ostream& operator<<(std::ostream& stream, const CompClusterExt& cl)
29{
30 stream << cl.asString();
31 return stream;
32}
33
34std::string CompCluster::asString() const
35{
36 return std::format(" row: {:4d} col: {:4d} pattID: {:4d} [flag: {:1d}]", getRow(), getCol(), getPatternID(), getFlag());
37}
38
39std::string CompClusterExt::asString() const
40{
41 return std::format(" chip: {:5d} row: {:4d} col: {:4d} pattID: {:4d} [flag: {:1d}]", getChipID(), getRow(), getCol(), getPatternID(), getFlag());
42}
43
44//______________________________________________________________________________
46{
47 // print itself
48 std::cout << *this << "\n";
49}
50
51//______________________________________________________________________________
53{
54 // print itself
55 std::cout << *this << "\n";
56}
57
58//______________________________________________________________________________
59void CompCluster::sanityCheck()
60{
61 // check self-consistency
62 static_assert(NBitsRow + NBitsCol + NBitsPattID + 1 < 8 * sizeof(mData), "mData is too short to fit all fields");
63}
Definition of the ITSMFT compact cluster.
std::string asString() const
UShort_t getChipID() const
static constexpr int NBitsRow
Definition CompCluster.h:31
UShort_t getRow() const
Definition CompCluster.h:57
UShort_t getPatternID() const
Definition CompCluster.h:59
UShort_t getCol() const
Definition CompCluster.h:58
std::string asString() const
static constexpr int NBitsPattID
Definition CompCluster.h:33
static constexpr int NBitsCol
Definition CompCluster.h:32
GLuint GLuint stream
Definition glcorearb.h:1806
std::ostream & operator<<(std::ostream &os, const ClusterPattern &pattern)