Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class CompCluster
}

void print() const;
std::string asString() const;

ClassDefNV(CompCluster, 2);
};
Expand All @@ -97,7 +98,7 @@ class CompCluster
class CompClusterExt : public CompCluster
{
private:
UShort_t mChipID; ///< chip id
UShort_t mChipID; ///< chip id

public:
CompClusterExt(UShort_t row = 0, UShort_t col = 0, UShort_t patt = 0, UShort_t chipID = 0) : CompCluster(row, col, patt), mChipID(chipID)
Expand All @@ -116,6 +117,7 @@ class CompClusterExt : public CompCluster
void setChipID(UShort_t c) { mChipID = c; }

void print() const;
std::string asString() const;

ClassDefNV(CompClusterExt, 1);
};
Expand Down
16 changes: 13 additions & 3 deletions DataFormats/Detectors/ITSMFT/common/src/CompCluster.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,32 @@
#include "DataFormatsITSMFT/CompCluster.h"
#include <cassert>
#include <iostream>
#include <format>

using namespace o2::itsmft;

std::ostream& operator<<(std::ostream& stream, const CompCluster& cl)
{
stream << " row: " << cl.getRow() << " col: " << cl.getCol()
<< " pattID " << cl.getPatternID() << " [flag: " << cl.getFlag() << "] ";
stream << cl.asString();
return stream;
}

std::ostream& operator<<(std::ostream& stream, const CompClusterExt& cl)
{
stream << " chip: " << cl.getChipID() << ((const CompCluster&)cl);
stream << cl.asString();
return stream;
}

std::string CompCluster::asString() const
{
return std::format(" row: {:4d} col: {:4d} pattID: {:4d} [flag: {:1d}]", getRow(), getCol(), getPatternID(), getFlag());
}

std::string CompClusterExt::asString() const
{
return std::format(" chip: {:5d} row: {:4d} col: {:4d} pattID: {:4d} [flag: {:1d}]", getChipID(), getRow(), getCol(), getPatternID(), getFlag());
}

//______________________________________________________________________________
void CompCluster::print() const
{
Expand Down